import{t as e}from"./BASFhCi9.js";import{$n as t,Bn as n,Dn as r,En as i,Hn as a,Kn as o,Ln as s,Nn as c,Rn as l,Sn as u,Tn as d,a as f,ar as p,bn as m,cr as h,fn as g,jn as _,or as v,sr as y,wn as b,xn as x,zn as S}from"./DLvf9lie.js";import{a as C,i as w,n as T,o as E,r as D}from"./BuSyKSSC.js";import{t as O}from"./DBizn_kH.js";var k=f(`outline`,`arrows-sort`,`ArrowsSort`,[[`path`,{d:`M3 9l4 -4l4 4m-4 -4v14`,key:`svg-0`}],[`path`,{d:`M21 15l-4 4l-4 -4m4 4v-14`,key:`svg-1`}]]),A={class:`relative`},j=[`title`,`aria-label`,`disabled`,`aria-expanded`],M=[`onClick`],N={class:`whitespace-nowrap`},P=c({__name:`IconMenuSelect`,props:{icon:{},title:{},options:{},modelValue:{},disabled:{type:Boolean}},emits:[`update:modelValue`],setup(c,{emit:f}){let k=c,P=f,F=t(null),I=t(null),L=t(!1),{floatingStyles:R}=T(F,I,{placement:`bottom-end`,middleware:[C(8),w(),E({padding:8})],whileElementsMounted:D}),{onKeydown:z}=O({isOpen:L,triggerEl:F,menuEl:I,close:()=>{L.value=!1}});function B(e){P(`update:modelValue`,e),L.value=!1}function V(e){let t=e.target;!F.value?.contains(t)&&!I.value?.contains(t)&&(L.value=!1)}return s(()=>document.addEventListener(`click`,V)),l(()=>document.removeEventListener(`click`,V)),(t,s)=>(S(),r(`div`,A,[b(`button`,{ref_key:`reference`,ref:F,type:`button`,class:v([`flex h-9 w-9 items-center justify-center rounded-[0.625rem] border border-base-content/10 bg-base-200/80 text-base-content/70 transition-all duration-200 hover:border-primary/30 hover:bg-primary/15 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-base-content/10 disabled:hover:bg-base-200/80 disabled:hover:text-base-content/70`,{"border-primary/30 bg-primary/15 text-primary":p(L)}]),title:k.title,"aria-label":k.title,disabled:k.disabled,"aria-haspopup":`menu`,"aria-expanded":p(L),onClick:s[0]||=m(e=>L.value=!p(L),[`stop`])},[(S(),d(a(k.icon),{size:18}))],10,j),(S(),d(u,{to:`body`},[_(g,{"enter-active-class":`transition-opacity duration-150`,"leave-active-class":`transition-opacity duration-100`,"enter-from-class":`opacity-0`,"leave-to-class":`opacity-0`},{default:o(()=>[p(L)?(S(),r(`div`,{key:0,ref_key:`floating`,ref:I,style:y(p(R)),role:`menu`,class:`z-70 max-h-80 min-w-40 overflow-y-auto rounded-xl border border-base-content/10 bg-base-300/98 p-1.5 shadow-[0_10px_40px_rgb(0_0_0/0.3)] backdrop-blur-[12px]`,onKeydown:s[1]||=(...e)=>p(z)&&p(z)(...e)},[(S(!0),r(x,null,n(c.options,t=>(S(),r(`button`,{key:t.value,type:`button`,role:`menuitem`,class:v([`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg px-2.5 py-2 text-[0.8125rem] text-base-content transition-all duration-150 hover:bg-base-content/8`,{"bg-primary/15 text-primary":t.value===c.modelValue}]),onClick:e=>B(t.value)},[b(`span`,N,h(t.label),1),t.value===c.modelValue?(S(),d(p(e),{key:0,size:16})):i(``,!0)],10,M))),128))],36)):i(``,!0)]),_:1})]))]))}}),F=Object.assign(P,{__name:`IconMenuSelect`});export{k as n,F as t};