Files
powerservice/wp-content/plugins/yabe-webfont/assets/dist/assets/usePositioner-BR1Prb1t.js
T
2026-10-19 12:45:45 -06:00

1 line
64 KiB
JavaScript

import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{B as n,C as r,D as i,E as a,I as o,L as s,O as c,P as l,R as u,S as d,T as f,U as p,W as m,_ as h,b as g,c as _,d as v,f as y,g as b,h as x,k as S,l as C,m as w,p as T,r as E,v as D,w as O,x as k,y as A}from"./button-BhAQo6Sy.js";import{B as j,I as M,L as N,M as P,N as ee,T as te,b as ne,f as F,m as re,nt as I,u as L,v as ie,x as R,z}from"./api-Bb85n68L.js";import{d as B,f as V,p as H,r as ae,s as U,u as oe}from"./input-DbQb1wvc.js";var se=p(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),W=e(m(),1),ce=e(I(),1),G=E();(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=z.startingStyle]=`startingStyle`,e[e.endingStyle=z.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var le={"data-popup-open":``},ue={"data-popup-open":``,"data-pressed":``},de={"data-open":``},fe={"data-closed":``},pe={"data-anchor-hidden":``},me={open(e){return e?le:null}},he={open(e){return e?ue:null}},ge={open(e){return e?de:fe},anchorHidden(e){return e?pe:null}},_e={...ge,...j},ve=0,K=class e{static create(){return new e}currentId=ve;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ve,t()},e)}isStarted(){return this.currentId!==ve}clear=()=>{this.currentId!==ve&&(clearTimeout(this.currentId),this.currentId=ve)};disposeEffect=()=>this.clear};function ye(){let e=n(K.create).current;return ie(e.disposeEffect),e}function be(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:xe,platform:q,maxTouchPoints:Se}=be(),Ce=xe.toLowerCase(),we=q.toLowerCase(),Te=/^i(os$|p)/.test(we)||we===`macintel`&&Se>1,Ee=`android`,De=we===Ee||Ce.includes(Ee),Oe=!Te&&we.startsWith(`mac`);we.startsWith(`win`),!De&&/^(linux|chrome os)/.test(we);var ke=Oe||Te,Ae=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Ae&&Ce.includes(`firefox`),!Ae&&Ce.includes(`chrom`);var je=ke,Me=/jsdom|happydom/.test(Ce);function Ne(e){e.preventDefault(),e.stopPropagation()}function Pe(e){return`nativeEvent`in e}function Fe(e){return e.pointerType===``&&e.isTrusted?!0:De&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ie(e){return Me?!1:!De&&e.width===0&&e.height===0||De&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Le(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Re(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ze=`data-base-ui-focusable`,Be=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ve=`ArrowLeft`,He=`ArrowRight`,Ue=`ArrowUp`,We=`ArrowDown`;function Ge(e,t){if(!k(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(B(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ke(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function qe(e){return e.matches(`html,body`)}function Je(e){return d(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ye(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Be}`)!=null}function Xe(e){return e?e.getAttribute(`role`)===`combobox`&&Je(e):!1}function Ze(e){if(!e||Me)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Qe(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function $e(e,t){return t!=null&&!Le(t)?0:typeof e==`function`?e():e}function et(e,t,n){let r=$e(e,n);return typeof r==`number`?r:r?.[t]}function tt(e){return typeof e==`function`?e():e}function nt(e,t){return t||e===`click`||e===`mousedown`}function rt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function J(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function it(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Y(e){let t=n(at,e).current;return t.next=e,_(t.effect),t}function at(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ot=W.forwardRef(function(e,t){let[n,r]=W.useState();_(()=>{je&&Ae&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:re,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),st=Math.min,X=Math.max,ct=Math.round,lt=Math.floor,ut=e=>({x:e,y:e}),dt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ft(e,t,n){return X(e,st(t,n))}function pt(e,t){return typeof e==`function`?e(t):e}function Z(e){return e.split(`-`)[0]}function mt(e){return e.split(`-`)[1]}function ht(e){return e===`x`?`y`:`x`}function gt(e){return e===`y`?`height`:`width`}function Q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function _t(e){return ht(Q(e))}function vt(e,t,n){n===void 0&&(n=!1);let r=mt(e),i=_t(e),a=gt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Dt(o)),[o,Dt(o)]}function yt(e){let t=Dt(e);return[bt(e),t,bt(t)]}function bt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var xt=[`left`,`right`],St=[`right`,`left`],Ct=[`top`,`bottom`],wt=[`bottom`,`top`];function Tt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?St:xt:t?xt:St;case`left`:case`right`:return t?Ct:wt;default:return[]}}function Et(e,t,n,r){let i=mt(e),a=Tt(Z(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(bt)))),a}function Dt(e){let t=Z(e);return dt[t]+e.slice(t.length)}function Ot(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function kt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ot(e)}function At(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var jt=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Mt(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return a(n)?n.host:null}function Nt(e){for(let t of Array.from(e.children))if(x(t)===`summary`)return t;return null}function Pt(e,t){let n=Nt(t);return!!n&&(e===n||B(n,e))}function Ft(e){let t=e?x(e):``;return e!=null&&e.matches(jt)&&(t!==`summary`||e.parentElement!=null&&x(e.parentElement)===`details`&&Nt(e.parentElement)===e)&&(t!==`details`||Nt(e)==null)&&(t!==`input`||e.type!==`hidden`)}function It(e){if(!Ft(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Mt(t)){let n=t!==e,r=x(t)===`slot`;if(t.hasAttribute(`inert`)||n&&x(t)===`details`&&!t.open&&!Pt(e,t)||t.hasAttribute(`hidden`)||!r&&!Lt(t,n))return!1}return!0}function Lt(e,t){let n=v(e);return t?n.display!==`none`:U(e,n)}function Rt(e){let t=e.tabIndex;if(t<0){let t=x(e);if(t===`details`||t===`audio`||t===`video`||d(e)&&e.isContentEditable)return 0}return t}function zt(e){if(x(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Bt(e,t){let n=zt(e);if(!n)return!0;let r=t.find(e=>{let t=zt(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=zt(e);return t?.name===n.name&&t.form===n.form})===n}function Vt(e){if(d(e)&&x(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return d(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ht(e,t){Vt(e).forEach(e=>{Ft(e)&&t.push(e),Ht(e,t)})}function Ut(e,t,n){Vt(e).forEach(e=>{d(e)&&e.matches(t)&&n.push(e),Ut(e,t,n)})}function Wt(e){return It(e)&&Rt(e)>=0}function Gt(e){let t=[];return Ht(e,t),t.filter(It)}function Kt(e){let t=Gt(e);return t.filter(e=>Rt(e)>=0&&Bt(e,t))}function qt(e,t){let n=Kt(e),r=n.length;if(r===0)return;let i=oe(H(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Jt(e){return qt(H(e).body,1)||e}function Yt(e){return qt(H(e).body,-1)||e}function Xt(e,t){if(!e)return null;let n=Kt(H(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Zt(e){return Xt(e,1)}function Qt(e){return Xt(e,-1)}function $t(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!B(n,r)}function en(e){Kt(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function tn(e){let t=[];Ut(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function nn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...nn(e,t.id,n)])}function rn(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function an(e){return`data-base-ui-${e}`}var on={style:{transition:`none`}},sn=`data-base-ui-click-trigger`,cn={fallbackAxisSide:`none`},ln={fallbackAxisSide:`end`},un={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},dn=W.createContext(null),fn=()=>W.useContext(dn),pn=an(`portal`);function mn(e={}){let{ref:t,container:n,componentProps:r=o,elementProps:i}=e,a=ne(),s=fn()?.portalNode,[c,u]=W.useState(null),[d,f]=W.useState(null),p=C(e=>{e!==null&&f(e)}),m=W.useRef(null);_(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(O(n)?n:n.current))??s??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,s]);let h=l(`div`,r,{ref:[t,p],props:[{id:a,[pn]:``},i]}),g=c&&h?ce.createPortal(h,c):null;return{node:d,nodeId:W.isValidElement(h)?h.props.id:void 0,subtree:g}}var hn=W.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=mn({container:o,ref:t,componentProps:e,elementProps:s}),d=W.useRef(null),f=W.useRef(null),p=W.useRef(null),m=W.useRef(null),[h,g]=W.useState(null),v=W.useRef(!1),y=h?.modal,b=h?.open,x=!!h&&!h.modal&&h.open&&!!c;W.useEffect(()=>{if(!c||y)return;function e(e){c&&e.relatedTarget&&$t(e)&&(e.type===`focusin`?v.current&&=(tn(c),!1):(en(c),v.current=!0))}return it(J(c,`focusin`,e,!0),J(c,`focusout`,e,!0))},[c,y]),_(()=>{!c||b!==!0||!v.current||(tn(c),v.current=!1)},[b,c]);let S=W.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,G.jsxs)(W.Fragment,{children:[u,(0,G.jsxs)(dn.Provider,{value:S,children:[x&&c&&(0,G.jsx)(ot,{"data-type":`outside`,ref:d,onFocus:e=>{$t(e,c)?p.current?.focus():Yt(h?h.domReference:null)?.focus()}}),x&&c&&(0,G.jsx)(`span`,{"aria-owns":l,style:un}),c&&ce.createPortal(a,c),x&&c&&(0,G.jsx)(ot,{"data-type":`outside`,ref:f,onFocus:e=>{$t(e,c)?m.current?.focus():(Jt(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,R(`focus-out`,e.nativeEvent)))}})]})]})});function gn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var _n=class{nodesRef={current:[]};events=gn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},vn=W.createContext(null),yn=W.createContext(null),bn=()=>W.useContext(vn)?.id||null,xn=e=>{let t=W.useContext(yn);return e??t};function Sn(e){let t=ne(),n=xn(e),r=bn();return _(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Cn(e){let{children:t,id:n}=e,r=bn();return(0,G.jsx)(vn.Provider,{value:W.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function wn(e){let{children:t,externalTree:r}=e,i=n(()=>r??new _n).current;return(0,G.jsx)(yn.Provider,{value:i,children:t})}function Tn(){return!1}function En(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Dn(e,t={}){let{enabled:n=!0,escapeKey:i=!0,outsidePress:o=!0,outsidePressEvent:s=`sloppy`,referencePress:c=Tn,bubbles:l,externalTree:u}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=f.useState(`floatingElement`),{dataRef:h}=f.context,g=xn(u),_=C(typeof o==`function`?o:()=>!1),y=typeof o==`function`?_:o,b=y!==!1,x=C(()=>s),{escapeKey:S,outsidePress:w}=En(l),T=W.useRef(!1),E=W.useRef(!1),O=W.useRef(!1),A=W.useRef(!1),j=W.useRef(``),M=W.useRef(null),P=ye(),ne=ye(),F=C(()=>{ne.clear(),h.current.insideReactTree=!1}),re=C(e=>{let t=h.current.floatingContext?.nodeId;return(g?nn(g.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=C(e=>Ke(e,f.select(`floatingElement`))||Ke(e,f.select(`domReferenceElement`))),L=C(e=>{c()&&f.setOpen(!1,R(N,e.nativeEvent))}),ie=C(e=>{if(!p||!n||!i||e.key!==`Escape`||A.current||!S&&re(`__escapeKeyBubbles`))return;let t=Pe(e)?e.nativeEvent:e,r=R(te,t);f.setOpen(!1,r),r.isCanceled||e.preventDefault(),!S&&!r.isPropagationAllowed&&e.stopPropagation()}),z=C(()=>{h.current.insideReactTree=!0,ne.start(0,F)}),ae=C(e=>{if(!p||!n||e.button!==0)return;let t=V(e.nativeEvent);B(f.select(`floatingElement`),t)&&(T.current||(T.current=!0,E.current=!1))}),U=C(e=>{!p||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&T.current&&(E.current=!0)});W.useEffect(()=>{if(!p||!n)return F;h.current.__escapeKeyBubbles=S,h.current.__outsidePressBubbles=w;let e=new K,t=new K;function o(){e.clear(),A.current=!0}function s(){e.start(Ae?5:0,()=>{A.current=!1})}function c(){O.current=!0,t.start(0,()=>{O.current=!1})}function l(){T.current=!1,E.current=!1}function u(){let e=j.current,t=e===`pen`||!e?`mouse`:e,n=x(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function _(e){let t=u();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function C(e){let t=h.current.floatingContext?.nodeId,n=g&&nn(g.nodesRef.current,t).some(t=>Ke(e,t.context?.elements.floating));return I(e)||n}function N(e){if(_(e)){e.type!==`click`&&!I(e)&&(t.clear(),O.current=!1),F();return}if(h.current.insideReactTree){F();return}let n=V(e),i=`[${an(`inert`)}]`,o=k(n)?n.getRootNode():null,s=Array.from((a(o)?o:H(f.select(`floatingElement`))).querySelectorAll(i)),c=f.context.triggerElements;if(n&&(c.hasElement(n)||c.hasMatchingElement(e=>B(e,n))))return;let l=k(n)?n:null;for(;l&&!r(l);){let e=D(l);if(r(e)||!k(e))break;l=e}if(!(s.length&&k(n)&&!qe(n)&&!B(n,f.select(`floatingElement`))&&s.every(e=>!B(l,e)))){if(d(n)&&!(`touches`in e)){let t=r(n),i=v(n),a=/auto|scroll/,o=t||a.test(i.overflowX),s=t||a.test(i.overflowY),c=o&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,l=s&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,u=i.direction===`rtl`,d=l&&(u?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),f=c&&e.offsetY>n.clientHeight;if(d||f)return}if(!C(e)){if(u()===`intentional`&&O.current){t.clear(),O.current=!1;return}typeof y==`function`&&!y(e)||re(`__outsidePressBubbles`)||(f.setOpen(!1,R(ee,e)),F())}}}function te(e){u()!==`sloppy`||e.pointerType===`touch`||!f.select(`open`)||!n||I(e)||N(e)}function ne(e){if(u()!==`sloppy`||!f.select(`open`)||!n||I(e))return;let t=e.touches[0];t&&(M.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=V(e);if(!n)return;let r=J(n,e.type,()=>{t(e),r()})}function z(e){j.current=`touch`,L(e,ne)}function ae(e){P.clear(),e.type===`pointerdown`&&(j.current=e.pointerType),!(e.type===`mousedown`&&M.current&&!M.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?te(e):N(e)})}function U(e){if(!T.current)return;let n=E.current;if(l(),u()===`intentional`){if(e.type===`pointercancel`){n&&c();return}if(!C(e)){if(n){c();return}typeof y==`function`&&!y(e)||(t.clear(),O.current=!0,F())}}}function oe(e){if(u()!==`sloppy`||!M.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-M.current.startX),r=Math.abs(t.clientY-M.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(M.current.dismissOnTouchEnd=!0),i>10&&(N(e),P.clear(),M.current=null)}function se(e){L(e,oe)}function W(e){u()!==`sloppy`||!M.current||I(e)||(M.current.dismissOnTouchEnd&&N(e),P.clear(),M.current=null)}function ce(e){L(e,W)}let G=H(m),le=it(i&&it(J(G,`keydown`,ie),J(G,`compositionstart`,o),J(G,`compositionend`,s)),b&&it(J(G,`click`,ae,!0),J(G,`pointerdown`,ae,!0),J(G,`pointerup`,U,!0),J(G,`pointercancel`,U,!0),J(G,`mousedown`,ae,!0),J(G,`mouseup`,U,!0),J(G,`touchstart`,z,!0),J(G,`touchmove`,se,!0),J(G,`touchend`,ce,!0)));return()=>{le(),e.clear(),t.clear(),l(),O.current=!1,F()}},[h,m,i,b,y,p,n,S,w,ie,F,x,re,I,g,f,P]);let oe=W.useMemo(()=>({onKeyDown:ie,onPointerDown:L,onClick:L}),[ie,L]),se=W.useMemo(()=>({onKeyDown:ie,onPointerDown:U,onMouseDown:U,onClickCapture:z,onMouseDownCapture(e){z(),ae(e)},onPointerDownCapture(e){z(),ae(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[ie,z,ae,U]);return W.useMemo(()=>n?{reference:oe,floating:se,trigger:oe}:{},[n,oe,se])}function On(e,t,n){let{reference:r,floating:i}=e,a=Q(t),o=_t(t),s=gt(o),c=Z(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=mt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function kn(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=pt(t,e),p=kt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=At(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=At(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var An=50,jn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=On(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<An&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=On(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mn=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=pt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Z(r),_=Q(o),v=Z(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Dt(o)]:yt(o)),x=p!==`none`;!d&&x&&b.push(...Et(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=vt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Q(t)||T.every(e=>Q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Nn=new Set([`left`,`top`]);async function Pn(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Z(n),s=mt(n),c=Q(n)===`y`,l=Nn.has(o)?-1:1,u=a&&c?-1:1,d=pt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fn=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pn(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},In=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=pt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Q(i),p=ht(f),m=u[p],h=u[f],g=(e,t)=>ft(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ln=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=pt(e,t),u={x:n,y:r},d=Q(i),f=ht(d),p=u[f],m=u[d],h=pt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nn.has(Z(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rn=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=pt(e,t),c=await i.detectOverflow(t,s),l=Z(n),u=mt(n),d=Q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=st(p-c[m],g),y=st(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*X(c.left,c.right):S=p-2*X(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function zn(e){let t=v(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=d(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ct(n)!==a||ct(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Bn(e){return k(e)?e:e.contextElement}function Vn(e){let t=Bn(e);if(!d(t))return ut(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zn(t),o=(a?ct(n.width):n.width)/r,s=(a?ct(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Hn=ut(0);function Un(e){let t=A(e);return!S()||!t.visualViewport?Hn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===A(e)}function Gn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Bn(e),o=ut(1);t&&(r?k(r)&&(o=Vn(r)):o=Vn(e));let s=Wn(a,n,r)?Un(a):ut(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=A(a),t=k(r)?A(r):r,n=e,i=w(n);for(;i&&t!==n;){let e=Vn(i),t=i.getBoundingClientRect(),r=v(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=A(i),i=w(n)}}return At({width:u,height:d,x:c,y:l})}function Kn(e,t){let n=b(e).scrollLeft;return t?t.left+n:Gn(T(e)).left+n}function qn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kn(e,n),y:n.top+t.scrollTop}}function Jn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=T(r),s=t?c(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=ut(1),p=ut(0),m=d(r);if((m||!a)&&((x(r)!==`body`||f(o))&&(l=b(r)),m)){let e=Gn(r);u=Vn(r),p.x=e.x+r.clientLeft,p.y=e.y+r.clientTop}let h=o&&!m&&!a?qn(o,l):ut(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+p.x+h.x,y:n.y*u.y-l.scrollTop*u.y+p.y+h.y}}function Yn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Xn(e){let t=b(e),n=e.ownerDocument.body,r=X(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=X(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Kn(e),o=-t.scrollTop;return v(n).direction===`rtl`&&(a+=X(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Zn=25;function Qn(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=A(e),a=T(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!S()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Kn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Zn&&(s-=o)}return{width:s,height:c,x:l,y:u}}function $n(e,t){let n=Gn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vn(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function er(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Qn(e,n,t);else if(t===`document`)r=Xn(T(e));else if(k(t))r=$n(t,n);else{let n=Un(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return At(r)}function tr(e,t){let n=t.get(e);if(n)return n;let i=h(e,[],!1).filter(e=>k(e)&&x(e)!==`body`),a=null,o=v(e).position===`fixed`,s=o?D(e):e;for(;k(s)&&!r(s);){let e=v(s),t=g(s),n=a?a.position:o?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?i=i.filter(e=>e!==s):a=e,s=D(s)}return t.set(e,i),i}function nr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?c(t)?[]:tr(t,this._c):[].concat(n),r],o=er(t,a[0],i),s=o.top,l=o.right,u=o.bottom,d=o.left;for(let e=1;e<a.length;e++){let n=er(t,a[e],i);s=X(n.top,s),l=st(n.right,l),u=st(n.bottom,u),d=X(n.left,d)}return{width:l-d,height:u-s,x:d,y:s}}function rr(e){let{width:t,height:n}=zn(e);return{width:t,height:n}}function ir(e,t,n){let r=d(t),i=T(t),a=n===`fixed`,o=Gn(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ut(0);if((r||!a)&&((x(t)!==`body`||f(i))&&(s=b(t)),r)){let e=Gn(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Kn(i));let l=i&&!r&&!a?qn(i,s):ut(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ar(e){return v(e).position===`static`}function or(e,t){if(!d(e)||v(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return T(e)===n&&(n=n.ownerDocument.body),n}function sr(e,t){let n=A(e);if(c(e))return n;if(!d(e)){let t=D(e);for(;t&&!r(t);){if(k(t)&&!ar(t))return t;t=D(t)}return n}let a=or(e,t);for(;a&&i(a)&&ar(a);)a=or(a,t);return a&&r(a)&&ar(a)&&!g(a)?n:a||y(e)||n}var cr=async function(e){let t=this.getOffsetParent||sr,n=this.getDimensions,r=await n(e.floating);return{reference:ir(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lr(e){return v(e).direction===`rtl`}var ur={convertOffsetParentRelativeRectToViewportRelativeRect:Jn,getDocumentElement:T,getClippingRect:nr,getOffsetParent:sr,getElementRects:cr,getClientRects:Yn,getDimensions:rr,getScale:Vn,isElement:k,isRTL:lr};function dr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fr(e,t,n){let r=null,i,a=T(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=lt(d),h=lt(a.clientWidth-(u+f)),g=lt(a.clientHeight-(d+p)),_=lt(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:X(0,st(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!dr(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=A(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pr(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Bn(e),u=i||a?[...l?h(l):[],...t?h(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fr(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,g=c?Gn(e):null;c&&_();function _(){let t=Gn(e);g&&!dr(g,t)&&n(),g=t,m=requestAnimationFrame(_)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var mr=Fn,hr=In,gr=Mn,_r=Rn,vr=Ln,yr=(e,t,n)=>{let r=new Map,i=n??{},a={...ur,...i.platform,_c:r};return jn(e,t,{...i,platform:a})},br=typeof document<`u`?W.useLayoutEffect:function(){};function xr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cr(e,t){let n=Sr(e);return Math.round(t*n)/n}function wr(e){let t=W.useRef(e);return br(()=>{t.current=e}),t}function Tr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=W.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=W.useState(r);xr(f,r)||p(r);let[m,h]=W.useState(null),[g,_]=W.useState(null),v=W.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=W.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=W.useRef(null),C=W.useRef(null),w=W.useRef(u),T=c!=null,E=wr(c),D=wr(i),O=wr(l),k=W.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yr(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!xr(w.current,t)&&(w.current=t,ce.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);br(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=W.useRef(!1);br(()=>(A.current=!0,()=>{A.current=!1}),[]),br(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=W.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=W.useMemo(()=>({reference:b,floating:x}),[b,x]),N=W.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Cr(M.floating,u.x),r=Cr(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sr(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return W.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Er=(e,t)=>{let n=mr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dr=(e,t)=>{let n=hr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Or=(e,t)=>({fn:vr(e).fn,options:[e,t]}),kr=(e,t)=>{let n=gr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ar=(e,t)=>{let n=_r(e);return{name:n.name,fn:n.fn,options:[e,t]}},jr=t((e=>{var t=m();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Mr=t(((e,t)=>{t.exports=jr()})),Nr=t((e=>{var t=m(),n=Mr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Pr=t(((e,t)=>{t.exports=Nr()})),Fr=Mr(),Ir=Pr(),Lr=[],Rr=void 0;function zr(){return Rr}function Br(e){Lr.push(e)}function Vr(e){let t=(t,r)=>{let i=n(Ur).current,a;try{Rr=i;for(let e of Lr)e.before(i);a=e(t,r);for(let e of Lr)e.after(i);i.didInitialize=!0}finally{Rr=void 0}return a};return t.displayName=e.displayName||e.name,t}function Hr(e){return W.forwardRef(Vr(e))}function Ur(){return{didInitialize:!1}}var Wr=u(19)?qr:Jr;function Gr(e,t,n,r,i){return Wr(e,t,n,r,i)}function Kr(e,t,n,r,i){let a=W.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Fr.useSyncExternalStore)(e.subscribe,a,a)}Br({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Fr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function qr(e,t,n,r,i){let a=zr();if(!a)return Kr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Jr(e,t,n,r,i){return(0,Ir.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Yr=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Gr(this,e,t,n,r)}},Xr=class extends Yr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){W.useDebugValue(e);let n=this;_(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;_(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);_(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){W.useDebugValue(e);let n=this,r=t!==void 0;_(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return W.useDebugValue(e),Gr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){W.useDebugValue(e);let n=C(t??s);this.context[e]=n}useStateSetter(e){let t=W.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Zr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Qr=class extends Xr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:gn(),nested:n,triggerElements:i},Zr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Re(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function $r(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=W.useRef(null);r===void 0&&f.current===null&&(f.current=new Qr({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),_(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};k(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var ei={tabIndex:-1,[ze]:``};function ti(e){return t=>t!==`touch`||e.current}function ni(e,t=!1){let r=ne(),i=bn()!=null,a=n(()=>e(r,i)).current;return $r({popupStore:a,treatPopupAsFloatingElement:t,floatingRootContext:a.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:a.setOpen}),a}function ri({handle:e,store:t}){return _(()=>e.attachStore(t),[e,t]),null}function ii(e,t){let n=W.useRef(null),r=W.useRef(null);return W.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function ai(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function oi(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function si(e,t,n,r={}){let i=n.reason,a=i===M,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=oi(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),ai(i,t,n.trigger,c()),e.update(i)};a?ce.flushSync(l):l()}function ci(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ii(e,n),o=C(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=W.useCallback(e=>{a(e),e&&o(e)},[a,o]);return _(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function li(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=W.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);_(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=R(P);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function ui(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=F(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=C(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return L({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function di(e,t){e.useSyncedValues(t),_(()=>()=>{e.update({activeTriggerProps:o,inactiveTriggerProps:o,popupProps:o})},[e])}function fi(e,t){_(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),_(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var pi=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function mi(){return new Qr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new pi,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function hi(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:mi(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:o,inactiveTriggerProps:o,popupProps:o}}function gi(e,t,n=!1){return new Qr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var _i=e=>e.triggerIdProp??e.activeTriggerId,vi=e=>e.openProp??e.open,yi=e=>(e.popupElement?.id??e.floatingId)||void 0;function bi(e,t){return t!==void 0&&vi(e)&&_i(e)===t}function xi(e,t){return bi(e,t)?!0:t!==void 0&&vi(e)&&_i(e)==null&&e.triggerCount===1}var Si={open:vi,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:_i,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:yi,isTriggerActive:(e,t)=>t!==void 0&&_i(e)===t,isOpenedByTrigger:(e,t)=>bi(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&_i(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>xi(e,t)?yi(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ci(e){let t=W.useCallback(t=>e===void 0?s:e.subscribeStore(t),[e]),n=W.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Fr.useSyncExternalStore)(t,n,()=>e?.serverStore)}function wi(e){return Ti(e,e.rootContext)}function Ti(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=W.useState(null),[d,f]=W.useState(void 0),[p,m]=W.useState(void 0),h=W.useRef(null),g=xn(r),v=W.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=Tr({...e,elements:{...v,...l&&{reference:l}}}),b=k(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=W.useCallback(e=>{let t=k(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=W.useCallback(e=>{(k(e)||e===null)&&(h.current=e,f(e)),(k(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!k(e))&&y.refs.setReference(e)},[y.refs,f]),w=W.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=W.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=W.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=W.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return _(()=>{o&&(h.current=o)},[o]),_(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),W.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var Ei=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new K,this.restTimeout=new K,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Di=new WeakMap;function Oi(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Di.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Di.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ki(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Di.get(n);a&&a!==e&&Oi(a),Oi(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Di.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ai(e){let t=e.context.dataRef.current,r=n(()=>t.hoverInteractionState??Ei.create()).current;return t.hoverInteractionState||=r,ie(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ji(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=xn(),d=bn(),f=Ai(a),p=ye(),m=C(()=>nt(l.current.openEvent?.type,f.interactedInside)),h=C(()=>rt(l.current.openEvent?.type)),g=C(()=>{Oi(f)});_(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),W.useEffect(()=>g,[g]),_(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&k(c)&&s){let e=c,t=s,n=H(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return ki(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),W.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&nn(u.nodesRef.current,d).length>0)}function t(e){let t=et(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,R(M,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=V(e);if(!Ye(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Ge(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&k(o)&&nn(u.nodesRef.current,r,!1).some(e=>B(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,R(M,t)),u.events.emit(`floating.closed`,t)})}let y=s;return it(y&&J(y,`mouseenter`,c),y&&J(y,`mouseleave`,_),y&&J(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Mi={current:null};function Ni(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Mi,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=xn(l),y=Ai(h),b=W.useRef(!1),x=Y(i),S=Y(r),w=Y(o),T=Y(n),E=Y(p),D=Y(f),O=C(()=>nt(g.current.openEvent?.type,y.interactedInside)),A=C(()=>E.current?.()!==!1),j=C((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!B(e,t);if(!k(n))return!1;let i=n;return r.hasMatchingElement(e=>B(e,i))&&(!e||!B(e,i))}),N=C(()=>{y.handler&&=(H(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),P=C(()=>{Oi(y)});return u&&(y.handleCloseOptions=x.current?.__options),W.useEffect(()=>N,[N]),W.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===M,N(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,N]),W.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=et(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,R(M,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,R(M,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!k(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Le(y.pointerType))return;let t=tt(w.current),n=et(S.current,`open`,y.pointerType),r=V(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(k(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(B(e,r)){s=e;break}}k(i)&&k(o)&&!h.context.triggerElements.hasElement(i)&&B(i,o)&&(s=o);let c=s!=null&&j(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&k(s)&&k(o)&&B(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){A()&&h.setOpen(!0,R(M,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&A()&&h.setOpen(!0,R(M,e,s))}):g&&A()&&h.setOpen(!0,R(M,e,s)))}function i(t){if(O()){P();return}N();let n=h.select(`domReferenceElement`),r=H(n);y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!Ge(t.relatedTarget,h.context.triggerElements)){if(x.current&&i){h.select(`open`)||y.openChangeTimeout.clear();let n=c.current;y.handler=x.current({...i,tree:v,x:t.clientX,y:t.clientY,onClose(){P(),N(),T.current&&!O()&&n===h.select(`domReferenceElement`)&&e(t,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!B(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){B(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?J(t,`mouseout`,o):void 0;return s?it(J(t,`mousemove`,r,{once:!0}),J(t,`mouseenter`,r),J(t,`mouseleave`,i),l):it(J(t,`mouseenter`,r),J(t,`mouseleave`,i),l)},[N,P,g,S,h,n,x,y,u,j,O,a,s,w,c,v,T,d,D,A,m]),W.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=j(r,n,e.target);if(a&&!Le(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;ki(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=tt(w.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,O())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&A()&&h.setOpen(!0,R(M,t,n))}y.pointerType===`touch`?ce.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,O,j,a,h,w,A])}var Pi=.1,Fi=Pi*Pi,$=.5;function Ii(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Li(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ii(e,t,n,r,i,a)&&(u=!u),Ii(e,t,i,a,o,s)&&(u=!u),Ii(e,t,o,s,c,l)&&(u=!u),Ii(e,t,c,l,n,r)&&(u=!u),u}function Ri(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function zi(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Bi(e={}){let{blockPointerEvents:t=!1}=e,n=new K,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Fi;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=V(r),g=r.type===`mouseleave`,_=B(u,h),v=B(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&k(r.relatedTarget)&&B(u,r.relatedTarget))return;function y(){return!!(s&&nn(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,A=(E?x:S).top,j=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let M=!1;switch(c){case`top`:M=zi(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:M=zi(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:M=zi(d,f,S.right-1,j,x.left+1,A);break;case`right`:M=zi(d,f,x.right-1,j,S.left+1,A)}if(M)return;if(l&&!Ri(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let N=!1;switch(c){case`top`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+$+1,o=C||T?S.bottom-$:S.top,s=C?T?S.bottom-$:S.top:S.bottom-$;N=Li(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-$,o=C||T?S.top+$:S.bottom,s=C?T?S.top+$:S.bottom:S.top+$;N=Li(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+$+1,o=w||E?S.right-$:S.left,s=w?E?S.right-$:S.left:S.right-$;N=Li(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-$,o=w||E?S.left+$:S.right,s=w?E?S.left+$:S.right:S.left+$;N=Li(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}N?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Vi(e){return e===`starting`?on:o}var Hi=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=pt(e,t)||{};if(l==null)return{};let f=kt(u),p={x:n,y:r},m=_t(i),h=gt(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=ft(k,j,A),N=!c.arrow&&mt(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Ui=(e,t)=>({...Hi(e),options:[e,t]}),Wi={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Gi={sideX:`left`,sideY:`top`},Ki=`--available-width`,qi=`--available-height`;function Ji(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Yi(e,t,n){let{rects:r,placement:i}=e;return{side:Ji(t,Z(i),n),align:mt(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Xi(e){return Zi(e,wi)}function Zi(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:w}=e,[T,E]=W.useState(null);!g&&T!==null&&E(null);let D=v.side||`flip`,O=v.align||`flip`,k=v.fallbackAxisSide||`end`,j=y?.crossAxis??!1,M=y?.rootBoundary,N=typeof n==`function`?n:void 0,P=C(N),ee=N?P:n,te=Y(n),ne=Y(g),F=ae()===`rtl`,re=T||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],I=o===`center`?re:`${re}-${o}`,L=l;typeof L==`number`?L={top:L,right:L,bottom:L,left:L}:L&&={top:L.top||0,right:L.right||0,bottom:L.bottom||0,left:L.left||0};let ie=+(i===`bottom`),R=+(i===`top`),z=+(i===`right`),B=+(i===`left`),V={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:L},U=W.useRef(null),oe=Y(a),se=Y(s),ce=typeof a==`function`?0:a,G=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Er(e=>{let t=Yi(e,i,F),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof se.current==`function`?se.current(t):se.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ce,G,F,i]));let ue=O===`none`&&D!==`shift`,de=!ue&&(u||j||D===`shift`),fe=D===`none`?null:kr({...V,padding:{top:L.top+1+ie,right:L.right+1+B,bottom:L.bottom+1+R,left:L.left+1+z},mainAxis:!j&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k}),pe=ue?null:Dr({...V,rootBoundary:M,mainAxis:O!==`none`,crossAxis:de,limiter:u||j?void 0:Or(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=Q(Z(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})},[V,u,j,M,L,O]);D===`shift`||O===`shift`||o===`center`?le.push(pe,fe):le.push(fe,pe),le.push(Ar({...V,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ne.current)return;let i=e.style;i.setProperty(Ki,`${t}px`),i.setProperty(qi,`${n}px`);let a=A(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Ui(e=>({element:U.current||H(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Z(r),l=Q(c),u=U.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(Yi(e,i,F)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,de&&l===`y`&&b?S:x),{}}},Wi,x),_(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=W.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:K,update:ye,placement:be,context:xe,isPositioned:q,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:I,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>pr(...e,me),nodeId:b,externalTree:w}),{sideX:Ce,sideY:we}=K.adaptiveOrigin||Gi,Te=q?r:`fixed`,Ee=W.useMemo(()=>{let e;return e=q?x?{position:Te,[Ce]:_e,[we]:ve}:{...Se,position:Te}:{position:Te,top:0,left:0},e[Ki]=`100vw`,e[qi]=`100vh`,q||(e.opacity=0),e},[x,Te,Ce,_e,we,ve,Se,q]),De=W.useRef(null);_(()=>{if(!g)return;let e=te.current,t=typeof e==`function`?e():e,n=(Qi(t)?t.current:t)||null;n!==De.current&&(he.setPositionReference(n),De.current=n)},[g,he,ee,te]),W.useEffect(()=>{if(!g)return;let e=te.current;typeof e!=`function`&&Qi(e)&&e.current!==De.current&&(he.setPositionReference(e.current),De.current=e.current)},[g,he,ee,te]),W.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return pr(ge.reference,ge.floating,ye,me)},[m,g,ge,ye,me]);let Oe=Z(be),ke=Ji(i,Oe,F),Ae=mt(be)||`center`,je=!!K.hide?.referenceHidden;_(()=>{S&&g&&q&&Oe!==re&&E(Oe)},[S,g,q,Oe,re]);let Me=W.useMemo(()=>({position:`absolute`,top:K.arrow?.y,left:K.arrow?.x}),[K.arrow]),Ne=K.arrow?.centerOffset!==0;return W.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:U,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:he,context:xe,isPositioned:q,update:ye}),[Ee,Me,U,Ne,ke,Ae,Oe,je,he,xe,q,ye])}function Qi(e){return e!=null&&`current`in e}function $i(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),l(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Vi(r),i],stateAttributesMapping:ge})}export{Qt as $,Hr as A,he as At,hn as B,fi as C,Ae as Ct,Xr as D,ye as Dt,Qr as E,K as Et,wn as F,ln as G,fn as H,Sn as I,nn as J,an as K,bn as L,ur as M,se as Mt,Dn as N,Gr as O,ge as Ot,Cn as P,Zt as Q,xn as R,ni as S,Me as St,$r as T,Oe as Tt,sn as U,mn as V,cn as W,Jt as X,Gt as Y,Yt as Z,ti as _,Ue as _t,Ni as a,Y as at,ui as b,Ie as bt,Ci as c,et as ct,Si as d,Xe as dt,$t as et,pi as f,Je as ft,oi as g,He as gt,si as h,Ve as ht,Bi as i,ot as it,Pr as j,me as jt,Vr as k,_e as kt,hi as l,Qe as lt,ri as m,We as mt,Xi as n,Kt as nt,ji as o,it as ot,ei as p,Ze as pt,rn as q,Vi as r,At as rt,Ai as s,J as st,$i as t,Wt as tt,gi as u,Ge as ut,ai as v,Le as vt,ci as w,Te as wt,di as x,Ne as xt,li as y,Fe as yt,_n as z};