@floating-ui/react
Advanced tools
Comparing version 0.24.8 to 0.25.0
@@ -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),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,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,modal:m=!0,visuallyHiddenDismiss:v=!1,closeOnFocusOut:p=!0}=e,{open:h,refs:b,nodeId:y,onOpenChange:E,events:w,dataRef:R,elements:{domReference:x,floating:I}}=t,k=!s()||i,C=q(o),T=q(c),O=q(l),L=M(),S=he(),A="number"==typeof c&&c<0,D=u.useRef(null),F=u.useRef(null),K=u.useRef(!1),H=u.useRef(null),B=u.useRef(!1),W=null!=S,V=x&&"combobox"===x.getAttribute("role")&&ne(x),X=u.useCallback((function(e){return void 0===e&&(e=I),e?d(e,oe()):[]}),[I]),Y=u.useCallback((e=>{const t=X(e);return C.current.map((e=>x&&"reference"===e?x:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[x,I,C,X]);function U(e){return!r&&v&&m?u.createElement(be,{ref:"start"===e?D:F,onClick:e=>E(!1,e.nativeEvent)},"string"==typeof v?v:"Dismiss"):null}u.useEffect((()=>{if(r||!m)return;function e(e){if("Tab"===e.key){_(I,G(P(I)))&&0===X().length&&!V&&re(e);const t=Y(),n=ee(e);"reference"===C.current[0]&&n===x&&(re(e),e.shiftKey?J(t[t.length-1]):J(t[1])),"floating"===C.current[1]&&n===I&&e.shiftKey&&(re(e),J(t[0]))}}const t=P(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,I,m,C,b,V,X,Y]),u.useEffect((()=>{if(!r&&p)return I&&N(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),!m&&I.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),!m&&I.removeEventListener("focusout",t)}):void 0;function e(){B.current=!0,setTimeout((()=>{B.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(_(x,t)||_(I,t)||_(t,I)||_(null==S?void 0:S.portalNode,t)||null!=t&&t.hasAttribute(j("focus-guard"))||L&&($(L.nodesRef.current,y).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}(L.nodesRef.current,y).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!==H.current&&(K.current=!0,E(!1,e))}))}}),[r,x,I,m,y,L,S,E,p]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==S||null==(e=S.portalNode)?void 0:e.querySelectorAll("["+j("portal")+"]"))||[]);if(I&&m){const e=[I,...t,D.current,F.current].filter((e=>null!=e)),n=(k?a:f)(C.current.includes("reference")||V?e.concat(x||[]):e,void 0,j("inert"));return()=>{n()}}}),[r,x,I,m,C,S,V,k]),g((()=>{if(r||!I)return;const e=G(P(I));queueMicrotask((()=>{const t=Y(I),n=T.current,r=("number"==typeof n?t[n]:n.current)||I,o=_(I,e);A||o||!h||J(r,{preventScroll:r===I})}))}),[r,h,I,A,Y,T]),g((()=>{if(r||!I)return;let e=!1;const t=P(I),n=G(t),o=R.current;function u(t){if("escapeKey"===t.type&&b.domReference.current&&(H.current=b.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(K.current=!1,e=n.preventScroll):K.current=!n}return H.current=n,w.on("dismiss",u),()=>{w.off("dismiss",u);const n=G(t);(_(I,n)||L&&$(L.nodesRef.current,y).some((e=>{var t;return _(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&b.domReference.current&&(H.current=b.domReference.current),O.current&&N(H.current)&&!K.current&&J(H.current,{cancelPrevious:!1,preventScroll:e})}}),[r,I,O,R,b,w,L,y]),g((()=>{if(!r&&S)return S.setFocusManagerState({...t,modal:m,closeOnFocusOut:p,open:h}),()=>{S.setFocusManagerState(null)}}),[r,S,m,h,p,t]),g((()=>{if(!r&&I&&"function"==typeof MutationObserver){const e=()=>{const e=I.getAttribute("tabindex");C.current.includes("floating")||G(P(I))!==b.domReference.current&&0===X().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,I,b,C,X]);const z=!r&&k&&!V&&(W||m);return u.createElement(u.Fragment,null,z&&u.createElement(me,{"data-type":"inside",ref:null==S?void 0:S.beforeInsideRef,onFocus:e=>{if(m){const e=Y();J("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=S&&S.preserveTabOrder&&S.portalNode)if(K.current=!1,le(e,S.portalNode)){const e=ie()||x;null==e||e.focus()}else{var t;null==(t=S.beforeOutsideRef.current)||t.focus()}}}),!V&&U("start"),n,U("end"),z&&u.createElement(me,{"data-type":"inside",ref:null==S?void 0:S.afterInsideRef,onFocus:e=>{if(m)J(Y()[0]);else if(null!=S&&S.preserveTabOrder&&S.portalNode)if(p&&(K.current=!0),le(e,S.portalNode)){const e=ce()||x;null==e||e.focus()}else{var t;null==(t=S.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?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,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(!0,e.nativeEvent):r(!1,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&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Me(e)||Ce(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,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}; | ||
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 c,useEffect as i,useRef as l}from"react";import{isElement as s,isHTMLElement as a,getWindow as f,getComputedStyle as d}from"@floating-ui/utils/dom";import{getDocument as m,isMouseLikePointerType as v,contains as p,activeElement as g,isSafari as b,isTypeableElement as y,stopEvent as h,getTarget as E,getPlatform as R,isReactEvent as w,isEventTargetWithin as x,isVirtualClick as I,isVirtualPointerEvent as k,isMac as M,getUserAgent as C}from"@floating-ui/utils/react";import{supportsInert as T,hideOthers as O,suppressOthers as P}from"aria-hidden";import{tabbable as L}from"tabbable";import{createPortal as S,flushSync as A}from"react-dom";function D(){return D=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},D.apply(this,arguments)}var F="undefined"!=typeof document?c:i;let N=!1,K=0;const B=()=>"floating-ui-"+K++;const _=u["useId".toString()]||function(){const[e,t]=u.useState((()=>N?B():void 0));return F((()=>{null==e&&t(B())}),[]),u.useEffect((()=>{N||(N=!0)}),[]),e},H=u.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:c}},width:i=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:v,...p}={},...g}=t;const b=_();if(!o)return null;a*=2;const y=a/2,h=i/2*(s/-8+1),E=l/2*s/4,[R,w]=r.split("-"),x=e.isRTL(o),I=!!m,k="top"===R||"bottom"===R,M=f&&"end"===w?"bottom":"top";let C=f&&"end"===w?"right":"left";f&&x&&(C="end"===w?"left":"right");const T=null!=(null==c?void 0:c.x)?f||c.x:"",O=null!=(null==c?void 0:c.y)?f||c.y:"",P=m||"M0,0 H"+i+" L"+(i-h)+","+(l-E)+" Q"+i/2+","+l+" "+h+","+(l-E)+" Z",L={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[R];return u.createElement("svg",D({},g,{"aria-hidden":!0,ref:n,width:I?i:i+a,height:i,viewBox:"0 0 "+i+" "+(l>i?l:i),style:{position:"absolute",pointerEvents:"none",[C]:T,[M]:O,[R]:k||I?"100%":"calc(100% - "+a/2+"px)",transform:""+L+(null!=v?v:""),...p}}),a>0&&u.createElement("path",{clipPath:"url(#"+b+")",fill:"none",stroke:d,strokeWidth:a+(m?0:1),d:P}),u.createElement("path",{stroke:a&&!m?g.fill:"none",d:P}),u.createElement("clipPath",{id:b},u.createElement("rect",{x:-y,y:y*(I?-1:1),width:i+a,height:i})))}));function q(){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 j=u.createContext(null),W=u.createContext(null),X=()=>{var e;return(null==(e=u.useContext(j))?void 0:e.id)||null},Y=()=>u.useContext(W);function U(e){const t=_(),n=Y(),r=X(),o=e||r;return F((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function V(e){let{children:t,id:n}=e;const r=X();return u.createElement(j.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)}function z(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))}),[]),c=u.useState((()=>q()))[0];return u.createElement(W.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:c})),[n,r,o,c])},t)}function Z(e){return"data-floating-ui-"+e}function G(e){const t=l(e);return F((()=>{t.current=e})),t}const Q=Z("safe-polygon");function J(e,t,n){return n&&!v(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function $(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:c,elements:{domReference:i,floating:l},refs:a}=e,{enabled:f=!0,delay:d=0,handleClose:g=null,mouseOnly:b=!1,restMs:y=0,move:h=!0}=t,E=Y(),R=X(),w=G(g),x=G(d),I=u.useRef(),k=u.useRef(),M=u.useRef(),C=u.useRef(),T=u.useRef(!0),O=u.useRef(!1),P=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(f)return c.on("dismiss",e),()=>{c.off("dismiss",e)};function e(){clearTimeout(k.current),clearTimeout(C.current),T.current=!0}}),[f,c]),u.useEffect((()=>{if(!f||!w.current||!n)return;function e(e){L()&&r(!1,e)}const t=m(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,f,w,o,L]);const S=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=J(x.current,"close",I.current);n&&!M.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[x,r]),A=u.useCallback((()=>{P.current(),M.current=void 0}),[]),D=u.useCallback((()=>{if(O.current){const e=m(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(Q),O.current=!1}}),[a]);return u.useEffect((()=>{if(f&&s(i)){const e=i;return n&&e.addEventListener("mouseleave",a),null==l||l.addEventListener("mouseleave",a),h&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",c),()=>{n&&e.removeEventListener("mouseleave",a),null==l||l.removeEventListener("mouseleave",a),h&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",c)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(k.current),T.current=!1,b&&!v(I.current)||y>0&&0===J(x.current,"open"))return;const t=J(x.current,"open",I.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function c(r){if(t())return;P.current();const o=m(l);if(clearTimeout(C.current),w.current){n||clearTimeout(k.current),M.current=w.current({...e,tree:E,x:r.clientX,y:r.clientY,onClose(){D(),A(),S(r)}});const t=M.current;return o.addEventListener("mousemove",t),void(P.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==I.current||!p(l,r.relatedTarget))&&S(r)}function a(n){t()||null==w.current||w.current({...e,tree:E,x:n.clientX,y:n.clientY,onClose(){D(),A(),S(n)}})(n)}}),[i,l,f,e,b,y,h,S,A,D,r,n,E,x,w,o]),F((()=>{var e;if(f&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&L()){const e=m(l).body;if(e.setAttribute(Q,""),e.style.pointerEvents="none",O.current=!0,s(i)&&l){var t,r;const e=i,n=null==E||null==(t=E.nodesRef.current.find((e=>e.id===R)))||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=""}}}}),[f,n,R,l,i,E,w,o,L]),F((()=>{n||(I.current=void 0,A(),D())}),[n,A,D]),u.useEffect((()=>()=>{A(),clearTimeout(k.current),clearTimeout(C.current),D()}),[f,i,A,D]),u.useMemo((()=>{if(!f)return{};function e(e){I.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===y||(clearTimeout(C.current),C.current=setTimeout((()=>{T.current||r(!0,e.nativeEvent)}),y))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){c.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),S(e.nativeEvent,!1)}}}}),[c,f,y,n,r,S])}const ee=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),te=()=>u.useContext(ee),ne=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,c]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),i=u.useRef(null),l=u.useCallback((e=>{c({currentId:e})}),[]);return F((()=>{o.currentId?null===i.current?i.current=o.currentId:c({isInstantPhase:!0}):(c({isInstantPhase:!1}),i.current=null)}),[o.currentId]),u.createElement(ee.Provider,{value:u.useMemo((()=>({...o,setState:c,setCurrentId:l})),[o,c,l])},t)},re=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:c,initialDelay:i,setState:l,timeoutMs:s}=te();F((()=>{u&&(l({delay:{open:1,close:J(i,"close")}}),u!==o&&r(!1))}),[o,r,l,u,i]),F((()=>{function e(){r(!1),l({delay:i,currentId:null})}if(!n&&u===o){if(s){const t=window.setTimeout(e,s);return()=>{clearTimeout(t)}}e()}}),[n,l,u,o,r,i,s]),F((()=>{n&&c(o)}),[n,c,o])};let oe=0;function ue(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(oe);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():oe=requestAnimationFrame(u)}function ce(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}const ie=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function le(e,t){const n=L(e,ie());"prev"===t&&n.reverse();const r=n.indexOf(g(m(e)));return n.slice(r+1)[0]}function se(){return le(document.body,"next")}function ae(){return le(document.body,"prev")}function fe(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!p(n,r)}function de(e){L(e,ie()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function me(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 ve={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 pe(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const ge=u.forwardRef((function(e,t){const[n,r]=u.useState();F((()=>(b()&&r("button"),document.addEventListener("keydown",pe),()=>{document.removeEventListener("keydown",pe)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Z("focus-guard")]:"",style:ve};return u.createElement("span",D({},e,o))})),be=u.createContext(null);function ye(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=u.useState(null),c=_(),i=Ee(),l=u.useMemo((()=>({id:t,root:n,portalContext:i,uniqueId:c})),[t,n,i,c]),a=u.useRef();return F((()=>()=>{null==r||r.remove()}),[r,l]),F((()=>{if(a.current===l)return;a.current=l;const{id:e,root:t,portalContext:n,uniqueId:r}=l,u=e?document.getElementById(e):null,c=Z("portal");if(u){const e=document.createElement("div");e.id=r,e.setAttribute(c,""),u.appendChild(e),o(e)}else{let u=t||(null==n?void 0:n.portalNode);u&&!s(u)&&(u=u.current),u=u||document.body;let i=null;e&&(i=document.createElement("div"),i.id=e,u.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(c,""),u=i||u,u.appendChild(l),o(l)}}),[l]),r}function he(e){let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const c=ye({id:n,root:r}),[i,l]=u.useState(null),s=u.useRef(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),m=!!i&&!i.modal&&i.open&&o&&!(!r&&!c);return u.useEffect((()=>{if(c&&o&&(null==i||!i.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&&fe(e)){("focusin"===e.type?me:de)(c)}}}),[c,o,null==i?void 0:i.modal]),u.createElement(be.Provider,{value:u.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:a,beforeInsideRef:f,afterInsideRef:d,portalNode:c,setFocusManagerState:l})),[o,c])},m&&c&&u.createElement(ge,{"data-type":"outside",ref:s,onFocus:e=>{if(fe(e,c)){var t;null==(t=f.current)||t.focus()}else{const e=ae()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ve}),c&&S(t,c),m&&c&&u.createElement(ge,{"data-type":"outside",ref:a,onFocus:e=>{if(fe(e,c)){var t;null==(t=d.current)||t.focus()}else{const t=se()||(null==i?void 0:i.refs.domReference.current);null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent))}}}))}const Ee=()=>u.useContext(be),Re=u.forwardRef((function(e,t){return u.createElement("button",D({},e,{type:"button",ref:t,tabIndex:-1,style:ve}))}));function we(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:c=!0,initialFocus:i=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:v,refs:b,nodeId:R,onOpenChange:w,events:x,dataRef:I,elements:{domReference:k,floating:M}}=t,C=!T()||c,S=G(o),A=G(i),D=G(l),N=Y(),K=Ee(),B="number"==typeof i&&i<0,_=u.useRef(null),H=u.useRef(null),q=u.useRef(!1),j=u.useRef(null),W=u.useRef(!1),X=null!=K,U=k&&"combobox"===k.getAttribute("role")&&y(k),V=u.useCallback((function(e){return void 0===e&&(e=M),e?L(e,ie()):[]}),[M]),z=u.useCallback((e=>{const t=V(e);return S.current.map((e=>k&&"reference"===e?k:M&&"floating"===e?M:t)).filter(Boolean).flat()}),[k,M,S,V]);function Q(e){return!r&&f&&s?u.createElement(Re,{ref:"start"===e?_:H,onClick:e=>w(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){p(M,g(m(M)))&&0===V().length&&!U&&h(e);const t=z(),n=E(e);"reference"===S.current[0]&&n===k&&(h(e),e.shiftKey?ue(t[t.length-1]):ue(t[1])),"floating"===S.current[1]&&n===M&&e.shiftKey&&(h(e),ue(t[0]))}}const t=m(M);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,k,M,s,S,b,U,V,z]),u.useEffect((()=>{if(!r&&d)return M&&a(k)?(k.addEventListener("focusout",t),k.addEventListener("pointerdown",e),!s&&M.addEventListener("focusout",t),()=>{k.removeEventListener("focusout",t),k.removeEventListener("pointerdown",e),!s&&M.removeEventListener("focusout",t)}):void 0;function e(){W.current=!0,setTimeout((()=>{W.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(p(k,t)||p(M,t)||p(t,M)||p(null==K?void 0:K.portalNode,t)||null!=t&&t.hasAttribute(Z("focus-guard"))||N&&(ce(N.nodesRef.current,R).find((e=>{var n,r;return p(null==(n=e.context)?void 0:n.elements.floating,t)||p(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}(N.nodesRef.current,R).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&&!W.current&&t!==j.current&&(q.current=!0,w(!1,e))}))}}),[r,k,M,s,R,N,K,w,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==K||null==(e=K.portalNode)?void 0:e.querySelectorAll("["+Z("portal")+"]"))||[]);if(M&&s){const e=[M,...t,_.current,H.current].filter((e=>null!=e)),n=(C?O:P)(S.current.includes("reference")||U?e.concat(k||[]):e,void 0,Z("inert"));return()=>{n()}}}),[r,k,M,s,S,K,U,C]),F((()=>{if(r||!M)return;const e=m(M),t=g(e);queueMicrotask((()=>{const e=z(M),n=A.current,r=("number"==typeof n?e[n]:n.current)||M,o=p(M,t);B||o||!v||ue(r,{preventScroll:r===M})}))}),[r,v,M,B,z,A]),F((()=>{if(r||!M)return;let e=!1;const t=m(M),n=g(t),o=I.current;function u(t){if("escapeKey"===t.type&&b.domReference.current&&(j.current=b.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(q.current=!1,e=n.preventScroll):q.current=!n}return j.current=n,x.on("dismiss",u),()=>{x.off("dismiss",u);const n=g(t);(p(M,n)||N&&ce(N.nodesRef.current,R).some((e=>{var t;return p(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&b.domReference.current&&(j.current=b.domReference.current),D.current&&a(j.current)&&!q.current&&ue(j.current,{cancelPrevious:!1,preventScroll:e})}}),[r,M,D,I,b,x,N,R]),F((()=>{if(!r&&K)return K.setFocusManagerState({...t,modal:s,closeOnFocusOut:d,open:v}),()=>{K.setFocusManagerState(null)}}),[r,K,s,v,d,t]),F((()=>{if(!r&&M&&"function"==typeof MutationObserver){const e=()=>{const e=M.getAttribute("tabindex");S.current.includes("floating")||g(m(M))!==b.domReference.current&&0===V().length?"0"!==e&&M.setAttribute("tabindex","0"):"-1"!==e&&M.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,M,b,S,V]);const J=!r&&C&&!U&&(X||s);return u.createElement(u.Fragment,null,J&&u.createElement(ge,{"data-type":"inside",ref:null==K?void 0:K.beforeInsideRef,onFocus:e=>{if(s){const e=z();ue("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=K&&K.preserveTabOrder&&K.portalNode)if(q.current=!1,fe(e,K.portalNode)){const e=se()||k;null==e||e.focus()}else{var t;null==(t=K.beforeOutsideRef.current)||t.focus()}}}),!U&&Q("start"),n,Q("end"),J&&u.createElement(ge,{"data-type":"inside",ref:null==K?void 0:K.afterInsideRef,onFocus:e=>{if(s)ue(z()[0]);else if(null!=K&&K.preserveTabOrder&&K.portalNode)if(d&&(q.current=!0),fe(e,K.portalNode)){const e=ae()||k;null==e||e.focus()}else{var t;null==(t=K.afterOutsideRef.current)||t.focus()}}}))}function xe(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 Ie=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function ke(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[o,c]=u.useState((()=>new Map)),i=u.useCallback((e=>{c((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{c((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return F((()=>{const e=new Map(o);Array.from(e.keys()).sort(xe).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)||c(e)}),[o]),u.createElement(Ie.Provider,{value:u.useMemo((()=>({register:i,unregister:l,map:o,elementsRef:n,labelsRef:r})),[i,l,o,n,r])},t)}function Me(e){let{label:t}=void 0===e?{}:e;const[n,r]=u.useState(null),o=u.useRef(null),{register:c,unregister:i,map:l,elementsRef:s,labelsRef:a}=u.useContext(Ie),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 F((()=>{const e=o.current;if(e)return c(e),()=>{i(e)}}),[c,i]),F((()=>{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 Ce=Z("scroll-lock"),Te=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return F((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Ce))return;document.body.setAttribute(Ce,"");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(R()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Ce),Object.assign(document.body.style,{overflow:"",[r]:""})};const u=(null==(e=window.visualViewport)?void 0:e.offsetLeft)||0,c=(null==(t=window.visualViewport)?void 0:t.offsetTop)||0,i=window.pageXOffset,l=window.pageYOffset;return Object.assign(document.body.style,{position:"fixed",overflow:"hidden",top:-(l-Math.floor(c))+"px",left:-(i-Math.floor(u))+"px",right:"0",[r]:o+"px"}),()=>{Object.assign(document.body.style,{position:"",overflow:"",top:"",left:"",right:"",[r]:""}),document.body.removeAttribute(Ce),window.scrollTo(i,l)}}),[n]),u.createElement("div",D({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Oe(e){return a(e.target)&&"BUTTON"===e.target.tagName}function Pe(e){return y(e)}function Le(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:c}}=e,{enabled:i=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),m=u.useRef(!1);return u.useMemo((()=>i?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(v(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,e.nativeEvent)))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:v(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent):r(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Oe(e)||(" "!==e.key||Pe(c)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Oe(e)||Pe(c)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,e.nativeEvent))}}}:{}),[i,o,l,a,f,c,s,n,r])}const Se=u["useInsertionEffect".toString()]||(e=>e());function Ae(e){const t=u.useRef((()=>{}));return Se((()=>{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 De(e){return null!=e&&null!=e.clientX}function Fe(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:c}}=e,{enabled:i=!0,axis:l="both",x:s=null,y:a=null}=t,d=u.useRef(!1),m=u.useRef(null),[g,b]=u.useState(),[y,h]=u.useState([]),R=Ae(((e,t)=>{d.current||o.current.openEvent&&!De(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,c;const i=(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==(c=t.dataRef.current.openEvent)?void 0:c.type)||"")&&"touch"!==t.pointerType;let f=i.width,d=i.height,m=i.x,v=i.y;return null==n&&t.x&&l&&(n=i.x-t.x),null==r&&t.y&&s&&(r=i.y-t.y),m-=n||0,v-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?i.width:0,d="x"===t.axis?i.height:0,m=l&&null!=t.x?t.x:m,v=s&&null!=t.y?t.y:v):o&&!a&&(d="x"===t.axis?i.height:d,f="y"===t.axis?i.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:g}))})),w=Ae((e=>{null==s&&null==a&&(n?m.current||h([]):R(e.clientX,e.clientY))})),x=v(g)?c:n,I=u.useCallback((()=>{if(!x||!i||null!=s||null!=a)return;const e=f(r.floating.current);function t(n){const o=E(n);p(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):R(n.clientX,n.clientY)}if(!o.current.openEvent||De(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,i,x,r,R,s,a]);return u.useEffect((()=>I()),[I,y]),u.useEffect((()=>{i&&!c&&(d.current=!1)}),[i,c]),u.useEffect((()=>{!i&&n&&(d.current=!0)}),[i,n]),F((()=>{!i||null==s&&null==a||(d.current=!1,R(s,a))}),[i,s,a,R]),u.useMemo((()=>{if(!i)return{};function e(e){let{pointerType:t}=e;b(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[i,w])}const Ne={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ke={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"};function Be(e,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:c,nodeId:i,elements:{reference:l,domReference:f,floating:v},dataRef:p}=e,{enabled:g=!0,escapeKey:b=!0,outsidePress:y=!0,outsidePressEvent:h="pointerdown",referencePress:R=!1,referencePressEvent:M="pointerdown",ancestorScroll:C=!1,bubbles:T}=n,O=Y(),P=null!=X(),L=Ae("function"==typeof y?y:()=>!1),S="function"==typeof y?L:y,A=u.useRef(!1),{escapeKeyBubbles:D,outsidePressBubbles:F}=(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=Ae((e=>{if(!r||!g||!b||"Escape"!==e.key)return;const t=O?ce(O.nodesRef.current,i):[];if(!D&&(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}c.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,w(e)?e.nativeEvent:e)})),K=Ae((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=E(e);if(a(n)&&v){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"===d(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=O&&ce(O.nodesRef.current,i).some((t=>{var n;return x(e,null==(n=t.context)?void 0:n.elements.floating)}));if(x(e,v)||x(e,f)||r)return;const u=O?ce(O.nodesRef.current,i):[];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}c.emit("dismiss",{type:"outsidePress",data:{returnFocus:P?{preventScroll:!0}:I(e)||k(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!g)return;function e(e){o(!1,e)}p.current.__escapeKeyBubbles=D,p.current.__outsidePressBubbles=F;const n=m(v);b&&n.addEventListener("keydown",N),S&&n.addEventListener(h,K);let u=[];return C&&(s(f)&&(u=t(f)),s(v)&&(u=u.concat(t(v))),!s(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})})),()=>{b&&n.removeEventListener("keydown",N),S&&n.removeEventListener(h,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[p,v,f,l,b,S,h,r,o,C,g,D,F,N,K]),u.useEffect((()=>{A.current=!1}),[S,h]),u.useMemo((()=>g?{reference:{onKeyDown:N,[Ne[M]]:e=>{R&&(c.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[Ke[h]]:()=>{A.current=!0}}}:{}),[g,c,R,h,M,o,N])}function _e(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:c}=e,[i,l]=u.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||i,f=n(e),d=Y(),m=Ae(((e,t)=>{e&&(p.current.openEvent=t),null==o||o(e,t)})),v=u.useRef(null),p=u.useRef({}),g=u.useState((()=>q()))[0],b=_(),y=u.useCallback((e=>{const t=s(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),h=u.useCallback((e=>{(s(e)||null===e)&&(v.current=e,l(e)),(s(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!s(e))&&f.refs.setReference(e)}),[f.refs]),E=u.useMemo((()=>({...f.refs,setReference:h,setPositionReference:y,domReference:v})),[f.refs,h,y]),R=u.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),w=u.useMemo((()=>({...f,refs:E,elements:R,dataRef:p,nodeId:c,floatingId:b,events:g,open:r,onOpenChange:m})),[f,c,b,g,r,m,E,R]);return F((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===c));e&&(e.context=w)})),u.useMemo((()=>({...f,context:w,refs:E,elements:R})),[f,E,R,w])}function He(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:c,refs:i,elements:{floating:l,domReference:f}}=e,{enabled:d=!0,keyboardOnly:v=!0}=t,b=u.useRef(""),y=u.useRef(!1),h=u.useRef();return u.useEffect((()=>{if(!d)return;const e=m(l).defaultView||window;function t(){!n&&a(f)&&f===g(m(f))&&(y.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[l,f,n,d]),u.useEffect((()=>{if(d)return c.on("dismiss",e),()=>{c.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(y.current=!0)}}),[c,d]),u.useEffect((()=>()=>{clearTimeout(h.current)}),[]),u.useMemo((()=>d?{reference:{onPointerDown(e){let{pointerType:t}=e;b.current=t,y.current=!(!t||!v)},onMouseLeave(){y.current=!1},onFocus(e){var t;y.current||"focus"===e.type&&"mousedown"===(null==(t=o.current.openEvent)?void 0:t.type)&&x(o.current.openEvent,f)||r(!0,e.nativeEvent)},onBlur(e){y.current=!1;const t=e.relatedTarget,n=s(t)&&t.hasAttribute(Z("focus-guard"))&&"outside"===t.getAttribute("data-type");h.current=setTimeout((()=>{p(i.floating.current,t)||p(f,t)||n||r(!1,e.nativeEvent)}))}}}:{}),[d,v,f,i,o,r])}function qe(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 je(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>qe(t,e,"reference")),t),r=u.useCallback((t=>qe(t,e,"floating")),t),o=u.useCallback((t=>qe(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 We=!1;const Xe="ArrowUp",Ye="ArrowDown",Ue="ArrowLeft",Ve="ArrowRight";function ze(e,t,n){return Math.floor(e/t)!==n}function Ze(e,t){return t<0||t>=e.current.length}function Ge(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const c=e.current;let i=n;do{var l,s;i+=r?-u:u}while(i>=0&&i<=c.length-1&&(o?o.includes(i):null==c[i]||(null==(l=c[i])?void 0:l.hasAttribute("disabled"))||"true"===(null==(s=c[i])?void 0:s.getAttribute("aria-disabled"))));return i}function Qe(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Je(e,t){return Qe(t,e===Xe||e===Ye,e===Ue||e===Ve)}function $e(e,t,n){return Qe(t,e===Ye,n?e===Ue:e===Ve)||"Enter"===e||" "==e||""===e}function et(e,t){return Ge(e,{disabledIndices:t})}function tt(e,t){return Ge(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:c,floating:i}}=e,{listRef:l,activeIndex:s,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:v=null,allowEscape:y=!1,loop:E=!1,nested:R=!1,rtl:w=!1,virtual:x=!1,focusItemOnOpen:C="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:O=!0,disabledIndices:P,orientation:L="vertical",cols:S=1,scrollItemIntoView:A=!0}=t,D=X(),N=Y(),K=Ae(f),B=u.useRef(C),_=u.useRef(null!=v?v:-1),H=u.useRef(null),q=u.useRef(!0),j=u.useRef(K),W=u.useRef(!!i),U=u.useRef(!1),V=u.useRef(!1),z=G(P),Z=G(n),Q=G(A),[J,$]=u.useState(),ee=Ae((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(x?$(r.id):ue(r,{preventScroll:!0,sync:!(!M()||!b())&&(We||U.current)}),requestAnimationFrame((()=>{const e=Q.current;e&&r&&(n||!q.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));F((()=>{document.createElement("div").focus({get preventScroll(){return We=!0,!1}})}),[]),F((()=>{d&&(n&&i?B.current&&null!=v&&(V.current=!0,K(v)):W.current&&(_.current=-1,j.current(null)))}),[d,n,i,v,K]),F((()=>{if(d&&n&&i)if(null==s){if(U.current=!1,null!=v)return;if(W.current&&(_.current=-1,ee(l,_)),!W.current&&B.current&&(null!=H.current||!0===B.current&&null==H.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else _.current=null==H.current||$e(H.current,L,w)||R?et(l,z.current):tt(l,z.current),H.current=null,K(_.current)};t()}}else Ze(l,s)||(_.current=s,ee(l,_,V.current),V.current=!1)}),[d,n,i,s,v,R,l,L,w,K,ee,z]),F((()=>{if(d&&W.current&&!i&&N){var e,t;const n=N.nodesRef.current,r=null==(e=n.find((e=>e.id===D)))||null==(t=e.context)?void 0:t.elements.floating,o=g(m(i)),u=n.some((e=>e.context&&p(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,i,N,D]),F((()=>{j.current=K,W.current=!!i})),F((()=>{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&&K(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...T&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;q.current&&"touch"!==t&&(_.current=-1,ee(l,_),K(null),x||ue(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,T,l,K,x]);return u.useMemo((()=>{if(!d)return{};const e=z.current;function t(t){if(q.current=!1,U.current=!0,!Z.current&&t.currentTarget===o.floating.current)return;if(R&&function(e,t,n){return Qe(t,n?e===Ve:e===Ue,e===Xe)}(t.key,L,w))return h(t),r(!1,t.nativeEvent),void(a(c)&&c.focus());const u=_.current,i=et(l,e),s=tt(l,e);if("Home"===t.key&&(h(t),_.current=i,K(_.current)),"End"===t.key&&(h(t),_.current=s,K(_.current)),S>1){const n=_.current;if(t.key===Xe){if(h(t),-1===n)_.current=s;else if(_.current=Ge(l,{startingIndex:n,amount:S,decrement:!0,disabledIndices:e}),E&&(n-S<i||_.current<0)){const e=n%S,t=s%S,r=s-(t-e);_.current=t===e?s:t>e?r:r-S}Ze(l,_.current)&&(_.current=n),K(_.current)}if(t.key===Ye&&(h(t),-1===n?_.current=i:(_.current=Ge(l,{startingIndex:n,amount:S,disabledIndices:e}),E&&n+S>s&&(_.current=Ge(l,{startingIndex:n%S-S,amount:S,disabledIndices:e}))),Ze(l,_.current)&&(_.current=n),K(_.current)),"both"===L){const r=Math.floor(n/S);t.key===Ve&&(h(t),n%S!=S-1?(_.current=Ge(l,{startingIndex:n,disabledIndices:e}),E&&ze(_.current,S,r)&&(_.current=Ge(l,{startingIndex:n-n%S-1,disabledIndices:e}))):E&&(_.current=Ge(l,{startingIndex:n-n%S-1,disabledIndices:e})),ze(_.current,S,r)&&(_.current=n)),t.key===Ue&&(h(t),n%S!=0?(_.current=Ge(l,{startingIndex:n,disabledIndices:e,decrement:!0}),E&&ze(_.current,S,r)&&(_.current=Ge(l,{startingIndex:n+(S-n%S),decrement:!0,disabledIndices:e}))):E&&(_.current=Ge(l,{startingIndex:n+(S-n%S),decrement:!0,disabledIndices:e})),ze(_.current,S,r)&&(_.current=n));const o=Math.floor(s/S)===r;return Ze(l,_.current)&&(_.current=E&&o?t.key===Ue?s:Ge(l,{startingIndex:n-n%S-1,disabledIndices:e}):n),void K(_.current)}}if(Je(t.key,L)){if(h(t),n&&!x&&g(t.currentTarget.ownerDocument)===t.currentTarget)return _.current=$e(t.key,L,w)?i:s,void K(_.current);$e(t.key,L,w)?_.current=E?u>=s?y&&u!==l.current.length?-1:i:Ge(l,{startingIndex:u,disabledIndices:e}):Math.min(s,Ge(l,{startingIndex:u,disabledIndices:e})):_.current=E?u<=i?y&&-1!==u?l.current.length:s:Ge(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(i,Ge(l,{startingIndex:u,decrement:!0,disabledIndices:e})),Ze(l,_.current)?K(null):K(_.current)}}function u(e){"auto"===C&&I(e.nativeEvent)&&(B.current=!0)}const i=x&&n&&te&&{"aria-activedescendant":J};return{reference:{...i,onKeyDown(o){q.current=!1;const u=0===o.key.indexOf("Arrow");if(x&&n)return t(o);if(!n&&!O&&u)return;const c=u||"Enter"===o.key||""===o.key.trim(),i=Je(o.key,L),s=function(e,t,n){return Qe(t,n?e===Ue:e===Ve,e===Ye)}(o.key,L,w);c&&(H.current=R&&i?null:o.key),R?s&&(h(o),n?(_.current=et(l,e),K(_.current)):r(!0,o.nativeEvent)):i&&(null!=v&&(_.current=v),h(o),!n&&O?r(!0,o.nativeEvent):t(o),n&&K(_.current))},onFocus(){n&&K(null)},onPointerDown:function(e){B.current=C,"auto"===C&&k(e.nativeEvent)&&(B.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===L?void 0:L,...i,onKeyDown:t,onPointerMove(){q.current=!0}},item:ne}}),[c,o,J,z,Z,l,d,L,w,x,n,te,R,v,O,y,S,E,C,K,r,ne])}function rt(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 ot(e,t){void 0===t&&(t={});const{open:n,floatingId:r}=e,{enabled:o=!0,role:c="dialog"}=t,i=_();return u.useMemo((()=>{const e={id:r,role:c};return o?"tooltip"===c?{reference:{"aria-describedby":n?r:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":n?r:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:i}},floating:{...e,..."menu"===c&&{"aria-labelledby":i}}}:{}}),[o,c,n,r,i])}const ut=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function ct(e,t){return"function"==typeof e?e(t):e}function it(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,c=("number"==typeof o?o:o.close)||0,[i,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,c);return F((()=>{i&&!f&&a("unmounted")}),[i,f]),F((()=>{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 lt(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:c,duration:i=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof i,d=(f?i:i.open)||0,m=(f?i:i.close)||0,[v,p]=u.useState((()=>({...ct(c,a),...ct(n,a)}))),{isMounted:g,status:b}=it(e,{duration:i}),y=G(n),h=G(r),E=G(o),R=G(c);return F((()=>{const e=ct(y.current,a),t=ct(E.current,a),n=ct(R.current,a),r=ct(h.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(ut).join(","),transitionDuration:d+"ms",...n,...r}),"close"===b){const r=t||e;p({transitionProperty:Object.keys(r).map(ut).join(","),transitionDuration:m+"ms",...n,...r})}}),[m,E,y,h,R,d,b,a]),{isMounted:g,styles:v}}function st(e,t){var n;const{open:r,dataRef:o}=e,{listRef:c,activeIndex:i,onMatch:l,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:v=null}=t,p=u.useRef(),g=u.useRef(""),b=u.useRef(null!=(n=null!=v?v:i)?n:-1),y=u.useRef(null),E=Ae(l),R=Ae(s),w=G(f),x=G(m);return F((()=>{r&&(clearTimeout(p.current),y.current=null,g.current="")}),[r]),F((()=>{var e;r&&""===g.current&&(b.current=null!=(e=null!=v?v:i)?e:-1)}),[r,v,i]),u.useMemo((()=>{if(!a)return{};function e(e){e?o.current.typing||(o.current.typing=e,R(e)):o.current.typing&&(o.current.typing=e,R(e))}function t(e,t,n){const r=w.current?w.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=c.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(o,o,g.current)?e(!1):" "===n.key&&h(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(h(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())}))&&g.current===n.key&&(g.current="",b.current=y.current),g.current+=n.key,clearTimeout(p.current),p.current=setTimeout((()=>{g.current="",b.current=y.current,e(!1)}),d);const u=b.current,i=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],g.current);-1!==i?(E(i),y.current=i):" "!==n.key&&(g.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[a,r,o,c,d,x,w,E,R])}function at(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const ft=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:u,onFallbackChange:c,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:m,elements:{floating:v}}=t,p=n.current[l];if(!p)return{};const g={...t,...await r(-p.offsetTop-v.clientTop-m.reference.height/2-p.offsetHeight/2-i).fn(t)},b=(null==f?void 0:f.current)||v,y=await o(at(g,b.scrollHeight),d),h=await o(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),R=g.y+E,w=Math.max(0,b.scrollHeight-E-Math.max(0,y.bottom));return b.style.maxHeight=w+"px",b.scrollTop=E,c&&(b.offsetHeight<p.offsetHeight*Math.min(s,n.current.length-1)-1||h.top>=-a||h.bottom>=-a?A((()=>c(!0))):A((()=>c(!1)))),u&&(u.current=await o(at({...g,y:R},b.offsetHeight),d)),{y:R}}});function dt(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:i,onChange:l}=t,s=Ae(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==c.current)return;const n=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,u=t.scrollHeight-t.clientHeight,i=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),A((()=>{s((e=>e+Math[l](n,u*i)))}))):/firefox/i.test(C())&&(t.scrollTop+=n))}const t=(null==i?void 0:i.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{f.current=t.scrollTop,null!=c.current&&(d.current={...c.current})})),()=>{f.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0}),[o,n,r.floating,c,i,s]),u.useMemo((()=>o?{floating:{onKeyDown(){a.current=!0},onWheel(){a.current=!1},onPointerMove(){a.current=!1},onScroll(){const e=(null==i?void 0:i.current)||r.floating;if(c.current&&e&&a.current){if(null!==f.current){const t=e.scrollTop-f.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&A((()=>s((e=>e+t))))}requestAnimationFrame((()=>{f.current=e.scrollTop}))}}}}:{}),[o,c,r.floating,i,s])}function mt(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,c=u-1;e<u;c=e++){const[u,i]=t[e]||[0,0],[l,s]=t[c]||[0,0];i>=r!=s>=r&&n<=(l-u)*(r-i)/(s-i)+u&&(o=!o)}return o}function vt(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,c=null,i=null,l=performance.now();const a=e=>{let{x:n,y:a,placement:f,elements:d,onClose:m,nodeId:v,tree:g}=e;return function(e){function b(){clearTimeout(o),m()}if(clearTimeout(o),!d.domReference||!d.floating||null==f||null==n||null==a)return;const{clientX:y,clientY:h}=e,R=[y,h],w=E(e),x="mouseleave"===e.type,I=p(d.floating,w),k=p(d.domReference,w),M=d.domReference.getBoundingClientRect(),C=d.floating.getBoundingClientRect(),T=f.split("-")[0],O=n>C.right-C.width/2,P=a>C.bottom-C.height/2,L=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(R,M),S=C.width>M.width,A=C.height>M.height,D=(S?M:C).left,F=(S?M:C).right,N=(A?M:C).top,K=(A?M:C).bottom;if(I&&(u=!0,!x))return;if(k&&(u=!1),k&&!x)return void(u=!0);if(x&&s(e.relatedTarget)&&p(d.floating,e.relatedTarget))return;if(g&&ce(g.nodesRef.current,v).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===T&&a>=M.bottom-1||"bottom"===T&&a<=M.top+1||"left"===T&&n>=M.right-1||"right"===T&&n<=M.left+1)return b();let B=[];switch(T){case"top":B=[[D,M.top+1],[D,C.bottom-1],[F,C.bottom-1],[F,M.top+1]];break;case"bottom":B=[[D,C.top+1],[D,M.bottom-1],[F,M.bottom-1],[F,C.top+1]];break;case"left":B=[[C.right-1,K],[C.right-1,N],[M.left+1,N],[M.left+1,K]];break;case"right":B=[[M.right-1,K],[M.right-1,N],[C.left+1,N],[C.left+1,K]]}if(!mt([y,h],B)){if(u&&!L)return b();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===c||null===i||0===r)return c=e,i=t,l=n,null;const o=e-c,u=t-i,s=Math.sqrt(o*o+u*u);return c=e,i=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return b()}mt([y,h],function(e){let[n,r]=e;switch(T){case"top":return[[S?n+t/2:O?n+4*t:n-4*t,r+t+1],[S?n-t/2:O?n+4*t:n-4*t,r+t+1],...[[C.left,O||S?C.bottom-t:C.top],[C.right,O?S?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return[[S?n+t/2:O?n+4*t:n-4*t,r-t],[S?n-t/2:O?n+4*t:n-4*t,r-t],...[[C.left,O||S?C.top+t:C.bottom],[C.right,O?S?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:P?r+4*t:r-4*t];return[...[[P||A?C.right-t:C.left,C.top],[P?A?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:P?r+4*t:r-4*t],[n-t,A?r-t/2:P?r+4*t:r-4*t],...[[P||A?C.left+t:C.right,C.top],[P?A?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,a]))?!u&&r&&(o=window.setTimeout(b,40)):b()}}};return a.__options={blockPointerEvents:n},a}export{H as FloatingArrow,ne as FloatingDelayGroup,we as FloatingFocusManager,ke as FloatingList,V as FloatingNode,Te as FloatingOverlay,he as FloatingPortal,z as FloatingTree,ft as inner,vt as safePolygon,Le as useClick,Fe as useClientPoint,re as useDelayGroup,te as useDelayGroupContext,Be as useDismiss,_e as useFloating,U as useFloatingNodeId,X as useFloatingParentNodeId,ye as useFloatingPortalNode,Y as useFloatingTree,He as useFocus,$ as useHover,_ as useId,dt as useInnerOffset,je as useInteractions,Me as useListItem,nt as useListNavigation,rt as useMergeRefs,ot as useRole,it as useTransitionStatus,lt as useTransitionStyles,st 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,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,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:m,refs:p,nodeId:v,onOpenChange:g,events:b,dataRef:E,elements:{domReference:w,floating:R}}=t,I=!U()||i,O=P(o),k=P(l),T=P(s),S=h(),A=Me(),L="number"==typeof l&&l<0,D=u.useRef(null),N=u.useRef(null),F=u.useRef(!1),j=u.useRef(null),K=u.useRef(!1),H=null!=A,B=w&&"combobox"===w.getAttribute("role")&&pe(w),q=u.useCallback((function(e){return void 0===e&&(e=R),e?ce(e,ge()):[]}),[R]),W=u.useCallback((e=>{const t=q(e);return O.current.map((e=>w&&"reference"===e?w:R&&"floating"===e?R:t)).filter(Boolean).flat()}),[w,R,O,q]);function V(e){return!r&&f&&a?u.createElement(Ce,{ref:"start"===e?D:N,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!a)return;function e(e){if("Tab"===e.key){M(R,le(y(R)))&&0===q().length&&!B&&ve(e);const t=W(),n=de(e);"reference"===O.current[0]&&n===w&&(ve(e),e.shiftKey?ae(t[t.length-1]):ae(t[1])),"floating"===O.current[1]&&n===R&&e.shiftKey&&(ve(e),ae(t[0]))}}const t=y(R);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,w,R,a,O,p,B,q,W]),u.useEffect((()=>{if(!r&&d)return R&&x(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),!a&&R.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),!a&&R.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(M(w,t)||M(R,t)||M(t,R)||M(null==A?void 0:A.portalNode,t)||null!=t&&t.hasAttribute(C("focus-guard"))||S&&(fe(S.nodesRef.current,v).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}(S.nodesRef.current,v).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&&!K.current&&t!==j.current&&(F.current=!0,g(!1,e))}))}}),[r,w,R,a,v,S,A,g,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==A||null==(e=A.portalNode)?void 0:e.querySelectorAll("["+C("portal")+"]"))||[]);if(R&&a){const e=[R,...t,D.current,N.current].filter((e=>null!=e)),n=(I?_:z)(O.current.includes("reference")||B?e.concat(w||[]):e,void 0,C("inert"));return()=>{n()}}}),[r,w,R,a,O,A,B,I]),c((()=>{if(r||!R)return;const e=le(y(R));queueMicrotask((()=>{const t=W(R),n=k.current,r=("number"==typeof n?t[n]:n.current)||R,o=M(R,e);L||o||!m||ae(r,{preventScroll:r===R})}))}),[r,m,R,L,W,k]),c((()=>{if(r||!R)return;let e=!1;const t=y(R),n=le(t),o=E.current;function u(t){if("escapeKey"===t.type&&p.domReference.current&&(j.current=p.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 j.current=n,b.on("dismiss",u),()=>{b.off("dismiss",u);const n=le(t);(M(R,n)||S&&fe(S.nodesRef.current,v).some((e=>{var t;return M(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&p.domReference.current&&(j.current=p.domReference.current),T.current&&x(j.current)&&!F.current&&ae(j.current,{cancelPrevious:!1,preventScroll:e})}}),[r,R,T,E,p,b,S,v]),c((()=>{if(!r&&A)return A.setFocusManagerState({...t,modal:a,closeOnFocusOut:d,open:m}),()=>{A.setFocusManagerState(null)}}),[r,A,a,m,d,t]),c((()=>{if(!r&&R&&"function"==typeof MutationObserver){const e=()=>{const e=R.getAttribute("tabindex");O.current.includes("floating")||le(y(R))!==p.domReference.current&&0===q().length?"0"!==e&&R.setAttribute("tabindex","0"):"-1"!==e&&R.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(R,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[r,R,p,O,q]);const X=!r&&I&&!B&&(H||a);return u.createElement(u.Fragment,null,X&&u.createElement(Oe,{"data-type":"inside",ref:null==A?void 0:A.beforeInsideRef,onFocus:e=>{if(a){const e=W();ae("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(F.current=!1,Ee(e,A.portalNode)){const e=ye()||w;null==e||e.focus()}else{var t;null==(t=A.beforeOutsideRef.current)||t.focus()}}}),!B&&V("start"),n,V("end"),X&&u.createElement(Oe,{"data-type":"inside",ref:null==A?void 0:A.afterInsideRef,onFocus:e=>{if(a)ae(W()[0]);else if(null!=A&&A.preserveTabOrder&&A.portalNode)if(d&&(F.current=!0),Ee(e,A.portalNode)){const e=be()||w;null==e||e.focus()}else{var t;null==(t=A.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?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,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(!0,e.nativeEvent):r(!1,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&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||De(e)||Ne(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,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])}})); | ||
!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(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function p(e){return e instanceof Element||e instanceof m(e).Element}function v(e){return e instanceof HTMLElement||e instanceof m(e).HTMLElement}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}function h(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 ShadowRoot||r instanceof m(r).ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function y(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function b(){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 E(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(y())||t.test(b()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function w(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 R(){return/apple/i.test(navigator.vendor)}function x(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function I(e){return(null==e?void 0:e.ownerDocument)||document}function O(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function k(e){return"composedPath"in e?e.composedPath()[0]:e.target}const T="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function M(e){return v(e)&&e.matches(T)}function C(e){e.preventDefault(),e.stopPropagation()}function P(){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 S=u.createContext(null),A=u.createContext(null),L=()=>{var e;return(null==(e=u.useContext(S))?void 0:e.id)||null},D=()=>u.useContext(A);function N(e){return"data-floating-ui-"+e}function F(e){const t=n.useRef(e);return c((()=>{t.current=e})),t}const j=N("safe-polygon");function K(e,t,n){return n&&!x(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const H=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),B=()=>u.useContext(H);var q=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},_=new WeakMap,W=new WeakMap,U={},z=0,V=function(e){return e&&(e.host||V(e.parentNode))},X=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=V(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]);U[n]||(U[n]=new WeakMap);var u=U[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=(_.get(e)||0)+1,s=(u.get(e)||0)+1;_.set(e,l),u.set(e,s),i.push(e),1===l&&o&&W.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return a(t),c.clear(),z++,function(){i.forEach((function(e){var t=_.get(e)-1,o=u.get(e)-1;_.set(e,t),u.set(e,o),t||(W.has(e)||e.removeAttribute(r),W.delete(e)),o||e.removeAttribute(n)})),--z||(_=new WeakMap,_=new WeakMap,W=new WeakMap,U={})}},Y=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||q(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),X(r,o,n,"aria-hidden")):function(){return null}},G=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||q(e);return r?X(e,r,n,"inert"):function(){return null}},Z=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},$=function(e,t,n){return void 0===n&&(n="data-suppressed"),(Z()?G:Y)(e,t,n)},Q=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"].join(","),J="undefined"==typeof Element,ee=J?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,te=!J&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},ne=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{ee.call(i,Q)&&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},re=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},oe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ue=function(e){return"INPUT"===e.tagName},ie=function(e){return function(e){return ue(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||te(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)},ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},le=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ee.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ee.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ce(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=te(e);if(i&&!i.shadowRoot&&!0===r(i))return ce(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){for(var t,n=te(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=te(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},se=function(e,t){return!(t.disabled||function(e){return ue(e)&&"hidden"===e.type}(t)||le(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!!ee.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ae=function(e,t){return!(ie(t)||re(t)<0||!se(e,t))},fe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},de=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=re(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(oe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},me=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ne([e],t.includeContainer,{filter:ae.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:fe}):function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Q));return t&&ee.call(e,Q)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ae.bind(null,t)),de(n)};let pe=0;function ve(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(pe);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():pe=requestAnimationFrame(u)}function ge(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}const he=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ye(e,t){const n=me(e,he());"prev"===t&&n.reverse();const r=n.indexOf(g(I(e)));return n.slice(r+1)[0]}function be(){return ye(document.body,"next")}function Ee(){return ye(document.body,"prev")}function we(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!h(n,r)}function Re(e){me(e,he()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function xe(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 Ie={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 Oe(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const ke=u.forwardRef((function(e,t){const[n,r]=u.useState();c((()=>(R()&&r("button"),document.addEventListener("keydown",Oe),()=>{document.removeEventListener("keydown",Oe)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[N("focus-guard")]:"",style:Ie};return u.createElement("span",i({},e,o))})),Te=u.createContext(null);function Me(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=N("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&&!p(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(Te),Pe=u.forwardRef((function(e,t){return u.createElement("button",i({},e,{type:"button",ref:t,tabIndex:-1,style:Ie}))}));function Se(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 Ae=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});const Le=N("scroll-lock"),De=u.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;return c((()=>{var e,t;if(!n)return;if(document.body.hasAttribute(Le))return;document.body.setAttribute(Le,"");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(y()))return Object.assign(document.body.style,{overflow:"hidden",[r]:o+"px"}),()=>{document.body.removeAttribute(Le),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(Le),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 Ne(e){return v(e.target)&&"BUTTON"===e.target.tagName}function Fe(e){return M(e)}const je=u["useInsertionEffect".toString()]||(e=>e());function Ke(e){const t=u.useRef((()=>{}));return je((()=>{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 He(e){return null!=e&&null!=e.clientX}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(H.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:s})),[o,i,s])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=e,{open:m,refs:p,nodeId:y,onOpenChange:b,events:E,dataRef:w,elements:{domReference:R,floating:x}}=t,O=!Z()||i,T=F(o),P=F(l),S=F(s),A=D(),L=Ce(),j="number"==typeof l&&l<0,K=u.useRef(null),H=u.useRef(null),B=u.useRef(!1),q=u.useRef(null),_=u.useRef(!1),W=null!=L,U=R&&"combobox"===R.getAttribute("role")&&M(R),z=u.useCallback((function(e){return void 0===e&&(e=x),e?me(e,he()):[]}),[x]),V=u.useCallback((e=>{const t=z(e);return T.current.map((e=>R&&"reference"===e?R:x&&"floating"===e?x:t)).filter(Boolean).flat()}),[R,x,T,z]);function X(e){return!r&&f&&a?u.createElement(Pe,{ref:"start"===e?K:H,onClick:e=>b(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}u.useEffect((()=>{if(r||!a)return;function e(e){if("Tab"===e.key){h(x,g(I(x)))&&0===z().length&&!U&&C(e);const t=V(),n=k(e);"reference"===T.current[0]&&n===R&&(C(e),e.shiftKey?ve(t[t.length-1]):ve(t[1])),"floating"===T.current[1]&&n===x&&e.shiftKey&&(C(e),ve(t[0]))}}const t=I(x);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,R,x,a,T,p,U,z,V]),u.useEffect((()=>{if(!r&&d)return x&&v(R)?(R.addEventListener("focusout",t),R.addEventListener("pointerdown",e),!a&&x.addEventListener("focusout",t),()=>{R.removeEventListener("focusout",t),R.removeEventListener("pointerdown",e),!a&&x.removeEventListener("focusout",t)}):void 0;function e(){_.current=!0,setTimeout((()=>{_.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(h(R,t)||h(x,t)||h(t,x)||h(null==L?void 0:L.portalNode,t)||null!=t&&t.hasAttribute(N("focus-guard"))||A&&(ge(A.nodesRef.current,y).find((e=>{var n,r;return h(null==(n=e.context)?void 0:n.elements.floating,t)||h(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}(A.nodesRef.current,y).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&&!_.current&&t!==q.current&&(B.current=!0,b(!1,e))}))}}),[r,R,x,a,y,A,L,b,d]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==L||null==(e=L.portalNode)?void 0:e.querySelectorAll("["+N("portal")+"]"))||[]);if(x&&a){const e=[x,...t,K.current,H.current].filter((e=>null!=e)),n=(O?Y:$)(T.current.includes("reference")||U?e.concat(R||[]):e,void 0,N("inert"));return()=>{n()}}}),[r,R,x,a,T,L,U,O]),c((()=>{if(r||!x)return;const e=g(I(x));queueMicrotask((()=>{const t=V(x),n=P.current,r=("number"==typeof n?t[n]:n.current)||x,o=h(x,e);j||o||!m||ve(r,{preventScroll:r===x})}))}),[r,m,x,j,V,P]),c((()=>{if(r||!x)return;let e=!1;const t=I(x),n=g(t),o=w.current;function u(t){if("escapeKey"===t.type&&p.domReference.current&&(q.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(B.current=!1,e=n.preventScroll):B.current=!n}return q.current=n,E.on("dismiss",u),()=>{E.off("dismiss",u);const n=g(t);(h(x,n)||A&&ge(A.nodesRef.current,y).some((e=>{var t;return h(null==(t=e.context)?void 0:t.elements.floating,n)}))||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&p.domReference.current&&(q.current=p.domReference.current),S.current&&v(q.current)&&!B.current&&ve(q.current,{cancelPrevious:!1,preventScroll:e})}}),[r,x,S,w,p,E,A,y]),c((()=>{if(!r&&L)return L.setFocusManagerState({...t,modal:a,closeOnFocusOut:d,open:m}),()=>{L.setFocusManagerState(null)}}),[r,L,a,m,d,t]),c((()=>{if(!r&&x&&"function"==typeof MutationObserver){const e=()=>{const e=x.getAttribute("tabindex");T.current.includes("floating")||g(I(x))!==p.domReference.current&&0===z().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()}}}),[r,x,p,T,z]);const G=!r&&O&&!U&&(W||a);return u.createElement(u.Fragment,null,G&&u.createElement(ke,{"data-type":"inside",ref:null==L?void 0:L.beforeInsideRef,onFocus:e=>{if(a){const e=V();ve("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(B.current=!1,we(e,L.portalNode)){const e=be()||R;null==e||e.focus()}else{var t;null==(t=L.beforeOutsideRef.current)||t.focus()}}}),!U&&X("start"),n,X("end"),G&&u.createElement(ke,{"data-type":"inside",ref:null==L?void 0:L.afterInsideRef,onFocus:e=>{if(a)ve(V()[0]);else if(null!=L&&L.preserveTabOrder&&L.portalNode)if(d&&(B.current=!0),we(e,L.portalNode)){const e=Ee()||R;null==e||e.focus()}else{var t;null==(t=L.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(Se).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(Ae.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=L();return u.createElement(S.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=De,e.FloatingPortal=function(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const c=Me({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&&we(e)){("focusin"===e.type?xe:Re)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(Te.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:m,portalNode:c,setFocusManagerState:s})),[i,c])},p&&c&&u.createElement(ke,{"data-type":"outside",ref:a,onFocus:e=>{if(we(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Ee()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&c&&u.createElement("span",{"aria-owns":c.id,style:Ie}),c&&r.createPortal(t,c),p&&c&&u.createElement(ke,{"data-type":"outside",ref:f,onFocus:e=>{if(we(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=be()||(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((()=>P()))[0];return u.createElement(A.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:v}=e;return function(e){function g(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:y,clientY:b}=e,E=[y,b],w=k(e),R="mouseleave"===e.type,x=h(f.floating,w),I=h(f.domReference,w),O=f.domReference.getBoundingClientRect(),T=f.floating.getBoundingClientRect(),M=a.split("-")[0],C=n>T.right-T.width/2,P=s>T.bottom-T.height/2,S=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,O),A=T.width>O.width,L=T.height>O.height,D=(A?O:T).left,N=(A?O:T).right,F=(L?O:T).top,j=(L?O:T).bottom;if(x&&(u=!0,!R))return;if(I&&(u=!1),I&&!R)return void(u=!0);if(R&&p(e.relatedTarget)&&h(f.floating,e.relatedTarget))return;if(v&&ge(v.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===M&&s>=O.bottom-1||"bottom"===M&&s<=O.top+1||"left"===M&&n>=O.right-1||"right"===M&&n<=O.left+1)return g();let K=[];switch(M){case"top":K=[[D,O.top+1],[D,T.bottom-1],[N,T.bottom-1],[N,O.top+1]];break;case"bottom":K=[[D,T.top+1],[D,O.bottom-1],[N,O.bottom-1],[N,T.top+1]];break;case"left":K=[[T.right-1,j],[T.right-1,F],[O.left+1,F],[O.left+1,j]];break;case"right":K=[[O.right-1,j],[O.right-1,F],[T.left+1,F],[T.left+1,j]]}if(!it([y,b],K)){if(u&&!S)return g();if(!R&&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 g()}it([y,b],function(e){let[n,r]=e;switch(M){case"top":return[[A?n+t/2:C?n+4*t:n-4*t,r+t+1],[A?n-t/2:C?n+4*t:n-4*t,r+t+1],...[[T.left,C||A?T.bottom-t:T.top],[T.right,C?A?T.bottom-t:T.top:T.bottom-t]]];case"bottom":return[[A?n+t/2:C?n+4*t:n-4*t,r-t],[A?n-t/2:C?n+4*t:n-4*t,r-t],...[[T.left,C||A?T.top+t:T.bottom],[T.right,C?A?T.top+t:T.bottom:T.top+t]]];case"left":{const e=[n+t+1,L?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,L?r-t/2:P?r+4*t:r-4*t];return[...[[P||L?T.right-t:T.left,T.top],[P?L?T.right-t:T.left:T.right-t,T.bottom]],e,o]}case"right":return[[n-t,L?r+t/2:P?r+4*t:r-4*t],[n-t,L?r-t/2:P?r+4*t:r-4*t],...[[P||L?T.left+t:T.right,T.top],[P?L?T.left+t:T.right:T.left+t,T.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};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&&(x(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent)):r(!1,e.nativeEvent)))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:x(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent):r(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Ne(e)||(" "!==e.key||Fe(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Ne(e)||Fe(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!s,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),p=u.useRef(null),[v,g]=u.useState(),[y,b]=u.useState([]),E=Ke(((e,t)=>{d.current||o.current.openEvent&&!He(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:v}))})),w=Ke((e=>{null==a&&null==f&&(n?p.current||b([]):E(e.clientX,e.clientY))})),R=x(v)?i:n,I=u.useCallback((()=>{if(!R||!l||null!=a||null!=f)return;const e=m(r.floating.current);function t(n){const o=k(n);h(r.floating.current,o)?(e.removeEventListener("mousemove",t),p.current=null):E(n.clientX,n.clientY)}if(!o.current.openEvent||He(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}r.setPositionReference(r.domReference.current)}),[o,l,R,r,E,a,f]);return u.useEffect((()=>I()),[I,y]),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,E(a,f))}),[l,a,f,E]),u.useMemo((()=>{if(!l)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[l,w])},e.useDelayGroup=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:u,setCurrentId:i,initialDelay:l,setState:s,timeoutMs:a}=B();c((()=>{u&&(s({delay:{open:1,close:K(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=B,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:g=!0,outsidePress:h=!0,outsidePressEvent:y="pointerdown",referencePress:b=!1,referencePressEvent:R="pointerdown",ancestorScroll:x=!1,bubbles:T}=n,M=D(),C=null!=L(),P=Ke("function"==typeof h?h:()=>!1),S="function"==typeof h?P:h,A=u.useRef(!1),{escapeKeyBubbles:N,outsidePressBubbles:F}=(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),j=Ke((e=>{if(!r||!d||!g||"Escape"!==e.key)return;const t=M?ge(M.nodesRef.current,c):[];if(!N&&(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)})),K=Ke((e=>{const t=A.current;if(A.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=k(e);if(v(n)&&a){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,o=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let u=o&&e.offsetX>n.clientWidth;if(o){"rtl"===(r=n,m(r).getComputedStyle(r)).direction&&(u=e.offsetX<=n.offsetWidth-n.clientWidth)}if(u||t&&e.offsetY>n.clientHeight)return}var r;const u=M&&ge(M.nodesRef.current,c).some((t=>{var n;return O(e,null==(n=t.context)?void 0:n.elements.floating)}));if(O(e,a)||O(e,s)||u)return;const l=M?ge(M.nodesRef.current,c):[];if(l.length>0){let e=!0;if(l.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}:E(e)||w(e)}}),o(!1,e)}));return u.useEffect((()=>{if(!r||!d)return;function e(e){o(!1,e)}f.current.__escapeKeyBubbles=N,f.current.__outsidePressBubbles=F;const n=I(a);g&&n.addEventListener("keydown",j),S&&n.addEventListener(y,K);let u=[];return x&&(p(s)&&(u=t.getOverflowAncestors(s)),p(a)&&(u=u.concat(t.getOverflowAncestors(a))),!p(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})})),()=>{g&&n.removeEventListener("keydown",j),S&&n.removeEventListener(y,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[f,a,s,l,g,S,y,r,o,x,d,N,F,j,K]),u.useEffect((()=>{A.current=!1}),[S,y]),u.useMemo((()=>d?{reference:{onKeyDown:j,[Be[R]]:e=>{b&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:j,[qe[y]]:()=>{A.current=!0}}}:{}),[d,i,b,y,R,o,j])},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),m=D(),v=Ke(((e,t)=>{e&&(h.current.openEvent=t),null==o||o(e,t)})),g=u.useRef(null),h=u.useRef({}),y=u.useState((()=>P()))[0],b=f(),E=u.useCallback((e=>{const t=p(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),w=u.useCallback((e=>{(p(e)||null===e)&&(g.current=e,s(e)),(p(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!p(e))&&d.refs.setReference(e)}),[d.refs]),R=u.useMemo((()=>({...d.refs,setReference:w,setPositionReference:E,domReference:g})),[d.refs,w,E]),x=u.useMemo((()=>({...d.elements,domReference:a})),[d.elements,a]),I=u.useMemo((()=>({...d,refs:R,elements:x,dataRef:h,nodeId:i,floatingId:b,events:y,open:r,onOpenChange:v})),[d,i,b,y,r,v,R,x]);return c((()=>{const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===i));e&&(e.context=I)})),u.useMemo((()=>({...d,context:I,refs:R,elements:x})),[d,R,x,I])},e.useFloatingNodeId=function(e){const t=f(),n=D(),r=L(),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=L,e.useFloatingPortalNode=Me,e.useFloatingTree=D,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),y=u.useRef();return u.useEffect((()=>{if(!a)return;const e=I(l).defaultView||window;function t(){!n&&v(s)&&s===g(I(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(y.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)&&O(o.current.openEvent,s)||r(!0,e.nativeEvent)},onBlur(e){m.current=!1;const t=e.relatedTarget,n=p(t)&&t.hasAttribute(N("focus-guard"))&&"outside"===t.getAttribute("data-type");y.current=setTimeout((()=>{h(c.floating.current,t)||h(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:v=!1,restMs:g=0,move:y=!0}=t,b=D(),E=L(),w=F(m),R=F(d),O=u.useRef(),k=u.useRef(),T=u.useRef(),M=u.useRef(),C=u.useRef(!0),P=u.useRef(!1),S=u.useRef((()=>{})),A=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(M.current),C.current=!0}}),[f,i]),u.useEffect((()=>{if(!f||!w.current||!n)return;function e(e){A()&&r(!1,e)}const t=I(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,r,f,w,o,A]);const N=u.useCallback((function(e,t){void 0===t&&(t=!0);const n=K(R.current,"close",O.current);n&&!T.current?(clearTimeout(k.current),k.current=setTimeout((()=>r(!1,e)),n)):t&&(clearTimeout(k.current),r(!1,e))}),[R,r]),H=u.useCallback((()=>{S.current(),T.current=void 0}),[]),B=u.useCallback((()=>{if(P.current){const e=I(a.floating.current).body;e.style.pointerEvents="",e.removeAttribute(j),P.current=!1}}),[a]);return u.useEffect((()=>{if(f&&p(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),y&&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),y&&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),C.current=!1,v&&!x(O.current)||g>0&&0===K(R.current,"open"))return;const t=K(R.current,"open",O.current);t?k.current=setTimeout((()=>{r(!0,e)}),t):r(!0,e)}function i(r){if(t())return;S.current();const o=I(s);if(clearTimeout(M.current),w.current){n||clearTimeout(k.current),T.current=w.current({...e,tree:b,x:r.clientX,y:r.clientY,onClose(){B(),H(),N(r)}});const t=T.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==O.current||!h(s,r.relatedTarget))&&N(r)}function c(n){t()||null==w.current||w.current({...e,tree:b,x:n.clientX,y:n.clientY,onClose(){B(),H(),N(n)}})(n)}}),[l,s,f,e,v,g,y,N,H,B,r,n,b,R,w,o]),c((()=>{var e;if(f&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&A()){const e=I(s).body;if(e.setAttribute(j,""),e.style.pointerEvents="none",P.current=!0,p(l)&&s){var t,r;const e=l,n=null==b||null==(t=b.nodesRef.current.find((e=>e.id===E)))||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,E,s,l,b,w,o,A]),c((()=>{n||(O.current=void 0,H(),B())}),[n,H,B]),u.useEffect((()=>()=>{H(),clearTimeout(k.current),clearTimeout(M.current),B()}),[f,l,H,B]),u.useMemo((()=>{if(!f)return{};function e(e){O.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===g||(clearTimeout(M.current),M.current=setTimeout((()=>{C.current||r(!0,e.nativeEvent)}),g))}},floating:{onMouseEnter(){clearTimeout(k.current)},onMouseLeave(e){i.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),N(e.nativeEvent,!1)}}}}),[i,f,g,n,r,N])},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=Ke(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(b())&&(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(Ae),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:b=!1,nested:x=!1,rtl:O=!1,virtual:k=!1,focusItemOnOpen:T="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:P=!0,disabledIndices:S,orientation:A="vertical",cols:N=1,scrollItemIntoView:j=!0}=t,K=L(),H=D(),B=Ke(f),q=u.useRef(T),_=u.useRef(null!=m?m:-1),W=u.useRef(null),U=u.useRef(!0),z=u.useRef(B),V=u.useRef(!!l),X=u.useRef(!1),Y=u.useRef(!1),G=F(S),Z=F(n),$=F(j),[Q,J]=u.useState(),ee=Ke((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(k?J(r.id):ve(r,{preventScroll:!0,sync:!(!y().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!R())&&(We||X.current)}),requestAnimationFrame((()=>{const e=$.current;e&&r&&(n||!U.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?q.current&&null!=m&&(Y.current=!0,B(m)):V.current&&(_.current=-1,z.current(null)))}),[d,n,l,m,B]),c((()=>{if(d&&n&&l)if(null==a){if(X.current=!1,null!=m)return;if(V.current&&(_.current=-1,ee(s,_)),!V.current&&q.current&&(null!=W.current||!0===q.current&&null==W.current)){let e=0;const t=()=>{if(null==s.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else _.current=null==W.current||Je(W.current,A,O)||x?et(s,G.current):tt(s,G.current),W.current=null,B(_.current)};t()}}else Ge(s,a)||(_.current=a,ee(s,_,Y.current),Y.current=!1)}),[d,n,l,a,m,x,s,A,O,B,ee,G]),c((()=>{if(d&&V.current&&!l&&H){var e,t;const n=H.nodesRef.current,r=null==(e=n.find((e=>e.id===K)))||null==(t=e.context)?void 0:t.elements.floating,o=g(I(l)),u=n.some((e=>e.context&&h(e.context.elements.floating,o)));r&&!u&&r.focus({preventScroll:!0})}}),[d,l,H,K]),c((()=>{z.current=B,V.current=!!l})),c((()=>{n||(W.current=null)}),[n]);const te=null!=a,ne=u.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&B(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;U.current&&"touch"!==t&&(_.current=-1,ee(s,_),B(null),k||ve(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ee,M,s,B,k]);return u.useMemo((()=>{if(!d)return{};const e=G.current;function t(t){if(U.current=!1,X.current=!0,!Z.current&&t.currentTarget===o.floating.current)return;if(x&&function(e,t,n){return $e(t,n?e===Xe:e===Ve,e===Ue)}(t.key,A,O))return C(t),r(!1,t.nativeEvent),void(v(i)&&i.focus());const u=_.current,c=et(s,e),l=tt(s,e);if("Home"===t.key&&(C(t),_.current=c,B(_.current)),"End"===t.key&&(C(t),_.current=l,B(_.current)),N>1){const n=_.current;if(t.key===Ue){if(C(t),-1===n)_.current=l;else if(_.current=Ze(s,{startingIndex:n,amount:N,decrement:!0,disabledIndices:e}),b&&(n-N<c||_.current<0)){const e=n%N,t=l%N,r=l-(t-e);_.current=t===e?l:t>e?r:r-N}Ge(s,_.current)&&(_.current=n),B(_.current)}if(t.key===ze&&(C(t),-1===n?_.current=c:(_.current=Ze(s,{startingIndex:n,amount:N,disabledIndices:e}),b&&n+N>l&&(_.current=Ze(s,{startingIndex:n%N-N,amount:N,disabledIndices:e}))),Ge(s,_.current)&&(_.current=n),B(_.current)),"both"===A){const r=Math.floor(n/N);t.key===Xe&&(C(t),n%N!=N-1?(_.current=Ze(s,{startingIndex:n,disabledIndices:e}),b&&Ye(_.current,N,r)&&(_.current=Ze(s,{startingIndex:n-n%N-1,disabledIndices:e}))):b&&(_.current=Ze(s,{startingIndex:n-n%N-1,disabledIndices:e})),Ye(_.current,N,r)&&(_.current=n)),t.key===Ve&&(C(t),n%N!=0?(_.current=Ze(s,{startingIndex:n,disabledIndices:e,decrement:!0}),b&&Ye(_.current,N,r)&&(_.current=Ze(s,{startingIndex:n+(N-n%N),decrement:!0,disabledIndices:e}))):b&&(_.current=Ze(s,{startingIndex:n+(N-n%N),decrement:!0,disabledIndices:e})),Ye(_.current,N,r)&&(_.current=n));const o=Math.floor(l/N)===r;return Ge(s,_.current)&&(_.current=b&&o?t.key===Ve?l:Ze(s,{startingIndex:n-n%N-1,disabledIndices:e}):n),void B(_.current)}}if(Qe(t.key,A)){if(C(t),n&&!k&&g(t.currentTarget.ownerDocument)===t.currentTarget)return _.current=Je(t.key,A,O)?c:l,void B(_.current);Je(t.key,A,O)?_.current=b?u>=l?p&&u!==s.current.length?-1:c:Ze(s,{startingIndex:u,disabledIndices:e}):Math.min(l,Ze(s,{startingIndex:u,disabledIndices:e})):_.current=b?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,_.current)?B(null):B(_.current)}}function u(e){"auto"===T&&E(e.nativeEvent)&&(q.current=!0)}const c=k&&n&&te&&{"aria-activedescendant":Q};return{reference:{...c,onKeyDown(o){U.current=!1;const u=0===o.key.indexOf("Arrow");if(k&&n)return t(o);if(!n&&!P&&u)return;const i=u||"Enter"===o.key||""===o.key.trim(),c=Qe(o.key,A),l=function(e,t,n){return $e(t,n?e===Ve:e===Xe,e===ze)}(o.key,A,O);i&&(W.current=x&&c?null:o.key),x?l&&(C(o),n?(_.current=et(s,e),B(_.current)):r(!0,o.nativeEvent)):c&&(null!=m&&(_.current=m),C(o),!n&&P?r(!0,o.nativeEvent):t(o),n&&B(_.current))},onFocus(){n&&B(null)},onPointerDown:function(e){q.current=T,"auto"===T&&w(e.nativeEvent)&&(q.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===A?void 0:A,...c,onKeyDown:t,onPointerMove(){U.current=!0}},item:ne}}),[i,o,Q,G,Z,s,d,A,O,k,n,te,x,m,P,p,N,b,T,B,r,ne])},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=F(n),E=F(r),w=F(o),R=F(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=Ke(s),w=Ke(a),R=F(d),x=F(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&&C(n)),null==o||x.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(C(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.8", | ||
"version": "0.25.0", | ||
"@rollingversions": { | ||
@@ -18,11 +18,14 @@ "baseVersion": [ | ||
"unpkg": "./dist/floating-ui.react.umd.min.js", | ||
"types": "./index.d.ts", | ||
"types": "./src/types.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./index.d.ts", | ||
"import": { | ||
"types": "./src/types.d.mts", | ||
"default": "./dist/floating-ui.react.mjs" | ||
}, | ||
"types": "./src/types.d.ts", | ||
"module": "./dist/floating-ui.react.esm.js", | ||
"import": "./dist/floating-ui.react.mjs", | ||
"default": "./dist/floating-ui.react.umd.js" | ||
}, | ||
"./package.json": "./package.json" | ||
} | ||
}, | ||
@@ -32,4 +35,4 @@ "sideEffects": false, | ||
"dist/", | ||
"index.d.ts", | ||
"src/**/*.d.ts" | ||
"**/*.d.ts", | ||
"**/*.d.mts" | ||
], | ||
@@ -66,2 +69,3 @@ "scripts": { | ||
"@floating-ui/react-dom": "^2.0.1", | ||
"@floating-ui/utils": "^0.1.0", | ||
"aria-hidden": "^1.2.3", | ||
@@ -68,0 +72,0 @@ "tabbable": "^6.0.1" |
@@ -22,3 +22,3 @@ import * as React from 'react'; | ||
*/ | ||
export declare function FloatingPortal({ children, id, root, preserveTabOrder, }: FloatingPortalProps): import("react/jsx-runtime").JSX.Element; | ||
export declare function FloatingPortal({ children, id, root, preserveTabOrder, }: FloatingPortalProps): JSX.Element; | ||
export declare const usePortalContext: () => { | ||
@@ -25,0 +25,0 @@ preserveTabOrder: boolean; |
@@ -80,5 +80,9 @@ import type { UseFloatingOptions as UsePositionOptions, UseFloatingReturn as UsePositionFloatingReturn, VirtualElement } from '@floating-ui/react-dom'; | ||
}>; | ||
export interface UseFloatingOptions<RT extends ReferenceType = ReferenceType> extends UsePositionOptions<RT> { | ||
export interface UseFloatingOptions<RT extends ReferenceType = ReferenceType> extends Omit<UsePositionOptions<RT>, 'elements'> { | ||
elements?: { | ||
reference?: Element | null; | ||
floating?: HTMLElement | null; | ||
}; | ||
onOpenChange?: (open: boolean, event?: Event) => void; | ||
nodeId?: string; | ||
} |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
588973
74
6
12640
18
+ Added@floating-ui/utils@^0.1.0
+ Added@floating-ui/utils@0.1.6(transitive)