{"version":3,"file":"Cx1cdxJx.js","sources":["../../../../node_modules/.pnpm/@headlessui+vue@1.7.23_vue@3.5.12_typescript@5.6.3_/node_modules/@headlessui/vue/dist/components/menu/menu.js","../../../../node_modules/.pnpm/@nuxt+ui@2.20.0_axios@1.7.7_magicast@0.3.5_rollup@4.24.0_sortablejs@1.14.0_typescript@5.6.3_v_mfllii6etumfxz3e2rqnt3xxey/node_modules/@nuxt/ui/dist/runtime/components/elements/Dropdown.vue"],"sourcesContent":["import{computed as y,defineComponent as T,inject as K,nextTick as x,onMounted as N,onUnmounted as j,provide as L,ref as R,watchEffect as B}from\"vue\";import{useId as w}from'../../hooks/use-id.js';import{useOutsideClick as U}from'../../hooks/use-outside-click.js';import{useResolveButtonType as $}from'../../hooks/use-resolve-button-type.js';import{useTextValue as V}from'../../hooks/use-text-value.js';import{useTrackedPointer as H}from'../../hooks/use-tracked-pointer.js';import{useTreeWalker as Q}from'../../hooks/use-tree-walker.js';import{State as D,useOpenClosed as _,useOpenClosedProvider as q}from'../../internal/open-closed.js';import{Keys as c}from'../../keyboard.js';import{calculateActiveIndex as W,Focus as S}from'../../utils/calculate-active-index.js';import{dom as m}from'../../utils/dom.js';import{Focus as E,FocusableMode as J,focusFrom as z,isFocusableElement as G,restoreFocusIfNecessary as k,sortByDomNode as X}from'../../utils/focus-management.js';import{match as Y}from'../../utils/match.js';import{Features as F,render as P}from'../../utils/render.js';var Z=(i=>(i[i.Open=0]=\"Open\",i[i.Closed=1]=\"Closed\",i))(Z||{}),ee=(i=>(i[i.Pointer=0]=\"Pointer\",i[i.Other=1]=\"Other\",i))(ee||{});function te(o){requestAnimationFrame(()=>requestAnimationFrame(o))}let A=Symbol(\"MenuContext\");function O(o){let M=K(A,null);if(M===null){let i=new Error(`<${o} /> is missing a parent
component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,O),i}return M}let ge=T({name:\"Menu\",props:{as:{type:[Object,String],default:\"template\"}},setup(o,{slots:M,attrs:i}){let I=R(1),p=R(null),e=R(null),r=R([]),f=R(\"\"),d=R(null),g=R(1);function b(t=a=>a){let a=d.value!==null?r.value[d.value]:null,n=X(t(r.value.slice()),v=>m(v.dataRef.domRef)),s=a?n.indexOf(a):null;return s===-1&&(s=null),{items:n,activeItemIndex:s}}let l={menuState:I,buttonRef:p,itemsRef:e,items:r,searchQuery:f,activeItemIndex:d,activationTrigger:g,closeMenu:()=>{I.value=1,d.value=null},openMenu:()=>I.value=0,goToItem(t,a,n){let s=b(),v=W(t===S.Specific?{focus:S.Specific,id:a}:{focus:t},{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.disabled});f.value=\"\",d.value=v,g.value=n!=null?n:1,r.value=s.items},search(t){let n=f.value!==\"\"?0:1;f.value+=t.toLowerCase();let v=(d.value!==null?r.value.slice(d.value+n).concat(r.value.slice(0,d.value+n)):r.value).find(h=>h.dataRef.textValue.startsWith(f.value)&&!h.dataRef.disabled),u=v?r.value.indexOf(v):-1;u===-1||u===d.value||(d.value=u,g.value=1)},clearSearch(){f.value=\"\"},registerItem(t,a){let n=b(s=>[...s,{id:t,dataRef:a}]);r.value=n.items,d.value=n.activeItemIndex,g.value=1},unregisterItem(t){let a=b(n=>{let s=n.findIndex(v=>v.id===t);return s!==-1&&n.splice(s,1),n});r.value=a.items,d.value=a.activeItemIndex,g.value=1}};return U([p,e],(t,a)=>{var n;l.closeMenu(),G(a,J.Loose)||(t.preventDefault(),(n=m(p))==null||n.focus())},y(()=>I.value===0)),L(A,l),q(y(()=>Y(I.value,{[0]:D.Open,[1]:D.Closed}))),()=>{let t={open:I.value===0,close:l.closeMenu};return P({ourProps:{},theirProps:o,slot:t,slots:M,attrs:i,name:\"Menu\"})}}}),Se=T({name:\"MenuButton\",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:\"button\"},id:{type:String,default:null}},setup(o,{attrs:M,slots:i,expose:I}){var b;let p=(b=o.id)!=null?b:`headlessui-menu-button-${w()}`,e=O(\"MenuButton\");I({el:e.buttonRef,$el:e.buttonRef});function r(l){switch(l.key){case c.Space:case c.Enter:case c.ArrowDown:l.preventDefault(),l.stopPropagation(),e.openMenu(),x(()=>{var t;(t=m(e.itemsRef))==null||t.focus({preventScroll:!0}),e.goToItem(S.First)});break;case c.ArrowUp:l.preventDefault(),l.stopPropagation(),e.openMenu(),x(()=>{var t;(t=m(e.itemsRef))==null||t.focus({preventScroll:!0}),e.goToItem(S.Last)});break}}function f(l){switch(l.key){case c.Space:l.preventDefault();break}}function d(l){o.disabled||(e.menuState.value===0?(e.closeMenu(),x(()=>{var t;return(t=m(e.buttonRef))==null?void 0:t.focus({preventScroll:!0})})):(l.preventDefault(),e.openMenu(),te(()=>{var t;return(t=m(e.itemsRef))==null?void 0:t.focus({preventScroll:!0})})))}let g=$(y(()=>({as:o.as,type:M.type})),e.buttonRef);return()=>{var n;let l={open:e.menuState.value===0},{...t}=o,a={ref:e.buttonRef,id:p,type:g.value,\"aria-haspopup\":\"menu\",\"aria-controls\":(n=m(e.itemsRef))==null?void 0:n.id,\"aria-expanded\":e.menuState.value===0,onKeydown:r,onKeyup:f,onClick:d};return P({ourProps:a,theirProps:t,slot:l,attrs:M,slots:i,name:\"MenuButton\"})}}}),Me=T({name:\"MenuItems\",props:{as:{type:[Object,String],default:\"div\"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:null}},setup(o,{attrs:M,slots:i,expose:I}){var l;let p=(l=o.id)!=null?l:`headlessui-menu-items-${w()}`,e=O(\"MenuItems\"),r=R(null);I({el:e.itemsRef,$el:e.itemsRef}),Q({container:y(()=>m(e.itemsRef)),enabled:y(()=>e.menuState.value===0),accept(t){return t.getAttribute(\"role\")===\"menuitem\"?NodeFilter.FILTER_REJECT:t.hasAttribute(\"role\")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(t){t.setAttribute(\"role\",\"none\")}});function f(t){var a;switch(r.value&&clearTimeout(r.value),t.key){case c.Space:if(e.searchQuery.value!==\"\")return t.preventDefault(),t.stopPropagation(),e.search(t.key);case c.Enter:if(t.preventDefault(),t.stopPropagation(),e.activeItemIndex.value!==null){let s=e.items.value[e.activeItemIndex.value];(a=m(s.dataRef.domRef))==null||a.click()}e.closeMenu(),k(m(e.buttonRef));break;case c.ArrowDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(S.Next);case c.ArrowUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(S.Previous);case c.Home:case c.PageUp:return t.preventDefault(),t.stopPropagation(),e.goToItem(S.First);case c.End:case c.PageDown:return t.preventDefault(),t.stopPropagation(),e.goToItem(S.Last);case c.Escape:t.preventDefault(),t.stopPropagation(),e.closeMenu(),x(()=>{var n;return(n=m(e.buttonRef))==null?void 0:n.focus({preventScroll:!0})});break;case c.Tab:t.preventDefault(),t.stopPropagation(),e.closeMenu(),x(()=>z(m(e.buttonRef),t.shiftKey?E.Previous:E.Next));break;default:t.key.length===1&&(e.search(t.key),r.value=setTimeout(()=>e.clearSearch(),350));break}}function d(t){switch(t.key){case c.Space:t.preventDefault();break}}let g=_(),b=y(()=>g!==null?(g.value&D.Open)===D.Open:e.menuState.value===0);return()=>{var s,v;let t={open:e.menuState.value===0},{...a}=o,n={\"aria-activedescendant\":e.activeItemIndex.value===null||(s=e.items.value[e.activeItemIndex.value])==null?void 0:s.id,\"aria-labelledby\":(v=m(e.buttonRef))==null?void 0:v.id,id:p,onKeydown:f,onKeyup:d,role:\"menu\",tabIndex:0,ref:e.itemsRef};return P({ourProps:n,theirProps:a,slot:t,attrs:M,slots:i,features:F.RenderStrategy|F.Static,visible:b.value,name:\"MenuItems\"})}}}),be=T({name:\"MenuItem\",inheritAttrs:!1,props:{as:{type:[Object,String],default:\"template\"},disabled:{type:Boolean,default:!1},id:{type:String,default:null}},setup(o,{slots:M,attrs:i,expose:I}){var v;let p=(v=o.id)!=null?v:`headlessui-menu-item-${w()}`,e=O(\"MenuItem\"),r=R(null);I({el:r,$el:r});let f=y(()=>e.activeItemIndex.value!==null?e.items.value[e.activeItemIndex.value].id===p:!1),d=V(r),g=y(()=>({disabled:o.disabled,get textValue(){return d()},domRef:r}));N(()=>e.registerItem(p,g)),j(()=>e.unregisterItem(p)),B(()=>{e.menuState.value===0&&f.value&&e.activationTrigger.value!==0&&x(()=>{var u,h;return(h=(u=m(r))==null?void 0:u.scrollIntoView)==null?void 0:h.call(u,{block:\"nearest\"})})});function b(u){if(o.disabled)return u.preventDefault();e.closeMenu(),k(m(e.buttonRef))}function l(){if(o.disabled)return e.goToItem(S.Nothing);e.goToItem(S.Specific,p)}let t=H();function a(u){t.update(u)}function n(u){t.wasMoved(u)&&(o.disabled||f.value||e.goToItem(S.Specific,p,0))}function s(u){t.wasMoved(u)&&(o.disabled||f.value&&e.goToItem(S.Nothing))}return()=>{let{disabled:u,...h}=o,C={active:f.value,disabled:u,close:e.closeMenu};return P({ourProps:{id:p,ref:r,role:\"menuitem\",tabIndex:u===!0?void 0:-1,\"aria-disabled\":u===!0?!0:void 0,onClick:b,onFocus:l,onPointerenter:a,onMouseenter:a,onPointermove:n,onMousemove:n,onPointerleave:s,onMouseleave:s},theirProps:{...i,...h},slot:C,attrs:i,slots:M,name:\"MenuItem\"})}}});export{ge as Menu,Se as MenuButton,be as MenuItem,Me as MenuItems};\n","\n \n