Socket
Socket
Sign inDemoInstall

@floating-ui/react

Package Overview
Dependencies
12
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.24.6 to 0.24.7

2

dist/floating-ui.react.esm.min.js

@@ -1,1 +0,1 @@

import{platform as e,getOverflowAncestors as t,useFloating as n,offset as r,detectOverflow as o}from"@floating-ui/react-dom";export{arrow,autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/react-dom";import*as u from"react";import{useLayoutEffect as i,useEffect as c,useRef as l}from"react";import{supportsInert as s,hideOthers as a,suppressOthers as f}from"aria-hidden";import{tabbable as d}from"tabbable";import{createPortal as m,flushSync as v}from"react-dom";function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}var g="undefined"!=typeof document?i:c;let h=!1,b=0;const y=()=>"floating-ui-"+b++;const E=u["useId".toString()]||function(){const[e,t]=u.useState((()=>h?y():void 0));return g((()=>{null==e&&t(y())}),[]),u.useEffect((()=>{h||(h=!0)}),[]),e},w=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...g}={},...h}=t;const b=E();if(!o)return null;a*=2;const y=a/2,w=c/2*(s/-8+1),R=l/2*s/4,[x,I]=r.split("-"),k=e.isRTL(o),C=!!m,M="top"===x||"bottom"===x,T=f&&"end"===I?"bottom":"top";let O=f&&"end"===I?"right":"left";f&&k&&(O="end"===I?"left":"right");const P=null!=(null==i?void 0:i.x)?f||i.x:"",L=null!=(null==i?void 0:i.y)?f||i.y:"",S=m||"M0,0 H"+c+" L"+(c-w)+","+(l-R)+" Q"+c/2+","+l+" "+w+","+(l-R)+" Z",A={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",p({},h,{"aria-hidden":!0,ref:n,width:C?c:c+a,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[O]:P,[T]:L,[x]:M||C?"100%":"calc(100% - "+a/2+"px)",transform:""+A+(null!=v?v:""),...g}}),a>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:d,strokeWidth:a+(m?0:1),d:S}),u.createElement("path",{stroke:a&&!m?h.fill:"none",d:S}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-y,y:y*(C?-1:1),width:c+a,height:c})))}));function R(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const x=u.createContext(null),I=u.createContext(null),k=()=>{var e;return(null==(e=u.useContext(x))?void 0:e.id)||null},C=()=>u.useContext(I);function M(e){const t=E(),n=C(),r=k(),o=e||r;return g((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function T(e){let{children:t,id:n}=e;const r=k();return u.createElement(x.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function O(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>R()))[0];return u.createElement(I.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)}function P(e){return(null==e?void 0:e.ownerDocument)||document}function L(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function S(){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 A(e){return P(e).defaultView||window}function D(e){return!!e&&e instanceof A(e).Element}function N(e){return!!e&&e instanceof A(e).HTMLElement}function F(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(L())||t.test(S()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function K(e){return 0===e.width&&0===e.height||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}function B(){return/apple/i.test(navigator.vendor)}function H(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function _(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof A(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function j(e){return"data-floating-ui-"+e}function q(e){const t=l(e);return g((()=>{t.current=e})),t}const W=j("safe-polygon");function V(e,t,n){return n&&!H(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function X(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:v=0,move:p=!0}=t,h=C(),b=k(),y=q(d),E=q(f),w=u.useRef(),R=u.useRef(),x=u.useRef(),I=u.useRef(),M=u.useRef(!0),T=u.useRef(!1),O=u.useRef((()=>{})),L=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(R.current),clearTimeout(I.current),M.current=!0}}),[a,i]),u.useEffect((()=>{if(!a||!y.current||!n)return;function e(e){L()&&r(!1,e)}const t=P(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,y,o,L]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=V(E.current,"close",w.current);n&&!x.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(R.current),r(!1,e))}),[E,r]),A=u.useCallback((()=>{O.current(),x.current=void 0}),[]),N=u.useCallback((()=>{if(T.current){const e=P(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(W),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&D(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),p&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),p&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),M.current=!1,m&&!H(w.current)||v>0&&0===V(E.current,"open"))return;const t=V(E.current,"open",w.current);t?R.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;O.current();const o=P(l);if(clearTimeout(I.current),y.current){n||clearTimeout(R.current),x.current=y.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),A(),S(r)}});const t=x.current;return o.addEventListener("mousemove",t),void(O.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==w.current||!_(l,r.relatedTarget))&&S(r)}function s(n){t()||null==y.current||y.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n)}})(n)}}),[c,l,a,e,m,v,p,S,A,N,r,n,h,E,y,o]),g((()=>{var e;if(a&&n&&null!=(e=y.current)&&e.__options.blockPointerEvents&&L()){const e=P(l).body;if(e.setAttribute(W,""),e.style.pointerEvents="none",T.current=!0,D(c)&&l){var t,r;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===b)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,b,l,c,h,y,o,L]),g((()=>{n||(w.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(I.current),N()}),[a,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){w.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(I.current),I.current=setTimeout((()=>{M.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[i,a,v,n,r,S])}const Y=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),U=()=>u.useContext(Y),z=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return g((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(Y.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,i,l])},t)},Z=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:c,setState:l,timeoutMs:s}=U();g((()=>{u&&(l({delay:{open:1,close:V(c,"close")}}),u!==o&&r(!1))}),[o,r,l,u,c]),g((()=>{function e(){r(!1),l({delay:c,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,c,s]),g((()=>{n&&i(o)}),[n,i,o])};function G(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let Q=0;function J(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Q);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Q=requestAnimationFrame(u)}function $(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function ee(e){return"composedPath"in e?e.composedPath()[0]:e.target}const te="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ne(e){return N(e)&&e.matches(te)}function re(e){e.preventDefault(),e.stopPropagation()}const oe=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ue(e,t){const n=d(e,oe());"prev"===t&&n.reverse();const r=n.indexOf(G(P(e)));return n.slice(r+1)[0]}function ie(){return ue(document.body,"next")}function ce(){return ue(document.body,"prev")}function le(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_(n,r)}function se(e){d(e,oe()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ae(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const fe={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};function de(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const me=u.forwardRef((function(e,t){const[n,r]=u.useState();g((()=>(B()&&r("button"),document.addEventListener("keydown",de),()=>{document.removeEventListener("keydown",de)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[j("focus-guard")]:"",style:fe};return u.createElement("span",p({},e,o))})),ve=u.createContext(null);function pe(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=E(),c=he(),l=u.useMemo((()=>({id:t,root:n,portalContext:c,uniqueId:i})),[t,n,c,i]),s=u.useRef();return g((()=>()=>{null==r||r.remove()}),[r,l]),g((()=>{if(s.current===l)return;s.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,i=j("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!D(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[l]),r}function ge(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=pe({id:n,root:r}),[c,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=!!c&&!c.modal&&c.open&&o&&!(!r&&!i);return u.useEffect((()=>{if(i&&o&&(null==c||!c.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){if(i&&le(e)){("focusin"===e.type?ae:se)(i)}}}),[i,o,null==c?void 0:c.modal]),u.createElement(ve.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:f,afterInsideRef:d,portalNode:i,setFocusManagerState:l})),[o,i])},v&&i&&u.createElement(me,{"data-type":"outside",ref:s,onFocus:e=>{if(le(e,i)){var t;null==(t=f.current)||t.focus()}else{const e=ce()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),v&&i&&u.createElement("span",{"aria-owns":i.id,style:fe}),i&&m(t,i),v&&i&&u.createElement(me,{"data-type":"outside",ref:a,onFocus:e=>{if(le(e,i)){var t;null==(t=d.current)||t.focus()}else{const t=ie()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const he=()=>u.useContext(ve),be=u.forwardRef((function(e,t){return u.createElement("button",p({},e,{type:"button",ref:t,tabIndex:-1,style:fe}))}));function ye(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:c=!0,modal:l=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0}=e,{open:p,refs:h,nodeId:b,onOpenChange:y,events:E,dataRef:w,elements:{domReference:R,floating:x}}=t,I=!s()||o,k=q(r),M=q(i),T=q(c),O=C(),L=he(),S="number"==typeof i&&i<0,A=u.useRef(null),D=u.useRef(null),F=u.useRef(!1),K=u.useRef(null),B=u.useRef(!1),H=null!=L,W=R&&"combobox"===R.getAttribute("role")&&ne(R),V=u.useCallback((function(e){return void 0===e&&(e=x),e?d(e,oe()):[]}),[x]),X=u.useCallback((e=>{const t=V(e);return k.current.map((e=>R&&"reference"===e?R:x&&"floating"===e?x:t)).filter(Boolean).flat()}),[R,x,k,V]);function Y(e){return m&&l?u.createElement(be,{ref:"start"===e?A:D,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof m?m:"Dismiss"):null}u.useEffect((()=>{if(!l)return;function e(e){if("Tab"===e.key){_(x,G(P(x)))&&0===V().length&&!W&&re(e);const t=X(),n=ee(e);"reference"===k.current[0]&&n===R&&(re(e),e.shiftKey?J(t[t.length-1]):J(t[1])),"floating"===k.current[1]&&n===x&&e.shiftKey&&(re(e),J(t[0]))}}const t=P(x);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[R,x,l,k,h,W,V,X]),u.useEffect((()=>{if(v)return x&&N(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!l&&x.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!l&&x.removeEventListener("focusout",t)}):void 0;function e(){B.current=!0,setTimeout((()=>{B.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(_(R,t)||_(x,t)||_(t,x)||_(null==L?void 0:L.portalNode,t)||null!=t&&t.hasAttribute(j("focus-guard"))||O&&($(O.nodesRef.current,b).find((e=>{var n,r;return _(null==(n=e.context)?void 0:n.elements.floating,t)||_(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],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&&(r=r.concat(t))}return r}(O.nodesRef.current,b).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!B.current&&t!==K.current&&(F.current=!0,y(!1,e))}))}}),[R,x,l,b,O,L,y,v]),u.useEffect((()=>{var e;const t=Array.from((null==L||null==(e=L.portalNode)?void 0:e.querySelectorAll("["+j("portal")+"]"))||[]);if(x&&l){const e=[x,...t,A.current,D.current].filter((e=>null!=e)),n=(I?a:f)(k.current.includes("reference")||W?e.concat(R||[]):e,void 0,j("inert"));return()=>{n()}}}),[R,x,l,k,L,W,I]),g((()=>{if(!x)return;const e=G(P(x));queueMicrotask((()=>{const t=X(x),n=M.current,r=("number"==typeof n?t[n]:n.current)||x,o=_(x,e);S||o||!p||J(r,{preventScroll:r===x})}))}),[p,x,S,X,M]),g((()=>{if(!x)return;let e=!1;const t=P(x),n=G(t),r=w.current;function o(t){if("escapeKey"===t.type&&h.domReference.current&&(K.current=h.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(F.current=!1,e=n.preventScroll):F.current=!n}return K.current=n,E.on("dismiss",o),()=>{E.off("dismiss",o);const n=G(t);(_(x,n)||O&&$(O.nodesRef.current,b).some((e=>{var t;return _(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&h.domReference.current&&(K.current=h.domReference.current),T.current&&N(K.current)&&!F.current&&J(K.current,{cancelPrevious:!1,preventScroll:e})}}),[x,T,w,h,E,O,b]),g((()=>{if(L)return L.setFocusManagerState({...t,modal:l,closeOnFocusOut:v,open:p}),()=>{L.setFocusManagerState(null)}}),[L,l,p,v,t]),g((()=>{if(x&&"function"==typeof MutationObserver){const e=()=>{const e=x.getAttribute("tabindex");k.current.includes("floating")||G(P(x))!==h.domReference.current&&0===V().length?"0"!==e&&x.setAttribute("tabindex","0"):"-1"!==e&&x.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(x,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[x,h,k,V]);const U=I&&!W&&(H||l);return u.createElement(u.Fragment,null,U&&u.createElement(me,{"data-type":"inside",ref:null==L?void 0:L.beforeInsideRef,onFocus:e=>{if(l){const e=X();J("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(F.current=!1,le(e,L.portalNode)){const e=ie()||R;null==e||e.focus()}else{var t;null==(t=L.beforeOutsideRef.current)||t.focus()}}}),!W&&Y("start"),n,Y("end"),U&&u.createElement(me,{"data-type":"inside",ref:null==L?void 0:L.afterInsideRef,onFocus:e=>{if(l)J(X()[0]);else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(v&&(F.current=!0),le(e,L.portalNode)){const e=ce()||R;null==e||e.focus()}else{var t;null==(t=L.afterOutsideRef.current)||t.focus()}}}))}function Ee(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 we=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Re(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return g((()=>{const e=new Map(o);Array.from(e.keys()).sort(Ee).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(we.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function xe(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:c,map:l,elementsRef:s,labelsRef:a}=u.useContext(we),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return g((()=>{const e=o.current;if(e)return i(e),()=>{c(e)}}),[i,c]),g((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}const Ie=j("scroll-lock"),ke=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return g((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ie))return;document.body.setAttribute(Ie,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(L()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ie),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ie),window.scrollTo(c,l)}}),[n]),u.createElement("div",p({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ce(e){return N(e.target)&&"BUTTON"===e.target.tagName}function Me(e){return ne(e)}function Te(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(H(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:H(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Ce(e)||(" "!==e.key||Me(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||Ce(e)||Me(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])}const Oe=u["useInsertionEffect".toString()]||(e=>e());function Pe(e){const t=u.useRef((()=>{}));return Oe((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function Le(e){return null!=e&&null!=e.clientX}function Se(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:s=null,y:a=null}=t,f=u.useRef(!1),d=u.useRef(null),[m,v]=u.useState(),[p,h]=u.useState([]),b=Pe(((e,t)=>{f.current||o.current.openEvent&&!Le(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,v=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:v,top:v,right:m+f,bottom:v+d,left:m}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:m}))})),y=Pe((e=>{null==s&&null==a&&(n?d.current||h([]):b(e.clientX,e.clientY))})),E=H(m)?i:n,w=u.useCallback((()=>{if(!E||!c||null!=s||null!=a)return;const e=A(r.floating.current);function t(n){const o=ee(n);_(r.floating.current,o)?(e.removeEventListener("mousemove",t),d.current=null):b(n.clientX,n.clientY)}if(!o.current.openEvent||Le(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,E,r,b,s,a]);return u.useEffect((()=>w()),[w,p]),u.useEffect((()=>{c&&!i&&(f.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(f.current=!0)}),[c,n]),g((()=>{!c||null==s&&null==a||(f.current=!1,b(s,a))}),[c,s,a,b]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}}}),[c,y])}function Ae(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)}const De={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ne={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function Fe(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:v=!0,outsidePressEvent:p="pointerdown",referencePress:g=!1,referencePressEvent:h="pointerdown",ancestorScroll:b=!1,bubbles:y}=n,E=C(),w=null!=k(),R=Pe("function"==typeof v?v:()=>!1),x="function"==typeof v?R:v,I=u.useRef(!1),{escapeKeyBubbles:M,outsidePressBubbles:T}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(y),O=Pe((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=E?$(E.nodesRef.current,c):[];if(!M&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),L=Pe((e=>{const t=I.current;if(I.current=!1,t)return;if("function"==typeof x&&!x(e))return;const n=ee(e);if(N(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===A(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=E&&$(E.nodesRef.current,c).some((t=>{var n;return Ae(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ae(e,a)||Ae(e,s)||r)return;const u=E?$(E.nodesRef.current,c):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:F(e)||K(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=M,f.current.__outsidePressBubbles=T;const n=P(a);m&&n.addEventListener("keydown",O),x&&n.addEventListener(p,L);let u=[];return b&&(D(s)&&(u=t(s)),D(a)&&(u=u.concat(t(a))),!D(l)&&l&&l.contextElement&&(u=u.concat(t(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",O),x&&n.removeEventListener(p,L),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,x,p,r,o,b,d,M,T,O,L]),u.useEffect((()=>{I.current=!1}),[x,p]),u.useMemo((()=>d?{reference:{onKeyDown:O,[De[h]]:e=>{g&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:O,[Ne[p]]:()=>{I.current=!0}}}:{}),[d,i,g,p,h,o,O])}function Ke(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||c,a=n(e),f=C(),d=Pe(((e,t)=>{e&&(v.current.openEvent=t),null==o||o(e,t)})),m=u.useRef(null),v=u.useRef({}),p=u.useState((()=>R()))[0],h=E(),b=u.useCallback((e=>{const t=D(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a.refs.setReference(t)}),[a.refs]),y=u.useCallback((e=>{(D(e)||null===e)&&(m.current=e,l(e)),(D(a.refs.reference.current)||null===a.refs.reference.current||null!==e&&!D(e))&&a.refs.setReference(e)}),[a.refs]),w=u.useMemo((()=>({...a.refs,setReference:y,setPositionReference:b,domReference:m})),[a.refs,y,b]),x=u.useMemo((()=>({...a.elements,domReference:s})),[a.elements,s]),I=u.useMemo((()=>({...a,refs:w,elements:x,dataRef:v,nodeId:i,floatingId:h,events:p,open:r,onOpenChange:d})),[a,i,h,p,r,d,w,x]);return g((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...a,context:I,refs:w,elements:x})),[a,w,x,I])}function Be(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),v=u.useRef();return u.useEffect((()=>{if(!a)return;const e=P(l).defaultView||window;function t(){!n&&N(s)&&s===G(P(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(v.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&Ae(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=D(t)&&t.hasAttribute(j("focus-guard"))&&"outside"===t.getAttribute("data-type");v.current=setTimeout((()=>{_(c.floating.current,t)||_(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])}function He(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function _e(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>He(t,e,"reference")),t),r=u.useCallback((t=>He(t,e,"floating")),t),o=u.useCallback((t=>He(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}let je=!1;const qe="ArrowUp",We="ArrowDown",Ve="ArrowLeft",Xe="ArrowRight";function Ye(e,t,n){return Math.floor(e/t)!==n}function Ue(e,t){return t<0||t>=e.current.length}function ze(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))||(a=i[c])&&null===a.offsetParent));var a;return c}function Ze(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ge(e,t){return Ze(t,e===qe||e===We,e===Ve||e===Xe)}function Qe(e,t,n){return Ze(t,e===We,n?e===Ve:e===Xe)||"Enter"===e||" "==e||""===e}function Je(e,t){return ze(e,{disabledIndices:t})}function $e(e,t){return ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function et(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:s,onNavigate:a=(()=>{}),enabled:f=!0,selectedIndex:d=null,allowEscape:m=!1,loop:v=!1,nested:p=!1,rtl:h=!1,virtual:b=!1,focusItemOnOpen:y="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:w=!0,disabledIndices:R,orientation:x="vertical",cols:I=1,scrollItemIntoView:M=!0}=t,T=k(),O=C(),S=Pe(a),A=u.useRef(y),D=u.useRef(null!=d?d:-1),H=u.useRef(null),j=u.useRef(!0),W=u.useRef(S),V=u.useRef(!!c),X=u.useRef(!1),Y=u.useRef(!1),U=q(R),z=q(n),Z=q(M),[Q,$]=u.useState(),ee=Pe((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(b?$(r.id):J(r,{preventScroll:!0,sync:!(!L().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!B())&&(je||X.current)}),requestAnimationFrame((()=>{const e=Z.current;e&&r&&(n||!j.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));g((()=>{document.createElement("div").focus({get preventScroll(){return je=!0,!1}})}),[]),g((()=>{f&&(n&&c?A.current&&null!=d&&(Y.current=!0,S(d)):V.current&&(D.current=-1,W.current(null)))}),[f,n,c,d,S]),g((()=>{if(f&&n&&c)if(null==s){if(X.current=!1,null!=d)return;if(V.current&&(D.current=-1,ee(l,D)),!V.current&&A.current&&(null!=H.current||!0===A.current&&null==H.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else D.current=null==H.current||Qe(H.current,x,h)||p?Je(l,U.current):$e(l,U.current),H.current=null,S(D.current)};t()}}else Ue(l,s)||(D.current=s,ee(l,D,Y.current),Y.current=!1)}),[f,n,c,s,d,p,l,x,h,S,ee,U]),g((()=>{if(f&&V.current&&!c&&O){var e,t;const n=O.nodesRef.current,r=null==(e=n.find((e=>e.id===T)))||null==(t=e.context)?void 0:t.elements.floating,o=G(P(c)),u=n.some((e=>e.context&&_(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[f,c,O,T]),g((()=>{W.current=S,V.current=!!c})),g((()=>{n||(H.current=null)}),[n]);const te=null!=s,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&S(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...E&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(D.current=-1,ee(l,D),S(null),b||J(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,E,l,S,b]);return u.useMemo((()=>{if(!f)return{};const e=U.current;function t(t){if(j.current=!1,X.current=!0,!z.current&&t.currentTarget===o.floating.current)return;if(p&&function(e,t,n){return Ze(t,n?e===Xe:e===Ve,e===qe)}(t.key,x,h))return re(t),r(!1,t.nativeEvent),void(N(i)&&i.focus());const u=D.current,c=Je(l,e),s=$e(l,e);if("Home"===t.key&&(re(t),D.current=c,S(D.current)),"End"===t.key&&(re(t),D.current=s,S(D.current)),I>1){const n=D.current;if(t.key===qe){if(re(t),-1===n)D.current=s;else if(D.current=ze(l,{startingIndex:n,amount:I,decrement:!0,disabledIndices:e}),v&&(n-I<c||D.current<0)){const e=n%I,t=s%I,r=s-(t-e);D.current=t===e?s:t>e?r:r-I}Ue(l,D.current)&&(D.current=n),S(D.current)}if(t.key===We&&(re(t),-1===n?D.current=c:(D.current=ze(l,{startingIndex:n,amount:I,disabledIndices:e}),v&&n+I>s&&(D.current=ze(l,{startingIndex:n%I-I,amount:I,disabledIndices:e}))),Ue(l,D.current)&&(D.current=n),S(D.current)),"both"===x){const r=Math.floor(n/I);t.key===Xe&&(re(t),n%I!=I-1?(D.current=ze(l,{startingIndex:n,disabledIndices:e}),v&&Ye(D.current,I,r)&&(D.current=ze(l,{startingIndex:n-n%I-1,disabledIndices:e}))):v&&(D.current=ze(l,{startingIndex:n-n%I-1,disabledIndices:e})),Ye(D.current,I,r)&&(D.current=n)),t.key===Ve&&(re(t),n%I!=0?(D.current=ze(l,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Ye(D.current,I,r)&&(D.current=ze(l,{startingIndex:n+(I-n%I),decrement:!0,disabledIndices:e}))):v&&(D.current=ze(l,{startingIndex:n+(I-n%I),decrement:!0,disabledIndices:e})),Ye(D.current,I,r)&&(D.current=n));const o=Math.floor(s/I)===r;return Ue(l,D.current)&&(D.current=v&&o?t.key===Ve?s:ze(l,{startingIndex:n-n%I-1,disabledIndices:e}):n),void S(D.current)}}if(Ge(t.key,x)){if(re(t),n&&!b&&G(t.currentTarget.ownerDocument)===t.currentTarget)return D.current=Qe(t.key,x,h)?c:s,void S(D.current);Qe(t.key,x,h)?D.current=v?u>=s?m&&u!==l.current.length?-1:c:ze(l,{startingIndex:u,disabledIndices:e}):Math.min(s,ze(l,{startingIndex:u,disabledIndices:e})):D.current=v?u<=c?m&&-1!==u?l.current.length:s:ze(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,ze(l,{startingIndex:u,decrement:!0,disabledIndices:e})),Ue(l,D.current)?S(null):S(D.current)}}function u(e){"auto"===y&&F(e.nativeEvent)&&(A.current=!0)}const c=b&&n&&te&&{"aria-activedescendant":Q};return{reference:{...c,onKeyDown(o){j.current=!1;const u=0===o.key.indexOf("Arrow");if(b&&n)return t(o);if(!n&&!w&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Ge(o.key,x),s=function(e,t,n){return Ze(t,n?e===Ve:e===Xe,e===We)}(o.key,x,h);i&&(H.current=p&&c?null:o.key),p?s&&(re(o),n?(D.current=Je(l,e),S(D.current)):r(!0,o.nativeEvent)):c&&(null!=d&&(D.current=d),re(o),!n&&w?r(!0,o.nativeEvent):t(o),n&&S(D.current))},onFocus(){n&&S(null)},onPointerDown:function(e){A.current=y,"auto"===y&&K(e.nativeEvent)&&(A.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===x?void 0:x,...c,onKeyDown:t,onPointerMove(){j.current=!0}},item:ne}}),[i,o,Q,U,z,l,f,x,h,b,n,te,p,d,w,m,I,v,y,S,r,ne])}function tt(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}function nt(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=E();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])}const rt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function ot(e,t){return"function"==typeof e?e(t):e}function ut(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return g((()=>{c&&!f&&a("unmounted")}),[c,f]),g((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function it(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,m=(f?c:c.close)||0,[v,p]=u.useState((()=>({...ot(i,a),...ot(n,a)}))),{isMounted:h,status:b}=ut(e,{duration:c}),y=q(n),E=q(r),w=q(o),R=q(i);return g((()=>{const e=ot(y.current,a),t=ot(w.current,a),n=ot(R.current,a),r=ot(E.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===b&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===b&&p({transitionProperty:Object.keys(r).map(rt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===b){const r=t||e;p({transitionProperty:Object.keys(r).map(rt).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,w,y,E,R,d,b,a]),{isMounted:h,styles:v}}function ct(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=u.useRef(),h=u.useRef(""),b=u.useRef(null!=(n=null!=v?v:c)?n:-1),y=u.useRef(null),E=Pe(l),w=Pe(s),R=q(f),x=q(m);return g((()=>{r&&(clearTimeout(p.current),y.current=null,h.current="")}),[r]),g((()=>{var e;r&&""===h.current&&(b.current=null!=(e=null!=v?v:c)?e:-1)}),[r,v,c]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&re(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(re(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",b.current=y.current),h.current+=n.key,clearTimeout(p.current),p.current=setTimeout((()=>{h.current="",b.current=y.current,e(!1)}),d);const u=b.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),y.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,i,d,x,R,E,w])}function lt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const st=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=t,g=n.current[l];if(!g)return{};const h={...t,...await r(-g.offsetTop-p.clientTop-m.reference.height/2-g.offsetHeight/2-c).fn(t)},b=(null==f?void 0:f.current)||p,y=await o(lt(h,b.scrollHeight),d),E=await o(h,{...d,elementContext:"reference"}),w=Math.max(0,y.top),R=h.y+w,x=Math.max(0,b.scrollHeight-w-Math.max(0,y.bottom));return b.style.maxHeight=x+"px",b.scrollTop=w,i&&(b.offsetHeight<g.offsetHeight*Math.min(s,n.current.length-1)-1||E.top>=-a||E.bottom>=-a?v((()=>i(!0))):v((()=>i(!1)))),u&&(u.current=await o(lt({...h,y:R},b.offsetHeight),d)),{y:R}}});function at(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:c,onChange:l}=t,s=Pe(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,c=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),v((()=>{s((e=>e+Math[l](n,u*c)))}))):/firefox/i.test(S())&&(t.scrollTop+=n))}const t=(null==c?void 0:c.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=i.current&&(d.current={...i.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,i,c,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==c?void 0:c.current)||r.floating;if(i.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&v((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,i,r.floating,c,s])}function ft(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}function dt(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:v}=e;return function(e){function p(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,b=[g,h],y=ee(e),E="mouseleave"===e.type,w=_(f.floating,y),R=_(f.domReference,y),x=f.domReference.getBoundingClientRect(),I=f.floating.getBoundingClientRect(),k=a.split("-")[0],C=n>I.right-I.width/2,M=s>I.bottom-I.height/2,T=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,x),O=I.width>x.width,P=I.height>x.height,L=(O?x:I).left,S=(O?x:I).right,A=(P?x:I).top,N=(P?x:I).bottom;if(w&&(u=!0,!E))return;if(R&&(u=!1),R&&!E)return void(u=!0);if(E&&D(e.relatedTarget)&&_(f.floating,e.relatedTarget))return;if(v&&$(v.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=x.bottom-1||"bottom"===k&&s<=x.top+1||"left"===k&&n>=x.right-1||"right"===k&&n<=x.left+1)return p();let F=[];switch(k){case"top":F=[[L,x.top+1],[L,I.bottom-1],[S,I.bottom-1],[S,x.top+1]];break;case"bottom":F=[[L,I.top+1],[L,x.bottom-1],[S,x.bottom-1],[S,I.top+1]];break;case"left":F=[[I.right-1,N],[I.right-1,A],[x.left+1,A],[x.left+1,N]];break;case"right":F=[[x.right-1,N],[x.right-1,A],[I.left+1,A],[I.left+1,N]]}if(!ft([g,h],F)){if(u&&!T)return p();if(!E&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return p()}ft([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[O?n+t/2:C?n+4*t:n-4*t,r+t+1],[O?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[I.left,C||O?I.bottom-t:I.top],[I.right,C?O?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[O?n+t/2:C?n+4*t:n-4*t,r-t],[O?n-t/2:C?n+4*t:n-4*t,r-t],...[[I.left,C||O?I.top+t:I.bottom],[I.right,C?O?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,P?r+t/2:M?r+4*t:r-4*t],o=[n+t+1,P?r-t/2:M?r+4*t:r-4*t];return[...[[M||P?I.right-t:I.left,I.top],[M?P?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,P?r+t/2:M?r+4*t:r-4*t],[n-t,P?r-t/2:M?r+4*t:r-4*t],...[[M||P?I.left+t:I.right,I.top],[M?P?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(p,40)):p()}}};return s.__options={blockPointerEvents:n},s}export{w as FloatingArrow,z as FloatingDelayGroup,ye as FloatingFocusManager,Re as FloatingList,T as FloatingNode,ke as FloatingOverlay,ge as FloatingPortal,O as FloatingTree,st as inner,dt as safePolygon,Te as useClick,Se as useClientPoint,Z as useDelayGroup,U as useDelayGroupContext,Fe as useDismiss,Ke as useFloating,M as useFloatingNodeId,k as useFloatingParentNodeId,pe as useFloatingPortalNode,C as useFloatingTree,Be as useFocus,X as useHover,E as useId,at as useInnerOffset,_e as useInteractions,xe as useListItem,et as useListNavigation,tt as useMergeRefs,nt as useRole,ut as useTransitionStatus,it as useTransitionStyles,ct as useTypeahead};
import{platform as e,getOverflowAncestors as t,useFloating as n,offset as r,detectOverflow as o}from"@floating-ui/react-dom";export{arrow,autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/react-dom";import*as u from"react";import{useLayoutEffect as i,useEffect as c,useRef as l}from"react";import{supportsInert as s,hideOthers as a,suppressOthers as f}from"aria-hidden";import{tabbable as d}from"tabbable";import{createPortal as m,flushSync as v}from"react-dom";function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}var g="undefined"!=typeof document?i:c;let h=!1,b=0;const y=()=>"floating-ui-"+b++;const E=u["useId".toString()]||function(){const[e,t]=u.useState((()=>h?y():void 0));return g((()=>{null==e&&t(y())}),[]),u.useEffect((()=>{h||(h=!0)}),[]),e},w=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...g}={},...h}=t;const b=E();if(!o)return null;a*=2;const y=a/2,w=c/2*(s/-8+1),R=l/2*s/4,[x,I]=r.split("-"),k=e.isRTL(o),M=!!m,C="top"===x||"bottom"===x,T=f&&"end"===I?"bottom":"top";let O=f&&"end"===I?"right":"left";f&&k&&(O="end"===I?"left":"right");const P=null!=(null==i?void 0:i.x)?f||i.x:"",L=null!=(null==i?void 0:i.y)?f||i.y:"",S=m||"M0,0 H"+c+" L"+(c-w)+","+(l-R)+" Q"+c/2+","+l+" "+w+","+(l-R)+" Z",A={top:M?"rotate(180deg)":"",left:M?"rotate(90deg)":"rotate(-90deg)",bottom:M?"":"rotate(180deg)",right:M?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",p({},h,{"aria-hidden":!0,ref:n,width:M?c:c+a,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[O]:P,[T]:L,[x]:C||M?"100%":"calc(100% - "+a/2+"px)",transform:""+A+(null!=v?v:""),...g}}),a>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:d,strokeWidth:a+(m?0:1),d:S}),u.createElement("path",{stroke:a&&!m?h.fill:"none",d:S}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-y,y:y*(M?-1:1),width:c+a,height:c})))}));function R(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const x=u.createContext(null),I=u.createContext(null),k=()=>{var e;return(null==(e=u.useContext(x))?void 0:e.id)||null},M=()=>u.useContext(I);function C(e){const t=E(),n=M(),r=k(),o=e||r;return g((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function T(e){let{children:t,id:n}=e;const r=k();return u.createElement(x.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function O(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>R()))[0];return u.createElement(I.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)}function P(e){return(null==e?void 0:e.ownerDocument)||document}function L(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function S(){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 A(e){return P(e).defaultView||window}function D(e){return!!e&&(e instanceof Element||e instanceof A(e).Element)}function N(e){return!!e&&(e instanceof HTMLElement||e instanceof A(e).HTMLElement)}function F(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(L())||t.test(S()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function K(e){return 0===e.width&&0===e.height||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}function H(){return/apple/i.test(navigator.vendor)}function B(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function _(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof A(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function j(e){return"data-floating-ui-"+e}function q(e){const t=l(e);return g((()=>{t.current=e})),t}const W=j("safe-polygon");function V(e,t,n){return n&&!B(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function X(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:v=0,move:p=!0}=t,h=M(),b=k(),y=q(d),E=q(f),w=u.useRef(),R=u.useRef(),x=u.useRef(),I=u.useRef(),C=u.useRef(!0),T=u.useRef(!1),O=u.useRef((()=>{})),L=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(R.current),clearTimeout(I.current),C.current=!0}}),[a,i]),u.useEffect((()=>{if(!a||!y.current||!n)return;function e(e){L()&&r(!1,e)}const t=P(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,y,o,L]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=V(E.current,"close",w.current);n&&!x.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(R.current),r(!1,e))}),[E,r]),A=u.useCallback((()=>{O.current(),x.current=void 0}),[]),N=u.useCallback((()=>{if(T.current){const e=P(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(W),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&D(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),p&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),p&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),C.current=!1,m&&!B(w.current)||v>0&&0===V(E.current,"open"))return;const t=V(E.current,"open",w.current);t?R.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;O.current();const o=P(l);if(clearTimeout(I.current),y.current){n||clearTimeout(R.current),x.current=y.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),A(),S(r)}});const t=x.current;return o.addEventListener("mousemove",t),void(O.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==w.current||!_(l,r.relatedTarget))&&S(r)}function s(n){t()||null==y.current||y.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n)}})(n)}}),[c,l,a,e,m,v,p,S,A,N,r,n,h,E,y,o]),g((()=>{var e;if(a&&n&&null!=(e=y.current)&&e.__options.blockPointerEvents&&L()){const e=P(l).body;if(e.setAttribute(W,""),e.style.pointerEvents="none",T.current=!0,D(c)&&l){var t,r;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===b)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,b,l,c,h,y,o,L]),g((()=>{n||(w.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(I.current),N()}),[a,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){w.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(I.current),I.current=setTimeout((()=>{C.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[i,a,v,n,r,S])}const Y=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),U=()=>u.useContext(Y),z=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return g((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(Y.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,i,l])},t)},Z=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:c,setState:l,timeoutMs:s}=U();g((()=>{u&&(l({delay:{open:1,close:V(c,"close")}}),u!==o&&r(!1))}),[o,r,l,u,c]),g((()=>{function e(){r(!1),l({delay:c,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,c,s]),g((()=>{n&&i(o)}),[n,i,o])};function G(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let Q=0;function J(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Q);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():Q=requestAnimationFrame(u)}function $(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function ee(e){return"composedPath"in e?e.composedPath()[0]:e.target}const te="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ne(e){return N(e)&&e.matches(te)}function re(e){e.preventDefault(),e.stopPropagation()}const oe=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ue(e,t){const n=d(e,oe());"prev"===t&&n.reverse();const r=n.indexOf(G(P(e)));return n.slice(r+1)[0]}function ie(){return ue(document.body,"next")}function ce(){return ue(document.body,"prev")}function le(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_(n,r)}function se(e){d(e,oe()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function ae(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const fe={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};function de(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const me=u.forwardRef((function(e,t){const[n,r]=u.useState();g((()=>(H()&&r("button"),document.addEventListener("keydown",de),()=>{document.removeEventListener("keydown",de)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[j("focus-guard")]:"",style:fe};return u.createElement("span",p({},e,o))})),ve=u.createContext(null);function pe(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=E(),c=he(),l=u.useMemo((()=>({id:t,root:n,portalContext:c,uniqueId:i})),[t,n,c,i]),s=u.useRef();return g((()=>()=>{null==r||r.remove()}),[r,l]),g((()=>{if(s.current===l)return;s.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,i=j("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!D(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[l]),r}function ge(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=pe({id:n,root:r}),[c,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=!!c&&!c.modal&&c.open&&o&&!(!r&&!i);return u.useEffect((()=>{if(i&&o&&(null==c||!c.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){if(i&&le(e)){("focusin"===e.type?ae:se)(i)}}}),[i,o,null==c?void 0:c.modal]),u.createElement(ve.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:f,afterInsideRef:d,portalNode:i,setFocusManagerState:l})),[o,i])},v&&i&&u.createElement(me,{"data-type":"outside",ref:s,onFocus:e=>{if(le(e,i)){var t;null==(t=f.current)||t.focus()}else{const e=ce()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),v&&i&&u.createElement("span",{"aria-owns":i.id,style:fe}),i&&m(t,i),v&&i&&u.createElement(me,{"data-type":"outside",ref:a,onFocus:e=>{if(le(e,i)){var t;null==(t=d.current)||t.focus()}else{const t=ie()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const he=()=>u.useContext(ve),be=u.forwardRef((function(e,t){return u.createElement("button",p({},e,{type:"button",ref:t,tabIndex:-1,style:fe}))}));function ye(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:c=!0,modal:l=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0}=e,{open:p,refs:h,nodeId:b,onOpenChange:y,events:E,dataRef:w,elements:{domReference:R,floating:x}}=t,I=!s()||o,k=q(r),C=q(i),T=q(c),O=M(),L=he(),S="number"==typeof i&&i<0,A=u.useRef(null),D=u.useRef(null),F=u.useRef(!1),K=u.useRef(null),H=u.useRef(!1),B=null!=L,W=R&&"combobox"===R.getAttribute("role")&&ne(R),V=u.useCallback((function(e){return void 0===e&&(e=x),e?d(e,oe()):[]}),[x]),X=u.useCallback((e=>{const t=V(e);return k.current.map((e=>R&&"reference"===e?R:x&&"floating"===e?x:t)).filter(Boolean).flat()}),[R,x,k,V]);function Y(e){return m&&l?u.createElement(be,{ref:"start"===e?A:D,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof m?m:"Dismiss"):null}u.useEffect((()=>{if(!l)return;function e(e){if("Tab"===e.key){_(x,G(P(x)))&&0===V().length&&!W&&re(e);const t=X(),n=ee(e);"reference"===k.current[0]&&n===R&&(re(e),e.shiftKey?J(t[t.length-1]):J(t[1])),"floating"===k.current[1]&&n===x&&e.shiftKey&&(re(e),J(t[0]))}}const t=P(x);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[R,x,l,k,h,W,V,X]),u.useEffect((()=>{if(v)return x&&N(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!l&&x.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!l&&x.removeEventListener("focusout",t)}):void 0;function e(){H.current=!0,setTimeout((()=>{H.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(_(R,t)||_(x,t)||_(t,x)||_(null==L?void 0:L.portalNode,t)||null!=t&&t.hasAttribute(j("focus-guard"))||O&&($(O.nodesRef.current,b).find((e=>{var n,r;return _(null==(n=e.context)?void 0:n.elements.floating,t)||_(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],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&&(r=r.concat(t))}return r}(O.nodesRef.current,b).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!H.current&&t!==K.current&&(F.current=!0,y(!1,e))}))}}),[R,x,l,b,O,L,y,v]),u.useEffect((()=>{var e;const t=Array.from((null==L||null==(e=L.portalNode)?void 0:e.querySelectorAll("["+j("portal")+"]"))||[]);if(x&&l){const e=[x,...t,A.current,D.current].filter((e=>null!=e)),n=(I?a:f)(k.current.includes("reference")||W?e.concat(R||[]):e,void 0,j("inert"));return()=>{n()}}}),[R,x,l,k,L,W,I]),g((()=>{if(!x)return;const e=G(P(x));queueMicrotask((()=>{const t=X(x),n=C.current,r=("number"==typeof n?t[n]:n.current)||x,o=_(x,e);S||o||!p||J(r,{preventScroll:r===x})}))}),[p,x,S,X,C]),g((()=>{if(!x)return;let e=!1;const t=P(x),n=G(t),r=w.current;function o(t){if("escapeKey"===t.type&&h.domReference.current&&(K.current=h.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(F.current=!1,e=n.preventScroll):F.current=!n}return K.current=n,E.on("dismiss",o),()=>{E.off("dismiss",o);const n=G(t);(_(x,n)||O&&$(O.nodesRef.current,b).some((e=>{var t;return _(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&h.domReference.current&&(K.current=h.domReference.current),T.current&&N(K.current)&&!F.current&&J(K.current,{cancelPrevious:!1,preventScroll:e})}}),[x,T,w,h,E,O,b]),g((()=>{if(L)return L.setFocusManagerState({...t,modal:l,closeOnFocusOut:v,open:p}),()=>{L.setFocusManagerState(null)}}),[L,l,p,v,t]),g((()=>{if(x&&"function"==typeof MutationObserver){const e=()=>{const e=x.getAttribute("tabindex");k.current.includes("floating")||G(P(x))!==h.domReference.current&&0===V().length?"0"!==e&&x.setAttribute("tabindex","0"):"-1"!==e&&x.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(x,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[x,h,k,V]);const U=I&&!W&&(B||l);return u.createElement(u.Fragment,null,U&&u.createElement(me,{"data-type":"inside",ref:null==L?void 0:L.beforeInsideRef,onFocus:e=>{if(l){const e=X();J("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(F.current=!1,le(e,L.portalNode)){const e=ie()||R;null==e||e.focus()}else{var t;null==(t=L.beforeOutsideRef.current)||t.focus()}}}),!W&&Y("start"),n,Y("end"),U&&u.createElement(me,{"data-type":"inside",ref:null==L?void 0:L.afterInsideRef,onFocus:e=>{if(l)J(X()[0]);else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(v&&(F.current=!0),le(e,L.portalNode)){const e=ce()||R;null==e||e.focus()}else{var t;null==(t=L.afterOutsideRef.current)||t.focus()}}}))}function Ee(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 we=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Re(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return g((()=>{const e=new Map(o);Array.from(e.keys()).sort(Ee).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(we.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function xe(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:c,map:l,elementsRef:s,labelsRef:a}=u.useContext(we),f=u.useCallback((e=>{if(o.current=e,null!==n&&(s.current[n]=e,a)){var r;const o=void 0!==t;a.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,s,a,t]);return g((()=>{const e=o.current;if(e)return i(e),()=>{c(e)}}),[i,c]),g((()=>{const e=o.current?l.get(o.current):null;null!=e&&r(e)}),[l]),u.useMemo((()=>({ref:f,index:null==n?-1:n})),[n,f])}const Ie=j("scroll-lock"),ke=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return g((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ie))return;document.body.setAttribute(Ie,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(L()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ie),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ie),window.scrollTo(c,l)}}),[n]),u.createElement("div",p({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Me(e){return N(e.target)&&"BUTTON"===e.target.tagName}function Ce(e){return ne(e)}function Te(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(B(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:B(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Me(e)||(" "!==e.key||Ce(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||Me(e)||Ce(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])}const Oe=u["useInsertionEffect".toString()]||(e=>e());function Pe(e){const t=u.useRef((()=>{}));return Oe((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function Le(e){return null!=e&&null!=e.clientX}function Se(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:s=null,y:a=null}=t,f=u.useRef(!1),d=u.useRef(null),[m,v]=u.useState(),[p,h]=u.useState([]),b=Pe(((e,t)=>{f.current||o.current.openEvent&&!Le(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,v=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:v,top:v,right:m+f,bottom:v+d,left:m}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:m}))})),y=Pe((e=>{null==s&&null==a&&(n?d.current||h([]):b(e.clientX,e.clientY))})),E=B(m)?i:n,w=u.useCallback((()=>{if(!E||!c||null!=s||null!=a)return;const e=A(r.floating.current);function t(n){const o=ee(n);_(r.floating.current,o)?(e.removeEventListener("mousemove",t),d.current=null):b(n.clientX,n.clientY)}if(!o.current.openEvent||Le(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,E,r,b,s,a]);return u.useEffect((()=>w()),[w,p]),u.useEffect((()=>{c&&!i&&(f.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(f.current=!0)}),[c,n]),g((()=>{!c||null==s&&null==a||(f.current=!1,b(s,a))}),[c,s,a,b]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}}}),[c,y])}function Ae(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)}const De={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ne={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function Fe(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:v=!0,outsidePressEvent:p="pointerdown",referencePress:g=!1,referencePressEvent:h="pointerdown",ancestorScroll:b=!1,bubbles:y}=n,E=M(),w=null!=k(),R=Pe("function"==typeof v?v:()=>!1),x="function"==typeof v?R:v,I=u.useRef(!1),{escapeKeyBubbles:C,outsidePressBubbles:T}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(y),O=Pe((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=E?$(E.nodesRef.current,c):[];if(!C&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),L=Pe((e=>{const t=I.current;if(I.current=!1,t)return;if("function"==typeof x&&!x(e))return;const n=ee(e);if(N(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===A(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=E&&$(E.nodesRef.current,c).some((t=>{var n;return Ae(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ae(e,a)||Ae(e,s)||r)return;const u=E?$(E.nodesRef.current,c):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:F(e)||K(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=C,f.current.__outsidePressBubbles=T;const n=P(a);m&&n.addEventListener("keydown",O),x&&n.addEventListener(p,L);let u=[];return b&&(D(s)&&(u=t(s)),D(a)&&(u=u.concat(t(a))),!D(l)&&l&&l.contextElement&&(u=u.concat(t(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",O),x&&n.removeEventListener(p,L),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,x,p,r,o,b,d,C,T,O,L]),u.useEffect((()=>{I.current=!1}),[x,p]),u.useMemo((()=>d?{reference:{onKeyDown:O,[De[h]]:e=>{g&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:O,[Ne[p]]:()=>{I.current=!0}}}:{}),[d,i,g,p,h,o,O])}function Ke(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||c,a=n(e),f=M(),d=Pe(((e,t)=>{e&&(v.current.openEvent=t),null==o||o(e,t)})),m=u.useRef(null),v=u.useRef({}),p=u.useState((()=>R()))[0],h=E(),b=u.useCallback((e=>{const t=D(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a.refs.setReference(t)}),[a.refs]),y=u.useCallback((e=>{(D(e)||null===e)&&(m.current=e,l(e)),(D(a.refs.reference.current)||null===a.refs.reference.current||null!==e&&!D(e))&&a.refs.setReference(e)}),[a.refs]),w=u.useMemo((()=>({...a.refs,setReference:y,setPositionReference:b,domReference:m})),[a.refs,y,b]),x=u.useMemo((()=>({...a.elements,domReference:s})),[a.elements,s]),I=u.useMemo((()=>({...a,refs:w,elements:x,dataRef:v,nodeId:i,floatingId:h,events:p,open:r,onOpenChange:d})),[a,i,h,p,r,d,w,x]);return g((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...a,context:I,refs:w,elements:x})),[a,w,x,I])}function He(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),v=u.useRef();return u.useEffect((()=>{if(!a)return;const e=P(l).defaultView||window;function t(){!n&&N(s)&&s===G(P(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(v.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&Ae(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=D(t)&&t.hasAttribute(j("focus-guard"))&&"outside"===t.getAttribute("data-type");v.current=setTimeout((()=>{_(c.floating.current,t)||_(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])}function Be(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function _e(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>Be(t,e,"reference")),t),r=u.useCallback((t=>Be(t,e,"floating")),t),o=u.useCallback((t=>Be(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])}let je=!1;const qe="ArrowUp",We="ArrowDown",Ve="ArrowLeft",Xe="ArrowRight";function Ye(e,t,n){return Math.floor(e/t)!==n}function Ue(e,t){return t<0||t>=e.current.length}function ze(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))));return c}function Ze(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ge(e,t){return Ze(t,e===qe||e===We,e===Ve||e===Xe)}function Qe(e,t,n){return Ze(t,e===We,n?e===Ve:e===Xe)||"Enter"===e||" "==e||""===e}function Je(e,t){return ze(e,{disabledIndices:t})}function $e(e,t){return ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function et(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:s,onNavigate:a=(()=>{}),enabled:f=!0,selectedIndex:d=null,allowEscape:m=!1,loop:v=!1,nested:p=!1,rtl:h=!1,virtual:b=!1,focusItemOnOpen:y="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:w=!0,disabledIndices:R,orientation:x="vertical",cols:I=1,scrollItemIntoView:C=!0}=t,T=k(),O=M(),S=Pe(a),A=u.useRef(y),D=u.useRef(null!=d?d:-1),B=u.useRef(null),j=u.useRef(!0),W=u.useRef(S),V=u.useRef(!!c),X=u.useRef(!1),Y=u.useRef(!1),U=q(R),z=q(n),Z=q(C),[Q,$]=u.useState(),ee=Pe((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(b?$(r.id):J(r,{preventScroll:!0,sync:!(!L().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!H())&&(je||X.current)}),requestAnimationFrame((()=>{const e=Z.current;e&&r&&(n||!j.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));g((()=>{document.createElement("div").focus({get preventScroll(){return je=!0,!1}})}),[]),g((()=>{f&&(n&&c?A.current&&null!=d&&(Y.current=!0,S(d)):V.current&&(D.current=-1,W.current(null)))}),[f,n,c,d,S]),g((()=>{if(f&&n&&c)if(null==s){if(X.current=!1,null!=d)return;if(V.current&&(D.current=-1,ee(l,D)),!V.current&&A.current&&(null!=B.current||!0===A.current&&null==B.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else D.current=null==B.current||Qe(B.current,x,h)||p?Je(l,U.current):$e(l,U.current),B.current=null,S(D.current)};t()}}else Ue(l,s)||(D.current=s,ee(l,D,Y.current),Y.current=!1)}),[f,n,c,s,d,p,l,x,h,S,ee,U]),g((()=>{if(f&&V.current&&!c&&O){var e,t;const n=O.nodesRef.current,r=null==(e=n.find((e=>e.id===T)))||null==(t=e.context)?void 0:t.elements.floating,o=G(P(c)),u=n.some((e=>e.context&&_(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[f,c,O,T]),g((()=>{W.current=S,V.current=!!c})),g((()=>{n||(B.current=null)}),[n]);const te=null!=s,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&S(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...E&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(D.current=-1,ee(l,D),S(null),b||J(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,E,l,S,b]);return u.useMemo((()=>{if(!f)return{};const e=U.current;function t(t){if(j.current=!1,X.current=!0,!z.current&&t.currentTarget===o.floating.current)return;if(p&&function(e,t,n){return Ze(t,n?e===Xe:e===Ve,e===qe)}(t.key,x,h))return re(t),r(!1,t.nativeEvent),void(N(i)&&i.focus());const u=D.current,c=Je(l,e),s=$e(l,e);if("Home"===t.key&&(re(t),D.current=c,S(D.current)),"End"===t.key&&(re(t),D.current=s,S(D.current)),I>1){const n=D.current;if(t.key===qe){if(re(t),-1===n)D.current=s;else if(D.current=ze(l,{startingIndex:n,amount:I,decrement:!0,disabledIndices:e}),v&&(n-I<c||D.current<0)){const e=n%I,t=s%I,r=s-(t-e);D.current=t===e?s:t>e?r:r-I}Ue(l,D.current)&&(D.current=n),S(D.current)}if(t.key===We&&(re(t),-1===n?D.current=c:(D.current=ze(l,{startingIndex:n,amount:I,disabledIndices:e}),v&&n+I>s&&(D.current=ze(l,{startingIndex:n%I-I,amount:I,disabledIndices:e}))),Ue(l,D.current)&&(D.current=n),S(D.current)),"both"===x){const r=Math.floor(n/I);t.key===Xe&&(re(t),n%I!=I-1?(D.current=ze(l,{startingIndex:n,disabledIndices:e}),v&&Ye(D.current,I,r)&&(D.current=ze(l,{startingIndex:n-n%I-1,disabledIndices:e}))):v&&(D.current=ze(l,{startingIndex:n-n%I-1,disabledIndices:e})),Ye(D.current,I,r)&&(D.current=n)),t.key===Ve&&(re(t),n%I!=0?(D.current=ze(l,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Ye(D.current,I,r)&&(D.current=ze(l,{startingIndex:n+(I-n%I),decrement:!0,disabledIndices:e}))):v&&(D.current=ze(l,{startingIndex:n+(I-n%I),decrement:!0,disabledIndices:e})),Ye(D.current,I,r)&&(D.current=n));const o=Math.floor(s/I)===r;return Ue(l,D.current)&&(D.current=v&&o?t.key===Ve?s:ze(l,{startingIndex:n-n%I-1,disabledIndices:e}):n),void S(D.current)}}if(Ge(t.key,x)){if(re(t),n&&!b&&G(t.currentTarget.ownerDocument)===t.currentTarget)return D.current=Qe(t.key,x,h)?c:s,void S(D.current);Qe(t.key,x,h)?D.current=v?u>=s?m&&u!==l.current.length?-1:c:ze(l,{startingIndex:u,disabledIndices:e}):Math.min(s,ze(l,{startingIndex:u,disabledIndices:e})):D.current=v?u<=c?m&&-1!==u?l.current.length:s:ze(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,ze(l,{startingIndex:u,decrement:!0,disabledIndices:e})),Ue(l,D.current)?S(null):S(D.current)}}function u(e){"auto"===y&&F(e.nativeEvent)&&(A.current=!0)}const c=b&&n&&te&&{"aria-activedescendant":Q};return{reference:{...c,onKeyDown(o){j.current=!1;const u=0===o.key.indexOf("Arrow");if(b&&n)return t(o);if(!n&&!w&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Ge(o.key,x),s=function(e,t,n){return Ze(t,n?e===Ve:e===Xe,e===We)}(o.key,x,h);i&&(B.current=p&&c?null:o.key),p?s&&(re(o),n?(D.current=Je(l,e),S(D.current)):r(!0,o.nativeEvent)):c&&(null!=d&&(D.current=d),re(o),!n&&w?r(!0,o.nativeEvent):t(o),n&&S(D.current))},onFocus(){n&&S(null)},onPointerDown:function(e){A.current=y,"auto"===y&&K(e.nativeEvent)&&(A.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===x?void 0:x,...c,onKeyDown:t,onPointerMove(){j.current=!0}},item:ne}}),[i,o,Q,U,z,l,f,x,h,b,n,te,p,d,w,m,I,v,y,S,r,ne])}function tt(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}function nt(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=E();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])}const rt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function ot(e,t){return"function"==typeof e?e(t):e}function ut(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return g((()=>{c&&!f&&a("unmounted")}),[c,f]),g((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function it(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,m=(f?c:c.close)||0,[v,p]=u.useState((()=>({...ot(i,a),...ot(n,a)}))),{isMounted:h,status:b}=ut(e,{duration:c}),y=q(n),E=q(r),w=q(o),R=q(i);return g((()=>{const e=ot(y.current,a),t=ot(w.current,a),n=ot(R.current,a),r=ot(E.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===b&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===b&&p({transitionProperty:Object.keys(r).map(rt).join(","),transitionDuration:d+"ms",...n,...r}),"close"===b){const r=t||e;p({transitionProperty:Object.keys(r).map(rt).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,w,y,E,R,d,b,a]),{isMounted:h,styles:v}}function ct(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=u.useRef(),h=u.useRef(""),b=u.useRef(null!=(n=null!=v?v:c)?n:-1),y=u.useRef(null),E=Pe(l),w=Pe(s),R=q(f),x=q(m);return g((()=>{r&&(clearTimeout(p.current),y.current=null,h.current="")}),[r]),g((()=>{var e;r&&""===h.current&&(b.current=null!=(e=null!=v?v:c)?e:-1)}),[r,v,c]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&re(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(re(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",b.current=y.current),h.current+=n.key,clearTimeout(p.current),p.current=setTimeout((()=>{h.current="",b.current=y.current,e(!1)}),d);const u=b.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),y.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,i,d,x,R,E,w])}function lt(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const st=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=t,g=n.current[l];if(!g)return{};const h={...t,...await r(-g.offsetTop-p.clientTop-m.reference.height/2-g.offsetHeight/2-c).fn(t)},b=(null==f?void 0:f.current)||p,y=await o(lt(h,b.scrollHeight),d),E=await o(h,{...d,elementContext:"reference"}),w=Math.max(0,y.top),R=h.y+w,x=Math.max(0,b.scrollHeight-w-Math.max(0,y.bottom));return b.style.maxHeight=x+"px",b.scrollTop=w,i&&(b.offsetHeight<g.offsetHeight*Math.min(s,n.current.length-1)-1||E.top>=-a||E.bottom>=-a?v((()=>i(!0))):v((()=>i(!1)))),u&&(u.current=await o(lt({...h,y:R},b.offsetHeight),d)),{y:R}}});function at(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:c,onChange:l}=t,s=Pe(l),a=u.useRef(!1),f=u.useRef(null),d=u.useRef(null);return u.useEffect((()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,c=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),v((()=>{s((e=>e+Math[l](n,u*c)))}))):/firefox/i.test(S())&&(t.scrollTop+=n))}const t=(null==c?void 0:c.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=i.current&&(d.current={...i.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,i,c,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==c?void 0:c.current)||r.floating;if(i.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&v((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,i,r.floating,c,s])}function ft(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}function dt(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:v}=e;return function(e){function p(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,b=[g,h],y=ee(e),E="mouseleave"===e.type,w=_(f.floating,y),R=_(f.domReference,y),x=f.domReference.getBoundingClientRect(),I=f.floating.getBoundingClientRect(),k=a.split("-")[0],M=n>I.right-I.width/2,C=s>I.bottom-I.height/2,T=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,x),O=I.width>x.width,P=I.height>x.height,L=(O?x:I).left,S=(O?x:I).right,A=(P?x:I).top,N=(P?x:I).bottom;if(w&&(u=!0,!E))return;if(R&&(u=!1),R&&!E)return void(u=!0);if(E&&D(e.relatedTarget)&&_(f.floating,e.relatedTarget))return;if(v&&$(v.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=x.bottom-1||"bottom"===k&&s<=x.top+1||"left"===k&&n>=x.right-1||"right"===k&&n<=x.left+1)return p();let F=[];switch(k){case"top":F=[[L,x.top+1],[L,I.bottom-1],[S,I.bottom-1],[S,x.top+1]];break;case"bottom":F=[[L,I.top+1],[L,x.bottom-1],[S,x.bottom-1],[S,I.top+1]];break;case"left":F=[[I.right-1,N],[I.right-1,A],[x.left+1,A],[x.left+1,N]];break;case"right":F=[[x.right-1,N],[x.right-1,A],[I.left+1,A],[I.left+1,N]]}if(!ft([g,h],F)){if(u&&!T)return p();if(!E&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return p()}ft([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[O?n+t/2:M?n+4*t:n-4*t,r+t+1],[O?n-t/2:M?n+4*t:n-4*t,r+t+1],...[[I.left,M||O?I.bottom-t:I.top],[I.right,M?O?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[O?n+t/2:M?n+4*t:n-4*t,r-t],[O?n-t/2:M?n+4*t:n-4*t,r-t],...[[I.left,M||O?I.top+t:I.bottom],[I.right,M?O?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,P?r+t/2:C?r+4*t:r-4*t],o=[n+t+1,P?r-t/2:C?r+4*t:r-4*t];return[...[[C||P?I.right-t:I.left,I.top],[C?P?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,P?r+t/2:C?r+4*t:r-4*t],[n-t,P?r-t/2:C?r+4*t:r-4*t],...[[C||P?I.left+t:I.right,I.top],[C?P?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(p,40)):p()}}};return s.__options={blockPointerEvents:n},s}export{w as FloatingArrow,z as FloatingDelayGroup,ye as FloatingFocusManager,Re as FloatingList,T as FloatingNode,ke as FloatingOverlay,ge as FloatingPortal,O as FloatingTree,st as inner,dt as safePolygon,Te as useClick,Se as useClientPoint,Z as useDelayGroup,U as useDelayGroupContext,Fe as useDismiss,Ke as useFloating,C as useFloatingNodeId,k as useFloatingParentNodeId,pe as useFloatingPortalNode,M as useFloatingTree,He as useFocus,X as useHover,E as useId,at as useInnerOffset,_e as useInteractions,xe as useListItem,et as useListNavigation,tt as useMergeRefs,nt as useRole,ut as useTransitionStatus,it as useTransitionStyles,ct as useTypeahead};

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()]||function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},d=u.forwardRef((function(e,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=e;const b=f();if(!o)return null;d*=2;const E=d/2,w=l/2*(a/-8+1),R=s/2*a/4,[x,I]=r.split("-"),O=t.platform.isRTL(o),k=!!v,T="top"===x||"bottom"===x,C=m&&"end"===I?"bottom":"top";let M=m&&"end"===I?"right":"left";m&&O&&(M="end"===I?"left":"right");const P=null!=(null==c?void 0:c.x)?m||c.x:"",S=null!=(null==c?void 0:c.y)?m||c.y:"",A=v||"M0,0 H"+l+" L"+(l-w)+","+(s-R)+" Q"+l/2+","+s+" "+w+","+(s-R)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",i({},y,{"aria-hidden":!0,ref:n,width:k?l:l+d,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[M]:P,[C]:S,[x]:T||k?"100%":"calc(100% - "+d/2+"px)",transform:""+L+(null!=g?g:""),...h}}),d>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:p,strokeWidth:d+(v?0:1),d:A}),u.createElement("path",{stroke:d&&!v?y.fill:"none",d:A}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-E,y:E*(k?-1:1),width:l+d,height:l})))}));function m(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const p=u.createContext(null),v=u.createContext(null),g=()=>{var e;return(null==(e=u.useContext(p))?void 0:e.id)||null},h=()=>u.useContext(v);function y(e){return(null==e?void 0:e.ownerDocument)||document}function b(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){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 w(e){return y(e).defaultView||window}function R(e){return!!e&&e instanceof w(e).Element}function x(e){return!!e&&e instanceof w(e).HTMLElement}function I(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(b())||t.test(E()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function O(e){return 0===e.width&&0===e.height||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}function k(){return/apple/i.test(navigator.vendor)}function T(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function C(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof w(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function M(e){return"data-floating-ui-"+e}function P(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const S=M("safe-polygon");function A(e,t,n){return n&&!T(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const L=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),D=()=>u.useContext(L);var N=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},F=new WeakMap,j=new WeakMap,K={},B=0,H=function(e){return e&&(e.host||H(e.parentNode))},q=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=H(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);K[n]||(K[n]=new WeakMap);var u=K[n],i=[],c=new Set,l=new Set(o),s=function(e){e&&!c.has(e)&&(c.add(e),s(e.parentNode))};o.forEach(s);var a=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))a(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(F.get(e)||0)+1,s=(u.get(e)||0)+1;F.set(e,l),u.set(e,s),i.push(e),1===l&&o&&j.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return a(t),c.clear(),B++,function(){i.forEach((function(e){var t=F.get(e)-1,o=u.get(e)-1;F.set(e,t),u.set(e,o),t||(j.has(e)||e.removeAttribute(r),j.delete(e)),o||e.removeAttribute(n)})),--B||(F=new WeakMap,F=new WeakMap,j=new WeakMap,K={})}},_=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||N(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),q(r,o,n,"aria-hidden")):function(){return null}},W=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||N(e);return r?q(e,r,n,"inert"):function(){return null}},U=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},z=function(e,t,n){return void 0===n&&(n="data-suppressed"),(U()?W:_)(e,t,n)},V=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),X="undefined"==typeof Element,Y=X?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,G=!X&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Z=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{Y.call(i,V)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!r.shadowRootFilter||r.shadowRootFilter(i);if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},$=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Q=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},J=function(e){return"INPUT"===e.tagName},ee=function(e){return function(e){return J(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||G(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},te=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ne=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Y.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Y.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return te(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=G(e);if(i&&!i.shadowRoot&&!0===r(i))return te(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=G(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=G(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},re=function(e,t){return!(t.disabled||function(e){return J(e)&&"hidden"===e.type}(t)||ne(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Y.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},oe=function(e,t){return!(ee(t)||$(t)<0||!re(e,t))},ue=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ie=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=$(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(Q).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ce=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Z([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ue}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(V));return t&&Y.call(e,V)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,oe.bind(null,t)),ie(n)};function le(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let se=0;function ae(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(se);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():se=requestAnimationFrame(u)}function fe(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function de(e){return"composedPath"in e?e.composedPath()[0]:e.target}const me="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function pe(e){return x(e)&&e.matches(me)}function ve(e){e.preventDefault(),e.stopPropagation()}const ge=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function he(e,t){const n=ce(e,ge());"prev"===t&&n.reverse();const r=n.indexOf(le(y(e)));return n.slice(r+1)[0]}function ye(){return he(document.body,"next")}function be(){return he(document.body,"prev")}function Ee(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!C(n,r)}function we(e){ce(e,ge()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Re(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const xe={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};function Ie(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Oe=u.forwardRef((function(e,t){const[n,r]=u.useState();c((()=>(k()&&r("button"),document.addEventListener("keydown",Ie),()=>{document.removeEventListener("keydown",Ie)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[M("focus-guard")]:"",style:xe};return u.createElement("span",i({},e,o))})),ke=u.createContext(null);function Te(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=f(),l=Ce(),s=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),a=u.useRef();return c((()=>()=>{null==r||r.remove()}),[r,s]),c((()=>{if(a.current===s)return;a.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,u=e?document.getElementById(e):null,i=M("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!R(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[s]),r}const Ce=()=>u.useContext(ke),Me=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:xe}))}));function Pe(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 Se=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const Ae=M("scroll-lock"),Le=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ae))return;document.body.setAttribute(Ae,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(b()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ae),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ae),window.scrollTo(c,l)}}),[n]),u.createElement("div",i({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function De(e){return x(e.target)&&"BUTTON"===e.target.tagName}function Ne(e){return pe(e)}const Fe=u["useInsertionEffect".toString()]||(e=>e());function je(e){const t=u.useRef((()=>{}));return Fe((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function Ke(e){return null!=e&&null!=e.clientX}function Be(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)}const He={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function _e(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}let We=!1;const Ue="ArrowUp",ze="ArrowDown",Ve="ArrowLeft",Xe="ArrowRight";function Ye(e,t,n){return Math.floor(e/t)!==n}function Ge(e,t){return t<0||t>=e.current.length}function Ze(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))||(a=i[c])&&null===a.offsetParent));var a;return c}function $e(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Qe(e,t){return $e(t,e===Ue||e===ze,e===Ve||e===Xe)}function Je(e,t,n){return $e(t,e===ze,n?e===Ve:e===Xe)||"Enter"===e||" "==e||""===e}function et(e,t){return Ze(e,{disabledIndices:t})}function tt(e,t){return Ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const nt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function rt(e,t){return"function"==typeof e?e(t):e}function ot(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[l,s]=u.useState(!1),[a,f]=u.useState("unmounted"),d=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return c((()=>{l&&!d&&f("unmounted")}),[l,d]),c((()=>{if(r){if(n){f("initial");const e=requestAnimationFrame((()=>{f("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),f("close")}}),[n,r]),{isMounted:d,status:a}}function ut(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function it(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return t.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.FloatingArrow=d,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),s=u.useCallback((e=>{i({currentId:e})}),[]);return c((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(L.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:m,nodeId:p,onOpenChange:v,events:g,dataRef:b,elements:{domReference:E,floating:w}}=t,R=!U()||o,I=P(r),O=P(i),k=P(l),T=h(),S=Ce(),A="number"==typeof i&&i<0,L=u.useRef(null),D=u.useRef(null),N=u.useRef(!1),F=u.useRef(null),j=u.useRef(!1),K=null!=S,B=E&&"combobox"===E.getAttribute("role")&&pe(E),H=u.useCallback((function(e){return void 0===e&&(e=w),e?ce(e,ge()):[]}),[w]),q=u.useCallback((e=>{const t=H(e);return I.current.map((e=>E&&"reference"===e?E:w&&"floating"===e?w:t)).filter(Boolean).flat()}),[E,w,I,H]);function W(e){return a&&s?u.createElement(Me,{ref:"start"===e?L:D,onClick:e=>v(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(!s)return;function e(e){if("Tab"===e.key){C(w,le(y(w)))&&0===H().length&&!B&&ve(e);const t=q(),n=de(e);"reference"===I.current[0]&&n===E&&(ve(e),e.shiftKey?ae(t[t.length-1]):ae(t[1])),"floating"===I.current[1]&&n===w&&e.shiftKey&&(ve(e),ae(t[0]))}}const t=y(w);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[E,w,s,I,m,B,H,q]),u.useEffect((()=>{if(f)return w&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&w.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(C(E,t)||C(w,t)||C(t,w)||C(null==S?void 0:S.portalNode,t)||null!=t&&t.hasAttribute(M("focus-guard"))||T&&(fe(T.nodesRef.current,p).find((e=>{var n,r;return C(null==(n=e.context)?void 0:n.elements.floating,t)||C(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],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&&(r=r.concat(t))}return r}(T.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!j.current&&t!==F.current&&(N.current=!0,v(!1,e))}))}}),[E,w,s,p,T,S,v,f]),u.useEffect((()=>{var e;const t=Array.from((null==S||null==(e=S.portalNode)?void 0:e.querySelectorAll("["+M("portal")+"]"))||[]);if(w&&s){const e=[w,...t,L.current,D.current].filter((e=>null!=e)),n=(R?_:z)(I.current.includes("reference")||B?e.concat(E||[]):e,void 0,M("inert"));return()=>{n()}}}),[E,w,s,I,S,B,R]),c((()=>{if(!w)return;const e=le(y(w));queueMicrotask((()=>{const t=q(w),n=O.current,r=("number"==typeof n?t[n]:n.current)||w,o=C(w,e);A||o||!d||ae(r,{preventScroll:r===w})}))}),[d,w,A,q,O]),c((()=>{if(!w)return;let e=!1;const t=y(w),n=le(t),r=b.current;function o(t){if("escapeKey"===t.type&&m.domReference.current&&(F.current=m.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(N.current=!1,e=n.preventScroll):N.current=!n}return F.current=n,g.on("dismiss",o),()=>{g.off("dismiss",o);const n=le(t);(C(w,n)||T&&fe(T.nodesRef.current,p).some((e=>{var t;return C(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&m.domReference.current&&(F.current=m.domReference.current),k.current&&x(F.current)&&!N.current&&ae(F.current,{cancelPrevious:!1,preventScroll:e})}}),[w,k,b,m,g,T,p]),c((()=>{if(S)return S.setFocusManagerState({...t,modal:s,closeOnFocusOut:f,open:d}),()=>{S.setFocusManagerState(null)}}),[S,s,d,f,t]),c((()=>{if(w&&"function"==typeof MutationObserver){const e=()=>{const e=w.getAttribute("tabindex");I.current.includes("floating")||le(y(w))!==m.domReference.current&&0===H().length?"0"!==e&&w.setAttribute("tabindex","0"):"-1"!==e&&w.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(w,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[w,m,I,H]);const V=R&&!B&&(K||s);return u.createElement(u.Fragment,null,V&&u.createElement(Oe,{"data-type":"inside",ref:null==S?void 0:S.beforeInsideRef,onFocus:e=>{if(s){const e=q();ae("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=S&&S.preserveTabOrder&&S.portalNode)if(N.current=!1,Ee(e,S.portalNode)){const e=ye()||E;null==e||e.focus()}else{var t;null==(t=S.beforeOutsideRef.current)||t.focus()}}}),!B&&W("start"),n,W("end"),V&&u.createElement(Oe,{"data-type":"inside",ref:null==S?void 0:S.afterInsideRef,onFocus:e=>{if(s)ae(q()[0]);else if(null!=S&&S.preserveTabOrder&&S.portalNode)if(f&&(N.current=!0),Ee(e,S.portalNode)){const e=be()||E;null==e||e.focus()}else{var t;null==(t=S.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=function(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),s=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return c((()=>{const e=new Map(o);Array.from(e.keys()).sort(Pe).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(Se.Provider,{value:u.useMemo((()=>({register:l,unregister:s,map:o,elementsRef:n,labelsRef:r})),[l,s,o,n,r])},t)},e.FloatingNode=function(e){let{children:t,id:n}=e;const r=g();return u.createElement(p.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Le,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=Te({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Ee(e)){("focusin"===e.type?Re:we)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(ke.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(Oe,{"data-type":"outside",ref:a,onFocus:e=>{if(Ee(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=be()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:xe}),c&&r.createPortal(t,c),p&&c&&u.createElement(Oe,{"data-type":"outside",ref:f,onFocus:e=>{if(Ee(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=ye()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>m()))[0];return u.createElement(v.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=n,v=o.current[l];if(!v)return{};const g={...n,...await t.offset(-v.offsetTop-p.clientTop-m.reference.height/2-v.offsetHeight/2-c).fn(n)},h=(null==f?void 0:f.current)||p,y=await t.detectOverflow(ut(g,h.scrollHeight),d),b=await t.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,R=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=R+"px",h.scrollTop=E,i&&(h.offsetHeight<v.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await t.detectOverflow(ut({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function v(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,y=[g,h],b=de(e),E="mouseleave"===e.type,w=C(f.floating,b),x=C(f.domReference,b),I=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),k=a.split("-")[0],T=n>O.right-O.width/2,M=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,I),S=O.width>I.width,A=O.height>I.height,L=(S?I:O).left,D=(S?I:O).right,N=(A?I:O).top,F=(A?I:O).bottom;if(w&&(u=!0,!E))return;if(x&&(u=!1),x&&!E)return void(u=!0);if(E&&R(e.relatedTarget)&&C(f.floating,e.relatedTarget))return;if(p&&fe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=I.bottom-1||"bottom"===k&&s<=I.top+1||"left"===k&&n>=I.right-1||"right"===k&&n<=I.left+1)return v();let j=[];switch(k){case"top":j=[[L,I.top+1],[L,O.bottom-1],[D,O.bottom-1],[D,I.top+1]];break;case"bottom":j=[[L,O.top+1],[L,I.bottom-1],[D,I.bottom-1],[D,O.top+1]];break;case"left":j=[[O.right-1,F],[O.right-1,N],[I.left+1,N],[I.left+1,F]];break;case"right":j=[[I.right-1,F],[I.right-1,N],[O.left+1,N],[O.left+1,F]]}if(!it([g,h],j)){if(u&&!P)return v();if(!E&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return v()}it([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[S?n+t/2:T?n+4*t:n-4*t,r+t+1],[S?n-t/2:T?n+4*t:n-4*t,r+t+1],...[[O.left,T||S?O.bottom-t:O.top],[O.right,T?S?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[S?n+t/2:T?n+4*t:n-4*t,r-t],[S?n-t/2:T?n+4*t:n-4*t,r-t],...[[O.left,T||S?O.top+t:O.bottom],[O.right,T?S?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:M?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:M?r+4*t:r-4*t];return[...[[M||A?O.right-t:O.left,O.top],[M?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:M?r+4*t:r-4*t],[n-t,A?r-t/2:M?r+4*t:r-4*t],...[[M||A?O.left+t:O.right,O.top],[M?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(v,40)):v()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(T(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:T(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||De(e)||(" "!==e.key||Ne(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||De(e)||Ne(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:a=null,y:f=null}=t,d=u.useRef(!1),m=u.useRef(null),[p,v]=u.useState(),[g,h]=u.useState([]),y=je(((e,t)=>{d.current||o.current.openEvent&&!Ke(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,p=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,p-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,p=s&&null!=t.y?t.y:p):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:p,top:p,right:m+f,bottom:p+d,left:m}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:p}))})),b=je((e=>{null==a&&null==f&&(n?m.current||h([]):y(e.clientX,e.clientY))})),E=T(p)?i:n,R=u.useCallback((()=>{if(!E||!l||null!=a||null!=f)return;const e=w(r.floating.current);function t(n){const o=de(n);C(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):y(n.clientX,n.clientY)}if(!o.current.openEvent||Ke(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,E,r,y,a,f]);return u.useEffect((()=>R()),[R,g]),u.useEffect((()=>{l&&!i&&(d.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(d.current=!0)}),[l,n]),c((()=>{!l||null==a&&null==f||(d.current=!1,y(a,f))}),[l,a,f,y]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}}}),[l,b])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=D();c((()=>{u&&(s({delay:{open:1,close:A(l,"close")}}),u!==o&&r(!1))}),[o,r,s,u,l]),c((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&u===o){if(a){const t=window.setTimeout(e,a);return()=>{clearTimeout(t)}}e()}}),[n,s,u,o,r,l,a]),c((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=D,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:v="pointerdown",referencePress:b=!1,referencePressEvent:E="pointerdown",ancestorScroll:k=!1,bubbles:T}=n,C=h(),M=null!=g(),P=je("function"==typeof p?p:()=>!1),S="function"==typeof p?P:p,A=u.useRef(!1),{escapeKeyBubbles:L,outsidePressBubbles:D}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(T),N=je((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=C?fe(C.nodesRef.current,c):[];if(!L&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),F=je((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=de(e);if(x(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===w(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=C&&fe(C.nodesRef.current,c).some((t=>{var n;return Be(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Be(e,a)||Be(e,s)||r)return;const u=C?fe(C.nodesRef.current,c):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:M?{preventScroll:!0}:I(e)||O(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=L,f.current.__outsidePressBubbles=D;const n=y(a);m&&n.addEventListener("keydown",N),S&&n.addEventListener(v,F);let u=[];return k&&(R(s)&&(u=t.getOverflowAncestors(s)),R(a)&&(u=u.concat(t.getOverflowAncestors(a))),!R(l)&&l&&l.contextElement&&(u=u.concat(t.getOverflowAncestors(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",N),S&&n.removeEventListener(v,F),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,S,v,r,o,k,d,L,D,N,F]),u.useEffect((()=>{A.current=!1}),[S,v]),u.useMemo((()=>d?{reference:{onKeyDown:N,[He[E]]:e=>{b&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[qe[v]]:()=>{A.current=!0}}}:{}),[d,i,b,v,E,o,N])},e.useFloating=function(e){var n;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(n=e.elements)?void 0:n.reference)||l,d=t.useFloating(e),p=h(),v=je(((e,t)=>{e&&(y.current.openEvent=t),null==o||o(e,t)})),g=u.useRef(null),y=u.useRef({}),b=u.useState((()=>m()))[0],E=f(),w=u.useCallback((e=>{const t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),x=u.useCallback((e=>{(R(e)||null===e)&&(g.current=e,s(e)),(R(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!R(e))&&d.refs.setReference(e)}),[d.refs]),I=u.useMemo((()=>({...d.refs,setReference:x,setPositionReference:w,domReference:g})),[d.refs,x,w]),O=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),k=u.useMemo((()=>({...d,refs:I,elements:O,dataRef:y,nodeId:i,floatingId:E,events:b,open:r,onOpenChange:v})),[d,i,E,b,r,v,I,O]);return c((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=k)})),u.useMemo((()=>({...d,context:k,refs:I,elements:O})),[d,I,O,k])},e.useFloatingNodeId=function(e){const t=f(),n=h(),r=g(),o=e||r;return c((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=g,e.useFloatingPortalNode=Te,e.useFloatingTree=h,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),p=u.useRef();return u.useEffect((()=>{if(!a)return;const e=y(l).defaultView||window;function t(){!n&&x(s)&&s===le(y(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(p.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&Be(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=R(t)&&t.hasAttribute(M("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=setTimeout((()=>{C(c.floating.current,t)||C(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:s},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:v=0,move:b=!0}=t,E=h(),w=g(),x=P(m),I=P(d),O=u.useRef(),k=u.useRef(),M=u.useRef(),L=u.useRef(),D=u.useRef(!0),N=u.useRef(!1),F=u.useRef((()=>{})),j=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(f)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(L.current),D.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!x.current||!n)return;function e(e){j()&&r(!1,e)}const t=y(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,x,o,j]);const K=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=A(I.current,"close",O.current);n&&!M.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[I,r]),B=u.useCallback((()=>{F.current(),M.current=void 0}),[]),H=u.useCallback((()=>{if(N.current){const e=y(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(S),N.current=!1}}),[a]);return u.useEffect((()=>{if(f&&R(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),b&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),b&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),D.current=!1,p&&!T(O.current)||v>0&&0===A(I.current,"open"))return;const t=A(I.current,"open",O.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;F.current();const o=y(s);if(clearTimeout(L.current),x.current){n||clearTimeout(k.current),M.current=x.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){H(),B(),K(r)}});const t=M.current;return o.addEventListener("mousemove",t),void(F.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==O.current||!C(s,r.relatedTarget))&&K(r)}function c(n){t()||null==x.current||x.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){H(),B(),K(n)}})(n)}}),[l,s,f,e,p,v,b,K,B,H,r,n,E,I,x,o]),c((()=>{var e;if(f&&n&&null!=(e=x.current)&&e.__options.blockPointerEvents&&j()){const e=y(s).body;if(e.setAttribute(S,""),e.style.pointerEvents="none",N.current=!0,R(l)&&s){var t,r;const e=l,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===w)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[f,n,w,s,l,E,x,o,j]),c((()=>{n||(O.current=void 0,B(),H())}),[n,B,H]),u.useEffect((()=>()=>{B(),clearTimeout(k.current),clearTimeout(L.current),H()}),[f,B,H]),u.useMemo((()=>{if(!f)return{};function e(e){O.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(L.current),L.current=setTimeout((()=>{D.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),K(e.nativeEvent,!1)}}}}),[i,f,v,n,r,K])},e.useId=f,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=t,a=je(s),f=u.useRef(!1),d=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{a((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,a]),u.useMemo((()=>i?{floating:{onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&f.current){if(null!==d.current){const t=e.scrollTop-d.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>a((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,a])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>_e(t,e,"reference")),t),r=u.useCallback((t=>_e(t,e,"floating")),t),o=u.useCallback((t=>_e(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=function(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:s,elementsRef:a,labelsRef:f}=u.useContext(Se),d=u.useCallback((e=>{if(o.current=e,null!==n&&(a.current[n]=e,f)){var r;const o=void 0!==t;f.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,a,f,t]);return c((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),c((()=>{const e=o.current?s.get(o.current):null;null!=e&&r(e)}),[s]),u.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])},e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:v=!1,nested:E=!1,rtl:w=!1,virtual:R=!1,focusItemOnOpen:T="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:S=!0,disabledIndices:A,orientation:L="vertical",cols:D=1,scrollItemIntoView:N=!0}=t,F=g(),j=h(),K=je(f),B=u.useRef(T),H=u.useRef(null!=m?m:-1),q=u.useRef(null),_=u.useRef(!0),W=u.useRef(K),U=u.useRef(!!l),z=u.useRef(!1),V=u.useRef(!1),X=P(A),Y=P(n),G=P(N),[Z,$]=u.useState(),Q=je((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(R?$(r.id):ae(r,{preventScroll:!0,sync:!(!b().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!k())&&(We||z.current)}),requestAnimationFrame((()=>{const e=G.current;e&&r&&(n||!_.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));c((()=>{document.createElement("div").focus({get preventScroll(){return We=!0,!1}})}),[]),c((()=>{d&&(n&&l?B.current&&null!=m&&(V.current=!0,K(m)):U.current&&(H.current=-1,W.current(null)))}),[d,n,l,m,K]),c((()=>{if(d&&n&&l)if(null==a){if(z.current=!1,null!=m)return;if(U.current&&(H.current=-1,Q(s,H)),!U.current&&B.current&&(null!=q.current||!0===B.current&&null==q.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else H.current=null==q.current||Je(q.current,L,w)||E?et(s,X.current):tt(s,X.current),q.current=null,K(H.current)};t()}}else Ge(s,a)||(H.current=a,Q(s,H,V.current),V.current=!1)}),[d,n,l,a,m,E,s,L,w,K,Q,X]),c((()=>{if(d&&U.current&&!l&&j){var e,t;const n=j.nodesRef.current,r=null==(e=n.find((e=>e.id===F)))||null==(t=e.context)?void 0:t.elements.floating,o=le(y(l)),u=n.some((e=>e.context&&C(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,j,F]),c((()=>{W.current=K,U.current=!!l})),c((()=>{n||(q.current=null)}),[n]);const J=null!=a,ee=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...M&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;_.current&&"touch"!==t&&(H.current=-1,Q(s,H),K(null),R||ae(o.floating.current,{preventScroll:!0}))}}}}),[n,o,Q,M,s,K,R]);return u.useMemo((()=>{if(!d)return{};const e=X.current;function t(t){if(_.current=!1,z.current=!0,!Y.current&&t.currentTarget===o.floating.current)return;if(E&&function(e,t,n){return $e(t,n?e===Xe:e===Ve,e===Ue)}(t.key,L,w))return ve(t),r(!1,t.nativeEvent),void(x(i)&&i.focus());const u=H.current,c=et(s,e),l=tt(s,e);if("Home"===t.key&&(ve(t),H.current=c,K(H.current)),"End"===t.key&&(ve(t),H.current=l,K(H.current)),D>1){const n=H.current;if(t.key===Ue){if(ve(t),-1===n)H.current=l;else if(H.current=Ze(s,{startingIndex:n,amount:D,decrement:!0,disabledIndices:e}),v&&(n-D<c||H.current<0)){const e=n%D,t=l%D,r=l-(t-e);H.current=t===e?l:t>e?r:r-D}Ge(s,H.current)&&(H.current=n),K(H.current)}if(t.key===ze&&(ve(t),-1===n?H.current=c:(H.current=Ze(s,{startingIndex:n,amount:D,disabledIndices:e}),v&&n+D>l&&(H.current=Ze(s,{startingIndex:n%D-D,amount:D,disabledIndices:e}))),Ge(s,H.current)&&(H.current=n),K(H.current)),"both"===L){const r=Math.floor(n/D);t.key===Xe&&(ve(t),n%D!=D-1?(H.current=Ze(s,{startingIndex:n,disabledIndices:e}),v&&Ye(H.current,D,r)&&(H.current=Ze(s,{startingIndex:n-n%D-1,disabledIndices:e}))):v&&(H.current=Ze(s,{startingIndex:n-n%D-1,disabledIndices:e})),Ye(H.current,D,r)&&(H.current=n)),t.key===Ve&&(ve(t),n%D!=0?(H.current=Ze(s,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Ye(H.current,D,r)&&(H.current=Ze(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e}))):v&&(H.current=Ze(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e})),Ye(H.current,D,r)&&(H.current=n));const o=Math.floor(l/D)===r;return Ge(s,H.current)&&(H.current=v&&o?t.key===Ve?l:Ze(s,{startingIndex:n-n%D-1,disabledIndices:e}):n),void K(H.current)}}if(Qe(t.key,L)){if(ve(t),n&&!R&&le(t.currentTarget.ownerDocument)===t.currentTarget)return H.current=Je(t.key,L,w)?c:l,void K(H.current);Je(t.key,L,w)?H.current=v?u>=l?p&&u!==s.current.length?-1:c:Ze(s,{startingIndex:u,disabledIndices:e}):Math.min(l,Ze(s,{startingIndex:u,disabledIndices:e})):H.current=v?u<=c?p&&-1!==u?s.current.length:l:Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e})),Ge(s,H.current)?K(null):K(H.current)}}function u(e){"auto"===T&&I(e.nativeEvent)&&(B.current=!0)}const c=R&&n&&J&&{"aria-activedescendant":Z};return{reference:{...c,onKeyDown(o){_.current=!1;const u=0===o.key.indexOf("Arrow");if(R&&n)return t(o);if(!n&&!S&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Qe(o.key,L),l=function(e,t,n){return $e(t,n?e===Ve:e===Xe,e===ze)}(o.key,L,w);i&&(q.current=E&&c?null:o.key),E?l&&(ve(o),n?(H.current=et(s,e),K(H.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(H.current=m),ve(o),!n&&S?r(!0,o.nativeEvent):t(o),n&&K(H.current))},onFocus(){n&&K(null)},onPointerDown:function(e){B.current=T,"auto"===T&&O(e.nativeEvent)&&(B.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===L?void 0:L,...c,onKeyDown:t,onPointerMove(){_.current=!0}},item:ee}}),[i,o,Z,X,Y,s,d,L,w,R,n,J,E,m,S,p,D,v,T,K,r,ee])},e.useMergeRefs=function(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)},e.useRole=function(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=f();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])},e.useTransitionStatus=ot,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,s=e.placement,a=s.split("-")[0],f=u.useMemo((()=>({side:a,placement:s})),[a,s]),d="number"==typeof l,m=(d?l:l.open)||0,p=(d?l:l.close)||0,[v,g]=u.useState((()=>({...rt(i,f),...rt(n,f)}))),{isMounted:h,status:y}=ot(e,{duration:l}),b=P(n),E=P(r),w=P(o),R=P(i);return c((()=>{const e=rt(b.current,f),t=rt(w.current,f),n=rt(R.current,f),r=rt(E.current,f)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:m+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,E,R,m,y,f]),{isMounted:h,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:v=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:l)?n:-1),b=u.useRef(null),E=je(s),w=je(a),R=P(d),x=P(p);return c((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),c((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:l)?e:-1)}),[r,v,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&ve(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(ve(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),m);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,m,x,R,E,w])}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/react-dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/react-dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.FloatingUIReactDOM,e.React,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(n);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var c="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;let l=!1,s=0;const a=()=>"floating-ui-"+s++;const f=u["useId".toString()]||function(){const[e,t]=u.useState((()=>l?a():void 0));return c((()=>{null==e&&t(a())}),[]),u.useEffect((()=>{l||(l=!0)}),[]),e},d=u.forwardRef((function(e,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=e;const b=f();if(!o)return null;d*=2;const E=d/2,w=l/2*(a/-8+1),R=s/2*a/4,[x,I]=r.split("-"),O=t.platform.isRTL(o),k=!!v,T="top"===x||"bottom"===x,M=m&&"end"===I?"bottom":"top";let C=m&&"end"===I?"right":"left";m&&O&&(C="end"===I?"left":"right");const P=null!=(null==c?void 0:c.x)?m||c.x:"",S=null!=(null==c?void 0:c.y)?m||c.y:"",A=v||"M0,0 H"+l+" L"+(l-w)+","+(s-R)+" Q"+l/2+","+s+" "+w+","+(s-R)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",i({},y,{"aria-hidden":!0,ref:n,width:k?l:l+d,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[C]:P,[M]:S,[x]:T||k?"100%":"calc(100% - "+d/2+"px)",transform:""+L+(null!=g?g:""),...h}}),d>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:p,strokeWidth:d+(v?0:1),d:A}),u.createElement("path",{stroke:d&&!v?y.fill:"none",d:A}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-E,y:E*(k?-1:1),width:l+d,height:l})))}));function m(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const p=u.createContext(null),v=u.createContext(null),g=()=>{var e;return(null==(e=u.useContext(p))?void 0:e.id)||null},h=()=>u.useContext(v);function y(e){return(null==e?void 0:e.ownerDocument)||document}function b(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){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 w(e){return y(e).defaultView||window}function R(e){return!!e&&(e instanceof Element||e instanceof w(e).Element)}function x(e){return!!e&&(e instanceof HTMLElement||e instanceof w(e).HTMLElement)}function I(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(b())||t.test(E()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function O(e){return 0===e.width&&0===e.height||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}function k(){return/apple/i.test(navigator.vendor)}function T(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof w(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function C(e){return"data-floating-ui-"+e}function P(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const S=C("safe-polygon");function A(e,t,n){return n&&!T(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const L=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),D=()=>u.useContext(L);var N=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},F=new WeakMap,j=new WeakMap,K={},H=0,B=function(e){return e&&(e.host||B(e.parentNode))},q=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=B(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);K[n]||(K[n]=new WeakMap);var u=K[n],i=[],c=new Set,l=new Set(o),s=function(e){e&&!c.has(e)&&(c.add(e),s(e.parentNode))};o.forEach(s);var a=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))a(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(F.get(e)||0)+1,s=(u.get(e)||0)+1;F.set(e,l),u.set(e,s),i.push(e),1===l&&o&&j.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return a(t),c.clear(),H++,function(){i.forEach((function(e){var t=F.get(e)-1,o=u.get(e)-1;F.set(e,t),u.set(e,o),t||(j.has(e)||e.removeAttribute(r),j.delete(e)),o||e.removeAttribute(n)})),--H||(F=new WeakMap,F=new WeakMap,j=new WeakMap,K={})}},_=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||N(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),q(r,o,n,"aria-hidden")):function(){return null}},W=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||N(e);return r?q(e,r,n,"inert"):function(){return null}},U=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},z=function(e,t,n){return void 0===n&&(n="data-suppressed"),(U()?W:_)(e,t,n)},V=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),X="undefined"==typeof Element,Y=X?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,G=!X&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Z=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{Y.call(i,V)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!r.shadowRootFilter||r.shadowRootFilter(i);if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},$=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Q=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},J=function(e){return"INPUT"===e.tagName},ee=function(e){return function(e){return J(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||G(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},te=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ne=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Y.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Y.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return te(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=G(e);if(i&&!i.shadowRoot&&!0===r(i))return te(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=G(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=G(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},re=function(e,t){return!(t.disabled||function(e){return J(e)&&"hidden"===e.type}(t)||ne(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Y.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},oe=function(e,t){return!(ee(t)||$(t)<0||!re(e,t))},ue=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ie=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=$(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(Q).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ce=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Z([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ue}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(V));return t&&Y.call(e,V)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,oe.bind(null,t)),ie(n)};function le(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let se=0;function ae(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(se);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():se=requestAnimationFrame(u)}function fe(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function de(e){return"composedPath"in e?e.composedPath()[0]:e.target}const me="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function pe(e){return x(e)&&e.matches(me)}function ve(e){e.preventDefault(),e.stopPropagation()}const ge=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function he(e,t){const n=ce(e,ge());"prev"===t&&n.reverse();const r=n.indexOf(le(y(e)));return n.slice(r+1)[0]}function ye(){return he(document.body,"next")}function be(){return he(document.body,"prev")}function Ee(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!M(n,r)}function we(e){ce(e,ge()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Re(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const xe={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};function Ie(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Oe=u.forwardRef((function(e,t){const[n,r]=u.useState();c((()=>(k()&&r("button"),document.addEventListener("keydown",Ie),()=>{document.removeEventListener("keydown",Ie)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[C("focus-guard")]:"",style:xe};return u.createElement("span",i({},e,o))})),ke=u.createContext(null);function Te(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),i=f(),l=Me(),s=u.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:i})),[t,n,l,i]),a=u.useRef();return c((()=>()=>{null==r||r.remove()}),[r,s]),c((()=>{if(a.current===s)return;a.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,u=e?document.getElementById(e):null,i=C("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!R(u)&&(u=u.current),u=u||document.body;let c=null;e&&(c=document.createElement("div"),c.id=e,u.appendChild(c));const l=document.createElement("div");l.id=r,l.setAttribute(i,""),u=c||u,u.appendChild(l),o(l)}}),[s]),r}const Me=()=>u.useContext(ke),Ce=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:xe}))}));function Pe(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 Se=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const Ae=C("scroll-lock"),Le=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ae))return;document.body.setAttribute(Ae,"");const r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth;if(!/iP(hone|ad|od)|iOS/.test(b()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ae),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,i=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,c=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(i))+"px",left:-(c-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ae),window.scrollTo(c,l)}}),[n]),u.createElement("div",i({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function De(e){return x(e.target)&&"BUTTON"===e.target.tagName}function Ne(e){return pe(e)}const Fe=u["useInsertionEffect".toString()]||(e=>e());function je(e){const t=u.useRef((()=>{}));return Fe((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function Ke(e){return null!=e&&null!=e.clientX}function He(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)}const Be={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function _e(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var u;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(u=r.get(n))||u.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}let We=!1;const Ue="ArrowUp",ze="ArrowDown",Ve="ArrowLeft",Xe="ArrowRight";function Ye(e,t,n){return Math.floor(e/t)!==n}function Ge(e,t){return t<0||t>=e.current.length}function Ze(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current;let c=n;do{var l,s;c+=r?-u:u}while(c>=0&&c<=i.length-1&&(o?o.includes(c):null==i[c]||(null==(l=i[c])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=i[c])?void 0:s.getAttribute("aria-disabled"))));return c}function $e(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Qe(e,t){return $e(t,e===Ue||e===ze,e===Ve||e===Xe)}function Je(e,t,n){return $e(t,e===ze,n?e===Ve:e===Xe)||"Enter"===e||" "==e||""===e}function et(e,t){return Ze(e,{disabledIndices:t})}function tt(e,t){return Ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const nt=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function rt(e,t){return"function"==typeof e?e(t):e}function ot(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[l,s]=u.useState(!1),[a,f]=u.useState("unmounted"),d=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return c((()=>{l&&!d&&f("unmounted")}),[l,d]),c((()=>{if(r){if(n){f("initial");const e=requestAnimationFrame((()=>{f("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),f("close")}}),[n,r]),{isMounted:d,status:a}}function ut(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function it(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return t.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.FloatingArrow=d,e.FloatingDelayGroup=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=u.useRef(null),s=u.useCallback((e=>{i({currentId:e})}),[]);return c((()=>{o.currentId?null===l.current?l.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),l.current=null)}),[o.currentId]),u.createElement(L.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,order:r=["content"],guards:o=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:m,nodeId:p,onOpenChange:v,events:g,dataRef:b,elements:{domReference:E,floating:w}}=t,R=!U()||o,I=P(r),O=P(i),k=P(l),T=h(),S=Me(),A="number"==typeof i&&i<0,L=u.useRef(null),D=u.useRef(null),N=u.useRef(!1),F=u.useRef(null),j=u.useRef(!1),K=null!=S,H=E&&"combobox"===E.getAttribute("role")&&pe(E),B=u.useCallback((function(e){return void 0===e&&(e=w),e?ce(e,ge()):[]}),[w]),q=u.useCallback((e=>{const t=B(e);return I.current.map((e=>E&&"reference"===e?E:w&&"floating"===e?w:t)).filter(Boolean).flat()}),[E,w,I,B]);function W(e){return a&&s?u.createElement(Ce,{ref:"start"===e?L:D,onClick:e=>v(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(!s)return;function e(e){if("Tab"===e.key){M(w,le(y(w)))&&0===B().length&&!H&&ve(e);const t=q(),n=de(e);"reference"===I.current[0]&&n===E&&(ve(e),e.shiftKey?ae(t[t.length-1]):ae(t[1])),"floating"===I.current[1]&&n===w&&e.shiftKey&&(ve(e),ae(t[0]))}}const t=y(w);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[E,w,s,I,m,H,B,q]),u.useEffect((()=>{if(f)return w&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&w.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(M(E,t)||M(w,t)||M(t,w)||M(null==S?void 0:S.portalNode,t)||null!=t&&t.hasAttribute(C("focus-guard"))||T&&(fe(T.nodesRef.current,p).find((e=>{var n,r;return M(null==(n=e.context)?void 0:n.elements.floating,t)||M(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],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&&(r=r.concat(t))}return r}(T.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!j.current&&t!==F.current&&(N.current=!0,v(!1,e))}))}}),[E,w,s,p,T,S,v,f]),u.useEffect((()=>{var e;const t=Array.from((null==S||null==(e=S.portalNode)?void 0:e.querySelectorAll("["+C("portal")+"]"))||[]);if(w&&s){const e=[w,...t,L.current,D.current].filter((e=>null!=e)),n=(R?_:z)(I.current.includes("reference")||H?e.concat(E||[]):e,void 0,C("inert"));return()=>{n()}}}),[E,w,s,I,S,H,R]),c((()=>{if(!w)return;const e=le(y(w));queueMicrotask((()=>{const t=q(w),n=O.current,r=("number"==typeof n?t[n]:n.current)||w,o=M(w,e);A||o||!d||ae(r,{preventScroll:r===w})}))}),[d,w,A,q,O]),c((()=>{if(!w)return;let e=!1;const t=y(w),n=le(t),r=b.current;function o(t){if("escapeKey"===t.type&&m.domReference.current&&(F.current=m.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(N.current=!1,e=n.preventScroll):N.current=!n}return F.current=n,g.on("dismiss",o),()=>{g.off("dismiss",o);const n=le(t);(M(w,n)||T&&fe(T.nodesRef.current,p).some((e=>{var t;return M(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&m.domReference.current&&(F.current=m.domReference.current),k.current&&x(F.current)&&!N.current&&ae(F.current,{cancelPrevious:!1,preventScroll:e})}}),[w,k,b,m,g,T,p]),c((()=>{if(S)return S.setFocusManagerState({...t,modal:s,closeOnFocusOut:f,open:d}),()=>{S.setFocusManagerState(null)}}),[S,s,d,f,t]),c((()=>{if(w&&"function"==typeof MutationObserver){const e=()=>{const e=w.getAttribute("tabindex");I.current.includes("floating")||le(y(w))!==m.domReference.current&&0===B().length?"0"!==e&&w.setAttribute("tabindex","0"):"-1"!==e&&w.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(w,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[w,m,I,B]);const V=R&&!H&&(K||s);return u.createElement(u.Fragment,null,V&&u.createElement(Oe,{"data-type":"inside",ref:null==S?void 0:S.beforeInsideRef,onFocus:e=>{if(s){const e=q();ae("reference"===r[0]?e[0]:e[e.length-1])}else if(null!=S&&S.preserveTabOrder&&S.portalNode)if(N.current=!1,Ee(e,S.portalNode)){const e=ye()||E;null==e||e.focus()}else{var t;null==(t=S.beforeOutsideRef.current)||t.focus()}}}),!H&&W("start"),n,W("end"),V&&u.createElement(Oe,{"data-type":"inside",ref:null==S?void 0:S.afterInsideRef,onFocus:e=>{if(s)ae(q()[0]);else if(null!=S&&S.preserveTabOrder&&S.portalNode)if(f&&(N.current=!0),Ee(e,S.portalNode)){const e=be()||E;null==e||e.focus()}else{var t;null==(t=S.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=function(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,i]=u.useState((()=>new Map)),l=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),s=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return c((()=>{const e=new Map(o);Array.from(e.keys()).sort(Pe).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(Se.Provider,{value:u.useMemo((()=>({register:l,unregister:s,map:o,elementsRef:n,labelsRef:r})),[l,s,o,n,r])},t)},e.FloatingNode=function(e){let{children:t,id:n}=e;const r=g();return u.createElement(p.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Le,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=Te({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=u.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Ee(e)){("focusin"===e.type?Re:we)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(ke.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(Oe,{"data-type":"outside",ref:a,onFocus:e=>{if(Ee(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=be()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:xe}),c&&r.createPortal(t,c),p&&c&&u.createElement(Oe,{"data-type":"outside",ref:f,onFocus:e=>{if(Ee(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=ye()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){let{children:t}=e;const n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>m()))[0];return u.createElement(v.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[n,r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(n){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:p}}=n,v=o.current[l];if(!v)return{};const g={...n,...await t.offset(-v.offsetTop-p.clientTop-m.reference.height/2-v.offsetHeight/2-c).fn(n)},h=(null==f?void 0:f.current)||p,y=await t.detectOverflow(ut(g,h.scrollHeight),d),b=await t.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,R=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=R+"px",h.scrollTop=E,i&&(h.offsetHeight<v.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await t.detectOverflow(ut({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function v(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:g,clientY:h}=e,y=[g,h],b=de(e),E="mouseleave"===e.type,w=M(f.floating,b),x=M(f.domReference,b),I=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),k=a.split("-")[0],T=n>O.right-O.width/2,C=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,I),S=O.width>I.width,A=O.height>I.height,L=(S?I:O).left,D=(S?I:O).right,N=(A?I:O).top,F=(A?I:O).bottom;if(w&&(u=!0,!E))return;if(x&&(u=!1),x&&!E)return void(u=!0);if(E&&R(e.relatedTarget)&&M(f.floating,e.relatedTarget))return;if(p&&fe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&s>=I.bottom-1||"bottom"===k&&s<=I.top+1||"left"===k&&n>=I.right-1||"right"===k&&n<=I.left+1)return v();let j=[];switch(k){case"top":j=[[L,I.top+1],[L,O.bottom-1],[D,O.bottom-1],[D,I.top+1]];break;case"bottom":j=[[L,O.top+1],[L,I.bottom-1],[D,I.bottom-1],[D,O.top+1]];break;case"left":j=[[O.right-1,F],[O.right-1,N],[I.left+1,N],[I.left+1,F]];break;case"right":j=[[I.right-1,F],[I.right-1,N],[O.left+1,N],[O.left+1,F]]}if(!it([g,h],j)){if(u&&!P)return v();if(!E&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return v()}it([g,h],function(e){let[n,r]=e;switch(k){case"top":return[[S?n+t/2:T?n+4*t:n-4*t,r+t+1],[S?n-t/2:T?n+4*t:n-4*t,r+t+1],...[[O.left,T||S?O.bottom-t:O.top],[O.right,T?S?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[S?n+t/2:T?n+4*t:n-4*t,r-t],[S?n-t/2:T?n+4*t:n-4*t,r-t],...[[O.left,T||S?O.top+t:O.bottom],[O.right,T?S?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:C?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:C?r+4*t:r-4*t];return[...[[C||A?O.right-t:O.left,O.top],[C?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:C?r+4*t:r-4*t],[n-t,A?r-t/2:C?r+4*t:r-4*t],...[[C||A?O.left+t:O.right,O.top],[C?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(v,40)):v()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(T(d.current,!0)&&a||"click"!==l&&(n?!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||r(!1,e.nativeEvent):(e.preventDefault(),r(!0,e.nativeEvent))))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:T(d.current,!0)&&a||(n?!s||o.current.openEvent&&"click"!==o.current.openEvent.type||r(!1,e.nativeEvent):r(!0,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||De(e)||(" "!==e.key||Ne(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&(n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent)))},onKeyUp(e){e.defaultPrevented||!f||De(e)||Ne(i)||" "===e.key&&m.current&&(m.current=!1,n?s&&r(!1,e.nativeEvent):r(!0,e.nativeEvent))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:l=!0,axis:s="both",x:a=null,y:f=null}=t,d=u.useRef(!1),m=u.useRef(null),[p,v]=u.useState(),[g,h]=u.useState([]),y=je(((e,t)=>{d.current||o.current.openEvent&&!Ke(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,m=c.x,p=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),m-=n||0,p-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,m=l&&null!=t.x?t.x:m,p=s&&null!=t.y?t.y:p):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:m,y:p,top:p,right:m+f,bottom:p+d,left:m}}}}(r.domReference,{x:e,y:t,axis:s,dataRef:o,pointerType:p}))})),b=je((e=>{null==a&&null==f&&(n?m.current||h([]):y(e.clientX,e.clientY))})),E=T(p)?i:n,R=u.useCallback((()=>{if(!E||!l||null!=a||null!=f)return;const e=w(r.floating.current);function t(n){const o=de(n);M(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):y(n.clientX,n.clientY)}if(!o.current.openEvent||Ke(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,E,r,y,a,f]);return u.useEffect((()=>R()),[R,g]),u.useEffect((()=>{l&&!i&&(d.current=!1)}),[l,i]),u.useEffect((()=>{!l&&n&&(d.current=!0)}),[l,n]),c((()=>{!l||null==a&&null==f||(d.current=!1,y(a,f))}),[l,a,f,y]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;v(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}}}),[l,b])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=D();c((()=>{u&&(s({delay:{open:1,close:A(l,"close")}}),u!==o&&r(!1))}),[o,r,s,u,l]),c((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&u===o){if(a){const t=window.setTimeout(e,a);return()=>{clearTimeout(t)}}e()}}),[n,s,u,o,r,l,a]),c((()=>{n&&i(o)}),[n,i,o])},e.useDelayGroupContext=D,e.useDismiss=function(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:c,elements:{reference:l,domReference:s,floating:a},dataRef:f}=e,{enabled:d=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:v="pointerdown",referencePress:b=!1,referencePressEvent:E="pointerdown",ancestorScroll:k=!1,bubbles:T}=n,M=h(),C=null!=g(),P=je("function"==typeof p?p:()=>!1),S="function"==typeof p?P:p,A=u.useRef(!1),{escapeKeyBubbles:L,outsidePressBubbles:D}=(e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}})(T),N=je((e=>{if(!r||!d||!m||"Escape"!==e.key)return;const t=M?fe(M.nodesRef.current,c):[];if(!L&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),F=je((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=de(e);if(x(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===w(a).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=M&&fe(M.nodesRef.current,c).some((t=>{var n;return He(e,null==(n=t.context)?void 0:n.elements.floating)}));if(He(e,a)||He(e,s)||r)return;const u=M?fe(M.nodesRef.current,c):[];if(u.length>0){let e=!0;if(u.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:C?{preventScroll:!0}:I(e)||O(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=L,f.current.__outsidePressBubbles=D;const n=y(a);m&&n.addEventListener("keydown",N),S&&n.addEventListener(v,F);let u=[];return k&&(R(s)&&(u=t.getOverflowAncestors(s)),R(a)&&(u=u.concat(t.getOverflowAncestors(a))),!R(l)&&l&&l.contextElement&&(u=u.concat(t.getOverflowAncestors(l.contextElement)))),u=u.filter((e=>{var t;return e!==(null==(t=n.defaultView)?void 0:t.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&n.removeEventListener("keydown",N),S&&n.removeEventListener(v,F),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,m,S,v,r,o,k,d,L,D,N,F]),u.useEffect((()=>{A.current=!1}),[S,v]),u.useMemo((()=>d?{reference:{onKeyDown:N,[Be[E]]:e=>{b&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[qe[v]]:()=>{A.current=!0}}}:{}),[d,i,b,v,E,o,N])},e.useFloating=function(e){var n;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[l,s]=u.useState(null),a=(null==(n=e.elements)?void 0:n.reference)||l,d=t.useFloating(e),p=h(),v=je(((e,t)=>{e&&(y.current.openEvent=t),null==o||o(e,t)})),g=u.useRef(null),y=u.useRef({}),b=u.useState((()=>m()))[0],E=f(),w=u.useCallback((e=>{const t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),x=u.useCallback((e=>{(R(e)||null===e)&&(g.current=e,s(e)),(R(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!R(e))&&d.refs.setReference(e)}),[d.refs]),I=u.useMemo((()=>({...d.refs,setReference:x,setPositionReference:w,domReference:g})),[d.refs,x,w]),O=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),k=u.useMemo((()=>({...d,refs:I,elements:O,dataRef:y,nodeId:i,floatingId:E,events:b,open:r,onOpenChange:v})),[d,i,E,b,r,v,I,O]);return c((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=k)})),u.useMemo((()=>({...d,context:k,refs:I,elements:O})),[d,I,O,k])},e.useFloatingNodeId=function(e){const t=f(),n=h(),r=g(),o=e||r;return c((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=g,e.useFloatingPortalNode=Te,e.useFloatingTree=h,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,refs:c,elements:{floating:l,domReference:s}}=e,{enabled:a=!0,keyboardOnly:f=!0}=t,d=u.useRef(""),m=u.useRef(!1),p=u.useRef();return u.useEffect((()=>{if(!a)return;const e=y(l).defaultView||window;function t(){!n&&x(s)&&s===le(y(s))&&(m.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,s,n,a]),u.useEffect((()=>{if(a)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(m.current=!0)}}),[i,a]),u.useEffect((()=>()=>{clearTimeout(p.current)}),[]),u.useMemo((()=>a?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,m.current=!(!t||!f)},onMouseLeave(){m.current=!1},onFocus(e){var t;m.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&He(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=R(t)&&t.hasAttribute(C("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=setTimeout((()=>{M(c.floating.current,t)||M(s,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[a,f,s,c,o,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:l,floating:s},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:v=0,move:b=!0}=t,E=h(),w=g(),x=P(m),I=P(d),O=u.useRef(),k=u.useRef(),C=u.useRef(),L=u.useRef(),D=u.useRef(!0),N=u.useRef(!1),F=u.useRef((()=>{})),j=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(f)return i.on("dismiss",e),()=>{i.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(L.current),D.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!x.current||!n)return;function e(e){j()&&r(!1,e)}const t=y(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,x,o,j]);const K=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=A(I.current,"close",O.current);n&&!C.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[I,r]),H=u.useCallback((()=>{F.current(),C.current=void 0}),[]),B=u.useCallback((()=>{if(N.current){const e=y(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(S),N.current=!1}}),[a]);return u.useEffect((()=>{if(f&&R(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),b&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),b&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),D.current=!1,p&&!T(O.current)||v>0&&0===A(I.current,"open"))return;const t=A(I.current,"open",O.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;F.current();const o=y(s);if(clearTimeout(L.current),x.current){n||clearTimeout(k.current),C.current=x.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){B(),H(),K(r)}});const t=C.current;return o.addEventListener("mousemove",t),void(F.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==O.current||!M(s,r.relatedTarget))&&K(r)}function c(n){t()||null==x.current||x.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){B(),H(),K(n)}})(n)}}),[l,s,f,e,p,v,b,K,H,B,r,n,E,I,x,o]),c((()=>{var e;if(f&&n&&null!=(e=x.current)&&e.__options.blockPointerEvents&&j()){const e=y(s).body;if(e.setAttribute(S,""),e.style.pointerEvents="none",N.current=!0,R(l)&&s){var t,r;const e=l,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===w)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[f,n,w,s,l,E,x,o,j]),c((()=>{n||(O.current=void 0,H(),B())}),[n,H,B]),u.useEffect((()=>()=>{H(),clearTimeout(k.current),clearTimeout(L.current),B()}),[f,H,B]),u.useMemo((()=>{if(!f)return{};function e(e){O.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===v||(clearTimeout(L.current),L.current=setTimeout((()=>{D.current||r(!0,e.nativeEvent)}),v))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),K(e.nativeEvent,!1)}}}}),[i,f,v,n,r,K])},e.useId=f,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=t,a=je(s),f=u.useRef(!1),d=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{a((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,a]),u.useMemo((()=>i?{floating:{onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&f.current){if(null!==d.current){const t=e.scrollTop-d.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>a((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,a])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>_e(t,e,"reference")),t),r=u.useCallback((t=>_e(t,e,"floating")),t),o=u.useCallback((t=>_e(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=function(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:i,unregister:l,map:s,elementsRef:a,labelsRef:f}=u.useContext(Se),d=u.useCallback((e=>{if(o.current=e,null!==n&&(a.current[n]=e,f)){var r;const o=void 0!==t;f.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,a,f,t]);return c((()=>{const e=o.current;if(e)return i(e),()=>{l(e)}}),[i,l]),c((()=>{const e=o.current?s.get(o.current):null;null!=e&&r(e)}),[s]),u.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])},e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:l}}=e,{listRef:s,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:m=null,allowEscape:p=!1,loop:v=!1,nested:E=!1,rtl:w=!1,virtual:R=!1,focusItemOnOpen:T="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:S=!0,disabledIndices:A,orientation:L="vertical",cols:D=1,scrollItemIntoView:N=!0}=t,F=g(),j=h(),K=je(f),H=u.useRef(T),B=u.useRef(null!=m?m:-1),q=u.useRef(null),_=u.useRef(!0),W=u.useRef(K),U=u.useRef(!!l),z=u.useRef(!1),V=u.useRef(!1),X=P(A),Y=P(n),G=P(N),[Z,$]=u.useState(),Q=je((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(R?$(r.id):ae(r,{preventScroll:!0,sync:!(!b().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!k())&&(We||z.current)}),requestAnimationFrame((()=>{const e=G.current;e&&r&&(n||!_.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));c((()=>{document.createElement("div").focus({get preventScroll(){return We=!0,!1}})}),[]),c((()=>{d&&(n&&l?H.current&&null!=m&&(V.current=!0,K(m)):U.current&&(B.current=-1,W.current(null)))}),[d,n,l,m,K]),c((()=>{if(d&&n&&l)if(null==a){if(z.current=!1,null!=m)return;if(U.current&&(B.current=-1,Q(s,B)),!U.current&&H.current&&(null!=q.current||!0===H.current&&null==q.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else B.current=null==q.current||Je(q.current,L,w)||E?et(s,X.current):tt(s,X.current),q.current=null,K(B.current)};t()}}else Ge(s,a)||(B.current=a,Q(s,B,V.current),V.current=!1)}),[d,n,l,a,m,E,s,L,w,K,Q,X]),c((()=>{if(d&&U.current&&!l&&j){var e,t;const n=j.nodesRef.current,r=null==(e=n.find((e=>e.id===F)))||null==(t=e.context)?void 0:t.elements.floating,o=le(y(l)),u=n.some((e=>e.context&&M(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,j,F]),c((()=>{W.current=K,U.current=!!l})),c((()=>{n||(q.current=null)}),[n]);const J=null!=a,ee=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...C&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;_.current&&"touch"!==t&&(B.current=-1,Q(s,B),K(null),R||ae(o.floating.current,{preventScroll:!0}))}}}}),[n,o,Q,C,s,K,R]);return u.useMemo((()=>{if(!d)return{};const e=X.current;function t(t){if(_.current=!1,z.current=!0,!Y.current&&t.currentTarget===o.floating.current)return;if(E&&function(e,t,n){return $e(t,n?e===Xe:e===Ve,e===Ue)}(t.key,L,w))return ve(t),r(!1,t.nativeEvent),void(x(i)&&i.focus());const u=B.current,c=et(s,e),l=tt(s,e);if("Home"===t.key&&(ve(t),B.current=c,K(B.current)),"End"===t.key&&(ve(t),B.current=l,K(B.current)),D>1){const n=B.current;if(t.key===Ue){if(ve(t),-1===n)B.current=l;else if(B.current=Ze(s,{startingIndex:n,amount:D,decrement:!0,disabledIndices:e}),v&&(n-D<c||B.current<0)){const e=n%D,t=l%D,r=l-(t-e);B.current=t===e?l:t>e?r:r-D}Ge(s,B.current)&&(B.current=n),K(B.current)}if(t.key===ze&&(ve(t),-1===n?B.current=c:(B.current=Ze(s,{startingIndex:n,amount:D,disabledIndices:e}),v&&n+D>l&&(B.current=Ze(s,{startingIndex:n%D-D,amount:D,disabledIndices:e}))),Ge(s,B.current)&&(B.current=n),K(B.current)),"both"===L){const r=Math.floor(n/D);t.key===Xe&&(ve(t),n%D!=D-1?(B.current=Ze(s,{startingIndex:n,disabledIndices:e}),v&&Ye(B.current,D,r)&&(B.current=Ze(s,{startingIndex:n-n%D-1,disabledIndices:e}))):v&&(B.current=Ze(s,{startingIndex:n-n%D-1,disabledIndices:e})),Ye(B.current,D,r)&&(B.current=n)),t.key===Ve&&(ve(t),n%D!=0?(B.current=Ze(s,{startingIndex:n,disabledIndices:e,decrement:!0}),v&&Ye(B.current,D,r)&&(B.current=Ze(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e}))):v&&(B.current=Ze(s,{startingIndex:n+(D-n%D),decrement:!0,disabledIndices:e})),Ye(B.current,D,r)&&(B.current=n));const o=Math.floor(l/D)===r;return Ge(s,B.current)&&(B.current=v&&o?t.key===Ve?l:Ze(s,{startingIndex:n-n%D-1,disabledIndices:e}):n),void K(B.current)}}if(Qe(t.key,L)){if(ve(t),n&&!R&&le(t.currentTarget.ownerDocument)===t.currentTarget)return B.current=Je(t.key,L,w)?c:l,void K(B.current);Je(t.key,L,w)?B.current=v?u>=l?p&&u!==s.current.length?-1:c:Ze(s,{startingIndex:u,disabledIndices:e}):Math.min(l,Ze(s,{startingIndex:u,disabledIndices:e})):B.current=v?u<=c?p&&-1!==u?s.current.length:l:Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,Ze(s,{startingIndex:u,decrement:!0,disabledIndices:e})),Ge(s,B.current)?K(null):K(B.current)}}function u(e){"auto"===T&&I(e.nativeEvent)&&(H.current=!0)}const c=R&&n&&J&&{"aria-activedescendant":Z};return{reference:{...c,onKeyDown(o){_.current=!1;const u=0===o.key.indexOf("Arrow");if(R&&n)return t(o);if(!n&&!S&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Qe(o.key,L),l=function(e,t,n){return $e(t,n?e===Ve:e===Xe,e===ze)}(o.key,L,w);i&&(q.current=E&&c?null:o.key),E?l&&(ve(o),n?(B.current=et(s,e),K(B.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(B.current=m),ve(o),!n&&S?r(!0,o.nativeEvent):t(o),n&&K(B.current))},onFocus(){n&&K(null)},onPointerDown:function(e){H.current=T,"auto"===T&&O(e.nativeEvent)&&(H.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===L?void 0:L,...c,onKeyDown:t,onPointerMove(){_.current=!0}},item:ee}}),[i,o,Z,X,Y,s,d,L,w,R,n,J,E,m,S,p,D,v,T,K,r,ee])},e.useMergeRefs=function(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)},e.useRole=function(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:i="dialog"}=t,c=f();return u.useMemo((()=>{const e={id:r,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?r:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:c}},floating:{...e,..."menu"===i&&{"aria-labelledby":c}}}:{}}),[o,i,n,r,c])},e.useTransitionStatus=ot,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:l=250}=t,s=e.placement,a=s.split("-")[0],f=u.useMemo((()=>({side:a,placement:s})),[a,s]),d="number"==typeof l,m=(d?l:l.open)||0,p=(d?l:l.close)||0,[v,g]=u.useState((()=>({...rt(i,f),...rt(n,f)}))),{isMounted:h,status:y}=ot(e,{duration:l}),b=P(n),E=P(r),w=P(o),R=P(i);return c((()=>{const e=rt(b.current,f),t=rt(w.current,f),n=rt(R.current,f),r=rt(E.current,f)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:m+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(nt).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,E,R,m,y,f]),{isMounted:h,styles:v}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:m=750,ignoreKeys:p=[],selectedIndex:v=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=v?v:l)?n:-1),b=u.useRef(null),E=je(s),w=je(a),R=P(d),x=P(p);return c((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),c((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=v?v:l)?e:-1)}),[r,v,l]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=R.current?R.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&ve(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(ve(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),m);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,m,x,R,E,w])}}));
{
"name": "@floating-ui/react",
"version": "0.24.6",
"version": "0.24.7",
"@rollingversions": {

@@ -5,0 +5,0 @@ "baseVersion": [

@@ -12,3 +12,2 @@ /// <reference types="react" />

export declare function isReactEvent(event: any): event is React.SyntheticEvent;
export declare function isHidden(el: HTMLElement | null): boolean;
export declare function isRootElement(element: Element): boolean;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc