import{u as h}from"./useFocusWithin-D9cSjn1O.js";import{d as B,r as t,w as k,k as C,Q as y,o as n,e as a,f as _,G as b,s as x,x as D,t as I,L,z as O,A as S,_ as z}from"./index-BEZl8isL.js";const E=e=>(O("data-v-1a34ae90"),e=e(),S(),e),F=E(()=>_("i",{class:"material-symbols-outlined"},"more_horiz",-1)),$=[F],j=["onClickCapture"],N=B({__name:"BaseDropdown",props:{options:{type:Object,required:!0}},emits:{selected:e=>typeof e=="string"},setup(e,{emit:f}){const m=f,c=t(),i=t(),r=t(!1),p=t("unset"),l=t("unset"),d=h(c);k(d,()=>{d.value||s()});function s(){r.value=!1}function v(){const o=i.value.getBoundingClientRect();p.value=`${o.top+o.height+4+window.pageYOffset}px`,l.value=`${o.left+window.pageXOffset}px`,r.value=!0}function w(o){m("selected",o),s()}return C(()=>window.addEventListener("scroll",s)),y(()=>window.removeEventListener("scroll",s)),(o,P)=>(n(),a("div",{ref_key:"root",ref:c,class:"BaseDropdown"},[_("button",{ref_key:"trigger",ref:i,class:"BaseDropdown__trigger",onClick:v},$,512),r.value?(n(),a("div",{key:0,class:"BaseDropdown__dropdown",style:b({top:p.value,left:l.value})},[(n(!0),a(x,null,D(Object.entries(e.options),([u,g])=>(n(),a("button",{key:u,class:"BaseDropdown__dropdown_item",tabindex:"1",onClickCapture:R=>w(u)},I(g),41,j))),128))],4)):L("",!0)],512))}}),A=z(N,[["__scopeId","data-v-1a34ae90"]]);export{A as default};
