99AI/public/assets/menu-19bde8fc.js
2024-07-07 13:09:08 +08:00

5 lines
26 KiB
JavaScript

import{a as E,X as d,n as j,y as S,r as y,e as L,f as q,B as le,l as ie,F as ae,p as X,d as P,G as ue}from"./vue-10b4afc0.js";var se={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function ce(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function de(e,t,n){var o=typeof t.fill=="string"?[t.fill]:t.fill||[],i=[],l=t.theme||n.theme;switch(l){case"outline":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("none"),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("none");break;case"filled":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("#FFF"),i.push("#FFF");break;case"two-tone":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone);break;case"multi-color":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.multiColor.outFillColor),i.push(typeof o[2]=="string"?o[2]:n.colors.multiColor.innerStrokeColor),i.push(typeof o[3]=="string"?o[3]:n.colors.multiColor.innerFillColor);break}return{size:t.size||n.size,strokeWidth:t.strokeWidth||n.strokeWidth,strokeLinecap:t.strokeLinecap||n.strokeLinecap,strokeLinejoin:t.strokeLinejoin||n.strokeLinejoin,colors:i,id:e}}var fe=Symbol("icon-context");function I(e,t,n){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(l){var r=ce(),u=E(fe,se);return function(){var v=l.size,m=l.strokeWidth,k=l.strokeLinecap,h=l.strokeLinejoin,a=l.theme,c=l.fill,s=l.spin,f=de(r,{size:v,strokeWidth:m,strokeLinecap:k,strokeLinejoin:h,theme:a,fill:c},u),g=[u.prefix+"-icon"];return g.push(u.prefix+"-icon-"+e),t&&u.rtl&&g.push(u.prefix+"-icon-rtl"),s&&g.push(u.prefix+"-icon-spin"),d("span",{class:g.join(" ")},[n(f)])}}};return o}const Ke=I("announcement",!0,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("rect",{x:"4",y:"15",width:"40",height:"26",rx:"2",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M24 7L16 15H32L24 7Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M12 24H30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M12 32H20",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),Ge=I("calendar",!1,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("path",{d:"M5 19H43V40C43 41.1046 42.1046 42 41 42H7C5.89543 42 5 41.1046 5 40V19Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M5 9C5 7.89543 5.89543 7 7 7H41C42.1046 7 43 7.89543 43 9V19H5V9Z",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M16 4V12",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M32 4V12",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M28 34H34",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M14 34H20",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M28 26H34",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M14 26H20",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),qe=I("commodity",!1,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("path",{d:"M9.78101 9.75193C9.90612 8.75107 10.7569 8 11.7656 8H36.2344C37.2431 8 38.0939 8.75107 38.219 9.75193L41.719 37.7519C41.8682 38.9456 40.9374 40 39.7344 40H8.26556C7.06257 40 6.1318 38.9456 6.28101 37.7519L9.78101 9.75193Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M15 18C15 18 17 22 24 22C31 22 33 18 33 18",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),Xe=I("delete-themes",!0,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 15H40L37 44H11L8 15Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M20.002 25.0024V35.0026",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap},null),d("path",{d:"M28.0024 24.9995V34.9972",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap},null),d("path",{d:"M12 14.9999L28.3242 3L36 15",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),Qe=I("logout",!0,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("path",{d:"M23.9917 6H6V42H24",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M33 33L42 24L33 15",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M16 23.9917H42",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),Ye=I("sun-one",!1,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("path",{d:"M24 37C31.1797 37 37 31.1797 37 24C37 16.8203 31.1797 11 24 11C16.8203 11 11 16.8203 11 24C11 31.1797 16.8203 37 24 37Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M24 6C25.3807 6 26.5 4.88071 26.5 3.5C26.5 2.11929 25.3807 1 24 1C22.6193 1 21.5 2.11929 21.5 3.5C21.5 4.88071 22.6193 6 24 6Z",fill:e.colors[0]},null),d("path",{d:"M38.5 12C39.8807 12 41 10.8807 41 9.5C41 8.11929 39.8807 7 38.5 7C37.1193 7 36 8.11929 36 9.5C36 10.8807 37.1193 12 38.5 12Z",fill:e.colors[0]},null),d("path",{d:"M44.5 26.5C45.8807 26.5 47 25.3807 47 24C47 22.6193 45.8807 21.5 44.5 21.5C43.1193 21.5 42 22.6193 42 24C42 25.3807 43.1193 26.5 44.5 26.5Z",fill:e.colors[0]},null),d("path",{d:"M38.5 41C39.8807 41 41 39.8807 41 38.5C41 37.1193 39.8807 36 38.5 36C37.1193 36 36 37.1193 36 38.5C36 39.8807 37.1193 41 38.5 41Z",fill:e.colors[0]},null),d("path",{d:"M24 47C25.3807 47 26.5 45.8807 26.5 44.5C26.5 43.1193 25.3807 42 24 42C22.6193 42 21.5 43.1193 21.5 44.5C21.5 45.8807 22.6193 47 24 47Z",fill:e.colors[0]},null),d("path",{d:"M9.5 41C10.8807 41 12 39.8807 12 38.5C12 37.1193 10.8807 36 9.5 36C8.11929 36 7 37.1193 7 38.5C7 39.8807 8.11929 41 9.5 41Z",fill:e.colors[0]},null),d("path",{d:"M3.5 26.5C4.88071 26.5 6 25.3807 6 24C6 22.6193 4.88071 21.5 3.5 21.5C2.11929 21.5 1 22.6193 1 24C1 25.3807 2.11929 26.5 3.5 26.5Z",fill:e.colors[0]},null),d("path",{d:"M9.5 12C10.8807 12 12 10.8807 12 9.5C12 8.11929 10.8807 7 9.5 7C8.11929 7 7 8.11929 7 9.5C7 10.8807 8.11929 12 9.5 12Z",fill:e.colors[0]},null)])}),Je=I("user",!1,function(e){return d("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[d("circle",{cx:"24",cy:"12",r:"8",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),d("path",{d:"M42 44C42 34.0589 33.9411 26 24 26C14.0589 26 6 34.0589 6 44",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])});let ve=Symbol("headlessui.useid"),he=0;function W(){return E(ve,()=>`${++he}`)()}function b(e){var t;if(e==null||e.value==null)return null;let n=(t=e.value.$el)!=null?t:e.value;return n instanceof Node?n:null}function T(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,T),o}var me=Object.defineProperty,ke=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t,n)=>(ke(e,typeof t!="symbol"?t+"":t,n),n);let ge=class{constructor(){V(this,"current",this.detect()),V(this,"currentId",0)}set(t){this.current!==t&&(this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},H=new ge;function z(e){if(H.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let t=b(e);if(t)return t.ownerDocument}return document}let N=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var $=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))($||{}),we=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(we||{}),be=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(be||{});function Q(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(N)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var B=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(B||{});function U(e,t=0){var n;return e===((n=z(e))==null?void 0:n.body)?!1:T(t,{0(){return e.matches(N)},1(){let o=e;for(;o!==null;){if(o.matches(N))return!0;o=o.parentElement}return!1}})}function Y(e){let t=z(e);j(()=>{t&&!U(t.activeElement,0)&&ye(e)})}var pe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(pe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ye(e){e==null||e.focus({preventScroll:!0})}let Ce=["textarea","input"].join(",");function Le(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Ce))!=null?n:!1}function J(e,t=n=>n){return e.slice().sort((n,o)=>{let i=t(n),l=t(o);if(i===null||l===null)return 0;let r=i.compareDocumentPosition(l);return r&Node.DOCUMENT_POSITION_FOLLOWING?-1:r&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function je(e,t){return Ie(Q(),t,{relativeTo:e})}function Ie(e,t,{sorted:n=!0,relativeTo:o=null,skipElements:i=[]}={}){var l;let r=(l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e==null?void 0:e.ownerDocument)!=null?l:document,u=Array.isArray(e)?n?J(e):e:Q(e);i.length>0&&u.length>1&&(u=u.filter(s=>!i.includes(s))),o=o??r.activeElement;let v=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),m=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,u.indexOf(o))-1;if(t&4)return Math.max(0,u.indexOf(o))+1;if(t&8)return u.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),k=t&32?{preventScroll:!0}:{},h=0,a=u.length,c;do{if(h>=a||h+a<=0)return 0;let s=m+h;if(t&16)s=(s+a)%a;else{if(s<0)return 3;if(s>=a)return 1}c=u[s],c==null||c.focus(k),h+=v}while(c!==r.activeElement);return t&6&&Le(c)&&c.select(),2}function Me(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Se(){return/Android/gi.test(window.navigator.userAgent)}function xe(){return Me()||Se()}function F(e,t,n){H.isServer||S(o=>{document.addEventListener(e,t,n),o(()=>document.removeEventListener(e,t,n))})}function Fe(e,t,n){H.isServer||S(o=>{window.addEventListener(e,t,n),o(()=>window.removeEventListener(e,t,n))})}function Ee(e,t,n=L(()=>!0)){function o(l,r){if(!n.value||l.defaultPrevented)return;let u=r(l);if(u===null||!u.getRootNode().contains(u))return;let v=function m(k){return typeof k=="function"?m(k()):Array.isArray(k)||k instanceof Set?k:[k]}(e);for(let m of v){if(m===null)continue;let k=m instanceof HTMLElement?m:b(m);if(k!=null&&k.contains(u)||l.composed&&l.composedPath().includes(k))return}return!U(u,B.Loose)&&u.tabIndex!==-1&&l.preventDefault(),t(l,u)}let i=y(null);F("pointerdown",l=>{var r,u;n.value&&(i.value=((u=(r=l.composedPath)==null?void 0:r.call(l))==null?void 0:u[0])||l.target)},!0),F("mousedown",l=>{var r,u;n.value&&(i.value=((u=(r=l.composedPath)==null?void 0:r.call(l))==null?void 0:u[0])||l.target)},!0),F("click",l=>{xe()||i.value&&(o(l,()=>i.value),i.value=null)},!0),F("touchend",l=>o(l,()=>l.target instanceof HTMLElement?l.target:null),!0),Fe("blur",l=>o(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function _(e,t){if(e)return e;let n=t??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Pe(e,t){let n=y(_(e.value.type,e.value.as));return q(()=>{n.value=_(e.value.type,e.value.as)}),S(()=>{var o;n.value||b(t)&&b(t)instanceof HTMLButtonElement&&!((o=b(t))!=null&&o.hasAttribute("type"))&&(n.value="button")}),n}function Z(e){return[e.screenX,e.screenY]}function Te(){let e=y([-1,-1]);return{wasMoved(t){let n=Z(t);return e.value[0]===n[0]&&e.value[1]===n[1]?!1:(e.value=n,!0)},update(t){e.value=Z(t)}}}function Oe({container:e,accept:t,walk:n,enabled:o}){S(()=>{let i=e.value;if(!i||o!==void 0&&!o.value)return;let l=z(e);if(!l)return;let r=Object.assign(v=>t(v),{acceptNode:t}),u=l.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,r,!1);for(;u.nextNode();)n(u.currentNode)})}var R=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(R||{}),De=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(De||{});function O({visible:e=!0,features:t=0,ourProps:n,theirProps:o,...i}){var l;let r=te(o,n),u=Object.assign(i,{props:r});if(e||t&2&&r.static)return A(u);if(t&1){let v=(l=r.unmount)==null||l?0:1;return T(v,{0(){return null},1(){return A({...i,props:{...r,hidden:!0,style:{display:"none"}}})}})}return A(u)}function A({props:e,attrs:t,slots:n,slot:o,name:i}){var l,r;let{as:u,...v}=Ae(e,["unmount","static"]),m=(l=n.default)==null?void 0:l.call(n,o),k={};if(o){let h=!1,a=[];for(let[c,s]of Object.entries(o))typeof s=="boolean"&&(h=!0),s===!0&&a.push(c);h&&(k["data-headlessui-state"]=a.join(" "))}if(u==="template"){if(m=ee(m??[]),Object.keys(v).length>0||Object.keys(t).length>0){let[h,...a]=m??[];if(!Ne(h)||a.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${i} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(v).concat(Object.keys(t)).map(f=>f.trim()).filter((f,g,w)=>w.indexOf(f)===g).sort((f,g)=>f.localeCompare(g)).map(f=>` - ${f}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(f=>` - ${f}`).join(`
`)].join(`
`));let c=te((r=h.props)!=null?r:{},v,k),s=le(h,c,!0);for(let f in c)f.startsWith("on")&&(s.props||(s.props={}),s.props[f]=c[f]);return s}return Array.isArray(m)&&m.length===1?m[0]:m}return ie(u,Object.assign({},v,k),{default:()=>m})}function ee(e){return e.flatMap(t=>t.type===ae?ee(t.children):[t])}function te(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let o of e)for(let i in o)i.startsWith("on")&&typeof o[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(o[i])):t[i]=o[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(o=>[o,void 0])));for(let o in n)Object.assign(t,{[o](i,...l){let r=n[o];for(let u of r){if(i instanceof Event&&i.defaultPrevented)return;u(i,...l)}}});return t}function tt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ae(e,t=[]){let n=Object.assign({},e);for(let o of t)o in n&&delete n[o];return n}function Ne(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}let ne=Symbol("Context");var M=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(M||{});function $e(){return E(ne,null)}function Re(e){X(ne,e)}var p=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(p||{});function We(e){throw new Error("Unexpected object: "+e)}var C=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(C||{});function He(e,t){let n=t.resolveItems();if(n.length<=0)return null;let o=t.resolveActiveIndex(),i=o??-1;switch(e.focus){case 0:{for(let l=0;l<n.length;++l)if(!t.resolveDisabled(n[l],l,n))return l;return o}case 1:{i===-1&&(i=n.length);for(let l=i-1;l>=0;--l)if(!t.resolveDisabled(n[l],l,n))return l;return o}case 2:{for(let l=i+1;l<n.length;++l)if(!t.resolveDisabled(n[l],l,n))return l;return o}case 3:{for(let l=n.length-1;l>=0;--l)if(!t.resolveDisabled(n[l],l,n))return l;return o}case 4:{for(let l=0;l<n.length;++l)if(t.resolveId(n[l],l,n)===e.id)return l;return o}case 5:return null;default:We(e)}}let K=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function G(e){var t,n;let o=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return o;let l=!1;for(let u of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),l=!0;let r=l?(n=i.innerText)!=null?n:"":o;return K.test(r)&&(r=r.replace(K,"")),r}function ze(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let o=n.split(" ").map(i=>{let l=document.getElementById(i);if(l){let r=l.getAttribute("aria-label");return typeof r=="string"?r.trim():G(l).trim()}return null}).filter(Boolean);if(o.length>0)return o.join(", ")}return G(e).trim()}function Be(e){let t=y(""),n=y("");return()=>{let o=b(e);if(!o)return"";let i=o.innerText;if(t.value===i)return n.value;let l=ze(o).trim().toLowerCase();return t.value=i,n.value=l,l}}var Ue=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ue||{}),Ve=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Ve||{});function _e(e){requestAnimationFrame(()=>requestAnimationFrame(e))}let re=Symbol("MenuContext");function D(e){let t=E(re,null);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,D),n}return t}let nt=P({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup(e,{slots:t,attrs:n}){let o=y(1),i=y(null),l=y(null),r=y([]),u=y(""),v=y(null),m=y(1);function k(a=c=>c){let c=v.value!==null?r.value[v.value]:null,s=J(a(r.value.slice()),g=>b(g.dataRef.domRef)),f=c?s.indexOf(c):null;return f===-1&&(f=null),{items:s,activeItemIndex:f}}let h={menuState:o,buttonRef:i,itemsRef:l,items:r,searchQuery:u,activeItemIndex:v,activationTrigger:m,closeMenu:()=>{o.value=1,v.value=null},openMenu:()=>o.value=0,goToItem(a,c,s){let f=k(),g=He(a===C.Specific?{focus:C.Specific,id:c}:{focus:a},{resolveItems:()=>f.items,resolveActiveIndex:()=>f.activeItemIndex,resolveId:w=>w.id,resolveDisabled:w=>w.dataRef.disabled});u.value="",v.value=g,m.value=s??1,r.value=f.items},search(a){let c=u.value!==""?0:1;u.value+=a.toLowerCase();let s=(v.value!==null?r.value.slice(v.value+c).concat(r.value.slice(0,v.value+c)):r.value).find(g=>g.dataRef.textValue.startsWith(u.value)&&!g.dataRef.disabled),f=s?r.value.indexOf(s):-1;f===-1||f===v.value||(v.value=f,m.value=1)},clearSearch(){u.value=""},registerItem(a,c){let s=k(f=>[...f,{id:a,dataRef:c}]);r.value=s.items,v.value=s.activeItemIndex,m.value=1},unregisterItem(a){let c=k(s=>{let f=s.findIndex(g=>g.id===a);return f!==-1&&s.splice(f,1),s});r.value=c.items,v.value=c.activeItemIndex,m.value=1}};return Ee([i,l],(a,c)=>{var s;h.closeMenu(),U(c,B.Loose)||(a.preventDefault(),(s=b(i))==null||s.focus())},L(()=>o.value===0)),X(re,h),Re(L(()=>T(o.value,{0:M.Open,1:M.Closed}))),()=>{let a={open:o.value===0,close:h.closeMenu};return O({ourProps:{},theirProps:e,slot:a,slots:t,attrs:n,name:"Menu"})}}}),rt=P({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:t,slots:n,expose:o}){var i;let l=(i=e.id)!=null?i:`headlessui-menu-button-${W()}`,r=D("MenuButton");o({el:r.buttonRef,$el:r.buttonRef});function u(h){switch(h.key){case p.Space:case p.Enter:case p.ArrowDown:h.preventDefault(),h.stopPropagation(),r.openMenu(),j(()=>{var a;(a=b(r.itemsRef))==null||a.focus({preventScroll:!0}),r.goToItem(C.First)});break;case p.ArrowUp:h.preventDefault(),h.stopPropagation(),r.openMenu(),j(()=>{var a;(a=b(r.itemsRef))==null||a.focus({preventScroll:!0}),r.goToItem(C.Last)});break}}function v(h){switch(h.key){case p.Space:h.preventDefault();break}}function m(h){e.disabled||(r.menuState.value===0?(r.closeMenu(),j(()=>{var a;return(a=b(r.buttonRef))==null?void 0:a.focus({preventScroll:!0})})):(h.preventDefault(),r.openMenu(),_e(()=>{var a;return(a=b(r.itemsRef))==null?void 0:a.focus({preventScroll:!0})})))}let k=Pe(L(()=>({as:e.as,type:t.type})),r.buttonRef);return()=>{var h;let a={open:r.menuState.value===0},{...c}=e,s={ref:r.buttonRef,id:l,type:k.value,"aria-haspopup":"menu","aria-controls":(h=b(r.itemsRef))==null?void 0:h.id,"aria-expanded":r.menuState.value===0,onKeydown:u,onKeyup:v,onClick:m};return O({ourProps:s,theirProps:c,slot:a,attrs:t,slots:n,name:"MenuButton"})}}}),ot=P({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(e,{attrs:t,slots:n,expose:o}){var i;let l=(i=e.id)!=null?i:`headlessui-menu-items-${W()}`,r=D("MenuItems"),u=y(null);o({el:r.itemsRef,$el:r.itemsRef}),Oe({container:L(()=>b(r.itemsRef)),enabled:L(()=>r.menuState.value===0),accept(a){return a.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:a.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(a){a.setAttribute("role","none")}});function v(a){var c;switch(u.value&&clearTimeout(u.value),a.key){case p.Space:if(r.searchQuery.value!=="")return a.preventDefault(),a.stopPropagation(),r.search(a.key);case p.Enter:if(a.preventDefault(),a.stopPropagation(),r.activeItemIndex.value!==null){let s=r.items.value[r.activeItemIndex.value];(c=b(s.dataRef.domRef))==null||c.click()}r.closeMenu(),Y(b(r.buttonRef));break;case p.ArrowDown:return a.preventDefault(),a.stopPropagation(),r.goToItem(C.Next);case p.ArrowUp:return a.preventDefault(),a.stopPropagation(),r.goToItem(C.Previous);case p.Home:case p.PageUp:return a.preventDefault(),a.stopPropagation(),r.goToItem(C.First);case p.End:case p.PageDown:return a.preventDefault(),a.stopPropagation(),r.goToItem(C.Last);case p.Escape:a.preventDefault(),a.stopPropagation(),r.closeMenu(),j(()=>{var s;return(s=b(r.buttonRef))==null?void 0:s.focus({preventScroll:!0})});break;case p.Tab:a.preventDefault(),a.stopPropagation(),r.closeMenu(),j(()=>je(b(r.buttonRef),a.shiftKey?$.Previous:$.Next));break;default:a.key.length===1&&(r.search(a.key),u.value=setTimeout(()=>r.clearSearch(),350));break}}function m(a){switch(a.key){case p.Space:a.preventDefault();break}}let k=$e(),h=L(()=>k!==null?(k.value&M.Open)===M.Open:r.menuState.value===0);return()=>{var a,c;let s={open:r.menuState.value===0},{...f}=e,g={"aria-activedescendant":r.activeItemIndex.value===null||(a=r.items.value[r.activeItemIndex.value])==null?void 0:a.id,"aria-labelledby":(c=b(r.buttonRef))==null?void 0:c.id,id:l,onKeydown:v,onKeyup:m,role:"menu",tabIndex:0,ref:r.itemsRef};return O({ourProps:g,theirProps:f,slot:s,attrs:t,slots:n,features:R.RenderStrategy|R.Static,visible:h.value,name:"MenuItems"})}}}),lt=P({name:"MenuItem",inheritAttrs:!1,props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},id:{type:String,default:null}},setup(e,{slots:t,attrs:n,expose:o}){var i;let l=(i=e.id)!=null?i:`headlessui-menu-item-${W()}`,r=D("MenuItem"),u=y(null);o({el:u,$el:u});let v=L(()=>r.activeItemIndex.value!==null?r.items.value[r.activeItemIndex.value].id===l:!1),m=Be(u),k=L(()=>({disabled:e.disabled,get textValue(){return m()},domRef:u}));q(()=>r.registerItem(l,k)),ue(()=>r.unregisterItem(l)),S(()=>{r.menuState.value===0&&v.value&&r.activationTrigger.value!==0&&j(()=>{var w,x;return(x=(w=b(u))==null?void 0:w.scrollIntoView)==null?void 0:x.call(w,{block:"nearest"})})});function h(w){if(e.disabled)return w.preventDefault();r.closeMenu(),Y(b(r.buttonRef))}function a(){if(e.disabled)return r.goToItem(C.Nothing);r.goToItem(C.Specific,l)}let c=Te();function s(w){c.update(w)}function f(w){c.wasMoved(w)&&(e.disabled||v.value||r.goToItem(C.Specific,l,0))}function g(w){c.wasMoved(w)&&(e.disabled||v.value&&r.goToItem(C.Nothing))}return()=>{let{disabled:w,...x}=e,oe={active:v.value,disabled:w,close:r.closeMenu};return O({ourProps:{id:l,ref:u,role:"menuitem",tabIndex:w===!0?void 0:-1,"aria-disabled":w===!0?!0:void 0,onClick:h,onFocus:a,onPointerenter:s,onMouseenter:s,onPointermove:f,onMousemove:f,onPointerleave:g,onMouseleave:g},theirProps:{...n,...x},slot:oe,attrs:n,slots:t,name:"MenuItem"})}}});export{Ke as A,qe as C,Xe as D,tt as E,I,Qe as L,ot as M,rt as S,Ae as T,Je as U,Ye as a,lt as b,Ge as c,O as d,W as e,p as f,nt as g,b as o,Pe as s};