@actview/floating-ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@actview/core"),require("@floating-ui/utils"),require("tabbable"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["exports","@actview/core","@floating-ui/utils","tabbable","@floating-ui/dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIActview={},e.ActviewCore,e.FloatingUIUtils,e.tabbable,e.FloatingUIDOM)}(this,(function(e,t,n,l,o){"use strict";var u=Symbol.for("react.element");function a(e){return!(!e||!0!==e.__v_isRef)}var r=function(e,t,n){let l,o,r=null;if(void 0!==n?r=""+n:t&&void 0!==t.key&&(r=""+t.key),t&&"key"in t){l={};for(const e in t)"key"!==e&&(l[e]=t[e])}else l=t||{};l&&void 0!==l["v-memo"]&&(o=l["v-memo"],delete l["v-memo"]);const i=function(e,t,n){return{$$typeof:u,type:e,key:t,ref:null,props:n}}(e,r,function(e){if(!e)return e;let t=null;for(const n in e){if("ref"===n)continue;const l=e[n];a(l)&&!l.__av_raw&&(t||(t={...e}),t[n]=l.value)}return t??e}(l));return void 0!==o&&(i.__memoDeps=()=>o,i.__memoValue=o),i},i=Symbol.for("react.fragment");function v(){return"undefined"!=typeof window}function s(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function c(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){return!!v()&&(e instanceof Node||e instanceof c(e).Node)}function f(e){return!!v()&&(e instanceof Element||e instanceof c(e).Element)}function m(e){return!!v()&&(e instanceof HTMLElement||e instanceof c(e).HTMLElement)}function p(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof c(e).ShadowRoot)}let g;function h(e){return/^(html|body|#document)$/.test(s(e))}function y(e){return c(e).getComputedStyle(e)}function b(e){if("html"===s(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||function(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return p(t)?t.host:t}function w(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function x(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(){return/apple/i.test(navigator.vendor)}function R(){const e=/android/i;return e.test(w())||e.test(x())}function E(){return w().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function k(){return x().includes("jsdom/")}const C="data-floating-ui-focusable",T="active",P="selected",M="ArrowLeft",O="ArrowRight",L="ArrowUp",A="ArrowDown";function D(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function S(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(t instanceof Node&&e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function N(e){return"composedPath"in e?e.composedPath()[0]:e.target}function F(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function V(e){return e.matches("html,body")}function K(e){return(null==e?void 0:e.ownerDocument)||document}function _(e){return m(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function U(e){return!!e&&("combobox"===e.getAttribute("role")&&_(e))}function W(e){if(!e||k())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}function H(e){return e?e.hasAttribute(C)?e:e.querySelector("["+C+"]")||e:null}function q(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var l;return e.parentId===t&&(!n||(null==(l=e.context)?void 0:l.open.value))})).flatMap((t=>[t,...q(e,t.id,n)]))}function j(e,t){let n,l=-1;return function t(o,u){u>l&&(n=o,l=u),q(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}function B(e,t){var n;let l=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(l=l.concat(t))}return l}function G(e){e.preventDefault(),e.stopPropagation()}function X(e){return!(0!==e.mozInputSource||!e.isTrusted)||(R()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Y(e){return!k()&&(!R()&&0===e.width&&0===e.height||R()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function z(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function $(e){return t.ref(e)}function Z(e){const n=t.ref(e);return function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return null==n.value?void 0:n.value(...t)}}function J(e,t,n){return Math.floor(e/t)!==n}function Q(e,t){return t<0||t>=e.value.length}function ee(e,t){return ne(e,{disabledIndices:t})}function te(e,t){return ne(e,{decrement:!0,startingIndex:e.value.length,disabledIndices:t})}function ne(e,t){let{startingIndex:n=-1,decrement:l=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t,a=n;do{a+=l?-u:u}while(a>=0&&a<=e.value.length-1&&re(e,a,o));return a}function le(e,t){let{event:l,orientation:o,loop:u,rtl:a,cols:r,disabledIndices:i,minIndex:v,maxIndex:s,prevIndex:c,stopEvent:d=!1}=t,f=c;if(l.key===L){if(d&&G(l),-1===c)f=s;else if(f=ne(e,{startingIndex:f,amount:r,decrement:!0,disabledIndices:i}),u&&(c-r<v||f<0)){const e=c%r,t=s%r,n=s-(t-e);f=t===e?s:t>e?n:n-r}Q(e,f)&&(f=c)}if(l.key===A&&(d&&G(l),-1===c?f=v:(f=ne(e,{startingIndex:c,amount:r,disabledIndices:i}),u&&c+r>s&&(f=ne(e,{startingIndex:c%r-r,amount:r,disabledIndices:i}))),Q(e,f)&&(f=c)),"both"===o){const t=n.floor(c/r);l.key===(a?M:O)&&(d&&G(l),c%r!=r-1?(f=ne(e,{startingIndex:c,disabledIndices:i}),u&&J(f,r,t)&&(f=ne(e,{startingIndex:c-c%r-1,disabledIndices:i}))):u&&(f=ne(e,{startingIndex:c-c%r-1,disabledIndices:i})),J(f,r,t)&&(f=c)),l.key===(a?O:M)&&(d&&G(l),c%r!=0?(f=ne(e,{startingIndex:c,decrement:!0,disabledIndices:i}),u&&J(f,r,t)&&(f=ne(e,{startingIndex:c+(r-c%r),decrement:!0,disabledIndices:i}))):u&&(f=ne(e,{startingIndex:c+(r-c%r),decrement:!0,disabledIndices:i})),J(f,r,t)&&(f=c));const o=n.floor(s/r)===t;Q(e,f)&&(f=u&&o?l.key===(a?O:M)?s:ne(e,{startingIndex:c-c%r-1,disabledIndices:i}):c)}return f}function oe(e,t,n){const l=[];let o=0;return e.forEach(((e,u)=>{let{width:a,height:r}=e,i=!1;for(n&&(o=0);!i;){const e=[];for(let n=0;n<a;n++)for(let l=0;l<r;l++)e.push(o+n+l*t);o%t+a<=t&&e.every((e=>null==l[e]))?(e.forEach((e=>{l[e]=u})),i=!0):o++}})),[...l]}function ue(e,t,n,l,o){if(-1===e)return-1;const u=n.indexOf(e),a=t[e];switch(o){case"tl":return u;case"tr":return a?u+a.width-1:u;case"bl":return a?u+(a.height-1)*l:u;case"br":return n.lastIndexOf(e)}}function ae(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function re(e,t,n){var l;if("function"==typeof n?n(t):null!=(l=null==n?void 0:n.includes(t))&&l)return!0;const o=e.value[t];return!!o&&(!ve(o)||(!!o.matches(":disabled")||!n&&(o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled"))))}function ie(e){return"hidden"===e.visibility||"collapse"===e.visibility}function ve(e,t){return void 0===t&&(t=e?getComputedStyle(e):null),!(!(e&&e.isConnected&&t)||ie(t))&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}const se=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ce(e,t){const n=l.tabbable(e,se()),o=n.length;if(0===o)return;const u=D(K(e)),a=n.indexOf(u);return n[-1===a?1===t?0:o-1:a+t]}function de(e){return ce(K(e).body,1)||e}function fe(e){return ce(K(e).body,-1)||e}function me(e,t){const n=t||e.currentTarget,l=e.relatedTarget;return!l||!S(n,l)}function pe(e){l.tabbable(e,se()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ge(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}function he(e){if(e.every((e=>null==e)))return null;const t=[];return n=>{e.forEach(((e,l)=>{if(null!=e)if("function"==typeof e){var o;if(null===n&&t[l])return t[l](),void(t[l]=void 0);null==(o=t[l])||o.call(t);const u=e(n);t[l]="function"==typeof u?u:void 0}else e.value=n}))}}function ye(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const be=t.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:t.ref([])}),we=t.defineComponent((function(e){const n=t.ref(new Set),l=t.isRef(e.elementsRef)?e.elementsRef:t.ref(e.elementsRef),o=e.labelsRef?t.isRef(e.labelsRef)?e.labelsRef:t.ref(e.labelsRef):void 0,u=e=>{n.value=new Set(n.value).add(e)},a=e=>{const t=new Set(n.value);t.delete(e),n.value=t},i=t.computed((()=>{const e=new Map;return Array.from(n.value.keys()).sort(ye).forEach(((t,n)=>{e.set(t,n)})),e})),v=t.computed((()=>({register:u,unregister:a,map:i.value,elementsRef:l,labelsRef:o})));return()=>r(be.Provider,{value:v.value,children:e.children},void 0)}));function xe(e){void 0===e&&(e={});const{label:n}=e,l=be.use(),o=t.ref(null),u=t.ref(null);let a=null;return t.watch((()=>u.value),(()=>{const e=u.value;e&&(l.value.register(e),a=e)})),t.onUnmounted((()=>{a&&l.value.unregister(a)})),t.watch((()=>l.value.map),(()=>{const e=u.value,t=e?l.value.map.get(e):null;if(null!=t&&(o.value=t,l.value.elementsRef.value[t]=e,l.value.labelsRef)){var a;const o=void 0!==n;l.value.labelsRef.value[t]=o?n:null!=(a=null==e?void 0:e.textContent)?a:null}})),{ref:e=>{if(u.value=e,e){l.value.register(e);const u=l.value.map.get(e);if(null!=u&&(o.value=u,l.value.elementsRef.value[u]=e,l.value.labelsRef)){var t;const o=void 0!==n;l.value.labelsRef.value[u]=o?n:null!=(t=null==e?void 0:e.textContent)?t:null}}},index:t.computed((()=>null==o.value?-1:o.value))}}function Ie(e,t){if("function"==typeof e)return e(t);if(e){const{ref:n,...l}=t;return{...e,ref:null!=n?n:e.ref,props:{...e.props,...l}}}return r("div",{...t},void 0)}const Re=t.createContext({activeIndex:0,onNavigate:()=>{}}),Ee=[M,O],ke=[L,A],Ce=[...Ee,...ke],Te=t.defineComponent((function(e){const n=t.ref(0),l=t.computed((()=>{var l;return null!=(l=t.toValue(e.activeIndex))?l:n.value})),o=t=>{e.onNavigate?e.onNavigate(t):n.value=t},u=t.ref([]),a=t.computed((()=>({activeIndex:l.value,onNavigate:o})));return()=>{const{render:n,orientation:i="both",loop:v=!0,rtl:s=!1,cols:c=1,disabledIndices:d,itemSizes:f,dense:m=!1,ref:p,...g}=e,h=n&&"function"!=typeof n?n.props:{},y=c>1;const b={...g,...h,ref:p,"aria-orientation":"both"===i?void 0:i,onKeyDown(e){null==g.onKeyDown||g.onKeyDown(e),null==h.onKeyDown||h.onKeyDown(e),function(e){if(!Ce.includes(e.key))return;let n=l.value;const a=ee(u,d),r=te(u,d),p=s?M:O,g=s?O:M;if(y){const o=f||Array.from({length:u.value.length},(()=>({width:1,height:1}))),g=oe(o,c,m),h=g.findIndex((e=>null!=e&&!re(u,e,d))),y=g.reduce(((e,t,n)=>null==t||re(u,t,d)?e:n),-1),b=g[le(t.ref(g.map((e=>e?u.value[e]:null))),{event:e,orientation:i,loop:v,rtl:s,cols:c,disabledIndices:ae([...("function"!=typeof d?d:null)||u.value.map(((e,t)=>re(u,t,d)?t:void 0)),void 0],g),minIndex:h,maxIndex:y,prevIndex:ue(l.value>r?a:l.value,o,g,c,e.key===A?"bl":e.key===p?"tr":"tl")})];null!=b&&(n=b)}const h={horizontal:[p],vertical:[A],both:[p,A]}[i],b={horizontal:[g],vertical:[L],both:[g,L]}[i],w=y?Ce:{horizontal:Ee,vertical:ke,both:Ce}[i];var x;n===l.value&&[...h,...b].includes(e.key)&&(n=v&&n===r&&h.includes(e.key)?a:v&&n===a&&b.includes(e.key)?r:ne(u,{startingIndex:n,decrement:b.includes(e.key),disabledIndices:d})),n===l.value||Q(u,n)||(e.stopPropagation(),w.includes(e.key)&&e.preventDefault(),o(n),null==(x=u.value[n])||x.focus())}(e)}};return r(Re.Provider,{value:a.value,children:r(we,{elementsRef:t.rawRef(u),children:Ie(n,b)},void 0)},void 0)}})),Pe=t.defineComponent((function(e){const n=Re.use(),{ref:l,index:o}=xe(),u=he([l,e.ref,function(){const t=e.render;return t&&"function"!=typeof t?t.props.ref:void 0}()]),a=t.computed((()=>n.value.activeIndex===o.value));return()=>{const{render:t,...l}=e,r=t&&"function"!=typeof t?t.props:{};return Ie(t,{...l,...r,ref:u,tabIndex:a.value?0:-1,"data-active":a.value?"":void 0,onFocus(e){null==l.onFocus||l.onFocus(e),null==r.onFocus||r.onFocus(e),n.value.onNavigate(o.value)}})}}));let Me=0;function Oe(){return t.ref("floating-ui-"+Math.random().toString(36).slice(2,6)+Me++)}const Le=t.defineComponent((function(e){const{context:{placement:n,elements:{floating:l},middlewareData:o},width:u=14,height:a=7,tipRadius:i=0,strokeWidth:v=0,staticOffset:s,stroke:c,d:d,ref:f}=e,m=Oe(),p=t.ref(!1);return t.watch((()=>l.value),(()=>{if(!l.value)return;"rtl"===y(l.value).direction&&(p.value=!0)})),()=>{var t;if(!l.value)return null;const[g,h]=n.value.split("-"),y="top"===g||"bottom"===g,{arrow:b,shift:w}=o.value;let x=s;(y&&null!=w&&w.x||!y&&null!=w&&w.y)&&(x=null);const I=2*v,R=I/2,E=u/2*(i/-8+1),k=a/2*i/4,C=!!d,T=x&&"end"===h?"bottom":"top";let P=x&&"end"===h?"right":"left";x&&p.value&&(P="end"===h?"left":"right");const M=null!=(null==b?void 0:b.x)?x||b.x:"",O=null!=(null==b?void 0:b.y)?x||b.y:"",L=d||"M0,0 H"+u+" L"+(u-E)+","+(a-k)+" Q"+u/2+","+a+" "+E+","+(a-k)+" Z",A={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[g],{transform:D,...S}=null!=(t=e.style)?t:{},{ref:N,context:F,style:V,...K}=e,_={...K,ref:f,"aria-hidden":!0,width:C?u:u+I,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[P]:M,[T]:O,[g]:y||C?"100%":"calc(100% - "+I/2+"px)",transform:[A,D].filter((e=>!!e)).join(" "),...S}};return r("svg",{..._,children:[I>0&&r("path",{clipPath:"url(#"+m.value+")",fill:"none",stroke:c,strokeWidth:I+(d?0:1),d:L},void 0),r("path",{stroke:I&&!d?K.fill:"none",d:L},void 0),r("clipPath",{id:m.value,children:r("rect",{x:-R,y:R*(C?-1:1),width:u+I,height:u},void 0)},void 0)]},void 0)}}));function Ae(){const e=new Map;return{emit(t,n){var l;null==(l=e.get(t))||l.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var l;null==(l=e.get(t))||l.delete(n)}}}const De=t.createContext(null),Se=t.createContext(null),Ne=()=>{var e;return(null==(e=De.use().value)?void 0:e.id)||null},Fe=()=>Se.use().value;const Ve=t.defineComponent((function(e){const n=De.use(),l=t.computed((()=>{var e;return(null==(e=n.value)?void 0:e.id)||null}));return()=>r(De.Provider,{value:{id:e.id,parentId:l.value},children:e.children},void 0)})),Ke=t.defineComponent((function(e){const n=t.ref([]),l=e=>{n.value=[...n.value,e]},o=e=>{n.value=n.value.filter((t=>t!==e))},u=Ae();return()=>r(Se.Provider,{value:{nodesRef:n,addNode:l,removeNode:o,events:u},children:e.children},void 0)}));function _e(e){return"data-floating-ui-"+e}function Ue(e){-1!==e.value&&(clearTimeout(e.value),e.value=-1)}const We=_e("safe-polygon");function He(e,t,n){if(n&&!z(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function qe(e){return"function"==typeof e?e():e}const je=()=>{},Be=t.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:je,setState:je,isInstantPhase:!1}),Ge=()=>Be.use(),Xe=t.defineComponent((function(e){const{children:n,delay:l,timeoutMs:o=0}=e,u=t.ref({delay:l,timeoutMs:o,initialDelay:l,currentId:null,isInstantPhase:!1}),a=e=>{u.value={...u.value,...e}},i=e=>{a({currentId:e})},v=t.ref(null);t.watch((()=>[u.value.currentId,u.value.isInstantPhase]),(()=>{u.value.currentId?null===v.value?v.value=u.value.currentId:u.value.isInstantPhase||a({isInstantPhase:!0}):(u.value.isInstantPhase&&a({isInstantPhase:!1}),v.value=null)}));const s=t.computed((()=>({...u.value,setState:a,setCurrentId:i})));return()=>r(Be.Provider,{value:s.value,children:n},void 0)}));const Ye=t.createContext({hasProvider:!1,timeoutMs:0,delayRef:t.ref(0),initialDelayRef:t.ref(0),timeoutIdRef:t.ref(-1),currentIdRef:t.ref(null),currentContextRef:t.ref(null)}),ze=t.defineComponent((function(e){const{children:n,delay:l,timeoutMs:o=0}=e,u=t.ref(l),a=t.ref(l),i=t.ref(null),v=t.ref(null),s=t.ref(-1),c=t.computed((()=>({hasProvider:!0,delayRef:u,initialDelayRef:a,currentIdRef:i,timeoutMs:o,currentContextRef:v,timeoutIdRef:s})));return()=>r(Ye.Provider,{value:c.value,children:n},void 0)}));let $e=0;function Ze(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:l=!0,sync:o=!1}=t;l&&cancelAnimationFrame($e);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():$e=requestAnimationFrame(u)}const Je={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qe(e){return"inert"===e?Je.inert:"aria-hidden"===e?Je["aria-hidden"]:Je.none}let et=new WeakSet,tt={},nt=0;function lt(e){return e?p(e)?e.host:lt(e.parentNode):null}const ot=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=lt(t);return e.contains(n)?n:null})).filter((e=>null!=e));function ut(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=K(e[0]).body;return function(e,t,n,l){const o="data-floating-ui-inert",u=l?"inert":n?"aria-hidden":null,a=ot(t,e),r=new Set,i=new Set(a),v=[];tt[o]||(tt[o]=new WeakMap);const c=tt[o];return a.forEach((function e(t){t&&!r.has(t)&&(r.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!i.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==s(t))if(r.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,l=Qe(u),a=(l.get(t)||0)+1,r=(c.get(t)||0)+1;l.set(t,a),c.set(t,r),v.push(t),1===a&&n&&et.add(t),1===r&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"inert"===u?"":"true")}}))}(t),r.clear(),nt++,()=>{v.forEach((e=>{const t=Qe(u),n=(t.get(e)||0)-1,l=(c.get(e)||0)-1;t.set(e,n),c.set(e,l),n||(!et.has(e)&&u&&e.removeAttribute(u),et.delete(e)),l||e.removeAttribute(o)})),nt--,nt||(Je.inert=new WeakMap,Je["aria-hidden"]=new WeakMap,Je.none=new WeakMap,et=new WeakSet,tt={})}}(e.concat(Array.from(l.querySelectorAll('[aria-live],[role="status"],output'))),l,t,n)}const at={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},rt=t.defineComponent((function(e){const n=t.ref(void 0);t.onMounted((()=>{I()&&(n.value="button")}));const{ref:l,...o}=e;return()=>r("span",{ref:l,...o,tabIndex:0,role:n.value,"aria-hidden":!n.value||void 0,[_e("focus-guard")]:"",style:at},void 0)})),it={clipPath:"inset(50%)",position:"fixed",top:0,left:0},vt=t.createContext(null),st=_e("portal");function ct(e){void 0===e&&(e={});const{id:n,root:l}=e,o=Oe(),u=ft(),a=t.ref(null),r=t.ref(null);return t.watch(a,((e,t)=>{null==t||t.remove(),queueMicrotask((()=>{r.value=null}))})),t.onUnmounted((()=>{var e;null==(e=a.value)||e.remove()})),t.watch((()=>{var e;return[n,o.value,t.toValue(l),null==(e=u.value)?void 0:e.portalNode]}),(()=>{var e;if(!o.value)return;if(r.value)return;const i=n?document.getElementById(n):null;if(i){const e=document.createElement("div");return e.id=o.value,e.setAttribute(st,""),i.appendChild(e),r.value=e,void(a.value=e)}const v=t.toValue(l);if(null===v)return;let s=v||(null==(e=u.value)?void 0:e.portalNode);s=s||document.body;let c=null;n&&(c=document.createElement("div"),c.id=n,s.appendChild(c));const d=document.createElement("div");d.id=o.value,d.setAttribute(st,""),s=c||s,s.appendChild(d),r.value=d,a.value=d}),{immediate:!0}),a}const dt=t.defineComponent((function(e){const{id:n,root:l,preserveTabOrder:o=!0,portalOwnerRole:u}=e,a=ct({id:n,root:l}),i=t.ref(null),v=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref(null),f=e=>{i.value="function"==typeof e?e(i.value):e},m=t.computed((()=>{var e;return null==(e=i.value)?void 0:e.modal})),p=t.computed((()=>{var e;return null==(e=i.value)?void 0:e.open})),g=t.computed((()=>!!i.value&&!i.value.modal&&i.value.open&&o&&!(!t.toValue(l)&&!a.value)));let h;t.watch((()=>[a.value,o,m.value]),(()=>{function e(e){if(a.value&&me(e)){("focusin"===e.type?ge:pe)(a.value)}}null==h||h(),h=void 0,a.value&&o&&!m.value&&(a.value.addEventListener("focusin",e,!0),a.value.addEventListener("focusout",e,!0),h=()=>{var t,n;null==(t=a.value)||t.removeEventListener("focusin",e,!0),null==(n=a.value)||n.removeEventListener("focusout",e,!0)})})),t.watch((()=>[a.value,p.value]),(()=>{a.value&&(p.value||ge(a.value))})),t.onUnmounted((()=>{null==h||h()}));const y=t.computed((()=>({preserveTabOrder:o,beforeOutsideRef:v,afterOutsideRef:s,beforeInsideRef:c,afterInsideRef:d,portalNode:a.value,setFocusManagerState:f})));return()=>r(vt.Provider,{value:y.value,children:[g.value&&a.value&&r(rt,{"data-type":"outside",ref:v,onFocus:e=>{var t;if(me(e,null!=(t=a.value)?t:void 0)){var n;null==(n=c.value)||n.focus()}else{const e=fe(i.value?i.value.domReference:null);null==e||e.focus()}}},void 0),g.value&&a.value&&r("span",{"aria-owns":a.value.id,role:u||void 0,style:it},void 0),a.value&&r(t.Teleport,{to:a.value,children:e.children},void 0),g.value&&a.value&&r(rt,{"data-type":"outside",ref:s,onFocus:e=>{var t;if(me(e,null!=(t=a.value)?t:void 0)){var n;null==(n=d.value)||n.focus()}else{var l,o;const t=de(i.value?i.value.domReference:null);null==t||t.focus(),(null==(l=i.value)?void 0:l.closeOnFocusOut)&&(null==(o=i.value)||o.onOpenChange(!1,e,"focus-out"))}}},void 0)]},void 0)})),ft=()=>vt.use();function mt(e){return t=>{e.forEach((e=>{if(e)if("function"==typeof e){const n=e(t);n&&"object"==typeof n&&"value"in n&&(n.value=t)}else e.value=t}))}}let pt=[];function gt(){pt=pt.filter((e=>{var t;return null==(t=e.deref())?void 0:t.isConnected}))}function ht(){gt();const e=pt[pt.length-1];return null==e?void 0:e.deref()}function yt(e,t){var n;if(!(t.value.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const o=se(),u=l.focusable(e,o).filter((e=>{const t=e.getAttribute("data-tabindex")||"";return l.isTabbable(e,o)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")})),a=e.getAttribute("tabindex");t.value.includes("floating")||0===u.length?"0"!==a&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):("-1"!==a||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const bt=t.defineComponent((function(e){const{ref:t,...n}=e;return()=>r("button",{...n,type:"button",ref:t,tabIndex:-1,style:at},void 0)})),wt=t.defineComponent((function(e){var n,o;const{context:u,children:a}=e,v=t.ref(t.toValue(null!=(n=e.disabled)&&n));t.watch((()=>{var n;return t.toValue(null!=(n=e.disabled)&&n)}),(e=>{v.value=e}));const c=t.computed((()=>{var t;return null!=(t=e.order)?t:["content"]})),d=t.computed((()=>{var t;return null==(t=e.guards)||t})),f=t.computed((()=>{var t;return null!=(t=e.initialFocus)?t:0})),p=t.computed((()=>{var n;return t.toValue(null!=(n=e.restoreFocus)&&n)})),g=t.computed((()=>{var t;return null==(t=e.modal)||t})),h=t.computed((()=>{var t;return null!=(t=e.visuallyHiddenDismiss)&&t})),y=t.computed((()=>{var t;return null==(t=e.closeOnFocusOut)||t})),b=t.computed((()=>{var t;return null!=(t=e.outsideElementsInert)&&t})),w=null!=(o=e.getInsideElements)?o:()=>[],{open:x,onOpenChange:I,events:R,dataRef:E,elements:{domReference:k,floating:C}}=u,T=()=>{var e;return null==(e=E.value.floatingContext)?void 0:e.nodeId.value},P=t.computed((()=>!1===f.value||"number"==typeof f.value&&f.value<0)),M=t.computed((()=>U(k.value)&&P.value)),O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,L=t.computed((()=>!O||d.value)),A=t.computed((()=>!L.value||O&&b.value)),F=c,V=f,_={get value(){return null==(t=e.returnFocus)||t;var t}},W=Fe(),j=ft(),z=t.ref(null),$=t.ref(null),Z=t.ref(!1),J=t.ref(!1),Q=t.ref(-1),ee=t.ref(-1),te=t.ref(""),ne=t.computed((()=>null!=j.value)),le=t.computed((()=>H(C.value))),oe=function(e){return void 0===e&&(e=le.value),e?l.tabbable(e,se()):[]},ue=e=>{const t=oe(null!=e?e:void 0);return F.value.map((e=>k.value&&"reference"===e?k.value:le.value&&"floating"===e?le.value:t)).filter(Boolean).flat()};let ae,re,ie;t.watch([k,C],(()=>{if(null==ae||ae(),ae=void 0,v.value)return;if(!g.value)return;function e(e){if("Tab"===e.key){S(le.value,D(K(le.value)))&&0===oe().length&&!M.value&&G(e);const t=ue(),n=N(e);"reference"===F.value[0]&&n===k.value&&(G(e),e.shiftKey?Ze(t[t.length-1]):Ze(t[1])),"floating"===F.value[1]&&n===le.value&&e.shiftKey&&(G(e),Ze(t[0]))}}const t=K(le.value);t.addEventListener("keydown",e),ae=()=>{t.removeEventListener("keydown",e)}})),t.watch(C,(()=>{function e(e){const t=N(e),n=oe().indexOf(t);-1!==n&&(Q.value=n)}null==re||re(),re=void 0,v.value||C.value&&(C.value.addEventListener("focusin",e),re=()=>{var t;null==(t=C.value)||t.removeEventListener("focusin",e)})})),t.watch([k,C,j,v],(()=>{if(null==ie||ie(),ie=void 0,v.value)return;if(!y.value)return;function e(){J.value=!0,setTimeout((()=>{J.value=!1}))}const t=Boolean(!W&&j.value);function n(){Ue(ee),E.value.insideReactTree=!0,ee.value=window.setTimeout((()=>{E.value.insideReactTree=!1}))}if(C.value&&m(k.value)){const l=function(e){const t=e.relatedTarget,n=e.currentTarget,l=N(e);queueMicrotask((()=>{var o,u;const a=T(),r=!(S(k.value,t)||S(C.value,t)||S(t,C.value)||S(null!=(o=null==(u=j.value)?void 0:u.portalNode)?o:null,t)||null!=t&&t.hasAttribute(_e("focus-guard"))||W&&(q(W.nodesRef.value,a).find((e=>{var n,l;return S(null==(n=e.context)?void 0:n.elements.floating.value,t)||S(null==(l=e.context)?void 0:l.elements.domReference.value,t)}))||B(W.nodesRef.value,a).find((e=>{var n,l,o;return[null==(n=e.context)?void 0:n.elements.floating.value,H(null==(l=e.context)?void 0:l.elements.floating.value)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference.value)===t}))));if(n===k.value&&le.value&&yt(le.value,F),p.value&&n!==k.value&&!ve(l)&&D(K(le.value))===K(le.value).body){if(m(le.value)&&(le.value.focus(),"popup"===p.value))return;const e=Q.value,t=oe(),n=t[e]||t[t.length-1]||le.value;m(n)&&n.focus()}E.value.insideReactTree?E.value.insideReactTree=!1:(M.value?n!==k.value||g.value:!g.value)&&t&&r&&!J.value&&(M.value||t!==ht())&&(Z.value=!0,I(!1,e,"focus-out"))}))};k.value.addEventListener("focusout",l),k.value.addEventListener("pointerdown",e),C.value.addEventListener("focusout",l),t&&C.value.addEventListener("focusout",n,!0),ie=()=>{var o,u,a,r;(null==(o=k.value)||o.removeEventListener("focusout",l),null==(u=k.value)||u.removeEventListener("pointerdown",e),null==(a=C.value)||a.removeEventListener("focusout",l),t)&&(null==(r=C.value)||r.removeEventListener("focusout",n,!0))}}}));const ce=t.ref(null),pe=t.ref(null),ge=mt([ce,()=>{var e;return null==(e=j.value)?void 0:e.beforeInsideRef}]),he=mt([pe,()=>{var e;return null==(e=j.value)?void 0:e.afterInsideRef}]);let ye,be;t.watch([k,C,j],(()=>{var e,t,n,l;if(null==ye||ye(),ye=void 0,v.value)return;if(!C.value)return;const o=Array.from((null==(e=j.value)||null==(e=e.portalNode)?void 0:e.querySelectorAll("["+_e("portal")+"]"))||[]),u=null==(t=(W?B(W.nodesRef.value,T()):[]).find((e=>{var t;return U((null==(t=e.context)?void 0:t.elements.domReference.value)||null)})))||null==(t=t.context)?void 0:t.elements.domReference.value,a=[C.value,u,...o,...w(),z.value,$.value,ce.value,pe.value,null==(n=j.value)?void 0:n.beforeOutsideRef.value,null==(l=j.value)?void 0:l.afterOutsideRef.value,F.value.includes("reference")||M.value?k.value:null].filter((e=>null!=e));ye=g.value||M.value?ut(a,!A.value,A.value):ut(a)})),t.watch([x,le,v],(()=>{if(v.value||!m(le.value))return;const t=K(le.value);D(t),queueMicrotask((()=>{var n;const l=ue(le.value),o=V.value;let u=void 0===e.initialFocus?null==(n=C.value)?void 0:n.querySelector("[autofocus]"):null;u||"number"!=typeof o?"function"==typeof o?u=o("")||null:o&&"object"==typeof o&&"__v_isRef"in o&&(u=o.value):u=l[o],u=u||l[0]||le.value;const a=S(le.value,D(t));P.value||a||!x.value||Ze(u,{preventScroll:u===le.value})}))}),{immediate:!0}),t.watch([x,le,k,v],(()=>{if(null==be||be(),be=void 0,v.value||!le.value)return;x.value&&(te.value="");const e=K(le.value),t=D(e);var n;function o(e){let{reason:t,event:n,nested:l}=e;if(te.value=function(e){return e instanceof KeyboardEvent?"keyboard":"pointerType"in e?e.pointerType||"keyboard":e instanceof MouseEvent?0===e.detail?"keyboard":"mouse":""}(n),x&&(Z.value=!1),["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(Z.value=!0),"outside-press"===t)if(l)Z.value=!1;else if(X(n)||Y(n))Z.value=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),Z.value=!e}}n=t,gt(),n&&"body"!==s(n)&&(pt.push(new WeakRef(n)),pt.length>20&&(pt=pt.slice(-20))),R.on("openchange",o);const u=e.createElement("span");u.setAttribute("tabindex","-1"),u.setAttribute("aria-hidden","true"),Object.assign(u.style,at),ne.value&&k.value&&"function"!=typeof _.value&&k.value.insertAdjacentElement("afterend",u),be=()=>{R.off("openchange",o);const t=D(e),n=S(C.value,t)||W&&q(W.nodesRef.value,T(),!1).some((e=>{var n;return S(null==(n=e.context)?void 0:n.elements.floating.value,t)})),a=function(){const e=_.value;let t="function"==typeof e?e(te.value):e;if(void 0===t||!1===t)return null;null===t&&(t=!0);const n=t&&"object"==typeof t&&"__v_isRef"in t?t.value:t;if("boolean"==typeof t){const e=k.value||ht();return e&&e.isConnected?e:u}return n||k.value||ht()||u}(),r="boolean"!=typeof _.value;queueMicrotask((()=>{const o=function(e){if(!e)return null;const t=se();return l.isTabbable(e,t)?e:l.tabbable(e,t)[0]||e}(a);if(_.value&&!Z.value&&m(o)&&(r||o===t||t===e.body||n)){const e={preventScroll:!0};"keyboard"===te.value&&(e.focusVisible=!0),o.focus(e)}u.remove()}))}})),t.watch(v,(()=>{queueMicrotask((()=>{Z.value=!1}))}),{immediate:!0}),t.watch([j,x,k],(()=>{if(v.value)return;const e=j.value;e&&(e.setFocusManagerState({modal:g.value,closeOnFocusOut:y.value,open:x.value,onOpenChange:I,domReference:k.value}),t.onWatcherCleanup((()=>{e.setFocusManagerState(null)})))}),{immediate:!0}),t.watch([le,v],(()=>{v.value||le.value&&yt(le.value,F)}),{immediate:!0});const we=t.computed((()=>!v.value&&L.value&&(!g.value||!M.value)&&(ne.value||g.value)));function xe(e){return!v.value&&h.value&&g.value?r(bt,{ref:"start"===e?z:$,onClick:e=>I(!1,e),children:"string"==typeof h?h:"Dismiss"},void 0):null}return t.onUnmounted((()=>{null==ae||ae(),null==re||re(),null==ie||ie(),null==ye||ye(),null==be||be(),queueMicrotask(gt)})),()=>r(i,{children:[we.value&&r(rt,{"data-type":"inside",ref:ge,onFocus:e=>{var t;if(g.value){const e=ue();Ze("reference"===c.value[0]?e[0]:e[e.length-1])}else if(null!=(t=j.value)&&t.preserveTabOrder&&j.value.portalNode){var n;if(Z.value=!1,me(e,null!=(n=j.value.portalNode)?n:void 0)){const e=de(k.value);null==e||e.focus()}else{var l;null==(l=j.value.beforeOutsideRef.value)||l.focus()}}}},void 0),!M.value&&xe("start"),e.children,xe("end"),we.value&&r(rt,{"data-type":"inside",ref:he,onFocus:e=>{var t;if(g.value)Ze(ue()[0]);else if(null!=(t=j.value)&&t.preserveTabOrder&&j.value.portalNode){var n;if(y.value&&(Z.value=!0),me(e,null!=(n=j.value.portalNode)?n:void 0)){const e=fe(k.value);null==e||e.focus()}else{var l;null==(l=j.value.afterOutsideRef.value)||l.focus()}}}},void 0)]},void 0)}));let xt=0;const It="--floating-ui-scrollbar-width";let Rt=()=>{};const Et=t.defineComponent((function(e){return t.watch((()=>e.lockScroll),(e=>{null!=e&&e&&(xt++,1===xt&&(Rt=function(){const e=w(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,l=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,u=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(It,o+"px"),o&&(n[l]=o+"px"),t){var r,i;const e=(null==(r=window.visualViewport)?void 0:r.offsetLeft)||0,t=(null==(i=window.visualViewport)?void 0:i.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(t))+"px",left:-(u-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[l]:""}),n.removeProperty(It),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(u,a))}}()),t.onWatcherCleanup((()=>{xt--,0===xt&&Rt()})))}),{immediate:!0}),()=>{const{ref:t,lockScroll:n,...l}=e;return r("div",{ref:t,...l,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...l.style}},void 0)}}));function kt(e){return m(e.target)&&"BUTTON"===e.target.tagName}function Ct(e){return _(e)}function Tt(e){return null!=e&&null!=e.clientX}const Pt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Mt=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}},Ot=new Set;let Lt=null;function At(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,l,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(l=n;0!=l--;)if(!At(e[l],t[l]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(l=n;0!=l--;)if(!{}.hasOwnProperty.call(t,o[l]))return!1;for(l=n;0!=l--;){const n=o[l];if(("_owner"!==n||!e.$$typeof)&&!At(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Dt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function St(e,t){const n=Dt(e);return Math.round(t*n)/n}function Nt(e){void 0===e&&(e={});const{placement:n="bottom",strategy:l="absolute",middleware:u=[],platform:a,elements:{reference:r,floating:i}={},transform:v=!0,whileElementsMounted:s,open:c}=e,d=t.ref(0),m=t.ref(0),p=t.ref(n),g=t.ref(l),h=t.ref({}),y=t.ref(!1),b=t.ref(null),w=t.ref(null),x=t.computed((()=>{var e;return null!=(e=t.toValue(r))?e:b.value})),I=t.computed((()=>{var e;return null!=(e=t.toValue(i))?e:w.value})),R=t.ref(null),E=t.ref(null),k=t.ref({x:0,y:0,strategy:l,placement:n,middlewareData:{},isPositioned:!1}),C=t.computed((()=>t.toValue(c))),T=$(a),P=()=>{if(!R.value||!E.value)return;const e={placement:p.value,strategy:g.value,middleware:u};T.value&&(e.platform=T.value),o.computePosition(R.value,E.value,e).then((e=>{const t={...e,isPositioned:!1!==C.value};M.value&&!At(k.value,t)&&(k.value=t,d.value=t.x,m.value=t.y,p.value=t.placement,g.value=t.strategy,h.value=t.middlewareData,y.value=t.isPositioned)}))};t.watch(C,(()=>{!1===C.value&&k.value.isPositioned&&(k.value.isPositioned=!1,y.value=!1)}));const M=t.ref(!1);let O;const L=()=>{null==O||O(),O=void 0,x.value&&(R.value=x.value),I.value&&(E.value=I.value),R.value&&E.value&&(s?O=s(R.value,E.value,P):P())};t.watch([x,I],L),t.onMounted((()=>{M.value=!0,L()})),t.onUnmounted((()=>{M.value=!1,null==O||O()}));const A=t.computed((()=>{var e,t;const n={position:g.value,left:0,top:0};if(!I.value)return n;const l=St(I.value,null!=(e=d.value)?e:0),o=St(I.value,null!=(t=m.value)?t:0);return v?{...n,transform:"translate("+l+"px, "+o+"px)",...Dt(I.value)>=1.5&&{willChange:"transform"}}:{position:g.value,left:l,top:o}}));return{x:d,y:m,strategy:g,placement:p,middlewareData:h,isPositioned:y,update:P,floatingStyles:A,refs:{reference:R,floating:E,setReference:e=>{var t;(null===e||f(e)||"function"==typeof(null==(t=e)?void 0:t.getBoundingClientRect))&&(e!==R.value&&(R.value=e,b.value=e))},setFloating:e=>{e!==E.value&&(E.value=e,w.value=e)}},elements:{reference:x,floating:I}}}function Ft(e){const{onOpenChange:n,elements:l}=e,o=Oe(),u=t.ref({}),a=Ae(),r=null!=Ne(),i=t.computed((()=>{var n;return null!=(n=t.toValue(e.open))&&n})),v=t.ref(t.toValue(l.reference)),s=Z(((e,t,l)=>{u.value.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:l,nested:r}),null==n||n(e,t,l)})),c={setPositionReference:e=>{v.value=e}},d={reference:t.computed((()=>v.value||t.toValue(l.reference)||null)),floating:t.computed((()=>t.toValue(l.floating)||null)),domReference:t.computed((()=>t.toValue(l.reference)||null))};return{dataRef:u,open:i,onOpenChange:s,elements:d,events:a,floatingId:o,refs:c}}function Vt(){return E()&&I()}function Kt(e,n,l){const o=new Map,u="item"===l;let a=e;if(u&&e){const{[T]:t,[P]:n,...l}=e;a=l}return{..."floating"===l&&{tabIndex:-1,[C]:""},...a,...n.map((n=>{const o=n?n[l]:null,u=o?t.unref(o):null;return"function"==typeof u?e?u(e):null:u})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,l]=t;var a;u&&[T,P].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof l&&(null==(a=o.get(n))||a.push(l),e[n]=function(){for(var e,t=arguments.length,l=new Array(t),u=0;u<t;u++)l[u]=arguments[u];return null==(e=o.get(n))?void 0:e.map((e=>e(...l))).find((e=>void 0!==e))})):e[n]=l)})),e):e),{})}}function _t(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ut(e,t){return _t(t,e===L||e===A,e===M||e===O)}function Wt(e,t,n){return _t(t,e===A,n?e===M:e===O)||"Enter"===e||" "===e||""===e}function Ht(e,t,n){return _t(t,n?e===M:e===O,e===A)}function qt(e,t,n,l){return"both"===t||"horizontal"===t&&l&&l>1?"Escape"===e:_t(t,n?e===O:e===M,e===L)}const jt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Bt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Gt(e,t){return"function"==typeof e?e(t):e}function Xt(e,n){void 0===n&&(n={});const{open:l,elements:{floating:o}}=e,{duration:u=250}=n,a=("number"==typeof u?u:u.close)||0,r=t.ref("unmounted"),i=function(e,n){const l=t.ref(e.value);let o;return t.watch(e,(e=>{e?(o&&(clearTimeout(o),o=void 0),l.value=!0):l.value&&(o=setTimeout((()=>{l.value=!1}),n))})),t.onUnmounted((()=>{o&&clearTimeout(o)})),l}(l,a);let v;return t.watch([i,r],(()=>{i.value||"close"!==r.value||(r.value="unmounted")})),t.watch([l,o],(()=>{null!=v&&(cancelAnimationFrame(v),v=void 0),o.value&&(l.value?(r.value="initial",v=requestAnimationFrame((()=>{r.value="open"}))):r.value="close")}),{immediate:!0}),t.onUnmounted((()=>{null!=v&&cancelAnimationFrame(v)})),{isMounted:i,status:r}}function Yt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function zt(e,t){const[n,l]=e;let o=!1;const u=t.length;for(let e=0,a=u-1;e<u;a=e++){const[u,r]=t[e]||[0,0],[i,v]=t[a]||[0,0];r>=l!=v>=l&&n<=(i-u)*(l-r)/(v-r)+u&&(o=!o)}return o}e.Composite=Te,e.CompositeItem=Pe,e.FloatingArrow=Le,e.FloatingDelayGroup=Xe,e.FloatingFocusManager=wt,e.FloatingList=we,e.FloatingNode=Ve,e.FloatingOverlay=Et,e.FloatingPortal=dt,e.FloatingTree=Ke,e.NextFloatingDelayGroup=ze,e.activeElement=D,e.contains=S,e.createGridCellMap=oe,e.disableFocusInside=pe,e.enableFocusInside=ge,e.findNonDisabledListIndex=ne,e.getDeepestNode=j,e.getDocument=K,e.getFloatingFocusElement=H,e.getGridCellIndexOfCorner=ue,e.getGridCellIndices=ae,e.getGridNavigatedIndex=le,e.getMaxListIndex=te,e.getMinListIndex=ee,e.getNextTabbable=de,e.getNodeAncestors=B,e.getNodeChildren=q,e.getPlatform=w,e.getPreviousTabbable=fe,e.getTabbableOptions=se,e.getTarget=N,e.getUserAgent=x,e.gridNavigation=function(e,t,l,o,u,a,r,i,v,s){void 0===s&&(s=2);const c=function(e,t){let{event:l,orientation:o,loop:u,onLoop:a,rtl:r,cols:i,disabledIndices:v,minIndex:s,maxIndex:c,prevIndex:d,stopEvent:f=!1}=t;const m={value:e};let p,g=d;if(l.key===L?p="up":l.key===A&&(p="down"),p){var h;const t=[],o=[];let r=!1,y=0;{let n=null,l=-1;e.forEach(((e,u)=>{if(null==e)return;y+=1;const a=e.closest('[role="row"]');a&&(r=!0),a===n&&-1!==l||(n=a,l+=1,t[l]=[]),t[l].push(u),o[u]=l}))}let b=!1,w=0;if(r)for(const e of t){const t=e.length;t>w&&(w=t),t!==i&&(b=!0)}const x=b&&y<e.length,I=w||i,R=e=>{if(!b||-1===d)return;const n=o[d];if(null==n)return;const r=t[n].indexOf(d),i="up"===e?-1:1;for(let e=n+i,f=0;f<t.length;f+=1,e+=i){if(e<0||e>=t.length){if(!u||x)return;if(e=e<0?t.length-1:0,a){var s,c;const n=Math.min(r,t[e].length-1),u=null!=(s=t[e][n])?s:t[e][0],i=a(l,d,u);e=null!=(c=o[i])?c:e}}const n=t[e];for(let e=Math.min(r,n.length-1);e>=0;e-=1){const t=n[e];if(!re(m,t,v))return t}}},E=e=>{if(!x||-1===d)return;const t=d%I,l="up"===e?-I:I,o=c-c%I,a=n.floor(c/I)+1;for(let e=d-t+l,n=0;n<a;n+=1,e+=l){if(e<0||e>c){if(!u)return;e=e<0?o:0}const n=Math.min(e+I-1,c);for(let l=Math.min(e+t,n);l>=e;l-=1)if(!re(m,l,v))return l}};f&&G(l);const k=null!=(h=R(p))?h:E(p);if(void 0!==k)g=k;else if(-1===d)g="up"===p?c:s;else if(g=ne(m,{startingIndex:d,amount:I,decrement:"up"===p,disabledIndices:v}),u){if("up"===p&&(d-I<s||g<0)){const e=d%I,t=c%I,n=c-(t-e);g=t===e?c:t>e?n:n-I,a&&(g=a(l,d,g))}"down"===p&&d+I>c&&(g=ne(m,{startingIndex:d%I-I,amount:I,disabledIndices:v}),a&&(g=a(l,d,g)))}Q(m,g)&&(g=d)}if("both"===o){const e=n.floor(d/i);l.key===(r?M:O)&&(f&&G(l),d%i!=i-1?(g=ne(m,{startingIndex:d,disabledIndices:v}),u&&J(g,i,e)&&(g=ne(m,{startingIndex:d-d%i-1,disabledIndices:v}),a&&(g=a(l,d,g)))):u&&(g=ne(m,{startingIndex:d-d%i-1,disabledIndices:v}),a&&(g=a(l,d,g))),J(g,i,e)&&(g=d)),l.key===(r?O:M)&&(f&&G(l),d%i!=0?(g=ne(m,{startingIndex:d,decrement:!0,disabledIndices:v}),u&&J(g,i,e)&&(g=ne(m,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:v}),a&&(g=a(l,d,g)))):u&&(g=ne(m,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:v}),a&&(g=a(l,d,g))),J(g,i,e)&&(g=d));const t=n.floor(c/i)===e;Q(m,g)&&(u&&t?(g=l.key===(r?O:M)?c:ne(m,{startingIndex:d-d%i-1,disabledIndices:v}),a&&(g=a(l,d,g))):g=d)}return g}(l.value,{event:e,orientation:o,loop:u,rtl:a,cols:s,disabledIndices:r,minIndex:i,maxIndex:v,prevIndex:t>v?i:t,stopEvent:!0});return Q(l,c)?void 0:c},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:l,overflowRef:u,onFallbackChange:a,offset:r=0,index:i=0,minItemsVisible:v=4,referenceOverflowThreshold:s=0,scrollRef:c,...d}=n.evaluate(e,t),{rects:f,platform:m,elements:{floating:p}}=t,g=l.value[i],h=(null==c?void 0:c.value)||p,y=p.clientTop||h.clientTop,b=0!==p.clientTop,w=0!==h.clientTop,x=p===h;if(!g)return{};const I={...t,...await o.offset(-g.offsetTop-p.clientTop-f.reference.height/2-g.offsetHeight/2-r).fn(t)},R=await m.detectOverflow(Yt(I,h.scrollHeight+y+p.clientTop),d),E=await m.detectOverflow(I,{...d,elementContext:"reference"}),k=n.max(0,R.top),C=I.y+k,T=(h.scrollHeight>h.clientHeight?e=>e:n.round)(n.max(0,h.scrollHeight+(b&&x||w?2*y:0)-k-n.max(0,R.bottom)));if(h.style.maxHeight=T+"px",h.scrollTop=k,a){a(h.offsetHeight<g.offsetHeight*n.min(v,l.value.length)-1||E.top>=-s||E.bottom>=-s)}return u&&(u.value=await m.detectOverflow(Yt({...I,y:C},h.offsetHeight+y+p.clientTop),d)),{y:C}}}),e.isAndroid=R,e.isDifferentGridRow=J,e.isElementVisible=ve,e.isEventTargetWithin=F,e.isHiddenByStyles=ie,e.isIndexOutOfListBounds=Q,e.isJSDOM=k,e.isListIndexDisabled=re,e.isMac=E,e.isMouseLikePointerType=z,e.isOutsideEvent=me,e.isReactEvent=function(e){return"nativeEvent"in e},e.isRootElement=V,e.isSafari=I,e.isTypeableCombobox=U,e.isTypeableElement=_,e.isVirtualClick=X,e.isVirtualPointerEvent=Y,e.matchesFocusVisible=W,e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:l=!0}=e;let o,u=!1,a=null,r=null,i="undefined"!=typeof performance?performance.now():0;function v(){null!=o&&(window.clearTimeout(o),o=void 0)}const s=e=>{let{x:n,y:s,placement:c,elements:d,onClose:m,nodeId:p,tree:g}=e;return function(e){function h(){v(),m()}if(v(),!d.domReference.value||!d.floating.value||null==c.value||null==n||null==s)return;const{clientX:y,clientY:b}=e,w=[y,b],x=N(e),I="mouseleave"===e.type,R=S(d.floating.value,x),E=S(d.domReference.value,x),k=d.domReference.value.getBoundingClientRect(),C=d.floating.value.getBoundingClientRect(),T=c.value.split("-")[0],P=n>C.right-C.width/2,M=s>C.bottom-C.height/2,O=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),L=C.width>k.width,A=C.height>k.height,D=(L?k:C).left,F=(L?k:C).right,V=(A?k:C).top,K=(A?k:C).bottom;if(R&&(u=!0,!I))return;if(E&&(u=!1),E&&!I)return void(u=!0);if(I&&f(e.relatedTarget)&&S(d.floating.value,e.relatedTarget))return;if(g&&q(g.nodesRef.value,p.value).length)return;if("top"===T&&s>=k.bottom-1||"bottom"===T&&s<=k.top+1||"left"===T&&n>=k.right-1||"right"===T&&n<=k.left+1)return h();let _=[];switch(T){case"top":_=[[D,k.top+1],[D,C.bottom-1],[F,C.bottom-1],[F,k.top+1]];break;case"bottom":_=[[D,C.top+1],[D,k.bottom-1],[F,k.bottom-1],[F,C.top+1]];break;case"left":_=[[C.right-1,K],[C.right-1,V],[k.left+1,V],[k.left+1,K]];break;case"right":_=[[k.right-1,K],[k.right-1,V],[C.left+1,V],[C.left+1,K]]}if(!zt([y,b],_)){if(u&&!O)return h();if(!I&&l){const t=function(e,t){const n=performance.now(),l=n-i;if(null===a||null===r||0===l)return a=e,r=t,i=n,null;const o=e-a,u=t-r,v=Math.sqrt(o*o+u*u);return a=e,r=t,i=n,v/l}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}zt([y,b],function(e){let[n,l]=e;switch(T){case"top":return[[L?n+t/2:P?n+4*t:n-4*t,l+t+1],[L?n-t/2:P?n+4*t:n-4*t,l+t+1],...[[C.left,P||L?C.bottom-t:C.top],[C.right,P?L?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return[[L?n+t/2:P?n+4*t:n-4*t,l-t],[L?n-t/2:P?n+4*t:n-4*t,l-t],...[[C.left,P||L?C.top+t:C.bottom],[C.right,P?L?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,A?l+t/2:M?l+4*t:l-4*t],o=[n+t+1,A?l-t/2:M?l+4*t:l-4*t];return[...[[M||A?C.right-t:C.left,C.top],[M?A?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return[[n-t,A?l+t/2:M?l+4*t:l-4*t],[n-t,A?l-t/2:M?l+4*t:l-4*t],...[[M||A?C.left+t:C.right,C.top],[M?A?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,s]))?!u&&l&&(o=window.setTimeout(h,40)):h()}}};return s.__options={blockPointerEvents:n},s},e.stopEvent=G,e.useClick=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,dataRef:u,elements:{domReference:a}}=e,{enabled:r=!0,event:i="click",toggle:v=!0,ignoreMouse:s=!1,keyboardHandlers:c=!0,stickIfOpen:d=!0}=n,f=t.ref(void 0),p=t.ref(!1);return r?{reference:{onPointerDown(e){f.value=e.pointerType},onMouseDown(e){const t=f.value;0===e.button&&"click"!==i&&(z(t,!0)&&s||(!l.value||!v||u.value.openEvent&&d&&"mousedown"!==u.value.openEvent.type?(e.preventDefault(),o(!0,e,"click")):o(!1,e,"click")))},onClick(e){const t=f.value;"mousedown"===i&&f.value?f.value=void 0:z(t,!0)&&s||(!l.value||!v||u.value.openEvent&&d&&"click"!==u.value.openEvent.type?o(!0,e,"click"):o(!1,e,"click"))},onKeyDown(e){f.value=void 0,e.defaultPrevented||!c||kt(e)||(" "!==e.key||Ct(a.value)||(e.preventDefault(),p.value=!0),function(e){return m(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&(l.value&&v?o(!1,e,"click"):o(!0,e,"click")))},onKeyUp(e){e.defaultPrevented||!c||kt(e)||Ct(a.value)||" "===e.key&&p.value&&(p.value=!1,l.value&&v?o(!1,e,"click"):o(!0,e,"click"))}}}:{}},e.useClientPoint=function(e,n){void 0===n&&(n={});const{open:l,dataRef:o,elements:{floating:u,domReference:a},refs:r}=e,i=t.computed((()=>{var e;return null==(e=t.toValue(n.enabled))||e})),v=t.computed((()=>{var e;return null!=(e=t.toValue(n.axis))?e:"both"})),s=t.computed((()=>{var e;return null!=(e=t.toValue(n.x))?e:null})),d=t.computed((()=>{var e;return null!=(e=t.toValue(n.y))?e:null})),f=t.ref(!1),m=t.ref(null),p=t.ref(void 0),g=t.ref(0),h=Z(((e,t)=>{f.value||o.value.openEvent&&!Tt(o.value.openEvent)||r.setPositionReference(function(e,t){let n=null,l=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const a=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},r="x"===t.axis||"both"===t.axis,i="y"===t.axis||"both"===t.axis,v=["mouseenter","mousemove"].includes((null==(u=t.dataRef.value.openEvent)?void 0:u.type)||"")&&"touch"!==t.pointerType;let s=a.width,c=a.height,d=a.x,f=a.y;return null==n&&t.x&&r&&(n=a.x-t.x),null==l&&t.y&&i&&(l=a.y-t.y),d-=n||0,f-=l||0,s=0,c=0,!o||v?(s="y"===t.axis?a.width:0,c="x"===t.axis?a.height:0,d=r&&null!=t.x?t.x:d,f=i&&null!=t.y?t.y:f):o&&!v&&(c="x"===t.axis?a.height:c,s="y"===t.axis?a.width:s),o=!0,{width:s,height:c,x:d,y:f,top:f,right:d+s,bottom:f+c,left:d}}}}(a.value,{x:e,y:t,axis:v.value,dataRef:o,pointerType:p.value}))})),y=Z((e=>{null==s.value&&null==d.value&&(l.value?m.value||g.value++:h(e.clientX,e.clientY))})),b=t.computed((()=>z(p.value)?u.value:l.value));function w(e){p.value=e.pointerType}t.watch([l,u,p,g],(()=>{var e;null==m.value||m.value(),m.value=null,m.value=null!=(e=(()=>{if(!b.value||!i.value||null!=s.value||null!=d.value)return;const e=c(u.value);function t(n){const l=N(n);S(u.value,l)?(e.removeEventListener("mousemove",t),m.value=null):h(n.clientX,n.clientY)}if(!o.value.openEvent||Tt(o.value.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.value=null};return m.value=n,n}r.setPositionReference(a.value)})())?e:null}),{immediate:!0}),t.onUnmounted((()=>{null==m.value||m.value(),m.value=null})),t.watch([i,u],(()=>{i.value&&!u.value&&(f.value=!1)}),{immediate:!0}),t.watch([i,l],(()=>{!i.value&&l.value&&(f.value=!0)})),t.watch([i,s,d],(()=>{!i.value||null==s.value&&null==d.value||(f.value=!1,h(s.value,d.value))}),{immediate:!0});const x={onPointerDown:w,onPointerEnter:w,onMouseMove:y,onMouseEnter:y};return i.value?{reference:x}:{}},e.useDelayGroup=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,floatingId:u}=e,{id:a,enabled:r=!0}=n,i=t.computed((()=>null!=a?a:u.value)),v=Ge();return t.watch((()=>[r,i.value,v.value.currentId,v.value.initialDelay]),(()=>{const{currentId:e,initialDelay:t,setState:n}=v.value;r&&e&&(n({delay:{open:1,close:He(t,"close")}}),e!==i.value&&o(!1))})),t.watch((()=>[r,l.value,v.value.currentId,v.value.initialDelay,v.value.timeoutMs]),(()=>{function e(){o(!1),v.value.setState({delay:v.value.initialDelay,currentId:null})}const{currentId:n,timeoutMs:u,setState:a,initialDelay:s}=v.value;if(r&&n&&!l.value&&n===i.value){if(u){const n=window.setTimeout(e,u);return void t.onWatcherCleanup((()=>{clearTimeout(n)}))}e()}})),t.watch((()=>[r,l.value,i.value]),(()=>{r&&v.value.setCurrentId!==je&&l.value&&v.value.setCurrentId(i.value)})),v},e.useDelayGroupContext=Ge,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:u,elements:a,dataRef:r}=e,{enabled:i=!0,escapeKey:v=!0,outsidePress:s=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:w=!1,bubbles:x,capture:I}=n,R=Fe(),E=Z("function"==typeof s?s:()=>!1),k="function"==typeof s?E:s,C=t.ref(!1),{escapeKey:T,outsidePress:P}=Mt(x),{escapeKey:M,outsidePress:O}=Mt(I),L=t.ref(!1),A=Z((e=>{var t;if(!l.value||!i||!v||"Escape"!==e.key)return;if(L.value)return;Lt!==e&&(Ot.clear(),Lt=e);const n=null==(t=r.value.floatingContext)?void 0:t.nodeId.value,o=R?q(R.nodesRef.value,n,!1):[];if(o.length>0){let e=!0;if(o.forEach((t=>{var n;(null!=(n=t.context)&&n.open.value||Ot.has(t.id))&&(e=!1)})),!e)return}T||e.stopPropagation(),Ot.add(n),u(!1,e,"escape-key")})),D=Z((e=>{var t;const n=()=>{var t;A(e),null==(t=N(e))||t.removeEventListener("keydown",n)};null==(t=N(e))||t.addEventListener("keydown",n)})),_=Z((e=>{var t;const n=C.value;if(C.value=!1,"click"===c&&n)return;if("function"==typeof k&&!k(e))return;const l=N(e),o="["+_e("inert")+"]",i=K(a.floating.value).querySelectorAll(o);let v=f(l)?l:null;for(;v&&!h(v);){const e=b(v);if(h(e)||!f(e))break;v=e}if(i.length&&f(l)&&!V(l)&&!S(l,a.floating.value)&&Array.from(i).every((e=>!S(v,e))))return;if(m(l)&&a.floating.value){const t=h(l),n=y(l),o=/auto|scroll/,u=t||o.test(n.overflowX),a=t||o.test(n.overflowY),r=u&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,i=a&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,v="rtl"===n.direction,s=i&&(v?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),c=r&&e.offsetY>l.clientHeight;if(s||c)return}const s=null==(t=r.value.floatingContext)?void 0:t.nodeId.value,d=R&&q(R.nodesRef.value,s).some((t=>{var n;return F(e,null==(n=t.context)?void 0:n.elements.floating.value)}));if(F(e,a.floating.value)||F(e,a.domReference.value)||d)return;const p=R?q(R.nodesRef.value,s):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open.value||t.context.dataRef.value.__outsidePressBubbles||(e=!1)})),!e)return}u(!1,e,"outside-press")})),U=Z((e=>{var t;const n=()=>{var t;_(e),null==(t=N(e))||t.removeEventListener(c,n)};null==(t=N(e))||t.addEventListener(c,n)}));let W;t.watch([l,a.floating,a.domReference],(()=>{if(null==W||W(),W=void 0,!l.value||!i)return;r.value.__escapeKeyBubbles=T,r.value.__outsidePressBubbles=P;let e=-1;function t(e){u(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),L.value=!0}function s(){e=window.setTimeout((()=>{L.value=!1}),(null==g&&(g="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),g?5:0))}const d=K(a.floating.value);v&&(d.addEventListener("keydown",M?D:A,M),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",s)),k&&d.addEventListener(c,O?U:_,O);let m=[];w&&(f(a.domReference.value)&&(m=o.getOverflowAncestors(a.domReference.value)),f(a.floating.value)&&(m=m.concat(o.getOverflowAncestors(a.floating.value))),!f(a.reference.value)&&a.reference.value&&a.reference.value.contextElement&&(m=m.concat(o.getOverflowAncestors(a.reference.value.contextElement)))),m=m.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),m.forEach((e=>{e.addEventListener("scroll",t)})),W=()=>{v&&(d.removeEventListener("keydown",M?D:A,M),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",s)),k&&d.removeEventListener(c,O?U:_,O),m.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),{immediate:!0}),t.onUnmounted((()=>{null==W||W()}));const H={onKeyDown:A,...d&&{[Pt[p]]:e=>{u(!1,e,"reference-press")},..."click"!==p&&{onClick(e){u(!1,e,"reference-press")}}}};function j(e){0===e.button&&(C.value=!0)}return i?{reference:H,floating:{onKeyDown:A,onMouseDown:j,onMouseUp:j}}:{}},e.useEffectEvent=Z,e.useFloating=function(e){var n,l;let{elements:o,...u}=void 0===e?{}:e;const{nodeId:a}=u,r=Ft({...u,elements:{reference:null!=(n=null==o?void 0:o.reference)?n:null,floating:null!=(l=null==o?void 0:o.floating)?l:null}}),i=u.rootContext||r,v=i.elements,s=t.ref(null),c=t.ref(null),d=null==v?void 0:v.domReference,m=t.computed((()=>d.value||s.value)),p=t.ref(null),g=Fe();t.watch(m,(()=>{m.value&&(p.value=m.value)}),{immediate:!0});const h=Nt({...u,elements:{...v,...c&&{reference:c}}}),y={...h.refs,setReference:e=>{(f(e)||null===e)&&(p.value=e,s.value=e),(f(h.refs.reference.value)||null===h.refs.reference.value||null!==e&&!f(e))&&h.refs.setReference(e)},setPositionReference:e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c.value=t,h.refs.setReference(t)},domReference:p},b={...h.elements,domReference:m},w={...h,...i,refs:y,elements:b,nodeId:t.computed((()=>t.toValue(a)))};return t.watchEffect((()=>{i.dataRef.value.floatingContext=w;const e=null==g?void 0:g.nodesRef.value.find((e=>e.id===t.toValue(a)));e&&(e.context=w)})),{...h,context:w,refs:y,elements:b}},e.useFloatingNodeId=function(e){const n=Oe(),l=Fe(),o=De.use(),u=t.computed((()=>{var t;return e||(null==(t=o.value)?void 0:t.id)||null}));let a=!1,r=null;return t.watch(n,(()=>{n.value&&!a&&(r={id:n.value,parentId:u.value},null==l||l.addNode(r),a=!0)}),{immediate:!0}),t.onUnmounted((()=>{r&&(null==l||l.removeNode(r))})),n},e.useFloatingParentNodeId=Ne,e.useFloatingPortalNode=ct,e.useFloatingRootContext=Ft,e.useFloatingTree=Fe,e.useFocus=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,events:u,dataRef:a,elements:r}=e,{enabled:i=!0,visibleOnly:v=!0}=n,s=t.ref(!1),d=t.ref(-1),p=t.ref(!0);let g;if(t.watch([r.domReference,l],(()=>{if(null==g||g(),g=void 0,!i)return;const e=c(r.domReference.value);function t(){!l.value&&m(r.domReference.value)&&r.domReference.value===D(K(r.domReference.value))&&(s.value=!0)}function n(){p.value=!0}function o(){p.value=!1}e.addEventListener("blur",t),Vt()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",o,!0)),g=()=>{e.removeEventListener("blur",t),Vt()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",o,!0))}}),{immediate:!0}),i){const e=e=>{let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(s.value=!0)};u.on("openchange",e),t.onUnmounted((()=>{u.off("openchange",e)}))}return t.onUnmounted((()=>{null==g||g(),Ue(d)})),i?{reference:{onMouseLeave(){s.value=!1},onFocus(e){if(s.value)return;const t=N(e);if(v&&f(t))if(Vt()&&!e.relatedTarget){if(!p.value&&!_(t))return}else if(!W(t))return;o(!0,e,"focus")},onBlur(e){s.value=!1;const t=e.relatedTarget,n=e,l=f(t)&&t.hasAttribute(_e("focus-guard"))&&"outside"===t.getAttribute("data-type");d.value=window.setTimeout((()=>{var e;const u=D(r.domReference.value?r.domReference.value.ownerDocument:document);(t||u!==r.domReference.value)&&(S(null==(e=a.value.floatingContext)?void 0:e.refs.floating.value,u)||S(r.domReference.value,u)||l||o(!1,n,"focus"))}))}}}:{}},e.useHover=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,dataRef:u,events:a,elements:r}=e,{enabled:i=!0,delay:v=0,handleClose:s=null,mouseOnly:c=!1,restMs:d=0,move:m=!0}=n,p=Fe(),g=Ne(),h=$(s),y=$(v),b=$(d),w=t.ref(void 0),x=t.ref(-1),I=t.ref(void 0),R=t.ref(-1),E=t.ref(!1),k=t.ref(!1),C=t.ref((()=>{})),T=t.ref(!1),P=Z((()=>{var e;const t=null==(e=u.value.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}));if(i){function _(e){let{open:t}=e;t||(Ue(x),Ue(R),E.value=!0,T.value=!1)}a.on("openchange",_),t.onUnmounted((()=>{a.off("openchange",_)}))}let M;t.watch([l,r.floating],(()=>{if(null==M||M(),M=void 0,!i)return;if(!h.value)return;if(!l.value)return;function e(e){P()&&o(!1,e,"hover")}const t=K(r.floating.value).documentElement;t.addEventListener("mouseleave",e),M=()=>{t.removeEventListener("mouseleave",e)}}),{immediate:!0});const O=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const l=He(y.value,"close",w.value);l&&!I.value?(Ue(x),x.value=window.setTimeout((()=>o(!1,e,n)),l)):t&&(Ue(x),o(!1,e,n))},L=Z((()=>{C.value(),I.value=void 0})),A=Z((()=>{if(k.value){const e=K(r.floating.value).body;e.style.pointerEvents="",e.removeAttribute(We),k.value=!1}})),D=Z((()=>!!u.value.openEvent&&["click","mousedown"].includes(u.value.openEvent.type)));let N,F;function V(e){w.value=e.pointerType}return t.watch([l,r.domReference,r.floating],(()=>{if(null==N||N(),N=void 0,i&&f(r.domReference.value)){const o=r.domReference.value,u=r.floating.value;l.value&&o.addEventListener("mouseleave",n),m&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),u&&(u.addEventListener("mouseleave",n),u.addEventListener("mouseenter",a),u.addEventListener("mouseleave",v)),N=()=>{l.value&&o.removeEventListener("mouseleave",n),m&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),u&&(u.removeEventListener("mouseleave",n),u.removeEventListener("mouseenter",a),u.removeEventListener("mouseleave",v))}}function e(e){if(Ue(x),E.value=!1,c&&!z(w.value)||qe(b.value)>0&&!He(y.value,"open"))return;const t=He(y.value,"open",w.value);t?x.value=window.setTimeout((()=>{l.value||o(!0,e,"hover")}),t):l.value||o(!0,e,"hover")}function t(e){if(D())return void A();C.value();const t=K(r.floating.value);if(Ue(R),T.value=!1,h.value&&u.value.floatingContext){l.value||Ue(x),I.value=h.value({...u.value.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),L(),D()||O(e,!0,"safe-polygon")}});const n=I.value;return t.addEventListener("mousemove",n),void(C.value=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.value||!S(r.floating.value,e.relatedTarget))&&O(e)}function n(e){D()||u.value.floatingContext&&(null==h.value||h.value({...u.value.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),L(),D()||O(e)}})(e))}function a(){Ue(x)}function v(e){D()||O(e,!1)}}),{immediate:!0}),t.watch([l,r.domReference,r.floating],(()=>{var e;if(null==F||F(),F=void 0,i&&l.value&&null!=(e=h.value)&&null!=(e=e.__options)&&e.blockPointerEvents&&P()){k.value=!0;const e=r.floating.value;if(f(r.domReference.value)&&e){var t;const n=K(r.floating.value).body;n.setAttribute(We,"");const l=r.domReference.value,o=null==p||null==(t=p.nodesRef.value.find((e=>e.id===g)))||null==(t=t.context)?void 0:t.elements.floating;null!=o&&o.value&&(o.value.style.pointerEvents=""),n.style.pointerEvents="none",l.style.pointerEvents="auto",e.style.pointerEvents="auto",F=()=>{n.style.pointerEvents="",l.style.pointerEvents="",e.style.pointerEvents=""}}}}),{immediate:!0}),t.watch(l,(()=>{l.value||(w.value=void 0,T.value=!1,L(),A())})),t.onUnmounted((()=>{null==M||M(),null==N||N(),null==F||F(),L(),Ue(x),Ue(R),A()})),i?{reference:{onPointerDown:V,onPointerEnter:V,onMouseMove(e){function t(){E.value||l.value||o(!0,e,"hover")}c&&!z(w.value)||l.value||0===qe(b.value)||T.value&&e.movementX**2+e.movementY**2<2||(Ue(R),"touch"===w.value?t():(T.value=!0,R.value=window.setTimeout(t,qe(b.value))))}}}:{}},e.useId=Oe,e.useInnerOffset=function(e,n){const{open:l,elements:o}=e,{enabled:u=!0,overflowRef:a,scrollRef:r,onChange:i}=n,v=i,s=t.ref(!1),c=t.ref(null),d=t.ref(null);let f;return t.watch([l,o.floating],(()=>{if(null==f||f(),f=void 0,!u)return;const e=(null==r?void 0:r.value)||o.floating.value;function t(t){if(t.ctrlKey||!e||null==a.value)return;const n=t.deltaY,l=a.value.top>=-.5,o=a.value.bottom>=-.5,u=e.scrollHeight-e.clientHeight,r=n<0?-1:1,i=n<0?"max":"min";e.scrollHeight<=e.clientHeight||(!l&&n>0||!o&&n<0?(t.preventDefault(),v((e=>e+Math[i](n,u*r)))):/firefox/i.test(x())&&(e.scrollTop+=n))}l.value&&e&&(e.addEventListener("wheel",t),requestAnimationFrame((()=>{c.value=e.scrollTop,null!=a.value&&(d.value={...a.value})})),f=()=>{c.value=null,d.value=null,e.removeEventListener("wheel",t)})})),u?{floating:{onKeyDown(){s.value=!0},onWheel(){s.value=!1},onPointerMove(){s.value=!1},onScroll(){const e=(null==r?void 0:r.value)||o.floating.value;if(a.value&&e&&s.value){if(null!==c.value){const t=e.scrollTop-c.value;(a.value.bottom<-.5&&t<-1||a.value.top<-.5&&t>1)&&v((e=>e+t))}requestAnimationFrame((()=>{c.value=e.scrollTop}))}}}}:{}},e.useInteractions=function(e){return void 0===e&&(e=[]),{getReferenceProps:t=>Kt(t,e,"reference"),getFloatingProps:t=>Kt(t,e,"floating"),getItemProps:t=>Kt(t,e,"item")}},e.useLatestRef=$,e.useListItem=xe,e.useListNavigation=function(e,n){var l;const{open:o,onOpenChange:u,elements:a,floatingId:r}=e,{listRef:i,activeIndex:v,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loop:p=!1,nested:g=!1,rtl:h=!1,virtual:y=!1,focusItemOnOpen:b="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:x=!0,disabledIndices:I,orientation:R="vertical",parentOrientation:E,cols:k=1,grid:C=null,scrollItemIntoView:T=!0,virtualItemRef:P,itemSizes:L,dense:N=!1}=n,F=t.computed((()=>H(a.floating.value))),V=Ne(),_=Fe();e.dataRef.value.orientation=R;const W=Z((()=>{s(-1===z.value?null:z.value)})),q=t.computed((()=>U(a.domReference.value))),B=t.ref(b),z=t.ref(null!=(l=t.toValue(d))?l:-1),J=t.ref(null),ie=t.ref(!0),ve=t.ref(W),se=t.ref(!!a.floating.value),ce=t.ref(o.value),de=t.ref(!1),fe=t.ref(!1),me=$(I),pe=$(T),ge=t.computed((()=>t.toValue(d))),he=t.ref(void 0),ye=t.ref(void 0),be=Z((()=>{function e(e){var t;y?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=r.value+"-"+Math.random().toString(16).slice(2,10)),he.value=e.id,null==_||_.events.emit("virtualfocus",e),P&&(P.value=e)):Ze(e,{sync:de.value,preventScroll:!0})}const t=i.value[z.value],n=fe.value;t&&e(t);(de.value?e=>e():requestAnimationFrame)((()=>{const l=i.value[z.value]||t;if(!l)return;t||e(l);const o=pe.value;o&&xe&&(n||!ie.value)&&(null==l.scrollIntoView||l.scrollIntoView("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))}))}));if(t.watch((()=>[o.value,a.floating.value,t.toValue(d)]),(()=>{c&&(o.value&&a.floating.value?B.value&&null!=t.toValue(d)&&(fe.value=!0,z.value=t.toValue(d),W()):se.value&&(z.value=-1,ve.value()))})),t.watch((()=>[o.value,a.floating.value,t.toValue(v)]),(()=>{if(!c)return;if(!o.value)return;if(!a.floating.value)return;const e=t.toValue(v);if(null==e){if(de.value=!1,null!=ge.value)return;if(se.value&&(z.value=-1,be()),(!ce.value||!se.value)&&B.value&&(null!=J.value||!0===B.value&&null==J.value)){let e=0;const n=()=>{if(null==i.value[0]){if(e++,e<=3){(1===e?queueMicrotask:2===e?t.nextTick:requestAnimationFrame)(n)}}else z.value=null==J.value||Wt(J.value,R,h)||g?ee(i):te(i),J.value=null,W()};n()}}else if(Q(i,e)){if(null!=e){z.value=e;let t=0;const n=()=>{Q(i,z.value)?t<2&&(t++,queueMicrotask(n)):(be(),fe.value=!1)};queueMicrotask(n)}}else z.value=e,be(),fe.value=!1})),t.watch([a.floating,o],(()=>{var e;if(!c||a.floating.value||!_||y||!se.value)return;const t=_.nodesRef.value,n=null==(e=t.find((e=>e.id===V)))||null==(e=e.context)?void 0:e.elements.floating,l=D(K(a.floating.value)),o=t.some((e=>e.context&&S(e.context.elements.floating.value,l)));null!=n&&n.value&&!o&&ie.value&&n.value.focus({preventScroll:!0})})),c&&_&&y&&!V){function Pe(e){ye.value=e.id,P&&(P.value=e)}_.events.on("virtualfocus",Pe),t.onUnmounted((()=>{_.events.off("virtualfocus",Pe)}))}t.watch([o,a.floating],(()=>{ve.value=W,ce.value=o.value,se.value=!!a.floating.value}),{immediate:!0,flush:"post"}),t.watch(o,(()=>{o.value||(J.value=null,B.value=b)}));const we=t.computed((()=>null!=t.toValue(v))),xe={onFocus(e){de.value=!0,Ie(e.currentTarget)},onClick(e){var t;null==(t=e.currentTarget)||t.focus({preventScroll:!0})},onMouseMove(e){de.value=!0,fe.value=!1,w&&Ie(e.currentTarget)},onPointerLeave(e){var t;ie.value&&"touch"!==e.pointerType&&(de.value=!0,w&&(z.value=-1,W(),y||null==(t=F.value)||t.focus({preventScroll:!0})))}};function Ie(e){if(!o.value)return;const n=i.value.indexOf(e);-1===n||z.value===n&&t.toValue(v)===n||(z.value=n,W())}const Re=()=>{var e;return null!=E?E:null==_||null==(e=_.nodesRef.value.find((e=>e.id===V)))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.value.orientation},Ee=Z((e=>{if(ie.value=!1,de.value=!0,229===e.which)return;if(!(o.value||e.currentTarget!==F.value||"Escape"===e.key&&g))return;if(g&&qt(e.key,R,h,k)){if(Ut(e.key,Re())||G(e),u(!1,e,"list-navigation"),m(a.domReference.value))if(y)null==_||_.events.emit("virtualfocus",a.domReference.value);else if(a.domReference.value.focus(),Ut(e.key,Re())){const t=new KeyboardEvent(e.type,{key:e.key,code:e.code,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!0,cancelable:!0});a.domReference.value.dispatchEvent(t)}return}const n=z.value,l=ee(i,I),r=te(i,I);if(q.value||("Home"===e.key&&(G(e),z.value=l,W()),"End"===e.key&&(G(e),z.value=r,W())),C){const t=C(e,z.value,i,R,p,h,I,l,r);if(null!=t&&(z.value=t,W()),"both"===R)return}else if(k>1){const n=L||Array.from({length:i.value.length},(()=>({width:1,height:1}))),o=oe(n,k,N),u=o.findIndex((e=>null!=e&&!re(i,e,I))),a=o.reduce(((e,t,n)=>null==t||re(i,t,I)?e:n),-1),v=o[le(t.ref(o.map((e=>null!=e?i.value[e]:null))),{event:e,orientation:R,loop:p,rtl:h,cols:k,disabledIndices:ae([...("function"!=typeof I?I:null)||i.value.map(((e,t)=>re(i,t,I)?t:void 0)),void 0],o),minIndex:u,maxIndex:a,prevIndex:ue(z.value>r?l:z.value,n,o,k,e.key===A?"bl":e.key===(h?M:O)?"tr":"tl"),stopEvent:!0})];if(null!=v&&(z.value=v,W()),"both"===R)return}if(Ut(e.key,R)){var v,s;if(G(e),o.value&&!y&&D(null!=(v=null==(s=e.currentTarget)?void 0:s.ownerDocument)?v:document)===e.currentTarget)return z.value=Wt(e.key,R,h)?l:r,void W();Wt(e.key,R,h)?z.value=p?n>=r?f&&n!==i.value.length?-1:l:ne(i,{startingIndex:n,disabledIndices:I}):Math.min(r,ne(i,{startingIndex:n,disabledIndices:I})):z.value=p?n<=l?f&&-1!==n?i.value.length:r:ne(i,{startingIndex:n,decrement:!0,disabledIndices:I}):Math.max(l,ne(i,{startingIndex:n,decrement:!0,disabledIndices:I})),Q(i,z.value)&&(z.value=-1),W()}})),ke=t.computed((()=>y&&o.value&&we.value&&{"aria-activedescendant":ye.value||he.value})),Ce=t.computed((()=>({"aria-orientation":"both"===R?void 0:R,...q.value?{}:ke.value,onKeyDown:Ee,onPointerMove(){ie.value=!0}}))),Te=t.computed((()=>{function e(e){"auto"===b&&X(e)&&(B.value=!0)}function n(e){B.value=b,"auto"===b&&Y(e)&&(B.value=!0)}return{...ke.value,onKeyDown(e){ie.value=!1;const n=e.key.startsWith("Arrow"),l=["Home","End"].includes(e.key),a=n||l,r=Ht(e.key,R,h),v=qt(e.key,R,h,k),s=Ht(e.key,Re(),h),c=Ut(e.key,R),f=(g?s:c)||"Enter"===e.key||""===e.key.trim();if(y&&o.value){const t=null==_?void 0:_.nodesRef.value.find((e=>null==e.parentId)),n=_&&t?j(_.nodesRef.value,t.id):null;if(a&&n&&P){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(r||v){var m,p;const l=(null==(m=n.context)?void 0:m.elements.domReference.value)===e.currentTarget,o=v&&!l?null==(p=n.context)?void 0:p.elements.domReference.value:r?i.value.find((e=>(null==e?void 0:e.id)===he.value)):null;o&&(G(e),o.dispatchEvent(t),ye.value=void 0)}var b;if((c||l)&&n.context)if(n.context.open.value&&n.parentId&&e.currentTarget!==n.context.elements.domReference.value)return G(e),void(null==(b=n.context.elements.domReference.value)||b.dispatchEvent(t))}return Ee(e)}if(o.value||x||!n){if(f){const t=Ut(e.key,Re());J.value=g&&t?null:e.key}if(g)s&&(G(e),o.value?(z.value=ee(i,me.value),W()):u(!0,e,"list-navigation"));else if(c){null!=t.toValue(d)&&(z.value=t.toValue(d)),G(e);const n=o.value;!o.value&&x?u(!0,e,"list-navigation"):Ee(e),n&&W()}}},onFocus(){o.value&&!y&&(z.value=-1,W())},onPointerDown:n,onPointerEnter:n,onMouseDown:e,onClick:e}}));return c?{reference:Te,floating:Ce,item:xe}:{}},e.useMergeRefs=he,e.useNextDelayGroup=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,floatingId:u}=e,{enabled:a=!0}=n,r=Ye.use(),{currentIdRef:i,delayRef:v,timeoutMs:s,initialDelayRef:c,currentContextRef:d,hasProvider:f,timeoutIdRef:m}=r.value,p=t.ref(!1);function g(e){p.value=e}return t.watch((()=>[a,l.value,i.value,s]),(()=>{function e(){var e;p.value=!1,null==(e=d.value)||e.setIsInstantPhase(!1),i.value=null,d.value=null,v.value=c.value}if(a&&i.value&&!l.value&&i.value===u.value){if(p.value=!1,s)return m.value=window.setTimeout(e,s),void t.onWatcherCleanup((()=>{clearTimeout(m.value)}));e()}})),t.watch((()=>[a,l.value,u.value]),(()=>{if(!a)return;if(!l.value)return;const e=d.value,t=i.value;d.value={onOpenChange:o,setIsInstantPhase:g},i.value=u.value,v.value={open:0,close:He(c.value,"close")},null!==t&&t!==u.value?(Ue(m),p.value=!0,null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(p.value=!1,null==e||e.setIsInstantPhase(!1))})),t.onUnmounted((()=>{d.value=null})),{hasProvider:f,delayRef:v,isInstantPhase:p}},e.useRole=function(e,n){var l;void 0===n&&(n={});const{open:o,elements:u,floatingId:a}=e,{enabled:r=!0,role:i="dialog"}=n,v=Oe(),s=t.computed((()=>{var e;return(null==(e=u.domReference.value)?void 0:e.id)||v.value})),c=t.computed((()=>{var e;return(null==(e=H(u.floating.value))?void 0:e.id)||a.value})),d=null!=(l=jt.get(i))?l:i,f=null!=Ne(),m=t.computed((()=>"tooltip"===d||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:o.value?c.value:void 0}:{"aria-expanded":o.value?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":o.value?c.value:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:s.value},..."menu"===d&&f&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}})),p=t.computed((()=>{const e={id:c.value,...d&&{role:d}};return"tooltip"===d||"label"===i?e:{...e,..."menu"===d&&{"aria-labelledby":s.value}}}));return r?{reference:m,floating:p,item:e=>{let{active:t,selected:n}=e;const l={role:"option",...t&&{id:c.value+"-fui-option"}};switch(i){case"select":case"combobox":return{...l,"aria-selected":n}}return{}}}:{}},e.useTransitionStatus=Xt,e.useTransitionStyles=function(e,n){void 0===n&&(n={});const{initial:l={opacity:0},open:o,close:u,common:a,duration:r=250}=n,i="number"==typeof r,v=(i?r:r.open)||0,s=(i?r:r.close)||0,c=e.placement.value,d={side:c.split("-")[0],placement:c},f=t.ref({...Gt(a,d),...Gt(l,d)}),{isMounted:m,status:p}=Xt(e,{duration:r}),g=$(l),h=$(o),y=$(u),b=$(a);return t.watch([p,c],(()=>{const t=e.placement.value,n={side:t.split("-")[0],placement:t},l=Gt(g.value,n),o=Gt(y.value,n),u=Gt(b.value,n),a=Gt(h.value,n)||Object.keys(l).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===p.value&&(f.value={transitionProperty:f.value.transitionProperty,...u,...l}),"open"===p.value&&(f.value={transitionProperty:Object.keys(a).map(Bt).join(","),transitionDuration:v+"ms",...u,...a}),"close"===p.value){const e=o||l;f.value={transitionProperty:Object.keys(e).map(Bt).join(","),transitionDuration:s+"ms",...u,...e}}}),{immediate:!0}),{isMounted:m,styles:f}},e.useTypeahead=function(e,n){var l,o;const{open:u,dataRef:a}=e,{listRef:r,activeIndex:i,onMatch:v,onTypingChange:s,enabled:c=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:m=[],selectedIndex:p=null}=n,g=t.ref(-1),h=t.ref(""),y=t.ref(null!=(l=null!=(o=t.toValue(p))?o:t.toValue(i))?l:-1),b=t.ref(null),w=Z(v),x=Z(s),I=$(d),R=$(m);t.watch(u,(()=>{u.value&&(Ue(g),b.value=null,h.value="")})),t.watch((()=>[u.value,t.toValue(p),t.toValue(i)]),(()=>{var e,n;u.value&&""===h.value&&(y.value=null!=(e=null!=(n=t.toValue(p))?n:t.toValue(i))?e:-1)}));const E=Z((e=>{e?a.value.typing||(a.value.typing=e,x(e)):a.value.typing&&(a.value.typing=e,x(e))})),k=Z((e=>{function t(e,t,n){const l=I.value?I.value(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return l?e.indexOf(l):-1}const n=r.value;if(h.value.length>0&&" "!==h.value[0]&&(-1===t(n,n,h.value)?E(!1):" "===e.key&&G(e)),null==n||R.value.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;u.value&&" "!==e.key&&(G(e),E(!0));n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.value===e.key&&(h.value="",y.value=b.value),h.value+=e.key,Ue(g),g.value=window.setTimeout((()=>{h.value="",y.value=b.value,E(!1)}),f);const l=y.value,o=t(n,[...n.slice((l||0)+1),...n.slice(0,(l||0)+1)],h.value);-1!==o?(w(o),b.value=o):" "!==e.key&&(h.value="",E(!1))}));return t.onUnmounted((()=>{Ue(g)})),c?{reference:{onKeyDown:k},floating:{onKeyDown:k,onKeyUp(e){" "===e.key&&E(!1)}}}:{}}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@actview/core"),require("@floating-ui/utils"),require("tabbable"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["exports","@actview/core","@floating-ui/utils","tabbable","@floating-ui/dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIActview={},e.ActviewCore,e.FloatingUIUtils,e.tabbable,e.FloatingUIDOM)}(this,(function(e,t,n,l,o){"use strict";var u=Symbol.for("react.element");function a(e){return!(!e||!0!==e.__v_isRef)}var r=function(e,t,n){let l,o,r=null;if(void 0!==n?r=""+n:t&&void 0!==t.key&&(r=""+t.key),t&&"key"in t){l={};for(const e in t)"key"!==e&&(l[e]=t[e])}else l=t||{};l&&void 0!==l["v-memo"]&&(o=l["v-memo"],delete l["v-memo"]);const i=function(e,t,n){return{$$typeof:u,type:e,key:t,ref:null,props:n}}(e,r,function(e){if(!e)return e;let t=null;for(const n in e){if("ref"===n)continue;const l=e[n];a(l)&&!l.__av_raw&&(t||(t={...e}),t[n]=l.value)}return t??e}(l));return void 0!==o&&(i.__memoDeps=()=>o,i.__memoValue=o),i},i=Symbol.for("react.fragment");function v(){return"undefined"!=typeof window}function s(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function c(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){return!!v()&&(e instanceof Node||e instanceof c(e).Node)}function f(e){return!!v()&&(e instanceof Element||e instanceof c(e).Element)}function m(e){return!!v()&&(e instanceof HTMLElement||e instanceof c(e).HTMLElement)}function p(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof c(e).ShadowRoot)}let g;function h(e){return/^(html|body|#document)$/.test(s(e))}function y(e){return c(e).getComputedStyle(e)}function b(e){if("html"===s(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||function(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return p(t)?t.host:t}function w(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function x(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(){return/apple/i.test(navigator.vendor)}function R(){const e=/android/i;return e.test(w())||e.test(x())}function E(){return w().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function k(){return x().includes("jsdom/")}const C="data-floating-ui-focusable",T="active",P="selected",M="ArrowLeft",O="ArrowRight",L="ArrowUp",A="ArrowDown";function D(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function S(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(t instanceof Node&&e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function N(e){return"composedPath"in e?e.composedPath()[0]:e.target}function F(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function V(e){return e.matches("html,body")}function K(e){return(null==e?void 0:e.ownerDocument)||document}function _(e){return m(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function U(e){return!!e&&("combobox"===e.getAttribute("role")&&_(e))}function W(e){if(!e||k())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}function H(e){return e?e.hasAttribute(C)?e:e.querySelector("["+C+"]")||e:null}function q(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var l;return e.parentId===t&&(!n||(null==(l=e.context)?void 0:l.open.value))})).flatMap((t=>[t,...q(e,t.id,n)]))}function j(e,t){let n,l=-1;return function t(o,u){u>l&&(n=o,l=u),q(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}function B(e,t){var n;let l=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(l=l.concat(t))}return l}function G(e){e.preventDefault(),e.stopPropagation()}function X(e){return!(0!==e.mozInputSource||!e.isTrusted)||(R()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Y(e){return!k()&&(!R()&&0===e.width&&0===e.height||R()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function z(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function $(e){return t.ref(e)}function Z(e){const n=t.ref(e);return function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return null==n.value?void 0:n.value(...t)}}function J(e,t,n){return Math.floor(e/t)!==n}function Q(e,t){return t<0||t>=e.value.length}function ee(e,t){return ne(e,{disabledIndices:t})}function te(e,t){return ne(e,{decrement:!0,startingIndex:e.value.length,disabledIndices:t})}function ne(e,t){let{startingIndex:n=-1,decrement:l=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t,a=n;do{a+=l?-u:u}while(a>=0&&a<=e.value.length-1&&re(e,a,o));return a}function le(e,t){let{event:l,orientation:o,loop:u,rtl:a,cols:r,disabledIndices:i,minIndex:v,maxIndex:s,prevIndex:c,stopEvent:d=!1}=t,f=c;if(l.key===L){if(d&&G(l),-1===c)f=s;else if(f=ne(e,{startingIndex:f,amount:r,decrement:!0,disabledIndices:i}),u&&(c-r<v||f<0)){const e=c%r,t=s%r,n=s-(t-e);f=t===e?s:t>e?n:n-r}Q(e,f)&&(f=c)}if(l.key===A&&(d&&G(l),-1===c?f=v:(f=ne(e,{startingIndex:c,amount:r,disabledIndices:i}),u&&c+r>s&&(f=ne(e,{startingIndex:c%r-r,amount:r,disabledIndices:i}))),Q(e,f)&&(f=c)),"both"===o){const t=n.floor(c/r);l.key===(a?M:O)&&(d&&G(l),c%r!=r-1?(f=ne(e,{startingIndex:c,disabledIndices:i}),u&&J(f,r,t)&&(f=ne(e,{startingIndex:c-c%r-1,disabledIndices:i}))):u&&(f=ne(e,{startingIndex:c-c%r-1,disabledIndices:i})),J(f,r,t)&&(f=c)),l.key===(a?O:M)&&(d&&G(l),c%r!=0?(f=ne(e,{startingIndex:c,decrement:!0,disabledIndices:i}),u&&J(f,r,t)&&(f=ne(e,{startingIndex:c+(r-c%r),decrement:!0,disabledIndices:i}))):u&&(f=ne(e,{startingIndex:c+(r-c%r),decrement:!0,disabledIndices:i})),J(f,r,t)&&(f=c));const o=n.floor(s/r)===t;Q(e,f)&&(f=u&&o?l.key===(a?O:M)?s:ne(e,{startingIndex:c-c%r-1,disabledIndices:i}):c)}return f}function oe(e,t,n){const l=[];let o=0;return e.forEach(((e,u)=>{let{width:a,height:r}=e,i=!1;for(n&&(o=0);!i;){const e=[];for(let n=0;n<a;n++)for(let l=0;l<r;l++)e.push(o+n+l*t);o%t+a<=t&&e.every((e=>null==l[e]))?(e.forEach((e=>{l[e]=u})),i=!0):o++}})),[...l]}function ue(e,t,n,l,o){if(-1===e)return-1;const u=n.indexOf(e),a=t[e];switch(o){case"tl":return u;case"tr":return a?u+a.width-1:u;case"bl":return a?u+(a.height-1)*l:u;case"br":return n.lastIndexOf(e)}}function ae(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function re(e,t,n){var l;if("function"==typeof n?n(t):null!=(l=null==n?void 0:n.includes(t))&&l)return!0;const o=e.value[t];return!!o&&(!ve(o)||(!!o.matches(":disabled")||!n&&(o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled"))))}function ie(e){return"hidden"===e.visibility||"collapse"===e.visibility}function ve(e,t){return void 0===t&&(t=e?getComputedStyle(e):null),!(!(e&&e.isConnected&&t)||ie(t))&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}const se=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ce(e,t){const n=l.tabbable(e,se()),o=n.length;if(0===o)return;const u=D(K(e)),a=n.indexOf(u);return n[-1===a?1===t?0:o-1:a+t]}function de(e){return ce(K(e).body,1)||e}function fe(e){return ce(K(e).body,-1)||e}function me(e,t){const n=t||e.currentTarget,l=e.relatedTarget;return!l||!S(n,l)}function pe(e){l.tabbable(e,se()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ge(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}function he(e){if(e.every((e=>null==e)))return null;const t=[];return n=>{e.forEach(((e,l)=>{if(null!=e)if("function"==typeof e){var o;if(null===n&&t[l])return t[l](),void(t[l]=void 0);null==(o=t[l])||o.call(t);const u=e(n);t[l]="function"==typeof u?u:void 0}else e.value=n}))}}function ye(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const be=t.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:t.ref([])}),we=t.defineComponent((function(e){const n=t.ref(new Set),l=t.isRef(e.elementsRef)?e.elementsRef:t.ref(e.elementsRef),o=e.labelsRef?t.isRef(e.labelsRef)?e.labelsRef:t.ref(e.labelsRef):void 0,u=t.computed((()=>{const e=new Map;return Array.from(n.value.keys()).sort(ye).forEach(((t,n)=>{e.set(t,n)})),e})),a={register:e=>{n.value=new Set(n.value).add(e)},unregister:e=>{const t=new Set(n.value);t.delete(e),n.value=t},get map(){return u.value},elementsRef:l,labelsRef:o};return()=>r(be.Provider,{value:a,children:e.children},void 0)}));function xe(e){void 0===e&&(e={});const{label:n}=e,l=be.use(),o=t.ref(null),u=t.ref(null);let a=null;return t.watch((()=>u.value),(()=>{const e=u.value;e&&(l.register(e),a=e)})),t.onUnmounted((()=>{a&&l.unregister(a)})),t.watch((()=>l.map),(()=>{const e=u.value,t=e?l.map.get(e):null;if(null!=t&&(o.value=t,l.elementsRef.value[t]=e,l.labelsRef)){var a;const o=void 0!==n;l.labelsRef.value[t]=o?n:null!=(a=null==e?void 0:e.textContent)?a:null}})),{ref:e=>{if(u.value=e,e){l.register(e);const u=l.map.get(e);if(null!=u&&(o.value=u,l.elementsRef.value[u]=e,l.labelsRef)){var t;const o=void 0!==n;l.labelsRef.value[u]=o?n:null!=(t=null==e?void 0:e.textContent)?t:null}}},index:t.computed((()=>null==o.value?-1:o.value))}}function Ie(e,t){if("function"==typeof e)return e(t);if(e){const{ref:n,...l}=t;return{...e,ref:null!=n?n:e.ref,props:{...e.props,...l}}}return r("div",{...t},void 0)}const Re=t.createContext({activeIndex:0,onNavigate:()=>{}}),Ee=[M,O],ke=[L,A],Ce=[...Ee,...ke],Te=t.defineComponent((function(e){const n=t.ref(0),l=t.computed((()=>{var l;return null!=(l=t.toValue(e.activeIndex))?l:n.value})),o=t=>{e.onNavigate?e.onNavigate(t):n.value=t},u=t.ref([]),a={get activeIndex(){return l.value},onNavigate:o};return()=>{const{render:n,orientation:i="both",loop:v=!0,rtl:s=!1,cols:c=1,disabledIndices:d,itemSizes:f,dense:m=!1,ref:p,...g}=e,h=n&&"function"!=typeof n?n.props:{},y=c>1;const b={...g,...h,ref:p,"aria-orientation":"both"===i?void 0:i,onKeyDown(e){null==g.onKeyDown||g.onKeyDown(e),null==h.onKeyDown||h.onKeyDown(e),function(e){if(!Ce.includes(e.key))return;let n=l.value;const a=ee(u,d),r=te(u,d),p=s?M:O,g=s?O:M;if(y){const o=f||Array.from({length:u.value.length},(()=>({width:1,height:1}))),g=oe(o,c,m),h=g.findIndex((e=>null!=e&&!re(u,e,d))),y=g.reduce(((e,t,n)=>null==t||re(u,t,d)?e:n),-1),b=g[le(t.ref(g.map((e=>e?u.value[e]:null))),{event:e,orientation:i,loop:v,rtl:s,cols:c,disabledIndices:ae([...("function"!=typeof d?d:null)||u.value.map(((e,t)=>re(u,t,d)?t:void 0)),void 0],g),minIndex:h,maxIndex:y,prevIndex:ue(l.value>r?a:l.value,o,g,c,e.key===A?"bl":e.key===p?"tr":"tl")})];null!=b&&(n=b)}const h={horizontal:[p],vertical:[A],both:[p,A]}[i],b={horizontal:[g],vertical:[L],both:[g,L]}[i],w=y?Ce:{horizontal:Ee,vertical:ke,both:Ce}[i];var x;n===l.value&&[...h,...b].includes(e.key)&&(n=v&&n===r&&h.includes(e.key)?a:v&&n===a&&b.includes(e.key)?r:ne(u,{startingIndex:n,decrement:b.includes(e.key),disabledIndices:d})),n===l.value||Q(u,n)||(e.stopPropagation(),w.includes(e.key)&&e.preventDefault(),o(n),null==(x=u.value[n])||x.focus())}(e)}};return r(Re.Provider,{value:a,children:r(we,{elementsRef:t.rawRef(u),children:Ie(n,b)},void 0)},void 0)}})),Pe=t.defineComponent((function(e){const n=Re.use(),{ref:l,index:o}=xe(),u=he([l,e.ref,function(){const t=e.render;return t&&"function"!=typeof t?t.props.ref:void 0}()]),a=t.computed((()=>n.activeIndex===o.value));return()=>{const{render:t,...l}=e,r=t&&"function"!=typeof t?t.props:{};return Ie(t,{...l,...r,ref:u,tabIndex:a.value?0:-1,"data-active":a.value?"":void 0,onFocus(e){null==l.onFocus||l.onFocus(e),null==r.onFocus||r.onFocus(e),n.onNavigate(o.value)}})}}));let Me=0;function Oe(){return t.ref("floating-ui-"+Math.random().toString(36).slice(2,6)+Me++)}const Le=t.defineComponent((function(e){const{context:{placement:n,elements:{floating:l},middlewareData:o},width:u=14,height:a=7,tipRadius:i=0,strokeWidth:v=0,staticOffset:s,stroke:c,d:d,ref:f}=e,m=Oe(),p=t.ref(!1);return t.watch((()=>l.value),(()=>{if(!l.value)return;"rtl"===y(l.value).direction&&(p.value=!0)})),()=>{var t;if(!l.value)return null;const[g,h]=n.value.split("-"),y="top"===g||"bottom"===g,{arrow:b,shift:w}=o.value;let x=s;(y&&null!=w&&w.x||!y&&null!=w&&w.y)&&(x=null);const I=2*v,R=I/2,E=u/2*(i/-8+1),k=a/2*i/4,C=!!d,T=x&&"end"===h?"bottom":"top";let P=x&&"end"===h?"right":"left";x&&p.value&&(P="end"===h?"left":"right");const M=null!=(null==b?void 0:b.x)?x||b.x:"",O=null!=(null==b?void 0:b.y)?x||b.y:"",L=d||"M0,0 H"+u+" L"+(u-E)+","+(a-k)+" Q"+u/2+","+a+" "+E+","+(a-k)+" Z",A={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[g],{transform:D,...S}=null!=(t=e.style)?t:{},{ref:N,context:F,style:V,...K}=e,_={...K,ref:f,"aria-hidden":!0,width:C?u:u+I,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[P]:M,[T]:O,[g]:y||C?"100%":"calc(100% - "+I/2+"px)",transform:[A,D].filter((e=>!!e)).join(" "),...S}};return r("svg",{..._,children:[I>0&&r("path",{clipPath:"url(#"+m.value+")",fill:"none",stroke:c,strokeWidth:I+(d?0:1),d:L},void 0),r("path",{stroke:I&&!d?K.fill:"none",d:L},void 0),r("clipPath",{id:m.value,children:r("rect",{x:-R,y:R*(C?-1:1),width:u+I,height:u},void 0)},void 0)]},void 0)}}));function Ae(){const e=new Map;return{emit(t,n){var l;null==(l=e.get(t))||l.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var l;null==(l=e.get(t))||l.delete(n)}}}const De=t.createContext(null),Se=t.createContext(null),Ne=()=>{var e;return(null==(e=De.use())?void 0:e.id)||null},Fe=()=>Se.use();const Ve=t.defineComponent((function(e){const n=De.use(),l=t.computed((()=>(null==n?void 0:n.id)||null));return()=>r(De.Provider,{value:{id:e.id,parentId:l.value},children:e.children},void 0)})),Ke=t.defineComponent((function(e){const n=t.ref([]),l=e=>{n.value=[...n.value,e]},o=e=>{n.value=n.value.filter((t=>t!==e))},u=Ae();return()=>r(Se.Provider,{value:{nodesRef:n,addNode:l,removeNode:o,events:u},children:e.children},void 0)}));function _e(e){return"data-floating-ui-"+e}function Ue(e){-1!==e.value&&(clearTimeout(e.value),e.value=-1)}const We=_e("safe-polygon");function He(e,t,n){if(n&&!z(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function qe(e){return"function"==typeof e?e():e}const je=()=>{},Be=t.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:je,setState:je,isInstantPhase:!1}),Ge=()=>Be.use(),Xe=t.defineComponent((function(e){const{children:n,delay:l,timeoutMs:o=0}=e,u=t.ref({delay:l,timeoutMs:o,initialDelay:l,currentId:null,isInstantPhase:!1}),a=e=>{u.value={...u.value,...e}},i=t.ref(null);t.watch((()=>[u.value.currentId,u.value.isInstantPhase]),(()=>{u.value.currentId?null===i.value?i.value=u.value.currentId:u.value.isInstantPhase||a({isInstantPhase:!0}):(u.value.isInstantPhase&&a({isInstantPhase:!1}),i.value=null)}));const v={get delay(){return u.value.delay},get initialDelay(){return u.value.initialDelay},get currentId(){return u.value.currentId},get timeoutMs(){return u.value.timeoutMs},get isInstantPhase(){return u.value.isInstantPhase},setState:a,setCurrentId:e=>{a({currentId:e})}};return()=>r(Be.Provider,{value:v,children:n},void 0)}));const Ye=t.createContext({hasProvider:!1,timeoutMs:0,delayRef:t.ref(0),initialDelayRef:t.ref(0),timeoutIdRef:t.ref(-1),currentIdRef:t.ref(null),currentContextRef:t.ref(null)}),ze=t.defineComponent((function(e){const{children:n,delay:l,timeoutMs:o=0}=e,u={hasProvider:!0,delayRef:t.ref(l),initialDelayRef:t.ref(l),currentIdRef:t.ref(null),timeoutMs:o,currentContextRef:t.ref(null),timeoutIdRef:t.ref(-1)};return()=>r(Ye.Provider,{value:u,children:n},void 0)}));let $e=0;function Ze(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:l=!0,sync:o=!1}=t;l&&cancelAnimationFrame($e);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():$e=requestAnimationFrame(u)}const Je={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qe(e){return"inert"===e?Je.inert:"aria-hidden"===e?Je["aria-hidden"]:Je.none}let et=new WeakSet,tt={},nt=0;function lt(e){return e?p(e)?e.host:lt(e.parentNode):null}const ot=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=lt(t);return e.contains(n)?n:null})).filter((e=>null!=e));function ut(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=K(e[0]).body;return function(e,t,n,l){const o="data-floating-ui-inert",u=l?"inert":n?"aria-hidden":null,a=ot(t,e),r=new Set,i=new Set(a),v=[];tt[o]||(tt[o]=new WeakMap);const c=tt[o];return a.forEach((function e(t){t&&!r.has(t)&&(r.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!i.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==s(t))if(r.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,l=Qe(u),a=(l.get(t)||0)+1,r=(c.get(t)||0)+1;l.set(t,a),c.set(t,r),v.push(t),1===a&&n&&et.add(t),1===r&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"inert"===u?"":"true")}}))}(t),r.clear(),nt++,()=>{v.forEach((e=>{const t=Qe(u),n=(t.get(e)||0)-1,l=(c.get(e)||0)-1;t.set(e,n),c.set(e,l),n||(!et.has(e)&&u&&e.removeAttribute(u),et.delete(e)),l||e.removeAttribute(o)})),nt--,nt||(Je.inert=new WeakMap,Je["aria-hidden"]=new WeakMap,Je.none=new WeakMap,et=new WeakSet,tt={})}}(e.concat(Array.from(l.querySelectorAll('[aria-live],[role="status"],output'))),l,t,n)}const at={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},rt=t.defineComponent((function(e){const n=t.ref(void 0);t.onMounted((()=>{I()&&(n.value="button")}));const{ref:l,...o}=e;return()=>r("span",{ref:l,...o,tabIndex:0,role:n.value,"aria-hidden":!n.value||void 0,[_e("focus-guard")]:"",style:at},void 0)})),it={clipPath:"inset(50%)",position:"fixed",top:0,left:0},vt=t.createContext(null),st=_e("portal");function ct(e){void 0===e&&(e={});const{id:n,root:l}=e,o=Oe(),u=ft(),a=t.ref(null),r=t.ref(null);return t.watch(a,((e,t)=>{null==t||t.remove(),queueMicrotask((()=>{r.value=null}))})),t.onUnmounted((()=>{var e;null==(e=a.value)||e.remove()})),t.watch((()=>[n,o.value,t.toValue(l),null==u?void 0:u.portalNode]),(()=>{if(!o.value)return;if(r.value)return;const e=n?document.getElementById(n):null;if(e){const t=document.createElement("div");return t.id=o.value,t.setAttribute(st,""),e.appendChild(t),r.value=t,void(a.value=t)}const i=t.toValue(l);if(null===i)return;let v=i||(null==u?void 0:u.portalNode);v=v||document.body;let s=null;n&&(s=document.createElement("div"),s.id=n,v.appendChild(s));const c=document.createElement("div");c.id=o.value,c.setAttribute(st,""),v=s||v,v.appendChild(c),r.value=c,a.value=c}),{immediate:!0}),a}const dt=t.defineComponent((function(e){const{id:n,root:l,preserveTabOrder:o=!0,portalOwnerRole:u}=e,a=ct({id:n,root:l}),i=t.ref(null),v=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref(null),f=t.computed((()=>{var e;return null==(e=i.value)?void 0:e.modal})),m=t.computed((()=>{var e;return null==(e=i.value)?void 0:e.open})),p=t.computed((()=>!!i.value&&!i.value.modal&&i.value.open&&o&&!(!t.toValue(l)&&!a.value)));let g;t.watch((()=>[a.value,o,f.value]),(()=>{function e(e){if(a.value&&me(e)){("focusin"===e.type?ge:pe)(a.value)}}null==g||g(),g=void 0,a.value&&o&&!f.value&&(a.value.addEventListener("focusin",e,!0),a.value.addEventListener("focusout",e,!0),g=()=>{var t,n;null==(t=a.value)||t.removeEventListener("focusin",e,!0),null==(n=a.value)||n.removeEventListener("focusout",e,!0)})})),t.watch((()=>[a.value,m.value]),(()=>{a.value&&(m.value||ge(a.value))})),t.onUnmounted((()=>{null==g||g()}));const h={preserveTabOrder:o,beforeOutsideRef:v,afterOutsideRef:s,beforeInsideRef:c,afterInsideRef:d,get portalNode(){return a.value},setFocusManagerState:e=>{i.value="function"==typeof e?e(i.value):e}};return()=>r(vt.Provider,{value:h,children:[p.value&&a.value&&r(rt,{"data-type":"outside",ref:v,onFocus:e=>{var t;if(me(e,null!=(t=a.value)?t:void 0)){var n;null==(n=c.value)||n.focus()}else{const e=fe(i.value?i.value.domReference:null);null==e||e.focus()}}},void 0),p.value&&a.value&&r("span",{"aria-owns":a.value.id,role:u||void 0,style:it},void 0),a.value&&r(t.Teleport,{to:a.value,children:e.children},void 0),p.value&&a.value&&r(rt,{"data-type":"outside",ref:s,onFocus:e=>{var t;if(me(e,null!=(t=a.value)?t:void 0)){var n;null==(n=d.value)||n.focus()}else{var l,o;const t=de(i.value?i.value.domReference:null);null==t||t.focus(),(null==(l=i.value)?void 0:l.closeOnFocusOut)&&(null==(o=i.value)||o.onOpenChange(!1,e,"focus-out"))}}},void 0)]},void 0)})),ft=()=>vt.use();function mt(e){return t=>{e.forEach((e=>{if(e)if("function"==typeof e){const n=e(t);n&&"object"==typeof n&&"value"in n&&(n.value=t)}else e.value=t}))}}let pt=[];function gt(){pt=pt.filter((e=>{var t;return null==(t=e.deref())?void 0:t.isConnected}))}function ht(){gt();const e=pt[pt.length-1];return null==e?void 0:e.deref()}function yt(e,t){var n;if(!(t.value.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const o=se(),u=l.focusable(e,o).filter((e=>{const t=e.getAttribute("data-tabindex")||"";return l.isTabbable(e,o)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")})),a=e.getAttribute("tabindex");t.value.includes("floating")||0===u.length?"0"!==a&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):("-1"!==a||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const bt=t.defineComponent((function(e){const{ref:t,...n}=e;return()=>r("button",{...n,type:"button",ref:t,tabIndex:-1,style:at},void 0)})),wt=t.defineComponent((function(e){var n,o;const{context:u,children:a}=e,v=t.ref(t.toValue(null!=(n=e.disabled)&&n));t.watch((()=>{var n;return t.toValue(null!=(n=e.disabled)&&n)}),(e=>{v.value=e}));const c=t.computed((()=>{var t;return null!=(t=e.order)?t:["content"]})),d=t.computed((()=>{var t;return null==(t=e.guards)||t})),f=t.computed((()=>{var t;return null!=(t=e.initialFocus)?t:0})),p=t.computed((()=>{var n;return t.toValue(null!=(n=e.restoreFocus)&&n)})),g=t.computed((()=>{var t;return null==(t=e.modal)||t})),h=t.computed((()=>{var t;return null!=(t=e.visuallyHiddenDismiss)&&t})),y=t.computed((()=>{var t;return null==(t=e.closeOnFocusOut)||t})),b=t.computed((()=>{var t;return null!=(t=e.outsideElementsInert)&&t})),w=null!=(o=e.getInsideElements)?o:()=>[],{open:x,onOpenChange:I,events:R,dataRef:E,elements:{domReference:k,floating:C}}=u,T=()=>{var e;return null==(e=E.value.floatingContext)?void 0:e.nodeId.value},P=t.computed((()=>!1===f.value||"number"==typeof f.value&&f.value<0)),M=t.computed((()=>U(k.value)&&P.value)),O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,L=t.computed((()=>!O||d.value)),A=t.computed((()=>!L.value||O&&b.value)),F=c,V=f,_={get value(){return null==(t=e.returnFocus)||t;var t}},W=Fe(),j=ft(),z=t.ref(null),$=t.ref(null),Z=t.ref(!1),J=t.ref(!1),Q=t.ref(-1),ee=t.ref(-1),te=t.ref(""),ne=t.computed((()=>null!=j)),le=t.computed((()=>H(C.value))),oe=function(e){return void 0===e&&(e=le.value),e?l.tabbable(e,se()):[]},ue=e=>{const t=oe(null!=e?e:void 0);return F.value.map((e=>k.value&&"reference"===e?k.value:le.value&&"floating"===e?le.value:t)).filter(Boolean).flat()};let ae,re,ie;t.watch([k,C],(()=>{if(null==ae||ae(),ae=void 0,v.value)return;if(!g.value)return;function e(e){if("Tab"===e.key){S(le.value,D(K(le.value)))&&0===oe().length&&!M.value&&G(e);const t=ue(),n=N(e);"reference"===F.value[0]&&n===k.value&&(G(e),e.shiftKey?Ze(t[t.length-1]):Ze(t[1])),"floating"===F.value[1]&&n===le.value&&e.shiftKey&&(G(e),Ze(t[0]))}}const t=K(le.value);t.addEventListener("keydown",e),ae=()=>{t.removeEventListener("keydown",e)}})),t.watch(C,(()=>{function e(e){const t=N(e),n=oe().indexOf(t);-1!==n&&(Q.value=n)}null==re||re(),re=void 0,v.value||C.value&&(C.value.addEventListener("focusin",e),re=()=>{var t;null==(t=C.value)||t.removeEventListener("focusin",e)})})),t.watch((()=>[k.value,C.value,null==j?void 0:j.portalNode,v.value]),(()=>{if(null==ie||ie(),ie=void 0,v.value)return;if(!y.value)return;function e(){J.value=!0,setTimeout((()=>{J.value=!1}))}const t=Boolean(!W&&j);function n(){Ue(ee),E.value.insideReactTree=!0,ee.value=window.setTimeout((()=>{E.value.insideReactTree=!1}))}if(C.value&&m(k.value)){const l=function(e){const t=e.relatedTarget,n=e.currentTarget,l=N(e);queueMicrotask((()=>{var o;const u=T(),a=!(S(k.value,t)||S(C.value,t)||S(t,C.value)||S(null!=(o=null==j?void 0:j.portalNode)?o:null,t)||null!=t&&t.hasAttribute(_e("focus-guard"))||W&&(q(W.nodesRef.value,u).find((e=>{var n,l;return S(null==(n=e.context)?void 0:n.elements.floating.value,t)||S(null==(l=e.context)?void 0:l.elements.domReference.value,t)}))||B(W.nodesRef.value,u).find((e=>{var n,l,o;return[null==(n=e.context)?void 0:n.elements.floating.value,H(null==(l=e.context)?void 0:l.elements.floating.value)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference.value)===t}))));if(n===k.value&&le.value&&yt(le.value,F),p.value&&n!==k.value&&!ve(l)&&D(K(le.value))===K(le.value).body){if(m(le.value)&&(le.value.focus(),"popup"===p.value))return;const e=Q.value,t=oe(),n=t[e]||t[t.length-1]||le.value;m(n)&&n.focus()}E.value.insideReactTree?E.value.insideReactTree=!1:(M.value?n!==k.value||g.value:!g.value)&&t&&a&&!J.value&&(M.value||t!==ht())&&(Z.value=!0,I(!1,e,"focus-out"))}))};k.value.addEventListener("focusout",l),k.value.addEventListener("pointerdown",e),C.value.addEventListener("focusout",l),t&&C.value.addEventListener("focusout",n,!0),ie=()=>{var o,u,a,r;(null==(o=k.value)||o.removeEventListener("focusout",l),null==(u=k.value)||u.removeEventListener("pointerdown",e),null==(a=C.value)||a.removeEventListener("focusout",l),t)&&(null==(r=C.value)||r.removeEventListener("focusout",n,!0))}}}));const ce=t.ref(null),pe=t.ref(null),ge=mt([ce,()=>null==j?void 0:j.beforeInsideRef]),he=mt([pe,()=>null==j?void 0:j.afterInsideRef]);let ye,be;t.watch((()=>[k.value,C.value,null==j?void 0:j.portalNode]),(()=>{var e,t;if(null==ye||ye(),ye=void 0,v.value)return;if(!C.value)return;const n=Array.from((null==j||null==(e=j.portalNode)?void 0:e.querySelectorAll("["+_e("portal")+"]"))||[]),l=null==(t=(W?B(W.nodesRef.value,T()):[]).find((e=>{var t;return U((null==(t=e.context)?void 0:t.elements.domReference.value)||null)})))||null==(t=t.context)?void 0:t.elements.domReference.value,o=[C.value,l,...n,...w(),z.value,$.value,ce.value,pe.value,null==j?void 0:j.beforeOutsideRef.value,null==j?void 0:j.afterOutsideRef.value,F.value.includes("reference")||M.value?k.value:null].filter((e=>null!=e));ye=g.value||M.value?ut(o,!A.value,A.value):ut(o)})),t.watch([x,le,v],(()=>{if(v.value||!m(le.value))return;const t=K(le.value);D(t),queueMicrotask((()=>{var n;const l=ue(le.value),o=V.value;let u=void 0===e.initialFocus?null==(n=C.value)?void 0:n.querySelector("[autofocus]"):null;u||"number"!=typeof o?"function"==typeof o?u=o("")||null:o&&"object"==typeof o&&"__v_isRef"in o&&(u=o.value):u=l[o],u=u||l[0]||le.value;const a=S(le.value,D(t));P.value||a||!x.value||Ze(u,{preventScroll:u===le.value})}))}),{immediate:!0}),t.watch([x,le,k,v],(()=>{if(null==be||be(),be=void 0,v.value||!le.value)return;x.value&&(te.value="");const e=K(le.value),t=D(e);var n;function o(e){let{reason:t,event:n,nested:l}=e;if(te.value=function(e){return e instanceof KeyboardEvent?"keyboard":"pointerType"in e?e.pointerType||"keyboard":e instanceof MouseEvent?0===e.detail?"keyboard":"mouse":""}(n),x&&(Z.value=!1),["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(Z.value=!0),"outside-press"===t)if(l)Z.value=!1;else if(X(n)||Y(n))Z.value=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),Z.value=!e}}n=t,gt(),n&&"body"!==s(n)&&(pt.push(new WeakRef(n)),pt.length>20&&(pt=pt.slice(-20))),R.on("openchange",o);const u=e.createElement("span");u.setAttribute("tabindex","-1"),u.setAttribute("aria-hidden","true"),Object.assign(u.style,at),ne.value&&k.value&&"function"!=typeof _.value&&k.value.insertAdjacentElement("afterend",u),be=()=>{R.off("openchange",o);const t=D(e),n=S(C.value,t)||W&&q(W.nodesRef.value,T(),!1).some((e=>{var n;return S(null==(n=e.context)?void 0:n.elements.floating.value,t)})),a=function(){const e=_.value;let t="function"==typeof e?e(te.value):e;if(void 0===t||!1===t)return null;null===t&&(t=!0);const n=t&&"object"==typeof t&&"__v_isRef"in t?t.value:t;if("boolean"==typeof t){const e=k.value||ht();return e&&e.isConnected?e:u}return n||k.value||ht()||u}(),r="boolean"!=typeof _.value;queueMicrotask((()=>{const o=function(e){if(!e)return null;const t=se();return l.isTabbable(e,t)?e:l.tabbable(e,t)[0]||e}(a);if(_.value&&!Z.value&&m(o)&&(r||o===t||t===e.body||n)){const e={preventScroll:!0};"keyboard"===te.value&&(e.focusVisible=!0),o.focus(e)}u.remove()}))}})),t.watch(v,(()=>{queueMicrotask((()=>{Z.value=!1}))}),{immediate:!0}),t.watch((()=>[null==j?void 0:j.portalNode,x.value,k.value]),(()=>{if(v.value)return;const e=j;e&&(e.setFocusManagerState({modal:g.value,closeOnFocusOut:y.value,open:x.value,onOpenChange:I,domReference:k.value}),t.onWatcherCleanup((()=>{e.setFocusManagerState(null)})))}),{immediate:!0}),t.watch([le,v],(()=>{v.value||le.value&&yt(le.value,F)}),{immediate:!0});const we=t.computed((()=>!v.value&&L.value&&(!g.value||!M.value)&&(ne.value||g.value)));function xe(e){return!v.value&&h.value&&g.value?r(bt,{ref:"start"===e?z:$,onClick:e=>I(!1,e),children:"string"==typeof h?h:"Dismiss"},void 0):null}return t.onUnmounted((()=>{null==ae||ae(),null==re||re(),null==ie||ie(),null==ye||ye(),null==be||be(),queueMicrotask(gt)})),()=>r(i,{children:[we.value&&r(rt,{"data-type":"inside",ref:ge,onFocus:e=>{if(g.value){const e=ue();Ze("reference"===c.value[0]?e[0]:e[e.length-1])}else if(null!=j&&j.preserveTabOrder&&j.portalNode){var t;if(Z.value=!1,me(e,null!=(t=j.portalNode)?t:void 0)){const e=de(k.value);null==e||e.focus()}else{var n;null==(n=j.beforeOutsideRef.value)||n.focus()}}}},void 0),!M.value&&xe("start"),e.children,xe("end"),we.value&&r(rt,{"data-type":"inside",ref:he,onFocus:e=>{if(g.value)Ze(ue()[0]);else if(null!=j&&j.preserveTabOrder&&j.portalNode){var t;if(y.value&&(Z.value=!0),me(e,null!=(t=j.portalNode)?t:void 0)){const e=fe(k.value);null==e||e.focus()}else{var n;null==(n=j.afterOutsideRef.value)||n.focus()}}}},void 0)]},void 0)}));let xt=0;const It="--floating-ui-scrollbar-width";let Rt=()=>{};const Et=t.defineComponent((function(e){return t.watch((()=>e.lockScroll),(e=>{null!=e&&e&&(xt++,1===xt&&(Rt=function(){const e=w(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,l=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,u=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(It,o+"px"),o&&(n[l]=o+"px"),t){var r,i;const e=(null==(r=window.visualViewport)?void 0:r.offsetLeft)||0,t=(null==(i=window.visualViewport)?void 0:i.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(t))+"px",left:-(u-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[l]:""}),n.removeProperty(It),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(u,a))}}()),t.onWatcherCleanup((()=>{xt--,0===xt&&Rt()})))}),{immediate:!0}),()=>{const{ref:t,lockScroll:n,...l}=e;return r("div",{ref:t,...l,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...l.style}},void 0)}}));function kt(e){return m(e.target)&&"BUTTON"===e.target.tagName}function Ct(e){return _(e)}function Tt(e){return null!=e&&null!=e.clientX}const Pt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Mt=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}},Ot=new Set;let Lt=null;function At(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,l,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(l=n;0!=l--;)if(!At(e[l],t[l]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(l=n;0!=l--;)if(!{}.hasOwnProperty.call(t,o[l]))return!1;for(l=n;0!=l--;){const n=o[l];if(("_owner"!==n||!e.$$typeof)&&!At(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Dt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function St(e,t){const n=Dt(e);return Math.round(t*n)/n}function Nt(e){void 0===e&&(e={});const{placement:n="bottom",strategy:l="absolute",middleware:u=[],platform:a,elements:{reference:r,floating:i}={},transform:v=!0,whileElementsMounted:s,open:c}=e,d=t.ref(0),m=t.ref(0),p=t.ref(n),g=t.ref(l),h=t.ref({}),y=t.ref(!1),b=t.ref(null),w=t.ref(null),x=t.computed((()=>{var e;return null!=(e=t.toValue(r))?e:b.value})),I=t.computed((()=>{var e;return null!=(e=t.toValue(i))?e:w.value})),R=t.ref(null),E=t.ref(null),k=t.ref({x:0,y:0,strategy:l,placement:n,middlewareData:{},isPositioned:!1}),C=t.computed((()=>t.toValue(c))),T=$(a),P=()=>{if(!R.value||!E.value)return;const e={placement:p.value,strategy:g.value,middleware:u};T.value&&(e.platform=T.value),o.computePosition(R.value,E.value,e).then((e=>{const t={...e,isPositioned:!1!==C.value};M.value&&!At(k.value,t)&&(k.value=t,d.value=t.x,m.value=t.y,p.value=t.placement,g.value=t.strategy,h.value=t.middlewareData,y.value=t.isPositioned)}))};t.watch(C,(()=>{!1===C.value&&k.value.isPositioned&&(k.value.isPositioned=!1,y.value=!1)}));const M=t.ref(!1);let O;const L=()=>{null==O||O(),O=void 0,x.value&&(R.value=x.value),I.value&&(E.value=I.value),R.value&&E.value&&(s?O=s(R.value,E.value,P):P())};t.watch([x,I],L),t.onMounted((()=>{M.value=!0,L()})),t.onUnmounted((()=>{M.value=!1,null==O||O()}));const A=t.computed((()=>{var e,t;const n={position:g.value,left:0,top:0};if(!I.value)return n;const l=St(I.value,null!=(e=d.value)?e:0),o=St(I.value,null!=(t=m.value)?t:0);return v?{...n,transform:"translate("+l+"px, "+o+"px)",...Dt(I.value)>=1.5&&{willChange:"transform"}}:{position:g.value,left:l,top:o}}));return{x:d,y:m,strategy:g,placement:p,middlewareData:h,isPositioned:y,update:P,floatingStyles:A,refs:{reference:R,floating:E,setReference:e=>{var t;(null===e||f(e)||"function"==typeof(null==(t=e)?void 0:t.getBoundingClientRect))&&(e!==R.value&&(R.value=e,b.value=e))},setFloating:e=>{e!==E.value&&(E.value=e,w.value=e)}},elements:{reference:x,floating:I}}}function Ft(e){const{onOpenChange:n,elements:l}=e,o=Oe(),u=t.ref({}),a=Ae(),r=null!=Ne(),i=t.computed((()=>{var n;return null!=(n=t.toValue(e.open))&&n})),v=t.ref(t.toValue(l.reference)),s=Z(((e,t,l)=>{u.value.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:l,nested:r}),null==n||n(e,t,l)})),c={setPositionReference:e=>{v.value=e}},d={reference:t.computed((()=>v.value||t.toValue(l.reference)||null)),floating:t.computed((()=>t.toValue(l.floating)||null)),domReference:t.computed((()=>t.toValue(l.reference)||null))};return{dataRef:u,open:i,onOpenChange:s,elements:d,events:a,floatingId:o,refs:c}}function Vt(){return E()&&I()}function Kt(e,n,l){const o=new Map,u="item"===l;let a=e;if(u&&e){const{[T]:t,[P]:n,...l}=e;a=l}return{..."floating"===l&&{tabIndex:-1,[C]:""},...a,...n.map((n=>{const o=n?n[l]:null,u=o?t.unref(o):null;return"function"==typeof u?e?u(e):null:u})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,l]=t;var a;u&&[T,P].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof l&&(null==(a=o.get(n))||a.push(l),e[n]=function(){for(var e,t=arguments.length,l=new Array(t),u=0;u<t;u++)l[u]=arguments[u];return null==(e=o.get(n))?void 0:e.map((e=>e(...l))).find((e=>void 0!==e))})):e[n]=l)})),e):e),{})}}function _t(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ut(e,t){return _t(t,e===L||e===A,e===M||e===O)}function Wt(e,t,n){return _t(t,e===A,n?e===M:e===O)||"Enter"===e||" "===e||""===e}function Ht(e,t,n){return _t(t,n?e===M:e===O,e===A)}function qt(e,t,n,l){return"both"===t||"horizontal"===t&&l&&l>1?"Escape"===e:_t(t,n?e===O:e===M,e===L)}const jt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Bt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Gt(e,t){return"function"==typeof e?e(t):e}function Xt(e,n){void 0===n&&(n={});const{open:l,elements:{floating:o}}=e,{duration:u=250}=n,a=("number"==typeof u?u:u.close)||0,r=t.ref("unmounted"),i=function(e,n){const l=t.ref(e.value);let o;return t.watch(e,(e=>{e?(o&&(clearTimeout(o),o=void 0),l.value=!0):l.value&&(o=setTimeout((()=>{l.value=!1}),n))})),t.onUnmounted((()=>{o&&clearTimeout(o)})),l}(l,a);let v;return t.watch([i,r],(()=>{i.value||"close"!==r.value||(r.value="unmounted")})),t.watch([l,o],(()=>{null!=v&&(cancelAnimationFrame(v),v=void 0),o.value&&(l.value?(r.value="initial",v=requestAnimationFrame((()=>{r.value="open"}))):r.value="close")}),{immediate:!0}),t.onUnmounted((()=>{null!=v&&cancelAnimationFrame(v)})),{isMounted:i,status:r}}function Yt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function zt(e,t){const[n,l]=e;let o=!1;const u=t.length;for(let e=0,a=u-1;e<u;a=e++){const[u,r]=t[e]||[0,0],[i,v]=t[a]||[0,0];r>=l!=v>=l&&n<=(i-u)*(l-r)/(v-r)+u&&(o=!o)}return o}e.Composite=Te,e.CompositeItem=Pe,e.FloatingArrow=Le,e.FloatingDelayGroup=Xe,e.FloatingFocusManager=wt,e.FloatingList=we,e.FloatingNode=Ve,e.FloatingOverlay=Et,e.FloatingPortal=dt,e.FloatingTree=Ke,e.NextFloatingDelayGroup=ze,e.activeElement=D,e.contains=S,e.createGridCellMap=oe,e.disableFocusInside=pe,e.enableFocusInside=ge,e.findNonDisabledListIndex=ne,e.getDeepestNode=j,e.getDocument=K,e.getFloatingFocusElement=H,e.getGridCellIndexOfCorner=ue,e.getGridCellIndices=ae,e.getGridNavigatedIndex=le,e.getMaxListIndex=te,e.getMinListIndex=ee,e.getNextTabbable=de,e.getNodeAncestors=B,e.getNodeChildren=q,e.getPlatform=w,e.getPreviousTabbable=fe,e.getTabbableOptions=se,e.getTarget=N,e.getUserAgent=x,e.gridNavigation=function(e,t,l,o,u,a,r,i,v,s){void 0===s&&(s=2);const c=function(e,t){let{event:l,orientation:o,loop:u,onLoop:a,rtl:r,cols:i,disabledIndices:v,minIndex:s,maxIndex:c,prevIndex:d,stopEvent:f=!1}=t;const m={value:e};let p,g=d;if(l.key===L?p="up":l.key===A&&(p="down"),p){var h;const t=[],o=[];let r=!1,y=0;{let n=null,l=-1;e.forEach(((e,u)=>{if(null==e)return;y+=1;const a=e.closest('[role="row"]');a&&(r=!0),a===n&&-1!==l||(n=a,l+=1,t[l]=[]),t[l].push(u),o[u]=l}))}let b=!1,w=0;if(r)for(const e of t){const t=e.length;t>w&&(w=t),t!==i&&(b=!0)}const x=b&&y<e.length,I=w||i,R=e=>{if(!b||-1===d)return;const n=o[d];if(null==n)return;const r=t[n].indexOf(d),i="up"===e?-1:1;for(let e=n+i,f=0;f<t.length;f+=1,e+=i){if(e<0||e>=t.length){if(!u||x)return;if(e=e<0?t.length-1:0,a){var s,c;const n=Math.min(r,t[e].length-1),u=null!=(s=t[e][n])?s:t[e][0],i=a(l,d,u);e=null!=(c=o[i])?c:e}}const n=t[e];for(let e=Math.min(r,n.length-1);e>=0;e-=1){const t=n[e];if(!re(m,t,v))return t}}},E=e=>{if(!x||-1===d)return;const t=d%I,l="up"===e?-I:I,o=c-c%I,a=n.floor(c/I)+1;for(let e=d-t+l,n=0;n<a;n+=1,e+=l){if(e<0||e>c){if(!u)return;e=e<0?o:0}const n=Math.min(e+I-1,c);for(let l=Math.min(e+t,n);l>=e;l-=1)if(!re(m,l,v))return l}};f&&G(l);const k=null!=(h=R(p))?h:E(p);if(void 0!==k)g=k;else if(-1===d)g="up"===p?c:s;else if(g=ne(m,{startingIndex:d,amount:I,decrement:"up"===p,disabledIndices:v}),u){if("up"===p&&(d-I<s||g<0)){const e=d%I,t=c%I,n=c-(t-e);g=t===e?c:t>e?n:n-I,a&&(g=a(l,d,g))}"down"===p&&d+I>c&&(g=ne(m,{startingIndex:d%I-I,amount:I,disabledIndices:v}),a&&(g=a(l,d,g)))}Q(m,g)&&(g=d)}if("both"===o){const e=n.floor(d/i);l.key===(r?M:O)&&(f&&G(l),d%i!=i-1?(g=ne(m,{startingIndex:d,disabledIndices:v}),u&&J(g,i,e)&&(g=ne(m,{startingIndex:d-d%i-1,disabledIndices:v}),a&&(g=a(l,d,g)))):u&&(g=ne(m,{startingIndex:d-d%i-1,disabledIndices:v}),a&&(g=a(l,d,g))),J(g,i,e)&&(g=d)),l.key===(r?O:M)&&(f&&G(l),d%i!=0?(g=ne(m,{startingIndex:d,decrement:!0,disabledIndices:v}),u&&J(g,i,e)&&(g=ne(m,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:v}),a&&(g=a(l,d,g)))):u&&(g=ne(m,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:v}),a&&(g=a(l,d,g))),J(g,i,e)&&(g=d));const t=n.floor(c/i)===e;Q(m,g)&&(u&&t?(g=l.key===(r?O:M)?c:ne(m,{startingIndex:d-d%i-1,disabledIndices:v}),a&&(g=a(l,d,g))):g=d)}return g}(l.value,{event:e,orientation:o,loop:u,rtl:a,cols:s,disabledIndices:r,minIndex:i,maxIndex:v,prevIndex:t>v?i:t,stopEvent:!0});return Q(l,c)?void 0:c},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:l,overflowRef:u,onFallbackChange:a,offset:r=0,index:i=0,minItemsVisible:v=4,referenceOverflowThreshold:s=0,scrollRef:c,...d}=n.evaluate(e,t),{rects:f,platform:m,elements:{floating:p}}=t,g=l.value[i],h=(null==c?void 0:c.value)||p,y=p.clientTop||h.clientTop,b=0!==p.clientTop,w=0!==h.clientTop,x=p===h;if(!g)return{};const I={...t,...await o.offset(-g.offsetTop-p.clientTop-f.reference.height/2-g.offsetHeight/2-r).fn(t)},R=await m.detectOverflow(Yt(I,h.scrollHeight+y+p.clientTop),d),E=await m.detectOverflow(I,{...d,elementContext:"reference"}),k=n.max(0,R.top),C=I.y+k,T=(h.scrollHeight>h.clientHeight?e=>e:n.round)(n.max(0,h.scrollHeight+(b&&x||w?2*y:0)-k-n.max(0,R.bottom)));if(h.style.maxHeight=T+"px",h.scrollTop=k,a){a(h.offsetHeight<g.offsetHeight*n.min(v,l.value.length)-1||E.top>=-s||E.bottom>=-s)}return u&&(u.value=await m.detectOverflow(Yt({...I,y:C},h.offsetHeight+y+p.clientTop),d)),{y:C}}}),e.isAndroid=R,e.isDifferentGridRow=J,e.isElementVisible=ve,e.isEventTargetWithin=F,e.isHiddenByStyles=ie,e.isIndexOutOfListBounds=Q,e.isJSDOM=k,e.isListIndexDisabled=re,e.isMac=E,e.isMouseLikePointerType=z,e.isOutsideEvent=me,e.isReactEvent=function(e){return"nativeEvent"in e},e.isRootElement=V,e.isSafari=I,e.isTypeableCombobox=U,e.isTypeableElement=_,e.isVirtualClick=X,e.isVirtualPointerEvent=Y,e.matchesFocusVisible=W,e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:l=!0}=e;let o,u=!1,a=null,r=null,i="undefined"!=typeof performance?performance.now():0;function v(){null!=o&&(window.clearTimeout(o),o=void 0)}const s=e=>{let{x:n,y:s,placement:c,elements:d,onClose:m,nodeId:p,tree:g}=e;return function(e){function h(){v(),m()}if(v(),!d.domReference.value||!d.floating.value||null==c.value||null==n||null==s)return;const{clientX:y,clientY:b}=e,w=[y,b],x=N(e),I="mouseleave"===e.type,R=S(d.floating.value,x),E=S(d.domReference.value,x),k=d.domReference.value.getBoundingClientRect(),C=d.floating.value.getBoundingClientRect(),T=c.value.split("-")[0],P=n>C.right-C.width/2,M=s>C.bottom-C.height/2,O=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),L=C.width>k.width,A=C.height>k.height,D=(L?k:C).left,F=(L?k:C).right,V=(A?k:C).top,K=(A?k:C).bottom;if(R&&(u=!0,!I))return;if(E&&(u=!1),E&&!I)return void(u=!0);if(I&&f(e.relatedTarget)&&S(d.floating.value,e.relatedTarget))return;if(g&&q(g.nodesRef.value,p.value).length)return;if("top"===T&&s>=k.bottom-1||"bottom"===T&&s<=k.top+1||"left"===T&&n>=k.right-1||"right"===T&&n<=k.left+1)return h();let _=[];switch(T){case"top":_=[[D,k.top+1],[D,C.bottom-1],[F,C.bottom-1],[F,k.top+1]];break;case"bottom":_=[[D,C.top+1],[D,k.bottom-1],[F,k.bottom-1],[F,C.top+1]];break;case"left":_=[[C.right-1,K],[C.right-1,V],[k.left+1,V],[k.left+1,K]];break;case"right":_=[[k.right-1,K],[k.right-1,V],[C.left+1,V],[C.left+1,K]]}if(!zt([y,b],_)){if(u&&!O)return h();if(!I&&l){const t=function(e,t){const n=performance.now(),l=n-i;if(null===a||null===r||0===l)return a=e,r=t,i=n,null;const o=e-a,u=t-r,v=Math.sqrt(o*o+u*u);return a=e,r=t,i=n,v/l}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}zt([y,b],function(e){let[n,l]=e;switch(T){case"top":return[[L?n+t/2:P?n+4*t:n-4*t,l+t+1],[L?n-t/2:P?n+4*t:n-4*t,l+t+1],...[[C.left,P||L?C.bottom-t:C.top],[C.right,P?L?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return[[L?n+t/2:P?n+4*t:n-4*t,l-t],[L?n-t/2:P?n+4*t:n-4*t,l-t],...[[C.left,P||L?C.top+t:C.bottom],[C.right,P?L?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,A?l+t/2:M?l+4*t:l-4*t],o=[n+t+1,A?l-t/2:M?l+4*t:l-4*t];return[...[[M||A?C.right-t:C.left,C.top],[M?A?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return[[n-t,A?l+t/2:M?l+4*t:l-4*t],[n-t,A?l-t/2:M?l+4*t:l-4*t],...[[M||A?C.left+t:C.right,C.top],[M?A?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,s]))?!u&&l&&(o=window.setTimeout(h,40)):h()}}};return s.__options={blockPointerEvents:n},s},e.stopEvent=G,e.useClick=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,dataRef:u,elements:{domReference:a}}=e,{enabled:r=!0,event:i="click",toggle:v=!0,ignoreMouse:s=!1,keyboardHandlers:c=!0,stickIfOpen:d=!0}=n,f=t.ref(void 0),p=t.ref(!1);return r?{reference:{onPointerDown(e){f.value=e.pointerType},onMouseDown(e){const t=f.value;0===e.button&&"click"!==i&&(z(t,!0)&&s||(!l.value||!v||u.value.openEvent&&d&&"mousedown"!==u.value.openEvent.type?(e.preventDefault(),o(!0,e,"click")):o(!1,e,"click")))},onClick(e){const t=f.value;"mousedown"===i&&f.value?f.value=void 0:z(t,!0)&&s||(!l.value||!v||u.value.openEvent&&d&&"click"!==u.value.openEvent.type?o(!0,e,"click"):o(!1,e,"click"))},onKeyDown(e){f.value=void 0,e.defaultPrevented||!c||kt(e)||(" "!==e.key||Ct(a.value)||(e.preventDefault(),p.value=!0),function(e){return m(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&(l.value&&v?o(!1,e,"click"):o(!0,e,"click")))},onKeyUp(e){e.defaultPrevented||!c||kt(e)||Ct(a.value)||" "===e.key&&p.value&&(p.value=!1,l.value&&v?o(!1,e,"click"):o(!0,e,"click"))}}}:{}},e.useClientPoint=function(e,n){void 0===n&&(n={});const{open:l,dataRef:o,elements:{floating:u,domReference:a},refs:r}=e,i=t.computed((()=>{var e;return null==(e=t.toValue(n.enabled))||e})),v=t.computed((()=>{var e;return null!=(e=t.toValue(n.axis))?e:"both"})),s=t.computed((()=>{var e;return null!=(e=t.toValue(n.x))?e:null})),d=t.computed((()=>{var e;return null!=(e=t.toValue(n.y))?e:null})),f=t.ref(!1),m=t.ref(null),p=t.ref(void 0),g=t.ref(0),h=Z(((e,t)=>{f.value||o.value.openEvent&&!Tt(o.value.openEvent)||r.setPositionReference(function(e,t){let n=null,l=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const a=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},r="x"===t.axis||"both"===t.axis,i="y"===t.axis||"both"===t.axis,v=["mouseenter","mousemove"].includes((null==(u=t.dataRef.value.openEvent)?void 0:u.type)||"")&&"touch"!==t.pointerType;let s=a.width,c=a.height,d=a.x,f=a.y;return null==n&&t.x&&r&&(n=a.x-t.x),null==l&&t.y&&i&&(l=a.y-t.y),d-=n||0,f-=l||0,s=0,c=0,!o||v?(s="y"===t.axis?a.width:0,c="x"===t.axis?a.height:0,d=r&&null!=t.x?t.x:d,f=i&&null!=t.y?t.y:f):o&&!v&&(c="x"===t.axis?a.height:c,s="y"===t.axis?a.width:s),o=!0,{width:s,height:c,x:d,y:f,top:f,right:d+s,bottom:f+c,left:d}}}}(a.value,{x:e,y:t,axis:v.value,dataRef:o,pointerType:p.value}))})),y=Z((e=>{null==s.value&&null==d.value&&(l.value?m.value||g.value++:h(e.clientX,e.clientY))})),b=t.computed((()=>z(p.value)?u.value:l.value));function w(e){p.value=e.pointerType}t.watch([l,u,p,g],(()=>{var e;null==m.value||m.value(),m.value=null,m.value=null!=(e=(()=>{if(!b.value||!i.value||null!=s.value||null!=d.value)return;const e=c(u.value);function t(n){const l=N(n);S(u.value,l)?(e.removeEventListener("mousemove",t),m.value=null):h(n.clientX,n.clientY)}if(!o.value.openEvent||Tt(o.value.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.value=null};return m.value=n,n}r.setPositionReference(a.value)})())?e:null}),{immediate:!0}),t.onUnmounted((()=>{null==m.value||m.value(),m.value=null})),t.watch([i,u],(()=>{i.value&&!u.value&&(f.value=!1)}),{immediate:!0}),t.watch([i,l],(()=>{!i.value&&l.value&&(f.value=!0)})),t.watch([i,s,d],(()=>{!i.value||null==s.value&&null==d.value||(f.value=!1,h(s.value,d.value))}),{immediate:!0});const x={onPointerDown:w,onPointerEnter:w,onMouseMove:y,onMouseEnter:y};return i.value?{reference:x}:{}},e.useDelayGroup=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,floatingId:u}=e,{id:a,enabled:r=!0}=n,i=t.computed((()=>null!=a?a:u.value)),v=Ge();return t.watch((()=>[r,i.value,v.currentId,v.initialDelay]),(()=>{const{currentId:e,initialDelay:t,setState:n}=v;r&&e&&(n({delay:{open:1,close:He(t,"close")}}),e!==i.value&&o(!1))})),t.watch((()=>[r,l.value,v.currentId,v.initialDelay,v.timeoutMs]),(()=>{function e(){o(!1),v.setState({delay:v.initialDelay,currentId:null})}const{currentId:n,timeoutMs:u,setState:a,initialDelay:s}=v;if(r&&n&&!l.value&&n===i.value){if(u){const n=window.setTimeout(e,u);return void t.onWatcherCleanup((()=>{clearTimeout(n)}))}e()}})),t.watch((()=>[r,l.value,i.value]),(()=>{r&&v.setCurrentId!==je&&l.value&&v.setCurrentId(i.value)})),v},e.useDelayGroupContext=Ge,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:u,elements:a,dataRef:r}=e,{enabled:i=!0,escapeKey:v=!0,outsidePress:s=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:w=!1,bubbles:x,capture:I}=n,R=Fe(),E=Z("function"==typeof s?s:()=>!1),k="function"==typeof s?E:s,C=t.ref(!1),{escapeKey:T,outsidePress:P}=Mt(x),{escapeKey:M,outsidePress:O}=Mt(I),L=t.ref(!1),A=Z((e=>{var t;if(!l.value||!i||!v||"Escape"!==e.key)return;if(L.value)return;Lt!==e&&(Ot.clear(),Lt=e);const n=null==(t=r.value.floatingContext)?void 0:t.nodeId.value,o=R?q(R.nodesRef.value,n,!1):[];if(o.length>0){let e=!0;if(o.forEach((t=>{var n;(null!=(n=t.context)&&n.open.value||Ot.has(t.id))&&(e=!1)})),!e)return}T||e.stopPropagation(),Ot.add(n),u(!1,e,"escape-key")})),D=Z((e=>{var t;const n=()=>{var t;A(e),null==(t=N(e))||t.removeEventListener("keydown",n)};null==(t=N(e))||t.addEventListener("keydown",n)})),_=Z((e=>{var t;const n=C.value;if(C.value=!1,"click"===c&&n)return;if("function"==typeof k&&!k(e))return;const l=N(e),o="["+_e("inert")+"]",i=K(a.floating.value).querySelectorAll(o);let v=f(l)?l:null;for(;v&&!h(v);){const e=b(v);if(h(e)||!f(e))break;v=e}if(i.length&&f(l)&&!V(l)&&!S(l,a.floating.value)&&Array.from(i).every((e=>!S(v,e))))return;if(m(l)&&a.floating.value){const t=h(l),n=y(l),o=/auto|scroll/,u=t||o.test(n.overflowX),a=t||o.test(n.overflowY),r=u&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,i=a&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,v="rtl"===n.direction,s=i&&(v?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),c=r&&e.offsetY>l.clientHeight;if(s||c)return}const s=null==(t=r.value.floatingContext)?void 0:t.nodeId.value,d=R&&q(R.nodesRef.value,s).some((t=>{var n;return F(e,null==(n=t.context)?void 0:n.elements.floating.value)}));if(F(e,a.floating.value)||F(e,a.domReference.value)||d)return;const p=R?q(R.nodesRef.value,s):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open.value||t.context.dataRef.value.__outsidePressBubbles||(e=!1)})),!e)return}u(!1,e,"outside-press")})),U=Z((e=>{var t;const n=()=>{var t;_(e),null==(t=N(e))||t.removeEventListener(c,n)};null==(t=N(e))||t.addEventListener(c,n)}));let W;t.watch([l,a.floating,a.domReference],(()=>{if(null==W||W(),W=void 0,!l.value||!i)return;r.value.__escapeKeyBubbles=T,r.value.__outsidePressBubbles=P;let e=-1;function t(e){u(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),L.value=!0}function s(){e=window.setTimeout((()=>{L.value=!1}),(null==g&&(g="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),g?5:0))}const d=K(a.floating.value);v&&(d.addEventListener("keydown",M?D:A,M),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",s)),k&&d.addEventListener(c,O?U:_,O);let m=[];w&&(f(a.domReference.value)&&(m=o.getOverflowAncestors(a.domReference.value)),f(a.floating.value)&&(m=m.concat(o.getOverflowAncestors(a.floating.value))),!f(a.reference.value)&&a.reference.value&&a.reference.value.contextElement&&(m=m.concat(o.getOverflowAncestors(a.reference.value.contextElement)))),m=m.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),m.forEach((e=>{e.addEventListener("scroll",t)})),W=()=>{v&&(d.removeEventListener("keydown",M?D:A,M),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",s)),k&&d.removeEventListener(c,O?U:_,O),m.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),{immediate:!0}),t.onUnmounted((()=>{null==W||W()}));const H={onKeyDown:A,...d&&{[Pt[p]]:e=>{u(!1,e,"reference-press")},..."click"!==p&&{onClick(e){u(!1,e,"reference-press")}}}};function j(e){0===e.button&&(C.value=!0)}return i?{reference:H,floating:{onKeyDown:A,onMouseDown:j,onMouseUp:j}}:{}},e.useEffectEvent=Z,e.useFloating=function(e){var n,l;let{elements:o,...u}=void 0===e?{}:e;const{nodeId:a}=u,r=Ft({...u,elements:{reference:null!=(n=null==o?void 0:o.reference)?n:null,floating:null!=(l=null==o?void 0:o.floating)?l:null}}),i=u.rootContext||r,v=i.elements,s=t.ref(null),c=t.ref(null),d=null==v?void 0:v.domReference,m=t.computed((()=>d.value||s.value)),p=t.ref(null),g=Fe();t.watch(m,(()=>{m.value&&(p.value=m.value)}),{immediate:!0});const h=Nt({...u,elements:{...v,...c&&{reference:c}}}),y={...h.refs,setReference:e=>{(f(e)||null===e)&&(p.value=e,s.value=e),(f(h.refs.reference.value)||null===h.refs.reference.value||null!==e&&!f(e))&&h.refs.setReference(e)},setPositionReference:e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c.value=t,h.refs.setReference(t)},domReference:p},b={...h.elements,domReference:m},w={...h,...i,refs:y,elements:b,nodeId:t.computed((()=>t.toValue(a)))};return t.watchEffect((()=>{i.dataRef.value.floatingContext=w;const e=null==g?void 0:g.nodesRef.value.find((e=>e.id===t.toValue(a)));e&&(e.context=w)})),{...h,context:w,refs:y,elements:b}},e.useFloatingNodeId=function(e){const n=Oe(),l=Fe(),o=De.use(),u=t.computed((()=>e||(null==o?void 0:o.id)||null));let a=!1,r=null;return t.watch(n,(()=>{n.value&&!a&&(r={id:n.value,parentId:u.value},null==l||l.addNode(r),a=!0)}),{immediate:!0}),t.onUnmounted((()=>{r&&(null==l||l.removeNode(r))})),n},e.useFloatingParentNodeId=Ne,e.useFloatingPortalNode=ct,e.useFloatingRootContext=Ft,e.useFloatingTree=Fe,e.useFocus=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,events:u,dataRef:a,elements:r}=e,{enabled:i=!0,visibleOnly:v=!0}=n,s=t.ref(!1),d=t.ref(-1),p=t.ref(!0);let g;if(t.watch([r.domReference,l],(()=>{if(null==g||g(),g=void 0,!i)return;const e=c(r.domReference.value);function t(){!l.value&&m(r.domReference.value)&&r.domReference.value===D(K(r.domReference.value))&&(s.value=!0)}function n(){p.value=!0}function o(){p.value=!1}e.addEventListener("blur",t),Vt()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",o,!0)),g=()=>{e.removeEventListener("blur",t),Vt()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",o,!0))}}),{immediate:!0}),i){const e=e=>{let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(s.value=!0)};u.on("openchange",e),t.onUnmounted((()=>{u.off("openchange",e)}))}return t.onUnmounted((()=>{null==g||g(),Ue(d)})),i?{reference:{onMouseLeave(){s.value=!1},onFocus(e){if(s.value)return;const t=N(e);if(v&&f(t))if(Vt()&&!e.relatedTarget){if(!p.value&&!_(t))return}else if(!W(t))return;o(!0,e,"focus")},onBlur(e){s.value=!1;const t=e.relatedTarget,n=e,l=f(t)&&t.hasAttribute(_e("focus-guard"))&&"outside"===t.getAttribute("data-type");d.value=window.setTimeout((()=>{var e;const u=D(r.domReference.value?r.domReference.value.ownerDocument:document);(t||u!==r.domReference.value)&&(S(null==(e=a.value.floatingContext)?void 0:e.refs.floating.value,u)||S(r.domReference.value,u)||l||o(!1,n,"focus"))}))}}}:{}},e.useHover=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,dataRef:u,events:a,elements:r}=e,{enabled:i=!0,delay:v=0,handleClose:s=null,mouseOnly:c=!1,restMs:d=0,move:m=!0}=n,p=Fe(),g=Ne(),h=$(s),y=$(v),b=$(d),w=t.ref(void 0),x=t.ref(-1),I=t.ref(void 0),R=t.ref(-1),E=t.ref(!1),k=t.ref(!1),C=t.ref((()=>{})),T=t.ref(!1),P=Z((()=>{var e;const t=null==(e=u.value.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}));if(i){function _(e){let{open:t}=e;t||(Ue(x),Ue(R),E.value=!0,T.value=!1)}a.on("openchange",_),t.onUnmounted((()=>{a.off("openchange",_)}))}let M;t.watch([l,r.floating],(()=>{if(null==M||M(),M=void 0,!i)return;if(!h.value)return;if(!l.value)return;function e(e){P()&&o(!1,e,"hover")}const t=K(r.floating.value).documentElement;t.addEventListener("mouseleave",e),M=()=>{t.removeEventListener("mouseleave",e)}}),{immediate:!0});const O=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const l=He(y.value,"close",w.value);l&&!I.value?(Ue(x),x.value=window.setTimeout((()=>o(!1,e,n)),l)):t&&(Ue(x),o(!1,e,n))},L=Z((()=>{C.value(),I.value=void 0})),A=Z((()=>{if(k.value){const e=K(r.floating.value).body;e.style.pointerEvents="",e.removeAttribute(We),k.value=!1}})),D=Z((()=>!!u.value.openEvent&&["click","mousedown"].includes(u.value.openEvent.type)));let N,F;function V(e){w.value=e.pointerType}return t.watch([l,r.domReference,r.floating],(()=>{if(null==N||N(),N=void 0,i&&f(r.domReference.value)){const o=r.domReference.value,u=r.floating.value;l.value&&o.addEventListener("mouseleave",n),m&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),u&&(u.addEventListener("mouseleave",n),u.addEventListener("mouseenter",a),u.addEventListener("mouseleave",v)),N=()=>{l.value&&o.removeEventListener("mouseleave",n),m&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),u&&(u.removeEventListener("mouseleave",n),u.removeEventListener("mouseenter",a),u.removeEventListener("mouseleave",v))}}function e(e){if(Ue(x),E.value=!1,c&&!z(w.value)||qe(b.value)>0&&!He(y.value,"open"))return;const t=He(y.value,"open",w.value);t?x.value=window.setTimeout((()=>{l.value||o(!0,e,"hover")}),t):l.value||o(!0,e,"hover")}function t(e){if(D())return void A();C.value();const t=K(r.floating.value);if(Ue(R),T.value=!1,h.value&&u.value.floatingContext){l.value||Ue(x),I.value=h.value({...u.value.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),L(),D()||O(e,!0,"safe-polygon")}});const n=I.value;return t.addEventListener("mousemove",n),void(C.value=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.value||!S(r.floating.value,e.relatedTarget))&&O(e)}function n(e){D()||u.value.floatingContext&&(null==h.value||h.value({...u.value.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),L(),D()||O(e)}})(e))}function a(){Ue(x)}function v(e){D()||O(e,!1)}}),{immediate:!0}),t.watch([l,r.domReference,r.floating],(()=>{var e;if(null==F||F(),F=void 0,i&&l.value&&null!=(e=h.value)&&null!=(e=e.__options)&&e.blockPointerEvents&&P()){k.value=!0;const e=r.floating.value;if(f(r.domReference.value)&&e){var t;const n=K(r.floating.value).body;n.setAttribute(We,"");const l=r.domReference.value,o=null==p||null==(t=p.nodesRef.value.find((e=>e.id===g)))||null==(t=t.context)?void 0:t.elements.floating;null!=o&&o.value&&(o.value.style.pointerEvents=""),n.style.pointerEvents="none",l.style.pointerEvents="auto",e.style.pointerEvents="auto",F=()=>{n.style.pointerEvents="",l.style.pointerEvents="",e.style.pointerEvents=""}}}}),{immediate:!0}),t.watch(l,(()=>{l.value||(w.value=void 0,T.value=!1,L(),A())})),t.onUnmounted((()=>{null==M||M(),null==N||N(),null==F||F(),L(),Ue(x),Ue(R),A()})),i?{reference:{onPointerDown:V,onPointerEnter:V,onMouseMove(e){function t(){E.value||l.value||o(!0,e,"hover")}c&&!z(w.value)||l.value||0===qe(b.value)||T.value&&e.movementX**2+e.movementY**2<2||(Ue(R),"touch"===w.value?t():(T.value=!0,R.value=window.setTimeout(t,qe(b.value))))}}}:{}},e.useId=Oe,e.useInnerOffset=function(e,n){const{open:l,elements:o}=e,{enabled:u=!0,overflowRef:a,scrollRef:r,onChange:i}=n,v=i,s=t.ref(!1),c=t.ref(null),d=t.ref(null);let f;return t.watch([l,o.floating],(()=>{if(null==f||f(),f=void 0,!u)return;const e=(null==r?void 0:r.value)||o.floating.value;function t(t){if(t.ctrlKey||!e||null==a.value)return;const n=t.deltaY,l=a.value.top>=-.5,o=a.value.bottom>=-.5,u=e.scrollHeight-e.clientHeight,r=n<0?-1:1,i=n<0?"max":"min";e.scrollHeight<=e.clientHeight||(!l&&n>0||!o&&n<0?(t.preventDefault(),v((e=>e+Math[i](n,u*r)))):/firefox/i.test(x())&&(e.scrollTop+=n))}l.value&&e&&(e.addEventListener("wheel",t),requestAnimationFrame((()=>{c.value=e.scrollTop,null!=a.value&&(d.value={...a.value})})),f=()=>{c.value=null,d.value=null,e.removeEventListener("wheel",t)})})),u?{floating:{onKeyDown(){s.value=!0},onWheel(){s.value=!1},onPointerMove(){s.value=!1},onScroll(){const e=(null==r?void 0:r.value)||o.floating.value;if(a.value&&e&&s.value){if(null!==c.value){const t=e.scrollTop-c.value;(a.value.bottom<-.5&&t<-1||a.value.top<-.5&&t>1)&&v((e=>e+t))}requestAnimationFrame((()=>{c.value=e.scrollTop}))}}}}:{}},e.useInteractions=function(e){return void 0===e&&(e=[]),{getReferenceProps:t=>Kt(t,e,"reference"),getFloatingProps:t=>Kt(t,e,"floating"),getItemProps:t=>Kt(t,e,"item")}},e.useLatestRef=$,e.useListItem=xe,e.useListNavigation=function(e,n){var l;const{open:o,onOpenChange:u,elements:a,floatingId:r}=e,{listRef:i,activeIndex:v,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loop:p=!1,nested:g=!1,rtl:h=!1,virtual:y=!1,focusItemOnOpen:b="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:x=!0,disabledIndices:I,orientation:R="vertical",parentOrientation:E,cols:k=1,grid:C=null,scrollItemIntoView:T=!0,virtualItemRef:P,itemSizes:L,dense:N=!1}=n,F=t.computed((()=>H(a.floating.value))),V=Ne(),_=Fe();e.dataRef.value.orientation=R;const W=Z((()=>{s(-1===z.value?null:z.value)})),q=t.computed((()=>U(a.domReference.value))),B=t.ref(b),z=t.ref(null!=(l=t.toValue(d))?l:-1),J=t.ref(null),ie=t.ref(!0),ve=t.ref(W),se=t.ref(!!a.floating.value),ce=t.ref(o.value),de=t.ref(!1),fe=t.ref(!1),me=$(I),pe=$(T),ge=t.computed((()=>t.toValue(d))),he=t.ref(void 0),ye=t.ref(void 0),be=Z((()=>{function e(e){var t;y?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=r.value+"-"+Math.random().toString(16).slice(2,10)),he.value=e.id,null==_||_.events.emit("virtualfocus",e),P&&(P.value=e)):Ze(e,{sync:de.value,preventScroll:!0})}const t=i.value[z.value],n=fe.value;t&&e(t);(de.value?e=>e():requestAnimationFrame)((()=>{const l=i.value[z.value]||t;if(!l)return;t||e(l);const o=pe.value;o&&xe&&(n||!ie.value)&&(null==l.scrollIntoView||l.scrollIntoView("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))}))}));if(t.watch((()=>[o.value,a.floating.value,t.toValue(d)]),(()=>{c&&(o.value&&a.floating.value?B.value&&null!=t.toValue(d)&&(fe.value=!0,z.value=t.toValue(d),W()):se.value&&(z.value=-1,ve.value()))})),t.watch((()=>[o.value,a.floating.value,t.toValue(v)]),(()=>{if(!c)return;if(!o.value)return;if(!a.floating.value)return;const e=t.toValue(v);if(null==e){if(de.value=!1,null!=ge.value)return;if(se.value&&(z.value=-1,be()),(!ce.value||!se.value)&&B.value&&(null!=J.value||!0===B.value&&null==J.value)){let e=0;const n=()=>{if(null==i.value[0]){if(e++,e<=3){(1===e?queueMicrotask:2===e?t.nextTick:requestAnimationFrame)(n)}}else z.value=null==J.value||Wt(J.value,R,h)||g?ee(i):te(i),J.value=null,W()};n()}}else if(Q(i,e)){if(null!=e){z.value=e;let t=0;const n=()=>{Q(i,z.value)?t<2&&(t++,queueMicrotask(n)):(be(),fe.value=!1)};queueMicrotask(n)}}else z.value=e,be(),fe.value=!1})),t.watch([a.floating,o],(()=>{var e;if(!c||a.floating.value||!_||y||!se.value)return;const t=_.nodesRef.value,n=null==(e=t.find((e=>e.id===V)))||null==(e=e.context)?void 0:e.elements.floating,l=D(K(a.floating.value)),o=t.some((e=>e.context&&S(e.context.elements.floating.value,l)));null!=n&&n.value&&!o&&ie.value&&n.value.focus({preventScroll:!0})})),c&&_&&y&&!V){function Pe(e){ye.value=e.id,P&&(P.value=e)}_.events.on("virtualfocus",Pe),t.onUnmounted((()=>{_.events.off("virtualfocus",Pe)}))}t.watch([o,a.floating],(()=>{ve.value=W,ce.value=o.value,se.value=!!a.floating.value}),{immediate:!0,flush:"post"}),t.watch(o,(()=>{o.value||(J.value=null,B.value=b)}));const we=t.computed((()=>null!=t.toValue(v))),xe={onFocus(e){de.value=!0,Ie(e.currentTarget)},onClick(e){var t;null==(t=e.currentTarget)||t.focus({preventScroll:!0})},onMouseMove(e){de.value=!0,fe.value=!1,w&&Ie(e.currentTarget)},onPointerLeave(e){var t;ie.value&&"touch"!==e.pointerType&&(de.value=!0,w&&(z.value=-1,W(),y||null==(t=F.value)||t.focus({preventScroll:!0})))}};function Ie(e){if(!o.value)return;const n=i.value.indexOf(e);-1===n||z.value===n&&t.toValue(v)===n||(z.value=n,W())}const Re=()=>{var e;return null!=E?E:null==_||null==(e=_.nodesRef.value.find((e=>e.id===V)))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.value.orientation},Ee=Z((e=>{if(ie.value=!1,de.value=!0,229===e.which)return;if(!(o.value||e.currentTarget!==F.value||"Escape"===e.key&&g))return;if(g&&qt(e.key,R,h,k)){if(Ut(e.key,Re())||G(e),u(!1,e,"list-navigation"),m(a.domReference.value))if(y)null==_||_.events.emit("virtualfocus",a.domReference.value);else if(a.domReference.value.focus(),Ut(e.key,Re())){const t=new KeyboardEvent(e.type,{key:e.key,code:e.code,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!0,cancelable:!0});a.domReference.value.dispatchEvent(t)}return}const n=z.value,l=ee(i,I),r=te(i,I);if(q.value||("Home"===e.key&&(G(e),z.value=l,W()),"End"===e.key&&(G(e),z.value=r,W())),C){const t=C(e,z.value,i,R,p,h,I,l,r);if(null!=t&&(z.value=t,W()),"both"===R)return}else if(k>1){const n=L||Array.from({length:i.value.length},(()=>({width:1,height:1}))),o=oe(n,k,N),u=o.findIndex((e=>null!=e&&!re(i,e,I))),a=o.reduce(((e,t,n)=>null==t||re(i,t,I)?e:n),-1),v=o[le(t.ref(o.map((e=>null!=e?i.value[e]:null))),{event:e,orientation:R,loop:p,rtl:h,cols:k,disabledIndices:ae([...("function"!=typeof I?I:null)||i.value.map(((e,t)=>re(i,t,I)?t:void 0)),void 0],o),minIndex:u,maxIndex:a,prevIndex:ue(z.value>r?l:z.value,n,o,k,e.key===A?"bl":e.key===(h?M:O)?"tr":"tl"),stopEvent:!0})];if(null!=v&&(z.value=v,W()),"both"===R)return}if(Ut(e.key,R)){var v,s;if(G(e),o.value&&!y&&D(null!=(v=null==(s=e.currentTarget)?void 0:s.ownerDocument)?v:document)===e.currentTarget)return z.value=Wt(e.key,R,h)?l:r,void W();Wt(e.key,R,h)?z.value=p?n>=r?f&&n!==i.value.length?-1:l:ne(i,{startingIndex:n,disabledIndices:I}):Math.min(r,ne(i,{startingIndex:n,disabledIndices:I})):z.value=p?n<=l?f&&-1!==n?i.value.length:r:ne(i,{startingIndex:n,decrement:!0,disabledIndices:I}):Math.max(l,ne(i,{startingIndex:n,decrement:!0,disabledIndices:I})),Q(i,z.value)&&(z.value=-1),W()}})),ke=t.computed((()=>y&&o.value&&we.value&&{"aria-activedescendant":ye.value||he.value})),Ce=t.computed((()=>({"aria-orientation":"both"===R?void 0:R,...q.value?{}:ke.value,onKeyDown:Ee,onPointerMove(){ie.value=!0}}))),Te=t.computed((()=>{function e(e){"auto"===b&&X(e)&&(B.value=!0)}function n(e){B.value=b,"auto"===b&&Y(e)&&(B.value=!0)}return{...ke.value,onKeyDown(e){ie.value=!1;const n=e.key.startsWith("Arrow"),l=["Home","End"].includes(e.key),a=n||l,r=Ht(e.key,R,h),v=qt(e.key,R,h,k),s=Ht(e.key,Re(),h),c=Ut(e.key,R),f=(g?s:c)||"Enter"===e.key||""===e.key.trim();if(y&&o.value){const t=null==_?void 0:_.nodesRef.value.find((e=>null==e.parentId)),n=_&&t?j(_.nodesRef.value,t.id):null;if(a&&n&&P){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(r||v){var m,p;const l=(null==(m=n.context)?void 0:m.elements.domReference.value)===e.currentTarget,o=v&&!l?null==(p=n.context)?void 0:p.elements.domReference.value:r?i.value.find((e=>(null==e?void 0:e.id)===he.value)):null;o&&(G(e),o.dispatchEvent(t),ye.value=void 0)}var b;if((c||l)&&n.context)if(n.context.open.value&&n.parentId&&e.currentTarget!==n.context.elements.domReference.value)return G(e),void(null==(b=n.context.elements.domReference.value)||b.dispatchEvent(t))}return Ee(e)}if(o.value||x||!n){if(f){const t=Ut(e.key,Re());J.value=g&&t?null:e.key}if(g)s&&(G(e),o.value?(z.value=ee(i,me.value),W()):u(!0,e,"list-navigation"));else if(c){null!=t.toValue(d)&&(z.value=t.toValue(d)),G(e);const n=o.value;!o.value&&x?u(!0,e,"list-navigation"):Ee(e),n&&W()}}},onFocus(){o.value&&!y&&(z.value=-1,W())},onPointerDown:n,onPointerEnter:n,onMouseDown:e,onClick:e}}));return c?{reference:Te,floating:Ce,item:xe}:{}},e.useMergeRefs=he,e.useNextDelayGroup=function(e,n){void 0===n&&(n={});const{open:l,onOpenChange:o,floatingId:u}=e,{enabled:a=!0}=n,r=Ye.use(),{currentIdRef:i,delayRef:v,timeoutMs:s,initialDelayRef:c,currentContextRef:d,hasProvider:f,timeoutIdRef:m}=r,p=t.ref(!1);function g(e){p.value=e}return t.watch((()=>[a,l.value,i.value,s]),(()=>{function e(){var e;p.value=!1,null==(e=d.value)||e.setIsInstantPhase(!1),i.value=null,d.value=null,v.value=c.value}if(a&&i.value&&!l.value&&i.value===u.value){if(p.value=!1,s)return m.value=window.setTimeout(e,s),void t.onWatcherCleanup((()=>{clearTimeout(m.value)}));e()}})),t.watch((()=>[a,l.value,u.value]),(()=>{if(!a)return;if(!l.value)return;const e=d.value,t=i.value;d.value={onOpenChange:o,setIsInstantPhase:g},i.value=u.value,v.value={open:0,close:He(c.value,"close")},null!==t&&t!==u.value?(Ue(m),p.value=!0,null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(p.value=!1,null==e||e.setIsInstantPhase(!1))})),t.onUnmounted((()=>{d.value=null})),{hasProvider:f,delayRef:v,isInstantPhase:p}},e.useRole=function(e,n){var l;void 0===n&&(n={});const{open:o,elements:u,floatingId:a}=e,{enabled:r=!0,role:i="dialog"}=n,v=Oe(),s=t.computed((()=>{var e;return(null==(e=u.domReference.value)?void 0:e.id)||v.value})),c=t.computed((()=>{var e;return(null==(e=H(u.floating.value))?void 0:e.id)||a.value})),d=null!=(l=jt.get(i))?l:i,f=null!=Ne(),m=t.computed((()=>"tooltip"===d||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:o.value?c.value:void 0}:{"aria-expanded":o.value?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":o.value?c.value:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:s.value},..."menu"===d&&f&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}})),p=t.computed((()=>{const e={id:c.value,...d&&{role:d}};return"tooltip"===d||"label"===i?e:{...e,..."menu"===d&&{"aria-labelledby":s.value}}}));return r?{reference:m,floating:p,item:e=>{let{active:t,selected:n}=e;const l={role:"option",...t&&{id:c.value+"-fui-option"}};switch(i){case"select":case"combobox":return{...l,"aria-selected":n}}return{}}}:{}},e.useTransitionStatus=Xt,e.useTransitionStyles=function(e,n){void 0===n&&(n={});const{initial:l={opacity:0},open:o,close:u,common:a,duration:r=250}=n,i="number"==typeof r,v=(i?r:r.open)||0,s=(i?r:r.close)||0,c=e.placement.value,d={side:c.split("-")[0],placement:c},f=t.ref({...Gt(a,d),...Gt(l,d)}),{isMounted:m,status:p}=Xt(e,{duration:r}),g=$(l),h=$(o),y=$(u),b=$(a);return t.watch([p,c],(()=>{const t=e.placement.value,n={side:t.split("-")[0],placement:t},l=Gt(g.value,n),o=Gt(y.value,n),u=Gt(b.value,n),a=Gt(h.value,n)||Object.keys(l).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===p.value&&(f.value={transitionProperty:f.value.transitionProperty,...u,...l}),"open"===p.value&&(f.value={transitionProperty:Object.keys(a).map(Bt).join(","),transitionDuration:v+"ms",...u,...a}),"close"===p.value){const e=o||l;f.value={transitionProperty:Object.keys(e).map(Bt).join(","),transitionDuration:s+"ms",...u,...e}}}),{immediate:!0}),{isMounted:m,styles:f}},e.useTypeahead=function(e,n){var l,o;const{open:u,dataRef:a}=e,{listRef:r,activeIndex:i,onMatch:v,onTypingChange:s,enabled:c=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:m=[],selectedIndex:p=null}=n,g=t.ref(-1),h=t.ref(""),y=t.ref(null!=(l=null!=(o=t.toValue(p))?o:t.toValue(i))?l:-1),b=t.ref(null),w=Z(v),x=Z(s),I=$(d),R=$(m);t.watch(u,(()=>{u.value&&(Ue(g),b.value=null,h.value="")})),t.watch((()=>[u.value,t.toValue(p),t.toValue(i)]),(()=>{var e,n;u.value&&""===h.value&&(y.value=null!=(e=null!=(n=t.toValue(p))?n:t.toValue(i))?e:-1)}));const E=Z((e=>{e?a.value.typing||(a.value.typing=e,x(e)):a.value.typing&&(a.value.typing=e,x(e))})),k=Z((e=>{function t(e,t,n){const l=I.value?I.value(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return l?e.indexOf(l):-1}const n=r.value;if(h.value.length>0&&" "!==h.value[0]&&(-1===t(n,n,h.value)?E(!1):" "===e.key&&G(e)),null==n||R.value.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;u.value&&" "!==e.key&&(G(e),E(!0));n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.value===e.key&&(h.value="",y.value=b.value),h.value+=e.key,Ue(g),g.value=window.setTimeout((()=>{h.value="",y.value=b.value,E(!1)}),f);const l=y.value,o=t(n,[...n.slice((l||0)+1),...n.slice(0,(l||0)+1)],h.value);-1!==o?(w(o),b.value=o):" "!==e.key&&(h.value="",E(!1))}));return t.onUnmounted((()=>{Ue(g)})),c?{reference:{onKeyDown:k},floating:{onKeyDown:k,onKeyUp(e){" "===e.key&&E(!1)}}}:{}}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actview/floating-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Floating UI for ActView",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -53,7 +53,7 @@
53
53
  "actview"
54
54
  ],
55
55
  "dependencies": {
56
- "@actview/core": "1.1.0",
56
+ "@actview/core": "1.3.0",
57
57
  "@actview/jsx": "1.1.0",
58
58
  "tabbable": "^6.0.0",
59
59
  "@floating-ui/dom": "^1.8.0",
@@ -67,7 +67,7 @@
67
67
  "@types/node": "^20.10.6",
68
68
  "resize-observer-polyfill": "^1.5.1",
69
69
  "vitest": "^4.1.9",
70
- "@actview/plugin-babel": "1.0.7",
70
+ "@actview/plugin-babel": "2.0.0",
71
71
  "config": "0.0.0"
72
72
  },
73
73
  "scripts": {