@dudousxd/nestjs-agent-dashboard 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/index.cjs +96 -28
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +96 -28
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/base-ui-CeQ9JhU_.js +41 -0
- package/dist/spa/assets/{index-Cchd2o0X.js → index-CTK2sMGd.js} +1 -1
- package/dist/spa/assets/index-Cto4iy07.js +1 -0
- package/dist/spa/assets/{preview-CYbdGs3V.js → preview-DD7Ge-bU.js} +1 -1
- package/dist/spa/assets/{recharts-DPC0gOrj.js → recharts-DSmxPXW6.js} +1 -1
- package/dist/spa/index.html +4 -4
- package/dist/spa/preview.html +4 -4
- package/package.json +9 -9
- package/dist/spa/assets/base-ui-Bj5tb_Ph.js +0 -55
- package/dist/spa/assets/index-DAU1txqd.js +0 -1
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var el=Object.defineProperty;var tl=(e,t,n)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xe=(e,t,n)=>tl(e,typeof t!="symbol"?t+"":t,n);function nl(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ws={exports:{}},hr={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ol=Symbol.for("react.transitional.element"),sl=Symbol.for("react.fragment");function zs(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var o in t)o!=="key"&&(n[o]=t[o])}else n=t;return t=n.ref,{$$typeof:ol,type:e,key:r,ref:t!==void 0?t:null,props:n}}hr.Fragment=sl;hr.jsx=zs;hr.jsxs=zs;Ws.exports=hr;var se=Ws.exports,Ys={exports:{}},fe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ao=Symbol.for("react.transitional.element"),il=Symbol.for("react.portal"),cl=Symbol.for("react.fragment"),ll=Symbol.for("react.strict_mode"),ul=Symbol.for("react.profiler"),al=Symbol.for("react.consumer"),fl=Symbol.for("react.context"),dl=Symbol.for("react.forward_ref"),pl=Symbol.for("react.suspense"),gl=Symbol.for("react.memo"),Ks=Symbol.for("react.lazy"),hl=Symbol.for("react.activity"),ns=Symbol.iterator;function ml(e){return e===null||typeof e!="object"?null:(e=ns&&e[ns]||e["@@iterator"],typeof e=="function"?e:null)}var Gs={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qs=Object.assign,Xs={};function hn(e,t,n){this.props=e,this.context=t,this.refs=Xs,this.updater=n||Gs}hn.prototype.isReactComponent={};hn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zs(){}Zs.prototype=hn.prototype;function fo(e,t,n){this.props=e,this.context=t,this.refs=Xs,this.updater=n||Gs}var po=fo.prototype=new Zs;po.constructor=fo;qs(po,hn.prototype);po.isPureReactComponent=!0;var rs=Array.isArray;function zr(){}var Pe={H:null,A:null,T:null,S:null},Js=Object.prototype.hasOwnProperty;function go(e,t,n){var r=n.ref;return{$$typeof:ao,type:e,key:t,ref:r!==void 0?r:null,props:n}}function yl(e,t){return go(e.type,t,e.props)}function ho(e){return typeof e=="object"&&e!==null&&e.$$typeof===ao}function bl(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var os=/\/+/g;function Mr(e,t){return typeof e=="object"&&e!==null&&e.key!=null?bl(""+e.key):t.toString(36)}function vl(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(zr,zr):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Xt(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case ao:case il:i=!0;break;case Ks:return i=e._init,Xt(i(e._payload),t,n,r,o)}}if(i)return o=o(e),i=r===""?"."+Mr(e,0):r,rs(o)?(n="",i!=null&&(n=i.replace(os,"$&/")+"/"),Xt(o,t,n,"",function(a){return a})):o!=null&&(ho(o)&&(o=yl(o,n+(o.key==null||e&&e.key===o.key?"":(""+o.key).replace(os,"$&/")+"/")+i)),t.push(o)),1;i=0;var c=r===""?".":r+":";if(rs(e))for(var l=0;l<e.length;l++)r=e[l],s=c+Mr(r,l),i+=Xt(r,t,n,s,o);else if(l=ml(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,s=c+Mr(r,l++),i+=Xt(r,t,n,s,o);else if(s==="object"){if(typeof e.then=="function")return Xt(vl(e),t,n,r,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function jn(e,t,n){if(e==null)return e;var r=[],o=0;return Xt(e,r,"","",function(s){return t.call(n,s,o++)}),r}function Rl(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ss=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},El={map:jn,forEach:function(e,t,n){jn(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return jn(e,function(){t++}),t},toArray:function(e){return jn(e,function(t){return t})||[]},only:function(e){if(!ho(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Activity=hl;fe.Children=El;fe.Component=hn;fe.Fragment=cl;fe.Profiler=ul;fe.PureComponent=fo;fe.StrictMode=ll;fe.Suspense=pl;fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pe;fe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Pe.H.useMemoCache(e)}};fe.cache=function(e){return function(){return e.apply(null,arguments)}};fe.cacheSignal=function(){return null};fe.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=qs({},e.props),o=e.key;if(t!=null)for(s in t.key!==void 0&&(o=""+t.key),t)!Js.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(r[s]=t[s]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var i=Array(s),c=0;c<s;c++)i[c]=arguments[c+2];r.children=i}return go(e.type,o,r)};fe.createContext=function(e){return e={$$typeof:fl,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:al,_context:e},e};fe.createElement=function(e,t,n){var r,o={},s=null;if(t!=null)for(r in t.key!==void 0&&(s=""+t.key),t)Js.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(o[r]=t[r]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var c=Array(i),l=0;l<i;l++)c[l]=arguments[l+2];o.children=c}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)o[r]===void 0&&(o[r]=i[r]);return go(e,s,o)};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:dl,render:e}};fe.isValidElement=ho;fe.lazy=function(e){return{$$typeof:Ks,_payload:{_status:-1,_result:e},_init:Rl}};fe.memo=function(e,t){return{$$typeof:gl,type:e,compare:t===void 0?null:t}};fe.startTransition=function(e){var t=Pe.T,n={};Pe.T=n;try{var r=e(),o=Pe.S;o!==null&&o(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(zr,ss)}catch(s){ss(s)}finally{t!==null&&n.types!==null&&(t.types=n.types),Pe.T=t}};fe.unstable_useCacheRefresh=function(){return Pe.H.useCacheRefresh()};fe.use=function(e){return Pe.H.use(e)};fe.useActionState=function(e,t,n){return Pe.H.useActionState(e,t,n)};fe.useCallback=function(e,t){return Pe.H.useCallback(e,t)};fe.useContext=function(e){return Pe.H.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e,t){return Pe.H.useDeferredValue(e,t)};fe.useEffect=function(e,t){return Pe.H.useEffect(e,t)};fe.useEffectEvent=function(e){return Pe.H.useEffectEvent(e)};fe.useId=function(){return Pe.H.useId()};fe.useImperativeHandle=function(e,t,n){return Pe.H.useImperativeHandle(e,t,n)};fe.useInsertionEffect=function(e,t){return Pe.H.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return Pe.H.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return Pe.H.useMemo(e,t)};fe.useOptimistic=function(e,t){return Pe.H.useOptimistic(e,t)};fe.useReducer=function(e,t,n){return Pe.H.useReducer(e,t,n)};fe.useRef=function(e){return Pe.H.useRef(e)};fe.useState=function(e){return Pe.H.useState(e)};fe.useSyncExternalStore=function(e,t,n){return Pe.H.useSyncExternalStore(e,t,n)};fe.useTransition=function(){return Pe.H.useTransition()};fe.version="19.2.8";Ys.exports=fe;var u=Ys.exports;const xl=rl(u),Qs=nl({__proto__:null,default:xl},[u]);var ei={exports:{}},Ge={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react-dom.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Sl=u;function ti(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Rt(){}var Ye={d:{f:Rt,r:function(){throw Error(ti(522))},D:Rt,C:Rt,L:Rt,m:Rt,X:Rt,S:Rt,M:Rt},p:0,findDOMNode:null},wl=Symbol.for("react.portal");function Tl(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var Pn=Sl.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function mr(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ge.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ye;Ge.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(ti(299));return Tl(e,t,null,n)};Ge.flushSync=function(e){var t=Pn.T,n=Ye.p;try{if(Pn.T=null,Ye.p=2,e)return e()}finally{Pn.T=t,Ye.p=n,Ye.d.f()}};Ge.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ye.d.C(e,t))};Ge.prefetchDNS=function(e){typeof e=="string"&&Ye.d.D(e)};Ge.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=mr(n,t.crossOrigin),o=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Ye.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:s}):n==="script"&&Ye.d.X(e,{crossOrigin:r,integrity:o,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ge.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=mr(t.as,t.crossOrigin);Ye.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Ye.d.M(e)};Ge.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=mr(n,t.crossOrigin);Ye.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Ge.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=mr(t.as,t.crossOrigin);Ye.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Ye.d.m(e)};Ge.requestFormReset=function(e){Ye.d.r(e)};Ge.unstable_batchedUpdates=function(e,t){return e(t)};Ge.useFormState=function(e,t,n){return Pn.H.useFormState(e,t,n)};Ge.useFormStatus=function(){return Pn.H.useHostTransitionStatus()};Ge.version="19.2.8";function ni(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ni)}catch(e){console.error(e)}}ni(),ei.exports=Ge;var tt=ei.exports;function Ne(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const is={};function Ke(e,t){const n=u.useRef(is);return n.current===is&&(n.current=e(t)),n}function Pt(e,t,n,r){const o=Ke(ri).current;return Pl(o,e,t,n,r)&&oi(o,[e,t,n,r]),o.callback}function Cl(e){const t=Ke(ri).current;return Ol(t,e)&&oi(t,e),t.callback}function ri(){return{callback:null,cleanup:null,refs:[]}}function Pl(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function Ol(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function oi(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Il=parseInt(u.version,10);function mo(e){return Il>=e}function cs(e){if(!u.isValidElement(e))return null;const t=e,n=t.props;return(mo(19)?n==null?void 0:n.ref:t.ref)??null}function Yr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ml(e,t){const n={};for(const r in e){const o=e[r];if(t!=null&&t.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function Al(e,t){return typeof e=="function"?e(t):e}function kl(e,t){return typeof e=="function"?e(t):e}const On={};function yr(e,t,n,r,o){let s={...Kr(e,On)};return t&&(s=Tn(s,t)),n&&(s=Tn(s,n)),r&&(s=Tn(s,r)),o&&(s=Tn(s,o)),s}function Ll(e){if(e.length===0)return On;if(e.length===1)return Kr(e[0],On);let t={...Kr(e[0],On)};for(let n=1;n<e.length;n+=1)t=Tn(t,e[n]);return t}function Tn(e,t){return si(t)?t(e):Dl(e,t)}function Dl(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Yr(e.style,r);break}case"className":{e[n]=ii(e.className,r);break}default:Fl(n,r)?e[n]=Nl(e[n],r):e[n]=r}}return e}function Fl(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function si(e){return typeof e=="function"}function Kr(e,t){return si(e)?e(t):e??On}function Nl(e,t){return t?e?n=>{if(_l(n)){const o=n;Gr(o);const s=t(o);return o.baseUIHandlerPrevented||e==null||e(o),s}const r=t(n);return e==null||e(n),r}:t:e}function Gr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ii(e,t){return t?e?t+" "+e:t:e}function _l(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Qe(){}const cn=Object.freeze([]),Be=Object.freeze({}),Vl=500,Hl={style:{transition:"none"}},ci="data-base-ui-click-trigger",Bl={fallbackAxisSide:"none"},li={fallbackAxisSide:"end"},$l={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ie(e,t,n={}){const r=t.render,o=jl(t,n);if(n.enabled===!1)return null;const s=n.state??Be;return Ul(e,r,o,s)}function jl(e,t={}){const{className:n,style:r,render:o}=e,{state:s=Be,ref:i,props:c,stateAttributesMapping:l,enabled:a=!0}=t,f=a?Al(n,s):void 0,d=a?kl(r,s):void 0,g=a?Ml(s,l):Be,p=a?Yr(g,Array.isArray(c)?Ll(c):c)??Be:Be;return typeof document<"u"&&(a?Array.isArray(i)?p.ref=Cl([p.ref,cs(o),...i]):p.ref=Pt(p.ref,cs(o),i):Pt(null,null)),a?(f!==void 0&&(p.className=ii(p.className,f)),d!==void 0&&(p.style=Yr(p.style,d)),p):Be}function Ul(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=yr(n,t.props);return o.ref=n.ref,u.cloneElement(t,o)}if(e&&typeof e=="string")return Wl(e,n);throw new Error(Ne(8))}function Wl(e,t){return e==="button"?u.createElement("button",{type:"button",...t,key:t.key}):e==="img"?u.createElement("img",{alt:"",...t,key:t.key}):u.createElement(e,t)}function Lp(e){return Ie(e.defaultTagName??"div",e,e)}const zl=()=>{},Z=typeof document<"u"?u.useLayoutEffect:zl,ui=u.createContext(void 0);function br(e){const t=u.useContext(ui);if(t===void 0&&!e)throw new Error(Ne(72));return t}const Yl=[];function yo(e){u.useEffect(e,Yl)}const Sn=0;class ht{constructor(){xe(this,"currentId",Sn);xe(this,"clear",()=>{this.currentId!==Sn&&(clearTimeout(this.currentId),this.currentId=Sn)});xe(this,"disposeEffect",()=>this.clear)}static create(){return new ht}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Sn,n()},t)}isStarted(){return this.currentId!==Sn}}function We(){const e=Ke(ht.create).current;return yo(e.disposeEffect),e}function vr(){return typeof window<"u"}function It(e){return bo(e)?(e.nodeName||"").toLowerCase():"#document"}function Ae(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(bo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bo(e){return vr()?e instanceof Node||e instanceof Ae(e).Node:!1}function Ce(e){return vr()?e instanceof Element||e instanceof Ae(e).Element:!1}function Me(e){return vr()?e instanceof HTMLElement||e instanceof Ae(e).HTMLElement:!1}function qr(e){return!vr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ae(e).ShadowRoot}function mn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Kl(e){return/^(table|td|th)$/.test(It(e))}function Rr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Gl=/transform|translate|scale|rotate|perspective|filter/,ql=/paint|layout|strict|content/,Nt=e=>!!e&&e!=="none";let Ar;function vo(e){const t=Ce(e)?nt(e):e;return Nt(t.transform)||Nt(t.translate)||Nt(t.scale)||Nt(t.rotate)||Nt(t.perspective)||!Er()&&(Nt(t.backdropFilter)||Nt(t.filter))||Gl.test(t.willChange||"")||ql.test(t.contain||"")}function Xl(e){let t=Ot(e);for(;Me(t)&&!xt(t);){if(vo(t))return t;if(Rr(t))return null;t=Ot(t)}return null}function Er(){return Ar==null&&(Ar=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ar}function xt(e){return/^(html|body|#document)$/.test(It(e))}function nt(e){return Ae(e).getComputedStyle(e)}function xr(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ot(e){if(It(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qr(e)&&e.host||yt(e);return qr(t)?t.host:t}function ai(e){const t=Ot(e);return xt(t)?(e.ownerDocument||e).body:Me(t)&&mn(t)?t:ai(t)}function St(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ai(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ae(o);if(s){const c=Xr(i);return t.concat(i,i.visualViewport||[],mn(o)?o:[],c&&n?St(c):[])}else return t.concat(o,St(o,[],n))}function Xr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fe(e){const t=Ke(Zl,e).current;return t.next=e,Z(t.effect),t}function Zl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const kr=Qs[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Jl=kr&&kr!==u.useLayoutEffect?kr:e=>e();function X(e){const t=Ke(Ql).current;return t.next=e,Jl(t.effect),t.trampoline}function Ql(){const e={next:void 0,callback:eu,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function eu(){}const yn=typeof navigator<"u",Lr=ru(),fi=su(),di=ou(),pi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),tu=Lr.platform==="MacIntel"&&Lr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Lr.platform),gi=yn&&/apple/i.test(navigator.vendor),Zr=yn&&/android/i.test(fi)||/android/i.test(di),nu=yn&&fi.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,hi=di.includes("jsdom/");function ru(){if(!yn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function ou(){if(!yn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function su(){if(!yn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Jr="data-base-ui-focusable",mi="active",yi="selected",bi="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",wt="ArrowLeft",Tt="ArrowRight",Ro="ArrowUp",An="ArrowDown";function ct(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ve(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&qr(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ue(e){return"composedPath"in e?e.composedPath()[0]:e.target}function it(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function iu(e){return e.matches("html,body")}function Le(e){return(e==null?void 0:e.ownerDocument)||document}function Eo(e){return Me(e)&&e.matches(bi)}function Qr(e){return e?e.getAttribute("role")==="combobox"&&Eo(e):!1}function cu(e){if(!e||hi)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function In(e){return e?e.hasAttribute(Jr)?e:e.querySelector(`[${Jr}]`)||e:null}function Bt(e,t,n=!0){return e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...Bt(e,o.id,n)])}function ls(e,t){var o;let n=[],r=(o=e.find(s=>s.id===t))==null?void 0:o.parentId;for(;r;){const s=e.find(i=>i.id===r);r=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function je(e){e.preventDefault(),e.stopPropagation()}function lu(e){return"nativeEvent"in e}function vi(e){return e.mozInputSource===0&&e.isTrusted?!0:Zr&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ri(e){return hi?!1:!Zr&&e.width===0&&e.height===0||Zr&&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 $t(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ei(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const uu=["top","right","bottom","left"],ln=Math.min,pt=Math.max,un=Math.round,Jt=Math.floor,gt=e=>({x:e,y:e}),au={left:"right",right:"left",bottom:"top",top:"bottom"};function xi(e,t,n){return pt(e,ln(t,n))}function mt(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function Mt(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function So(e){return e==="y"?"height":"width"}function rt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function wo(e){return xo(rt(e))}function fu(e,t,n){n===void 0&&(n=!1);const r=Mt(e),o=wo(e),s=So(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=sr(i)),[i,sr(i)]}function du(e){const t=sr(e);return[eo(e),t,eo(t)]}function eo(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const us=["left","right"],as=["right","left"],pu=["top","bottom"],gu=["bottom","top"];function hu(e,t,n){switch(e){case"top":case"bottom":return n?t?as:us:t?us:as;case"left":case"right":return t?pu:gu;default:return[]}}function mu(e,t,n,r){const o=Mt(e);let s=hu(et(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(eo)))),s}function sr(e){const t=et(e);return au[t]+e.slice(t.length)}function yu(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function Si(e){return typeof e!="number"?yu(e):{top:e,right:e,bottom:e,left:e}}function ir(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Un(e,t,n){return Math.floor(e/t)!==n}function Qt(e,t){return t<0||t>=e.current.length}function er(e,t){return $e(e,{disabledIndices:t})}function to(e,t){return $e(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $e(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.current.length-1&&Ct(e,s,r));return s}function wi(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:s,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:a,stopEvent:f=!1}){let d=a;const g=[],p={};let h=!1;{let y=null,b=-1;e.current.forEach((v,E)=>{if(v==null)return;const w=v.closest('[role="row"]');w&&(h=!0),(w!==y||b===-1)&&(y=w,b+=1,g[b]=[]),g[b].push(E),p[E]=b})}const m=h&&g.length>0&&g.some(y=>y.length!==s);function R(y){if(!m||a===-1)return;const b=p[a];if(b==null)return;const v=g[b].indexOf(a);let E=y==="up"?b-1:b+1;r&&(E<0?E=g.length-1:E>=g.length&&(E=0));const w=new Set;for(;E>=0&&E<g.length&&!w.has(E);){w.add(E);const x=g[E];if(x.length===0){E=y==="up"?E-1:E+1;continue}const S=Math.min(v,x.length-1);for(let P=S;P>=0;P-=1){const A=x[P];if(!Ct(e,A,i))return A}E=y==="up"?E-1:E+1,r&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(t.key===Ro){const y=R("up");if(y!==void 0)f&&je(t),d=y;else{if(f&&je(t),a===-1)d=l;else if(d=$e(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),r&&(a-s<c||d<0)){const b=a%s,v=l%s,E=l-(v-b);v===b?d=l:d=v>b?E:E-s}Qt(e,d)&&(d=a)}}if(t.key===An){const y=R("down");y!==void 0?(f&&je(t),d=y):(f&&je(t),a===-1?d=c:(d=$e(e,{startingIndex:a,amount:s,disabledIndices:i}),r&&a+s>l&&(d=$e(e,{startingIndex:a%s-s,amount:s,disabledIndices:i}))),Qt(e,d)&&(d=a))}if(n==="both"){const y=Jt(a/s);t.key===(o?wt:Tt)&&(f&&je(t),a%s!==s-1?(d=$e(e,{startingIndex:a,disabledIndices:i}),r&&Un(d,s,y)&&(d=$e(e,{startingIndex:a-a%s-1,disabledIndices:i}))):r&&(d=$e(e,{startingIndex:a-a%s-1,disabledIndices:i})),Un(d,s,y)&&(d=a)),t.key===(o?Tt:wt)&&(f&&je(t),a%s!==0?(d=$e(e,{startingIndex:a,decrement:!0,disabledIndices:i}),r&&Un(d,s,y)&&(d=$e(e,{startingIndex:a+(s-a%s),decrement:!0,disabledIndices:i}))):r&&(d=$e(e,{startingIndex:a+(s-a%s),decrement:!0,disabledIndices:i})),Un(d,s,y)&&(d=a));const b=Jt(l/s)===y;Qt(e,d)&&(r&&b?d=t.key===(o?Tt:wt)?l:$e(e,{startingIndex:a-a%s-1,disabledIndices:i}):d=a)}return d}function Ti(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},c)=>{let l=!1;for(n&&(o=0);!l;){const a=[];for(let f=0;f<s;f+=1)for(let d=0;d<i;d+=1)a.push(o+f+d*t);o%t+s<=t&&a.every(f=>r[f]==null)?(a.forEach(f=>{r[f]=c}),l=!0):o+=1}}),[...r]}function Ci(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Pi(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ct(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
|
|
26
|
-
* tabbable 6.5.0
|
|
27
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
28
|
-
*/var bu=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],cr=bu.join(","),Oi=typeof Element>"u",an=Oi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,lr=!Oi&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ur=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):ur(t.parentNode));return i},vu=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ii=function(t,n,r){if(ur(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(cr));return n&&an.call(t,cr)&&o.unshift(t),o=o.filter(r),o},ar=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!ur(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),l=c.length?c:i.children,a=ar(l,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:i,candidates:a})}else{var f=an.call(i,cr);f&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),g=!ur(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&g){var p=ar(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Mi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ai=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||vu(t))&&!Mi(t)?0:t.tabIndex},Ru=function(t,n){var r=Ai(t);return r<0&&n&&!Mi(t)?0:r},Eu=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ki=function(t){return t.tagName==="INPUT"},xu=function(t){return ki(t)&&t.type==="hidden"},Su=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},wu=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Tu=function(t){if(!t.name)return!0;var n=t.form||lr(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){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",i.message),!1}var s=wu(o,t.form);return!s||s===t},Cu=function(t){return ki(t)&&t.type==="radio"},Pu=function(t){return Cu(t)&&!Tu(t)},Ou=function(t){var n,r=t&&lr(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,c,l;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var a,f,d;r=lr(o),o=(a=r)===null||a===void 0?void 0:a.host,s=!!((f=o)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},fs=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Iu=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}var i=getComputedStyle(t),c=i.visibility;if(c==="hidden"||c==="collapse")return!0;var l=an.call(t,"details>summary:first-of-type"),a=l?t.parentElement:t;if(an.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var f=t;t;){var d=t.parentElement,g=lr(t);if(d&&!d.shadowRoot&&o(d)===!0)return fs(t);t.assignedSlot?t=t.assignedSlot:!d&&g!==t.ownerDocument?t=g.host:t=d}t=f}if(Ou(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return fs(t);return!1},Mu=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return an.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},no=function(t,n){return!(n.disabled||xu(n)||Iu(n,t)||Su(n)||Mu(n))},ro=function(t,n){return!(Pu(n)||Ai(n)<0||!no(t,n))},Au=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Li=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,l=Ru(c,i),a=i?Li(o.candidates):c;l===0?i?n.push.apply(n,a):n.push(c):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:a})}),r.sort(Eu).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},kn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ar([t],n.includeContainer,{filter:ro.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Au}):r=Ii(t,n.includeContainer,ro.bind(null,n)),Li(r)},ku=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ar([t],n.includeContainer,{filter:no.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ii(t,n.includeContainer,no.bind(null,n)),r},Di=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return an.call(t,cr)===!1?!1:ro(n,t)};const bn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Fi(e,t){const n=kn(e,bn()),r=n.length;if(r===0)return;const o=ct(Le(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function To(e){return Fi(Le(e).body,1)||e}function Ni(e){return Fi(Le(e).body,-1)||e}function _i(e,t){if(!e)return null;const n=kn(Le(e).body,bn()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Lu(e){return _i(e,1)}function Du(e){return _i(e,-1)}function en(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ve(n,r)}function Fu(e){kn(e,bn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ds(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Nu={...Qs};let ps=0;function _u(e,t="mui"){const[n,r]=u.useState(e),o=e||n;return u.useEffect(()=>{n==null&&(ps+=1,r(`${t}-${ps}`))},[n,t]),o}const gs=Nu.useId;function vn(e,t){if(gs!==void 0){const n=gs();return e??(t?`${t}-${n}`:n)}return _u(e,t)}function Vi(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class Vu{constructor(){xe(this,"nodesRef",{current:[]});xe(this,"events",Vi())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Hi=u.createContext(null),Bi=u.createContext(null),At=()=>{var e;return((e=u.useContext(Hi))==null?void 0:e.id)||null},zt=e=>{const t=u.useContext(Bi);return e??t};function Hu(e){const t=vn(),n=zt(e),r=At();return Z(()=>{if(!t)return;const o={id:t,parentId:r};return n==null||n.addNode(o),()=>{n==null||n.removeNode(o)}},[n,t,r]),t}function Bu(e){const{children:t,id:n}=e,r=At();return se.jsx(Hi.Provider,{value:u.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function $u(e){const{children:t,externalTree:n}=e,r=Ke(()=>n??new Vu).current;return se.jsx(Bi.Provider,{value:r,children:t})}const jt="none",dt="trigger-press",Je="trigger-hover",oo="trigger-focus",$i="outside-press",Dr="item-press",ju="close-press",Ut="focus-out",Sr="escape-key",Fr="list-navigation",Uu="cancel-open",Wu="disabled",Co="imperative-action",zu="window-resize";function de(e,t,n,r){let o=!1,s=!1;const i=r??Be;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}function fn(e){return`data-base-ui-${e}`}function tr(e,t,n){if(n&&!$t(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const ji=u.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ht,currentIdRef:{current:null},currentContextRef:{current:null}});function Yu(e){const{children:t,delay:n,timeoutMs:r=0}=e,o=u.useRef(n),s=u.useRef(n),i=u.useRef(null),c=u.useRef(null),l=We();return se.jsx(ji.Provider,{value:u.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:s,currentIdRef:i,timeoutMs:r,currentContextRef:c,timeout:l}),[r,l]),children:t})}function Ku(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{enabled:o=!0,open:s}=t,i=u.useContext(ji),{currentIdRef:c,delayRef:l,timeoutMs:a,initialDelayRef:f,currentContextRef:d,hasProvider:g,timeout:p}=i,[h,m]=u.useState(!1);return Z(()=>{function R(){var y;m(!1),(y=d.current)==null||y.setIsInstantPhase(!1),c.current=null,d.current=null,l.current=f.current}if(o&&c.current&&!s&&c.current===r){if(m(!1),a){const y=r;return p.start(a,()=>{n.select("open")||c.current&&c.current!==y||R()}),()=>{p.clear()}}R()}},[o,s,r,c,l,a,f,d,p,n]),Z(()=>{if(!o||!s)return;const R=d.current,y=c.current;p.clear(),d.current={onOpenChange:n.setOpen,setIsInstantPhase:m},c.current=r,l.current={open:0,close:tr(f.current,"close")},y!==null&&y!==r?(m(!0),R==null||R.setIsInstantPhase(!0),R==null||R.onOpenChange(!1,de(jt))):(m(!1),R==null||R.setIsInstantPhase(!1))},[o,s,r,n,c,l,a,f,d,p]),Z(()=>()=>{d.current=null},[d]),u.useMemo(()=>({hasProvider:g,delayRef:l,isInstantPhase:h}),[g,l,h])}const Po={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Wn=null;class Gu{constructor(){xe(this,"callbacks",[]);xe(this,"callbacksCount",0);xe(this,"nextId",1);xe(this,"startId",1);xe(this,"isScheduled",!1);xe(this,"tick",t=>{var o;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)(o=n[s])==null||o.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const zn=new Gu;class ft{constructor(){xe(this,"currentId",Wn);xe(this,"cancel",()=>{this.currentId!==Wn&&(zn.cancel(this.currentId),this.currentId=Wn)});xe(this,"disposeEffect",()=>this.cancel)}static create(){return new ft}static request(t){return zn.request(t)}static cancel(t){return zn.cancel(t)}request(t){this.cancel(),this.currentId=zn.request(()=>{this.currentId=Wn,t()})}}function Ln(){const e=Ke(ft.create).current;return yo(e.disposeEffect),e}function lt(e){return(e==null?void 0:e.ownerDocument)||document}const dn=u.forwardRef(function(t,n){const[r,o]=u.useState();Z(()=>{gi&&o("button")},[]);const s={tabIndex:0,role:r};return se.jsx("span",{...t,ref:n,style:Po,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});let hs=0;function nr(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(hs);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():hs=requestAnimationFrame(s)}const tn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ms(e){return e==="inert"?tn.inert:e==="aria-hidden"?tn["aria-hidden"]:tn.none}let Yn=new WeakSet,Kn={},Nr=0;const Ui=e=>e&&(e.host||Ui(e.parentNode)),qu=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ui(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Xu(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,i=qu(t,e),c=new Set,l=new Set(i),a=[];Kn[o]||(Kn[o]=new WeakMap);const f=Kn[o];i.forEach(d),g(t),c.clear();function d(p){!p||c.has(p)||(c.add(p),p.parentNode&&d(p.parentNode))}function g(p){!p||l.has(p)||[].forEach.call(p.children,h=>{if(It(h)!=="script")if(c.has(h))g(h);else{const m=s?h.getAttribute(s):null,R=m!==null&&m!=="false",y=ms(s),b=(y.get(h)||0)+1,v=(f.get(h)||0)+1;y.set(h,b),f.set(h,v),a.push(h),b===1&&R&&Yn.add(h),v===1&&h.setAttribute(o,""),!R&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return Nr+=1,()=>{a.forEach(p=>{const h=ms(s),R=(h.get(p)||0)-1,y=(f.get(p)||0)-1;h.set(p,R),f.set(p,y),R||(!Yn.has(p)&&s&&p.removeAttribute(s),Yn.delete(p)),y||p.removeAttribute(o)}),Nr-=1,Nr||(tn.inert=new WeakMap,tn["aria-hidden"]=new WeakMap,tn.none=new WeakMap,Yn=new WeakSet,Kn={})}}function Zu(e,t=!1,n=!1){const r=Le(e[0]).body;return Xu(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Wi=u.createContext(null),zi=()=>u.useContext(Wi),Ju=fn("portal");function Yi(e={}){const{ref:t,container:n,componentProps:r=Be,elementProps:o,elementState:s}=e,i=vn(),c=zi(),l=c==null?void 0:c.portalNode,[a,f]=u.useState(null),[d,g]=u.useState(null),p=u.useRef(null);Z(()=>{if(n===null){p.current&&(p.current=null,g(null),f(null));return}if(i==null)return;const R=(n&&(bo(n)?n:n.current))??l??document.body;if(R==null){p.current&&(p.current=null,g(null),f(null));return}p.current!==R&&(p.current=R,g(null),f(R))},[n,l,i]);const h=Ie("div",r,{ref:[t,g],state:s,props:[{id:i,[Ju]:""},o]});return{portalNode:d,portalSubtree:a&&h?tt.createPortal(h,a):null}}const Oo=u.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:c,...l}=t,{portalNode:a,portalSubtree:f}=Yi({container:o,ref:n,componentProps:t,elementProps:l}),d=u.useRef(null),g=u.useRef(null),p=u.useRef(null),h=u.useRef(null),[m,R]=u.useState(null),y=m==null?void 0:m.modal,b=m==null?void 0:m.open,v=typeof c=="boolean"?c:!!m&&!m.modal&&m.open&&!!a;u.useEffect(()=>{if(!a||y)return;function w(x){a&&en(x)&&(x.type==="focusin"?ds:Fu)(a)}return a.addEventListener("focusin",w,!0),a.addEventListener("focusout",w,!0),()=>{a.removeEventListener("focusin",w,!0),a.removeEventListener("focusout",w,!0)}},[a,y]),u.useEffect(()=>{!a||b||ds(a)},[b,a]);const E=u.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:g,beforeInsideRef:p,afterInsideRef:h,portalNode:a,setFocusManagerState:R}),[a]);return se.jsxs(u.Fragment,{children:[f,se.jsxs(Wi.Provider,{value:E,children:[v&&a&&se.jsx(dn,{"data-type":"outside",ref:d,onFocus:w=>{var x;if(en(w,a))(x=p.current)==null||x.focus();else{const S=m?m.domReference:null,P=Ni(S);P==null||P.focus()}}}),v&&a&&se.jsx("span",{"aria-owns":a.id,style:$l}),a&&tt.createPortal(r,a),v&&a&&se.jsx(dn,{"data-type":"outside",ref:g,onFocus:w=>{var x;if(en(w,a))(x=h.current)==null||x.focus();else{const S=m?m.domReference:null,P=To(S);P==null||P.focus(),m!=null&&m.closeOnFocusOut&&(m==null||m.onOpenChange(!1,de(Ut,w.nativeEvent)))}}})]})]})});function _t(e){return e==null?e:"current"in e?e.current:e}function Qu(e,t){const n=Ae(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const ys=20;let Et=[];function Io(){Et=Et.filter(e=>e.isConnected)}function ea(e){Io(),e&&It(e)!=="body"&&(Et.push(e),Et.length>ys&&(Et=Et.slice(-ys)))}function _r(){return Io(),Et[Et.length-1]}function ta(e){if(!e)return null;const t=bn();return Di(e,t)?e:kn(e,t)[0]||e}function na(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():nt(e).display!=="none"}function bs(e,t){var i;if(!t.current.includes("floating")&&!((i=e.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=bn(),o=ku(e,n).filter(c=>{const l=c.getAttribute("data-tabindex")||"";return Di(c,n)||c.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Mo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:c=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:f="",getInsideElements:d=()=>[],nextFocusableElement:g,previousFocusableElement:p,beforeContentFocusGuardRef:h,externalTree:m}=e,R="rootStore"in t?t.rootStore:t,y=R.useState("open"),b=R.useState("domReferenceElement"),v=R.useState("floatingElement"),{events:E,dataRef:w}=R.context,x=X(()=>{var j;return(j=w.current.floatingContext)==null?void 0:j.nodeId}),S=X(d),P=s===!1,A=Qr(b)&&P,M=Fe(o),k=Fe(s),L=Fe(i),I=Fe(f),F=zt(m),C=zi(),_=u.useRef(null),D=u.useRef(null),T=u.useRef(!1),O=u.useRef(!1),N=u.useRef(!1),J=u.useRef(-1),Y=u.useRef(""),B=u.useRef(""),ce=We(),Q=We(),$=Ln(),H=C!=null,W=In(v),ae=X((j=W)=>j?kn(j,bn()):[]),ge=X(j=>{const te=ae(j);return M.current.map(()=>te).filter(Boolean).flat()});u.useEffect(()=>{if(r||!l)return;function j(ie){ie.key==="Tab"&&ve(W,ct(Le(W)))&&ae().length===0&&!A&&je(ie)}const te=Le(W);return te.addEventListener("keydown",j),()=>{te.removeEventListener("keydown",j)}},[r,b,W,l,M,A,ae,ge]),u.useEffect(()=>{if(r||!v)return;function j(te){const ie=Ue(te),ue=ae().indexOf(ie);ue!==-1&&(J.current=ue)}return v.addEventListener("focusin",j),()=>{v.removeEventListener("focusin",j)}},[r,v,ae]),u.useEffect(()=>{if(r||!y)return;const j=Le(W);function te(){N.current=!1}function ie(ue){const U=Ue(ue),ne=ve(v,U)||ve(b,U)||ve(C==null?void 0:C.portalNode,U);N.current=!ne,B.current=ue.pointerType||"keyboard"}function oe(){B.current="keyboard"}return j.addEventListener("pointerdown",ie,!0),j.addEventListener("pointerup",te,!0),j.addEventListener("pointercancel",te,!0),j.addEventListener("keydown",oe,!0),()=>{j.removeEventListener("pointerdown",ie,!0),j.removeEventListener("pointerup",te,!0),j.removeEventListener("pointercancel",te,!0),j.removeEventListener("keydown",oe,!0)}},[r,v,b,W,y,C]),u.useEffect(()=>{if(r||!a)return;function j(){O.current=!0,Q.start(0,()=>{O.current=!1})}function te(U){const ne=U.relatedTarget,z=U.currentTarget,re=Ue(U);queueMicrotask(()=>{const K=x(),be=R.context.triggerElements,Re=!(ve(b,ne)||ve(v,ne)||ve(ne,v)||ve(C==null?void 0:C.portalNode,ne)||ne!=null&&be.hasElement(ne)||be.hasMatchingElement(me=>ve(me,ne))||ne!=null&&ne.hasAttribute(fn("focus-guard"))||F&&(Bt(F.nodesRef.current,K).find(me=>{var Ee,we;return ve((Ee=me.context)==null?void 0:Ee.elements.floating,ne)||ve((we=me.context)==null?void 0:we.elements.domReference,ne)})||ls(F.nodesRef.current,K).find(me=>{var Ee,we,ke;return[(Ee=me.context)==null?void 0:Ee.elements.floating,In((we=me.context)==null?void 0:we.elements.floating)].includes(ne)||((ke=me.context)==null?void 0:ke.elements.domReference)===ne})));if(z===b&&W&&bs(W,M),c&&z!==b&&!na(re)&&ct(Le(W))===Le(W).body){if(Me(W)&&(W.focus(),c==="popup")){$.request(()=>{W.focus()});return}const me=J.current,Ee=ae(),we=Ee[me]||Ee[Ee.length-1]||W;Me(we)&&we.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(A||!l)&&ne&&Re&&!O.current&&(A||ne!==_r())&&(T.current=!0,R.setOpen(!1,de(Ut,U)))})}function ie(){N.current||(w.current.insideReactTree=!0,ce.start(0,()=>{w.current.insideReactTree=!1}))}const oe=Me(b)?b:null,ue=[];if(!(!v&&!oe))return oe&&(oe.addEventListener("focusout",te),oe.addEventListener("pointerdown",j),ue.push(()=>{oe.removeEventListener("focusout",te),oe.removeEventListener("pointerdown",j)})),v&&(v.addEventListener("focusout",te),C&&(v.addEventListener("focusout",ie,!0),ue.push(()=>{v.removeEventListener("focusout",ie,!0)})),ue.push(()=>{v.removeEventListener("focusout",te)})),()=>{ue.forEach(U=>{U()})}},[r,b,v,W,l,F,C,R,a,c,ae,A,x,M,w,ce,Q,$]);const V=u.useRef(null),ee=u.useRef(null),q=Pt(V,h,C==null?void 0:C.beforeInsideRef),Se=Pt(ee,C==null?void 0:C.afterInsideRef);u.useEffect(()=>{var U,ne,z;if(r||!v||!y)return;const j=Array.from(((U=C==null?void 0:C.portalNode)==null?void 0:U.querySelectorAll(`[${fn("portal")}]`))||[]),ie=(z=(ne=(F?ls(F.nodesRef.current,x()):[]).find(re=>{var K;return Qr(((K=re.context)==null?void 0:K.elements.domReference)||null)}))==null?void 0:ne.context)==null?void 0:z.elements.domReference,oe=[v,ie,...j,...S(),_.current,D.current,V.current,ee.current,C==null?void 0:C.beforeOutsideRef.current,C==null?void 0:C.afterOutsideRef.current,_t(p),_t(g),A?b:null].filter(re=>re!=null),ue=Zu(oe,l||A);return()=>{ue()}},[y,r,b,v,l,M,C,A,F,x,S,g,p]),Z(()=>{if(!y||r||!Me(W))return;const j=Le(W),te=ct(j);queueMicrotask(()=>{const ie=ge(W),oe=k.current,ue=typeof oe=="function"?oe(I.current||""):oe;if(ue===void 0||ue===!1)return;let U;ue===!0||ue===null?U=ie[0]||W:U=_t(ue),U=U||ie[0]||W,!ve(W,te)&&nr(U,{preventScroll:U===W})})},[r,y,W,P,ge,k,I]),Z(()=>{if(r||!W)return;const j=Le(W),te=ct(j);ea(te);function ie(U){if(U.open||(Y.current=Qu(U.nativeEvent,B.current)),U.reason===Je&&U.nativeEvent.type==="mouseleave"&&(T.current=!0),U.reason===$i)if(U.nested)T.current=!1;else if(vi(U.nativeEvent)||Ri(U.nativeEvent))T.current=!1;else{let ne=!1;document.createElement("div").focus({get preventScroll(){return ne=!0,!1}}),ne?T.current=!1:T.current=!0}}E.on("openchange",ie);const oe=j.createElement("span");oe.setAttribute("tabindex","-1"),oe.setAttribute("aria-hidden","true"),Object.assign(oe.style,Po),H&&b&&b.insertAdjacentElement("afterend",oe);function ue(){const U=L.current;let ne=typeof U=="function"?U(Y.current):U;if(ne===void 0||ne===!1)return null;if(ne===null&&(ne=!0),typeof ne=="boolean"){const re=b||_r();return re&&re.isConnected?re:oe}const z=b||_r()||oe;return _t(ne)||z}return()=>{E.off("openchange",ie);const U=ct(j),ne=ve(v,U)||F&&Bt(F.nodesRef.current,x(),!1).some(re=>{var K;return ve((K=re.context)==null?void 0:K.elements.floating,U)}),z=ue();queueMicrotask(()=>{const re=ta(z),K=typeof L.current!="boolean";L.current&&!T.current&&Me(re)&&(!(!K&&re!==U&&U!==j.body)||ne)&&re.focus({preventScroll:!0}),oe.remove()})}},[r,v,W,L,w,E,F,H,b,x]),u.useEffect(()=>{queueMicrotask(()=>{T.current=!1})},[r]),u.useEffect(()=>{if(r||!y)return;function j(ie){const oe=Ue(ie);oe!=null&&oe.closest(`[${ci}]`)&&(O.current=!0)}const te=Le(W);return te.addEventListener("pointerdown",j,!0),()=>{te.removeEventListener("pointerdown",j,!0)}},[r,y,W]),Z(()=>{if(!r&&C)return C.setFocusManagerState({modal:l,closeOnFocusOut:a,open:y,onOpenChange:R.setOpen,domReference:b}),()=>{C.setFocusManagerState(null)}},[r,C,l,y,R,a,b]),Z(()=>{if(!(r||!W))return bs(W,M),()=>{queueMicrotask(Io)}},[r,W,M]);const le=!r&&(l?!A:!0)&&(H||l);return se.jsxs(u.Fragment,{children:[le&&se.jsx(dn,{"data-type":"inside",ref:q,onFocus:j=>{var te;if(l){const ie=ge();nr(ie[ie.length-1])}else if(C!=null&&C.portalNode)if(T.current=!1,en(j,C.portalNode)){const ie=To(b);ie==null||ie.focus()}else(te=_t(p??C.beforeOutsideRef))==null||te.focus()}}),n,le&&se.jsx(dn,{"data-type":"inside",ref:Se,onFocus:j=>{var te;if(l)nr(ge()[0]);else if(C!=null&&C.portalNode)if(a&&(T.current=!0),en(j,C.portalNode)){const ie=Ni(b);ie==null||ie.focus()}else(te=_t(g??C.afterOutsideRef))==null||te.focus()}})]})}function Ki(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:l=!0,touchOpenDelay:a=0}=t,f=u.useRef(void 0),d=Ln(),g=We(),p=u.useMemo(()=>({onPointerDown(h){f.current=h.pointerType},onMouseDown(h){const m=f.current,R=h.nativeEvent,y=n.select("open");if(h.button!==0||s==="click"||$t(m,!0)&&c)return;const b=r.current.openEvent,v=b==null?void 0:b.type,E=n.select("domReferenceElement")!==h.currentTarget,w=y&&E||!(y&&i&&(!(b&&l)||v==="click"||v==="mousedown"));if(Eo(R.target)){const S=de(dt,R,R.target);w&&m==="touch"&&a>0?g.start(a,()=>{n.setOpen(!0,S)}):n.setOpen(w,S);return}const x=h.currentTarget;d.request(()=>{const S=de(dt,R,x);w&&m==="touch"&&a>0?g.start(a,()=>{n.setOpen(!0,S)}):n.setOpen(w,S)})},onClick(h){if(s==="mousedown-only")return;const m=f.current;if(s==="mousedown"&&m){f.current=void 0;return}if($t(m,!0)&&c)return;const R=n.select("open"),y=r.current.openEvent,b=n.select("domReferenceElement")!==h.currentTarget,v=R&&b||!(R&&i&&(!(y&&l)||Ei(y))),E=de(dt,h.nativeEvent,h.currentTarget);v&&m==="touch"&&a>0?g.start(a,()=>{n.setOpen(!0,E)}):n.setOpen(v,E)},onKeyDown(){f.current=void 0}}),[r,s,c,n,l,i,d,g,a]);return u.useMemo(()=>o?{reference:p}:Be,[o,p])}function ra(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var p;const s=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(((p=t.dataRef.current.openEvent)==null?void 0:p.type)||"")&&t.pointerType!=="touch";let a=s.width,f=s.height,d=s.x,g=s.y;return n==null&&t.x&&i&&(n=s.x-t.x),r==null&&t.y&&c&&(r=s.y-t.y),d-=n||0,g-=r||0,a=0,f=0,!o||l?(a=t.axis==="y"?s.width:0,f=t.axis==="x"?s.height:0,d=i&&t.x!=null?t.x:d,g=c&&t.y!=null?t.y:g):o&&!l&&(f=t.axis==="x"?s.height:f,a=t.axis==="y"?s.width:a),o=!0,{width:a,height:f,x:d,y:g,top:g,right:d+a,bottom:g+f,left:d}}}}function vs(e){return e!=null&&e.clientX!=null}function oa(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{enabled:c=!0,axis:l="both",x:a=null,y:f=null}=t,d=u.useRef(!1),g=u.useRef(null),[p,h]=u.useState(),[m,R]=u.useState([]),y=X((x,S)=>{d.current||i.current.openEvent&&!vs(i.current.openEvent)||n.set("positionReference",ra(s,{x,y:S,axis:l,dataRef:i,pointerType:p}))}),b=X(x=>{a!=null||f!=null||(r?g.current||R([]):y(x.clientX,x.clientY))}),v=$t(p)?o:r,E=u.useCallback(()=>{if(!v||!c||a!=null||f!=null)return;const x=Ae(o);function S(P){const A=Ue(P);ve(o,A)?(x.removeEventListener("mousemove",S),g.current=null):y(P.clientX,P.clientY)}if(!i.current.openEvent||vs(i.current.openEvent)){x.addEventListener("mousemove",S);const P=()=>{x.removeEventListener("mousemove",S),g.current=null};return g.current=P,P}n.set("positionReference",s)},[v,c,a,f,o,i,s,n,y]);u.useEffect(()=>E(),[E,m]),u.useEffect(()=>{c&&!o&&(d.current=!1)},[c,o]),u.useEffect(()=>{!c&&r&&(d.current=!0)},[c,r]),Z(()=>{c&&(a!=null||f!=null)&&(d.current=!1,y(a,f))},[c,a,f,y]);const w=u.useMemo(()=>{function x(S){h(S.pointerType)}return{onPointerDown:x,onPointerEnter:x,onMouseMove:b,onMouseEnter:b}},[b]);return u.useMemo(()=>c?{reference:w}:{},[c,w])}function Rs(e,t,n){let{reference:r,floating:o}=e;const s=rt(t),i=wo(t),c=So(i),l=et(t),a=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,g=r[c]/2-o[c]/2;let p;switch(l){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}const h=Mt(t);return h&&(p[i]+=g*(h==="end"?1:-1)*(n&&a?-1:1)),p}async function sa(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:p=0}=mt(t,e),h=Si(p),R=c[g?d==="floating"?"reference":"floating":d],y=ir(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),b=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),E=await(s.isElement==null?void 0:s.isElement(v))&&await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1},w=ir(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:v,strategy:l}):b);return{top:(y.top-w.top+h.top)/E.y,bottom:(w.bottom-y.bottom+h.bottom)/E.y,left:(y.left-w.left+h.left)/E.x,right:(w.right-y.right+h.right)/E.x}}const ia=50,ca=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:sa},l=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Rs(a,r,l),g=r,p=0;const h={};for(let m=0;m<s.length;m++){const R=s[m];if(!R)continue;const{name:y,fn:b}=R,{x:v,y:E,data:w,reset:x}=await b({x:f,y:d,initialPlacement:r,placement:g,strategy:o,middlewareData:h,rects:a,platform:c,elements:{reference:e,floating:t}});f=v??f,d=E??d,h[y]={...h[y],...w},x&&p<ia&&(p++,typeof x=="object"&&(x.placement&&(g=x.placement),x.rects&&(a=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:f,y:d}=Rs(a,g,l)),m=-1)}return{x:f,y:d,placement:g,strategy:o,middlewareData:h}},la=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...R}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=et(o),b=rt(c),v=et(c)===c,E=await(l.isRTL==null?void 0:l.isRTL(a.floating)),w=g||(v||!m?[sr(c)]:du(c)),x=h!=="none";!g&&x&&w.push(...mu(c,m,h,E));const S=[c,...w],P=await l.detectOverflow(t,R),A=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&A.push(P[y]),d){const F=fu(o,i,E);A.push(P[F[0]],P[F[1]])}if(M=[...M,{placement:o,overflows:A}],!A.every(F=>F<=0)){var k,L;const F=(((k=s.flip)==null?void 0:k.index)||0)+1,C=S[F];if(C&&(!(d==="alignment"?b!==rt(C):!1)||M.every(T=>rt(T.placement)===b?T.overflows[0]>0:!0)))return{data:{index:F,overflows:M},reset:{placement:C}};let _=(L=M.filter(D=>D.overflows[0]<=0).sort((D,T)=>D.overflows[1]-T.overflows[1])[0])==null?void 0:L.placement;if(!_)switch(p){case"bestFit":{var I;const D=(I=M.filter(T=>{if(x){const O=rt(T.placement);return O===b||O==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(O=>O>0).reduce((O,N)=>O+N,0)]).sort((T,O)=>T[1]-O[1])[0])==null?void 0:I[0];D&&(_=D);break}case"initialPlacement":_=c;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Es(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xs(e){return uu.some(t=>e[t]>=0)}const ua=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=mt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=Es(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:xs(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),c=Es(i,n.floating);return{data:{escapedOffsets:c,escaped:xs(c)}}}default:return{}}}}},Gi=new Set(["left","top"]);async function aa(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=et(n),c=Mt(n),l=rt(n)==="y",a=Gi.has(i)?-1:1,f=s&&l?-1:1,d=mt(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),l?{x:p*f,y:g*a}:{x:g*a,y:p*f}}const fa=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,l=await aa(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},da=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:b=>{let{x:v,y:E}=b;return{x:v,y:E}}},...a}=mt(e,t),f={x:n,y:r},d=await s.detectOverflow(t,a),g=rt(o),p=xo(g);let h=f[p],m=f[g];const R=(b,v)=>xi(v+d[b==="y"?"top":"left"],v,v-d[b==="y"?"bottom":"right"]);i&&(h=R(p,h)),c&&(m=R(g,m));const y=l.fn({...t,[p]:h,[g]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:i,[g]:c}}}}}},pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:s,placement:i,rects:c,middlewareData:l}=t,{offset:a=0,mainAxis:f=!0,crossAxis:d=!0}=mt(e,t),g={x:o,y:s},p=rt(i),h=xo(p);let m=g[h],R=g[p];const y=mt(a,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(r=y.crossAxis)!=null?r:0};if(f){const w=h==="y"?"height":"width",x=c.reference[h]-c.floating[w]+b.mainAxis,S=c.reference[h]+c.reference[w]-b.mainAxis;m<x?m=x:m>S&&(m=S)}if(d){var v,E;const w=h==="y"?"width":"height",x=Gi.has(et(i)),S=c.reference[p]-c.floating[w]+(x&&((v=l.offset)==null?void 0:v[p])||0)+(x?0:b.crossAxis),P=c.reference[p]+c.reference[w]+(x?0:((E=l.offset)==null?void 0:E[p])||0)-(x?b.crossAxis:0);R<S?R=S:R>P&&(R=P)}return{[h]:m,[p]:R}}}},ga=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...c}=mt(e,t),l=await o.detectOverflow(t,c),a=et(n),f=Mt(n),d=rt(n)==="y",{width:g,height:p}=r.floating;let h,m;a==="top"||a==="bottom"?(h=a,m=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=a,h=f==="end"?"top":"bottom");const R=p-l.top-l.bottom,y=g-l.left-l.right,b=ln(p-l[h],R),v=ln(g-l[m],y),E=t.middlewareData.shift,w=!E;let x=b,S=v;E!=null&&E.enabled.x&&(S=y),E!=null&&E.enabled.y&&(x=R),w&&!f&&(d?S=g-2*pt(l.left,l.right):x=p-2*pt(l.top,l.bottom)),await i({...t,availableWidth:S,availableHeight:x});const P=await o.getDimensions(s.floating);return g!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function qi(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Me(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=un(n)!==s||un(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Ao(e){return Ce(e)?e:e.contextElement}function nn(e){const t=Ao(e);if(!Me(t))return gt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=qi(t);let i=(s?un(n.width):n.width)/r,c=(s?un(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const ha=gt(0);function Xi(e){const t=Ae(e);return!Er()||!t.visualViewport?ha:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ma(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ae(e)}function Wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ao(e);let i=gt(1);t&&(r?Ce(r)&&(i=nn(r)):i=nn(e));const c=ma(s,n,r)?Xi(s):gt(0);let l=(o.left+c.x)/i.x,a=(o.top+c.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(s&&r){const g=Ae(s),p=Ce(r)?Ae(r):r;let h=g,m=Xr(h);for(;m&&p!==h;){const R=nn(m),y=m.getBoundingClientRect(),b=nt(m),v=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*R.x,E=y.top+(m.clientTop+parseFloat(b.paddingTop))*R.y;l*=R.x,a*=R.y,f*=R.x,d*=R.y,l+=v,a+=E,h=Ae(m),m=Xr(h)}}return ir({width:f,height:d,x:l,y:a})}function wr(e,t){const n=xr(e).scrollLeft;return t?t.left+n:Wt(yt(e)).left+n}function Zi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ya(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=yt(r),c=t?Rr(t.floating):!1;if(r===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=gt(1);const f=gt(0),d=Me(r);if((d||!s)&&((It(r)!=="body"||mn(i))&&(l=xr(r)),d)){const p=Wt(r);a=nn(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const g=i&&!d&&!s?Zi(i,l):gt(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+g.x,y:n.y*a.y-l.scrollTop*a.y+f.y+g.y}}function ba(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function va(e){const t=xr(e),n=e.ownerDocument.body,r=pt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=pt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+wr(e);const i=-t.scrollTop;return nt(n).direction==="rtl"&&(s+=pt(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const Ra=25;function Ea(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=Ae(e),s=yt(e),i=o.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,f=0;if(i){const g=!Er()||t==="fixed";r?g||(a=-i.offsetLeft,f=-i.offsetTop):(c=i.width,l=i.height,g&&(a=i.offsetLeft,f=i.offsetTop))}if(wr(s)<=0){const g=s.ownerDocument,p=g.body,h=getComputedStyle(p),m=g.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,R=Math.abs(s.clientWidth-p.clientWidth-m),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?R/2:R;y<=Ra&&(c-=y)}return{width:c,height:l,x:a,y:f}}function xa(e,t){const n=Wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=nn(e),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,a=r*s.y;return{width:i,height:c,x:l,y:a}}function Ss(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=Ea(e,n,t);else if(t==="document")r=va(yt(e));else if(Ce(t))r=xa(t,n);else{const o=Xi(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ir(r)}function Sa(e,t){const n=t.get(e);if(n)return n;let r=St(e,[],!1).filter(c=>Ce(c)&&It(c)!=="body"),o=null;const s=nt(e).position==="fixed";let i=s?Ot(e):e;for(;Ce(i)&&!xt(i);){const c=nt(i),l=vo(i),a=o?o.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?r=r.filter(d=>d!==i):o=c,i=Ot(i)}return t.set(e,r),r}function wa(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Rr(t)?[]:Sa(t,this._c):[].concat(n),r],c=Ss(t,i[0],o);let l=c.top,a=c.right,f=c.bottom,d=c.left;for(let g=1;g<i.length;g++){const p=Ss(t,i[g],o);l=pt(p.top,l),a=ln(p.right,a),f=ln(p.bottom,f),d=pt(p.left,d)}return{width:a-d,height:f-l,x:d,y:l}}function Ta(e){const{width:t,height:n}=qi(e);return{width:t,height:n}}function Ca(e,t,n){const r=Me(t),o=yt(t),s=n==="fixed",i=Wt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=gt(0);if((r||!s)&&((It(t)!=="body"||mn(o))&&(c=xr(t)),r)){const g=Wt(t,!0,s,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!r&&o&&(l.x=wr(o));const a=o&&!r&&!s?Zi(o,c):gt(0),f=i.left+c.scrollLeft-l.x-a.x,d=i.top+c.scrollTop-l.y-a.y;return{x:f,y:d,width:i.width,height:i.height}}function Vr(e){return nt(e).position==="static"}function ws(e,t){if(!Me(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function Ji(e,t){const n=Ae(e);if(Rr(e))return n;if(!Me(e)){let o=Ot(e);for(;o&&!xt(o);){if(Ce(o)&&!Vr(o))return o;o=Ot(o)}return n}let r=ws(e,t);for(;r&&Kl(r)&&Vr(r);)r=ws(r,t);return r&&xt(r)&&Vr(r)&&!vo(r)?n:r||Xl(e)||n}const Pa=async function(e){const t=this.getOffsetParent||Ji,n=this.getDimensions,r=await n(e.floating);return{reference:Ca(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Oa(e){return nt(e).direction==="rtl"}const Ia={convertOffsetParentRelativeRectToViewportRelativeRect:ya,getDocumentElement:yt,getClippingRect:wa,getOffsetParent:Ji,getElementRects:Pa,getClientRects:ba,getDimensions:Ta,getScale:nn,isElement:Ce,isRTL:Oa};function Qi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ma(e,t,n){let r=null,o;const s=yt(e);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function c(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),i();const g=e.getBoundingClientRect(),{left:p,top:h,width:m,height:R}=g;if(f||t(),!m||!R)return;const y=Jt(h),b=Jt(s.clientWidth-(p+m)),v=Jt(s.clientHeight-(h+R)),E=Jt(p),x={rootMargin:-y+"px "+-b+"px "+-v+"px "+-E+"px",threshold:pt(0,ln(1,d))||1};let S=!0;function P(A){const M=A[0].intersectionRatio;if(!Qi(g,e.getBoundingClientRect()))return c();if(M!==d){if(!S)return c();M?c(!1,M):o=setTimeout(()=>{c(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(P,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(P,x)}r.observe(e)}const l=Ae(e),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),i()}}function Ts(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,a=Ao(e),f=o||s?[...a?St(a):[],...t?St(t):[]]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const d=a&&c?Ma(a,n,s):null;let g=-1,p=null;i&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===a&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(t)})),n()}),a&&!l&&p.observe(a),t&&p.observe(t));let h,m=l?Wt(e):null;l&&R();function R(){const y=Wt(e);m&&!Qi(m,y)&&n(),m=y,h=requestAnimationFrame(R)}return n(),()=>{var y;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const Aa=fa,ka=da,La=la,Da=ga,Fa=ua,Na=pa,_a=(e,t,n)=>{const r=new Map,o=n??{},s={...Ia,...o.platform,_c:r};return ca(e,t,{...o,platform:s})};var Va=typeof document<"u",Ha=function(){},rr=Va?u.useLayoutEffect:Ha;function fr(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,o;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(!fr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!fr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ec(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cs(e,t){const n=ec(e);return Math.round(t*n)/n}function Hr(e){const t=u.useRef(e);return rr(()=>{t.current=e}),t}function Ba(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[f,d]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=u.useState(r);fr(g,r)||p(r);const[h,m]=u.useState(null),[R,y]=u.useState(null),b=u.useCallback(T=>{T!==x.current&&(x.current=T,m(T))},[]),v=u.useCallback(T=>{T!==S.current&&(S.current=T,y(T))},[]),E=s||h,w=i||R,x=u.useRef(null),S=u.useRef(null),P=u.useRef(f),A=l!=null,M=Hr(l),k=Hr(o),L=Hr(a),I=u.useCallback(()=>{if(!x.current||!S.current)return;const T={placement:t,strategy:n,middleware:g};k.current&&(T.platform=k.current),_a(x.current,S.current,T).then(O=>{const N={...O,isPositioned:L.current!==!1};F.current&&!fr(P.current,N)&&(P.current=N,tt.flushSync(()=>{d(N)}))})},[g,t,n,k,L]);rr(()=>{a===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[a]);const F=u.useRef(!1);rr(()=>(F.current=!0,()=>{F.current=!1}),[]),rr(()=>{if(E&&(x.current=E),w&&(S.current=w),E&&w){if(M.current)return M.current(E,w,I);I()}},[E,w,I,M,A]);const C=u.useMemo(()=>({reference:x,floating:S,setReference:b,setFloating:v}),[b,v]),_=u.useMemo(()=>({reference:E,floating:w}),[E,w]),D=u.useMemo(()=>{const T={position:n,left:0,top:0};if(!_.floating)return T;const O=Cs(_.floating,f.x),N=Cs(_.floating,f.y);return c?{...T,transform:"translate("+O+"px, "+N+"px)",...ec(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:N}},[n,c,_.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:I,refs:C,elements:_,floatingStyles:D}),[f,I,C,_,D])}const $a=(e,t)=>{const n=Aa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ja=(e,t)=>{const n=ka(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ua=(e,t)=>({fn:Na(e).fn,options:[e,t]}),Wa=(e,t)=>{const n=La(e);return{name:n.name,fn:n.fn,options:[e,t]}},za=(e,t)=>{const n=Da(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ya=(e,t)=>{const n=Fa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ka={intentional:"onClick",sloppy:"onPointerDown"};function Ga(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Tr(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:l}=n.context,{enabled:a=!0,escapeKey:f=!0,outsidePress:d=!0,outsidePressEvent:g="sloppy",referencePress:p=!1,referencePressEvent:h="sloppy",ancestorScroll:m=!1,bubbles:R,externalTree:y}=t,b=zt(y),v=X(typeof d=="function"?d:()=>!1),E=typeof d=="function"?v:d,w=u.useRef(!1),{escapeKey:x,outsidePress:S}=Ga(R),P=u.useRef(null),A=We(),M=We(),k=X(()=>{M.clear(),l.current.insideReactTree=!1}),L=u.useRef(!1),I=u.useRef(""),F=X(V=>{I.current=V.pointerType}),C=X(()=>{const V=I.current,ee=V==="pen"||!V?"mouse":V,q=typeof g=="function"?g():g;return typeof q=="string"?q:q[ee]}),_=X(V=>{var j;if(!r||!a||!f||V.key!=="Escape"||L.current)return;const ee=(j=l.current.floatingContext)==null?void 0:j.nodeId,q=b?Bt(b.nodesRef.current,ee):[];if(!x&&q.length>0){let te=!0;if(q.forEach(ie=>{var oe;(oe=ie.context)!=null&&oe.open&&!ie.context.dataRef.current.__escapeKeyBubbles&&(te=!1)}),!te)return}const Se=lu(V)?V.nativeEvent:V,le=de(Sr,Se);n.setOpen(!1,le),!x&&!le.isPropagationAllowed&&V.stopPropagation()}),D=X(V=>{const ee=C();return ee==="intentional"&&V.type!=="click"||ee==="sloppy"&&V.type==="click"}),T=X(()=>{l.current.insideReactTree=!0,M.start(0,k)}),O=X((V,ee=!1)=>{var U;if(D(V)){k();return}if(l.current.insideReactTree){k();return}if(C()==="intentional"&&ee||typeof E=="function"&&!E(V))return;const q=Ue(V),Se=`[${fn("inert")}]`,le=Le(n.select("floatingElement")).querySelectorAll(Se),j=n.context.triggerElements;if(q&&(j.hasElement(q)||j.hasMatchingElement(ne=>ve(ne,q))))return;let te=Ce(q)?q:null;for(;te&&!xt(te);){const ne=Ot(te);if(xt(ne)||!Ce(ne))break;te=ne}if(le.length&&Ce(q)&&!iu(q)&&!ve(q,n.select("floatingElement"))&&Array.from(le).every(ne=>!ve(te,ne)))return;if(Me(q)&&!("touches"in V)){const ne=xt(q),z=nt(q),re=/auto|scroll/,K=ne||re.test(z.overflowX),be=ne||re.test(z.overflowY),Re=K&&q.clientWidth>0&&q.scrollWidth>q.clientWidth,me=be&&q.clientHeight>0&&q.scrollHeight>q.clientHeight,Ee=z.direction==="rtl",we=me&&(Ee?V.offsetX<=q.offsetWidth-q.clientWidth:V.offsetX>q.clientWidth),ke=Re&&V.offsetY>q.clientHeight;if(we||ke)return}const ie=(U=l.current.floatingContext)==null?void 0:U.nodeId,oe=b&&Bt(b.nodesRef.current,ie).some(ne=>{var z;return it(V,(z=ne.context)==null?void 0:z.elements.floating)});if(it(V,n.select("floatingElement"))||it(V,n.select("domReferenceElement"))||oe)return;const ue=b?Bt(b.nodesRef.current,ie):[];if(ue.length>0){let ne=!0;if(ue.forEach(z=>{var re;(re=z.context)!=null&&re.open&&!z.context.dataRef.current.__outsidePressBubbles&&(ne=!1)}),!ne)return}n.setOpen(!1,de($i,V)),k()}),N=X(V=>{C()!=="sloppy"||V.pointerType==="touch"||!n.select("open")||!a||it(V,n.select("floatingElement"))||it(V,n.select("domReferenceElement"))||O(V)}),J=X(V=>{if(C()!=="sloppy"||!n.select("open")||!a||it(V,n.select("floatingElement"))||it(V,n.select("domReferenceElement")))return;const ee=V.touches[0];ee&&(P.current={startTime:Date.now(),startX:ee.clientX,startY:ee.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}),Y=X(V=>{const ee=Ue(V);function q(){J(V),ee==null||ee.removeEventListener(V.type,q)}ee==null||ee.addEventListener(V.type,q)}),B=X(V=>{const ee=w.current;if(w.current=!1,A.clear(),V.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)return;const q=Ue(V);function Se(){V.type==="pointerdown"?N(V):O(V,ee),q==null||q.removeEventListener(V.type,Se)}q==null||q.addEventListener(V.type,Se)}),ce=X(V=>{if(C()!=="sloppy"||!P.current||it(V,n.select("floatingElement"))||it(V,n.select("domReferenceElement")))return;const ee=V.touches[0];if(!ee)return;const q=Math.abs(ee.clientX-P.current.startX),Se=Math.abs(ee.clientY-P.current.startY),le=Math.sqrt(q*q+Se*Se);le>5&&(P.current.dismissOnTouchEnd=!0),le>10&&(O(V),A.clear(),P.current=null)}),Q=X(V=>{const ee=Ue(V);function q(){ce(V),ee==null||ee.removeEventListener(V.type,q)}ee==null||ee.addEventListener(V.type,q)}),$=X(V=>{C()!=="sloppy"||!P.current||it(V,n.select("floatingElement"))||it(V,n.select("domReferenceElement"))||(P.current.dismissOnTouchEnd&&O(V),A.clear(),P.current=null)}),H=X(V=>{const ee=Ue(V);function q(){$(V),ee==null||ee.removeEventListener(V.type,q)}ee==null||ee.addEventListener(V.type,q)});u.useEffect(()=>{if(!r||!a)return;l.current.__escapeKeyBubbles=x,l.current.__outsidePressBubbles=S;const V=new ht;function ee(te){n.setOpen(!1,de(jt,te))}function q(){V.clear(),L.current=!0}function Se(){V.start(Er()?5:0,()=>{L.current=!1})}const le=Le(o);le.addEventListener("pointerdown",F,!0),f&&(le.addEventListener("keydown",_),le.addEventListener("compositionstart",q),le.addEventListener("compositionend",Se)),E&&(le.addEventListener("click",B,!0),le.addEventListener("pointerdown",B,!0),le.addEventListener("touchstart",Y,!0),le.addEventListener("touchmove",Q,!0),le.addEventListener("touchend",H,!0),le.addEventListener("mousedown",B,!0));let j=[];return m&&(Ce(i)&&(j=St(i)),Ce(o)&&(j=j.concat(St(o))),!Ce(s)&&s&&s.contextElement&&(j=j.concat(St(s.contextElement)))),j=j.filter(te=>{var ie;return te!==((ie=le.defaultView)==null?void 0:ie.visualViewport)}),j.forEach(te=>{te.addEventListener("scroll",ee,{passive:!0})}),()=>{le.removeEventListener("pointerdown",F,!0),f&&(le.removeEventListener("keydown",_),le.removeEventListener("compositionstart",q),le.removeEventListener("compositionend",Se)),E&&(le.removeEventListener("click",B,!0),le.removeEventListener("pointerdown",B,!0),le.removeEventListener("touchstart",Y,!0),le.removeEventListener("touchmove",Q,!0),le.removeEventListener("touchend",H,!0),le.removeEventListener("mousedown",B,!0)),j.forEach(te=>{te.removeEventListener("scroll",ee)}),V.clear()}},[l,o,s,i,f,E,r,c,m,a,x,S,_,O,B,N,Y,Q,H,F,n]),u.useEffect(k,[E,k]);const W=u.useMemo(()=>({onKeyDown:_,...p&&{[Ka[h]]:V=>{n.setOpen(!1,de(dt,V.nativeEvent))},...h!=="intentional"&&{onClick(V){n.setOpen(!1,de(dt,V.nativeEvent))}}}}),[_,n,p,h]),ae=X(V=>{const ee=Ue(V.nativeEvent);!ve(n.select("floatingElement"),ee)||V.button!==0||(w.current=!0)}),ge=u.useMemo(()=>({onKeyDown:_,onPointerDown:ae,onMouseDown:ae,onMouseUp:ae,onClickCapture:T,onMouseDownCapture:T,onPointerDownCapture:T,onMouseUpCapture:T,onTouchEndCapture:T,onTouchMoveCapture:T}),[_,ae,T]);return u.useMemo(()=>a?{reference:W,floating:ge,trigger:W}:{},[a,W,ge])}var dr=Symbol("NOT_FOUND");function qa(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Xa(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Ps=e=>Array.isArray(e)?e:[e];function Za(e){const t=Array.isArray(e[0])?e[0]:e;return Xa(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ja(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function Qa(e){let t;return{get(n){return t&&e(t.key,n)?t.value:dr},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function ef(e,t){let n=[];function r(c){const l=n.findIndex(a=>t(c,a.key));if(l>-1){const a=n[l];return l>0&&(n.splice(l,1),n.unshift(a)),a.value}return dr}function o(c,l){r(c)===dr&&(n.unshift({key:c,value:l}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var tf=(e,t)=>e===t;function nf(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function rf(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=tf,maxSize:o=1,resultEqualityCheck:s}=n,i=nf(r);let c=0;const l=o<=1?Qa(i):ef(o,i);function a(){let f=l.get(arguments);if(f===dr){if(f=e.apply(null,arguments),c++,s){const g=l.getEntries().find(p=>s(p.value,f));g&&(f=g.value,c!==0&&c--)}l.put(arguments,f)}return f}return a.clearCache=()=>{l.clear(),a.resetResultsCount()},a.resultsCount=()=>c,a.resetResultsCount=()=>{c=0},a}var of=class{constructor(e){this.value=e}deref(){return this.value}},sf=()=>typeof WeakRef>"u"?of:WeakRef,tc=sf(),cf=0,Os=1;function Gn(){return{s:cf,v:void 0,o:null,p:null}}function lf(e){return e instanceof tc?e.deref():e}function nc(e,t={}){let n=Gn();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let c=n;const{length:l}=arguments;for(let d=0,g=l;d<g;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let h=c.o;h===null&&(c.o=h=new WeakMap);const m=h.get(p);m===void 0?(c=Gn(),h.set(p,c)):c=m}else{let h=c.p;h===null&&(c.p=h=new Map);const m=h.get(p);m===void 0?(c=Gn(),h.set(p,c)):c=m}}const a=c;let f;if(c.s===Os)f=c.v;else if(f=e.apply(null,arguments),s++,r){const d=lf(o);d!=null&&r(d,f)&&(f=d,s!==0&&s--),o=typeof f=="object"&&f!==null||typeof f=="function"?new tc(f):f}return a.s=Os,a.v=f,f}return i.clearCache=()=>{n=Gn(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function rc(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,c,l={},a=o.pop();typeof a=="object"&&(l=a,a=o.pop()),qa(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const f={...n,...l},{memoize:d,memoizeOptions:g=[],argsMemoize:p=nc,argsMemoizeOptions:h=[]}=f,m=Ps(g),R=Ps(h),y=Za(o),b=d(function(){return s++,a.apply(null,arguments)},...m),v=p(function(){i++;const w=Ja(y,arguments);return c=b.apply(null,w),c},...R);return Object.assign(v,{resultFunc:a,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var Dp=rc(nc);rc({memoize:rf,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const G=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(Ne(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var oc={exports:{}},sc={};/**
|
|
29
|
-
* @license React
|
|
30
|
-
* use-sync-external-store-shim.production.js
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var pn=u;function uf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var af=typeof Object.is=="function"?Object.is:uf,ff=pn.useState,df=pn.useEffect,pf=pn.useLayoutEffect,gf=pn.useDebugValue;function hf(e,t){var n=t(),r=ff({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return pf(function(){o.value=n,o.getSnapshot=t,Br(o)&&s({inst:o})},[e,n,t]),df(function(){return Br(o)&&s({inst:o}),e(function(){Br(o)&&s({inst:o})})},[e]),gf(n),n}function Br(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!af(e,n)}catch{return!0}}function mf(e,t){return t()}var yf=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?mf:hf;sc.useSyncExternalStore=pn.useSyncExternalStore!==void 0?pn.useSyncExternalStore:yf;oc.exports=sc;var ic=oc.exports,cc={exports:{}},lc={};/**
|
|
37
|
-
* @license React
|
|
38
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
39
|
-
*
|
|
40
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the MIT license found in the
|
|
43
|
-
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var Cr=u,bf=ic;function vf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rf=typeof Object.is=="function"?Object.is:vf,Ef=bf.useSyncExternalStore,xf=Cr.useRef,Sf=Cr.useEffect,wf=Cr.useMemo,Tf=Cr.useDebugValue;lc.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=xf(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=wf(function(){function l(p){if(!a){if(a=!0,f=p,p=r(p),o!==void 0&&i.hasValue){var h=i.value;if(o(h,p))return d=h}return d=p}if(h=d,Rf(f,p))return h;var m=r(p);return o!==void 0&&o(h,m)?(f=p,h):(f=p,d=m)}var a=!1,f,d,g=n===void 0?null:n;return[function(){return l(t())},g===null?void 0:function(){return l(g())}]},[t,n,r,o]);var c=Ef(e,s[0],s[1]);return Sf(function(){i.hasValue=!0,i.value=c},[c]),Tf(c),c};cc.exports=lc;var Cf=cc.exports;const Pf=mo(19),Of=Pf?If:Mf;function ye(e,t,n,r,o){return Of(e,t,n,r,o)}function If(e,t,n,r,o){const s=u.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return ic.useSyncExternalStore(e.subscribe,s,s)}function Mf(e,t,n,r,o){return Cf.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class rn{constructor(t){xe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));xe(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){rn.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||rn.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};rn.prototype.setState.call(this,t)}}class Pr extends rn{constructor(n,r={},o){super(n);xe(this,"controlledValues",new Map);xe(this,"select",(n,r,o,s)=>{const i=this.selectors[n];return i(this.state,r,o,s)});xe(this,"useState",(n,r,o,s)=>{u.useDebugValue(n);const i=this.selectors[n];return ye(this,i,r,o,s)});this.context=r,this.selectors=o}useSyncedValue(n,r){u.useDebugValue(n),Z(()=>{this.state[n]!==r&&this.set(n,r)},[n,r])}useSyncedValueWithCleanup(n,r){Z(()=>(this.state[n]!==r&&this.set(n,r),()=>{this.set(n,void 0)}),[n,r])}useSyncedValues(n){const r=Object.values(n);Z(()=>{this.update(n)},r)}useControlledProp(n,r,o){u.useDebugValue(n);const s=r!==void 0;this.controlledValues.has(n)||(this.controlledValues.set(n,s),!s&&!Object.is(this.state[n],o)&&super.setState({...this.state,[n]:o})),Z(()=>{s&&!Object.is(this.state[n],r)&&super.setState({...this.state,[n]:r})},[n,r,o,s])}set(n,r){this.controlledValues.get(n)!==!0&&super.set(n,r)}update(n){const r={...n};for(const o in r)if(Object.hasOwn(r,o)&&this.controlledValues.get(o)===!0){delete r[o];continue}super.update(r)}setState(n){const r={...n};for(const o in r)if(Object.hasOwn(r,o)&&this.controlledValues.get(o)===!0){delete r[o];continue}super.setState({...this.state,...r})}useContextCallback(n,r){u.useDebugValue(n);const o=X(r??Qe);this.context[n]=o}useStateSetter(n){const r=u.useRef(void 0);return r.current===void 0&&(r.current=o=>{this.set(n,o)}),r.current}observe(n,r){let o;typeof n=="function"?o=n:o=this.selectors[n];let s=o(this.state);return r(s,s,this),this.subscribe(i=>{const c=o(i);if(!Object.is(s,c)){const l=s;s=c,r(c,l,this)}})}}const Af={open:G(e=>e.open),domReferenceElement:G(e=>e.domReferenceElement),referenceElement:G(e=>e.positionReference??e.referenceElement),floatingElement:G(e=>e.floatingElement),floatingId:G(e=>e.floatingId)};class ko extends Pr{constructor(n){const{nested:r,noEmit:o,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Vi(),nested:r,noEmit:o,triggerElements:i},Af);xe(this,"setOpen",(n,r)=>{var o,s;if((!n||!this.state.open||Ei(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const i={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",i)}(s=(o=this.context).onOpenChange)==null||s.call(o,n,r)})}}function Lo(e,t=!1,n=!1){const[r,o]=u.useState(e&&t?"idle":void 0),[s,i]=u.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),Z(()=>{if(!e&&s&&r!=="ending"&&n){const c=ft.request(()=>{o("ending")});return()=>{ft.cancel(c)}}},[e,s,r,n]),Z(()=>{if(!e||t)return;const c=ft.request(()=>{o(void 0)});return()=>{ft.cancel(c)}},[t,e]),Z(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ft.request(()=>{o("idle")});return()=>{ft.cancel(c)}},[t,e,s,o,r]),u.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:r}),[s,r])}function Do(e,t=!1,n=!0){const r=Ln();return X((o,s=null)=>{r.cancel();const i=_t(e);i!=null&&(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():r.request(()=>{function c(){i&&Promise.all(i.getAnimations().map(l=>l.finished)).then(()=>{s!=null&&s.aborted||tt.flushSync(o)}).catch(()=>{if(n){if(s!=null&&s.aborted)return;tt.flushSync(o)}else i.getAnimations().length>0&&i.getAnimations().some(l=>l.pending||l.playState!=="finished")&&c()})}t?r.request(c):c()}))})}function Yt(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=Fe(n),i=X(o),c=Do(r,n);u.useEffect(()=>{t&&c(()=>{n===s.current&&i()})},[t,n,i,c,s])}function kf(e,t){const n=u.useRef(null);return u.useCallback(r=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null&&(n.current=e,t.context.triggerElements.add(e,r)))},[t,e])}function uc(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=kf(e,n),i=X(c=>{s(c),c!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return Z(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function Fo(e){const t=e.useState("open");Z(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function No(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Lo(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=X(()=>{var l,a;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(a=(l=t.context).onOpenChangeComplete)==null||a.call(l,!1)}),c=t.useState("preventUnmountingOnClose");return Yt({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class Dn{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Lf(){return new ko({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Dn,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function _o(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Lf(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Be,inactiveTriggerProps:Be,popupProps:Be}}const Vo={open:G(e=>e.open),mounted:G(e=>e.mounted),transitionStatus:G(e=>e.transitionStatus),floatingRootContext:G(e=>e.floatingRootContext),preventUnmountingOnClose:G(e=>e.preventUnmountingOnClose),payload:G(e=>e.payload),activeTriggerId:G(e=>e.activeTriggerId),activeTriggerElement:G(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:G((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:G((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:G(e=>e.popupProps),popupElement:G(e=>e.popupElement),positionerElement:G(e=>e.positionerElement)};function ac(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=vn(),s=At()!=null,i=Ke(()=>new ko({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new Dn,floatingId:o,nested:s,noEmit:e.noEmit||!1})).current;return Z(()=>{const c={open:t,floatingId:o};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=Ce(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),i.update(c)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Df(e={}){const{nodeId:t,externalTree:n}=e,r=ac(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,c]=u.useState(null),l=u.useRef(null),a=zt(n);Z(()=>{s.domReference&&(l.current=s.domReference)},[s.domReference]);const f=Ba({...e,elements:{...s,...i&&{reference:i}}}),d=u.useCallback(S=>{const P=Ce(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;c(P),f.refs.setReference(P)},[f.refs]),[g,p]=u.useState(null),[h,m]=u.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",Ce(g)?g:null),o.useSyncedValue("floatingElement",h);const R=u.useCallback(S=>{(Ce(S)||S===null)&&(l.current=S,p(S)),(Ce(f.refs.reference.current)||f.refs.reference.current===null||S!==null&&!Ce(S))&&f.refs.setReference(S)},[f.refs,p]),y=u.useCallback(S=>{m(S),f.refs.setFloating(S)},[f.refs]),b=u.useMemo(()=>({...f.refs,setReference:R,setFloating:y,setPositionReference:d,domReference:l}),[f.refs,R,y,d]),v=u.useMemo(()=>({...f.elements,domReference:s.domReference}),[f.elements,s.domReference]),E=o.useState("open"),w=o.useState("floatingId"),x=u.useMemo(()=>({...f,dataRef:o.context.dataRef,open:E,onOpenChange:o.setOpen,events:o.context.events,floatingId:w,refs:b,elements:v,nodeId:t,rootStore:o}),[f,b,v,t,o,E,w]);return Z(()=>{o.context.dataRef.current.floatingContext=x;const S=a==null?void 0:a.nodesRef.current.find(P=>P.id===t);S&&(S.context=x)}),u.useMemo(()=>({...f,context:x,refs:b,elements:v,rootStore:o}),[f,b,v,x,o])}function Ho(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=vn(),i=At()!=null,c=t.useState("open"),l=t.useState("activeTriggerElement"),a=t.useState(r?"popupElement":"positionerElement"),f=t.context.triggerElements,d=Ke(()=>new ko({open:c,referenceElement:l,floatingElement:a,triggerElements:f,onOpenChange:o,floatingId:s,nested:i,noEmit:n})).current;return Z(()=>{const g={open:c,floatingId:s,referenceElement:l,floatingElement:a};Ce(l)&&(g.domReferenceElement=l),d.update(g)},[c,s,l,a,d]),d.context.onOpenChange=o,d.context.nested=i,d.context.noEmit=n,d}const $r=nu&&gi;function Ff(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:o}=n.context,{enabled:s=!0,visibleOnly:i=!0}=t,c=u.useRef(!1),l=We(),a=u.useRef(!0);u.useEffect(()=>{const d=n.select("domReferenceElement");if(!s)return;const g=Ae(d);function p(){!n.select("open")&&Me(d)&&d===ct(Le(d))&&(c.current=!0)}function h(){a.current=!0}function m(){a.current=!1}return g.addEventListener("blur",p),$r&&(g.addEventListener("keydown",h,!0),g.addEventListener("pointerdown",m,!0)),()=>{g.removeEventListener("blur",p),$r&&(g.removeEventListener("keydown",h,!0),g.removeEventListener("pointerdown",m,!0))}},[n,s]),u.useEffect(()=>{if(!s)return;function d(g){(g.reason===dt||g.reason===Sr)&&(c.current=!0)}return r.on("openchange",d),()=>{r.off("openchange",d)}},[r,s]);const f=u.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(d){if(c.current)return;const g=Ue(d.nativeEvent);if(i&&Ce(g)){if($r&&!d.relatedTarget){if(!a.current&&!Eo(g))return}else if(!cu(g))return}n.setOpen(!0,de(oo,d.nativeEvent,d.currentTarget))},onBlur(d){c.current=!1;const g=d.relatedTarget,p=d.nativeEvent,h=Ce(g)&&g.hasAttribute(fn("focus-guard"))&&g.getAttribute("data-type")==="outside";l.start(0,()=>{var y;const m=n.select("domReferenceElement"),R=ct(m?m.ownerDocument:document);!g&&R===m||ve((y=o.current.floatingContext)==null?void 0:y.refs.floating.current,R)||ve(m,R)||h||n.context.triggerElements.hasElement(d.relatedTarget)||n.setOpen(!1,de(oo,p))})}}),[o,n,i,l]);return u.useMemo(()=>s?{reference:f,trigger:f}:{},[s,f])}const so=fn("safe-polygon"),Nf=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${bi}`;function _f(e){return e?!!e.closest(Nf):!1}function fc(e){const t=u.useRef(void 0),n=u.useRef(!1),r=u.useRef(void 0),o=u.useRef(!0),s=u.useRef(!1),i=u.useRef(()=>{}),c=u.useRef(!1),l=We(),a=We(),f=u.useRef(void 0);return u.useMemo(()=>{const d=e.context.dataRef.current;return d.hoverInteractionState||(d.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:o,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:c,openChangeTimeout:l,restTimeout:a,handleCloseOptionsRef:f}),d.hoverInteractionState},[e,t,n,r,o,s,i,c,l,a,f])}const Vf=new Set(["click","mousedown"]);function dc(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:c=!0,closeDelay:l=0,externalTree:a}=t,{pointerTypeRef:f,interactedInsideRef:d,handlerRef:g,performedPointerEventsMutationRef:p,unbindMouseMoveRef:h,restTimeoutPendingRef:m,openChangeTimeout:R,handleCloseOptionsRef:y}=fc(n),b=zt(a),v=At(),E=X(()=>d.current?!0:i.current.openEvent?Vf.has(i.current.openEvent.type):!1),w=X(()=>{var k;const M=(k=i.current.openEvent)==null?void 0:k.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"}),x=u.useCallback((M,k=!0)=>{const L=Hf(l,f.current);L&&!g.current?R.start(L,()=>n.setOpen(!1,de(Je,M))):k&&(R.clear(),n.setOpen(!1,de(Je,M)))},[l,g,n,f,R]),S=X(()=>{h.current(),g.current=void 0}),P=X(()=>{if(p.current){const M=Le(o).body;M.style.pointerEvents="",M.removeAttribute(so),p.current=!1}}),A=X(M=>{const k=Ue(M);if(!_f(k)){d.current=!1;return}d.current=!0});Z(()=>{r||(f.current=void 0,m.current=!1,d.current=!1,S(),P())},[r,f,m,d,S,P]),u.useEffect(()=>()=>{S()},[S]),u.useEffect(()=>P,[P]),Z(()=>{var M,k,L;if(c&&r&&(M=y.current)!=null&&M.blockPointerEvents&&w()&&Ce(s)&&o){p.current=!0;const I=Le(o).body;I.setAttribute(so,"");const F=s,C=o,_=(L=(k=b==null?void 0:b.nodesRef.current.find(D=>D.id===v))==null?void 0:k.context)==null?void 0:L.elements.floating;return _&&(_.style.pointerEvents=""),I.style.pointerEvents="none",F.style.pointerEvents="auto",C.style.pointerEvents="auto",()=>{I.style.pointerEvents="",F.style.pointerEvents="",C.style.pointerEvents=""}}},[c,r,s,o,y,w,b,v,p]),u.useEffect(()=>{if(!c)return;function M(F){if(E()||!i.current.floatingContext||!n.select("open"))return;const C=n.context.triggerElements;F.relatedTarget&&C.hasElement(F.relatedTarget)||(P(),S(),E()||x(F))}function k(F){var C;R.clear(),P(),(C=g.current)==null||C.call(g,F),S()}function L(F){E()||x(F,!1)}const I=o;return I&&(I.addEventListener("mouseleave",M),I.addEventListener("mouseenter",k),I.addEventListener("mouseleave",L),I.addEventListener("pointerdown",A,!0)),()=>{I&&(I.removeEventListener("mouseleave",M),I.removeEventListener("mouseenter",k),I.removeEventListener("mouseleave",L),I.removeEventListener("pointerdown",A,!0))}})}function Hf(e,t){return t&&!$t(t)?0:typeof e=="function"?e():e}function jr(e){return typeof e=="function"?e():e}const Bf={current:null};function pc(e,t={}){var D;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:s=!0,delay:i=0,handleClose:c=null,mouseOnly:l=!1,restMs:a=0,move:f=!0,triggerElementRef:d=Bf,externalTree:g,isActiveTrigger:p=!0}=t,h=zt(g),{pointerTypeRef:m,interactedInsideRef:R,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:v,unbindMouseMoveRef:E,restTimeoutPendingRef:w,openChangeTimeout:x,restTimeout:S,handleCloseOptionsRef:P}=fc(n),A=Fe(c),M=Fe(i),k=Fe(a);p&&(P.current=(D=A.current)==null?void 0:D.__options);const L=X(()=>R.current?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),I=u.useCallback((T,O=!0)=>{const N=tr(M.current,"close",m.current);N&&!y.current?x.start(N,()=>n.setOpen(!1,de(Je,T))):O&&(x.clear(),n.setOpen(!1,de(Je,T)))},[M,y,n,m,x]),F=X(()=>{E.current(),y.current=void 0}),C=X(()=>{if(v.current){const T=Le(n.select("domReferenceElement")).body;T.style.pointerEvents="",T.removeAttribute(so),v.current=!1}});u.useEffect(()=>{if(!s)return;function T(O){O.open||(x.clear(),S.clear(),b.current=!0,w.current=!1)}return o.on("openchange",T),()=>{o.off("openchange",T)}},[s,o,x,S,b,w]);const _=X(T=>{var J;if(L()||!r.current.floatingContext)return;const O=n.context.triggerElements;if(T.relatedTarget&&O.hasElement(T.relatedTarget))return;const N=d.current;(J=A.current)==null||J.call(A,{...r.current.floatingContext,tree:h,x:T.clientX,y:T.clientY,onClose(){C(),F(),!L()&&N===n.select("domReferenceElement")&&I(T)}})(T)});return u.useEffect(()=>{if(!s)return;const T=d.current??(p?n.select("domReferenceElement"):null);if(!Ce(T))return;function O(Y){if(x.clear(),b.current=!1,l&&!$t(m.current)||jr(k.current)>0&&!tr(M.current,"open"))return;const B=tr(M.current,"open",m.current),ce=n.select("domReferenceElement"),Q=n.context.triggerElements,$=(Q.hasElement(Y.target)||Q.hasMatchingElement(ae=>ve(ae,Y.target)))&&(!ce||!ve(ce,Y.target)),H=Y.currentTarget??null,W=!n.select("open")||$;B?x.start(B,()=>{W&&n.setOpen(!0,de(Je,Y,H))}):W&&n.setOpen(!0,de(Je,Y,H))}function N(Y){if(L()){C();return}E.current();const B=n.select("domReferenceElement"),ce=Le(B);S.clear(),w.current=!1;const Q=n.context.triggerElements;if(Y.relatedTarget&&Q.hasElement(Y.relatedTarget))return;if(A.current&&r.current.floatingContext){n.select("open")||x.clear();const H=d.current;y.current=A.current({...r.current.floatingContext,tree:h,x:Y.clientX,y:Y.clientY,onClose(){C(),F(),!L()&&H===n.select("domReferenceElement")&&I(Y,!0)}});const W=y.current;W(Y),ce.addEventListener("mousemove",W),E.current=()=>{ce.removeEventListener("mousemove",W)};return}(m.current==="touch"?!ve(n.select("floatingElement"),Y.relatedTarget):!0)&&I(Y)}function J(Y){_(Y)}return n.select("open")&&T.addEventListener("mouseleave",J),f&&T.addEventListener("mousemove",O,{once:!0}),T.addEventListener("mouseenter",O),T.addEventListener("mouseleave",N),()=>{T.removeEventListener("mouseleave",J),f&&T.removeEventListener("mousemove",O),T.removeEventListener("mouseenter",O),T.removeEventListener("mouseleave",N)}},[F,C,b,r,M,I,n,s,A,_,p,L,l,f,m,k,S,w,x,d,h,E,y]),u.useMemo(()=>{function T(O){m.current=O.pointerType}return{onPointerDown:T,onPointerEnter:T,onMouseMove(O){const{nativeEvent:N}=O,J=O.currentTarget,Y=n.select("domReferenceElement"),B=n.context.triggerElements,ce=n.select("open"),Q=(B.hasElement(O.target)||B.hasMatchingElement(H=>ve(H,O.target)))&&(!Y||!ve(Y,O.target));if(l&&!$t(m.current)||ce&&!Q||jr(k.current)===0||!Q&&w.current&&O.movementX**2+O.movementY**2<2)return;S.clear();function $(){!b.current&&(!ce||Q)&&n.setOpen(!0,de(Je,N,J))}m.current==="touch"?tt.flushSync(()=>{$()}):Q&&ce?$():(w.current=!0,S.start(jr(k.current),$))}}},[b,l,n,m,k,S,w])}function Fn(e=[]){const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=e.map(a=>a==null?void 0:a.trigger),s=u.useCallback(a=>qn(a,e,"reference"),t),i=u.useCallback(a=>qn(a,e,"floating"),n),c=u.useCallback(a=>qn(a,e,"item"),r),l=u.useCallback(a=>qn(a,e,"trigger"),o);return u.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:l}),[s,i,c,l])}function qn(e,t,n){var i;const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Jr]="");for(const c in e)o&&e&&(c===mi||c===yi)||(s[c]=e[c]);for(let c=0;c<t.length;c+=1){let l;const a=(i=t[c])==null?void 0:i[n];typeof a=="function"?l=e?a(e):null:l=a,l&&Is(s,l,o,r)}return Is(s,e,o,r),s}function Is(e,t,n,r){var o;for(const s in t){const i=t[s];n&&(s===mi||s===yi)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof i=="function"&&((o=r.get(s))==null||o.push(i),e[s]=(...c)=>{var l;return(l=r.get(s))==null?void 0:l.map(a=>a(...c)).find(a=>a!==void 0)})):e[s]=i)}}const $f="Escape";function Or(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Xn(e,t){return Or(t,e===Ro||e===An,e===wt||e===Tt)}function Ur(e,t,n){return Or(t,e===An,n?e===wt:e===Tt)||e==="Enter"||e===" "||e===""}function jf(e,t,n){return Or(t,n?e===wt:e===Tt,e===An)}function Uf(e,t,n,r){const o=n?e===Tt:e===wt,s=e===Ro;return t==="both"||t==="horizontal"&&r&&r>1?e===$f:Or(t,o,s)}function Wf(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:l,onNavigate:a=()=>{},enabled:f=!0,selectedIndex:d=null,allowEscape:g=!1,loopFocus:p=!1,nested:h=!1,rtl:m=!1,virtual:R=!1,focusItemOnOpen:y="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:v=!0,disabledIndices:E=void 0,orientation:w="vertical",parentOrientation:x,cols:S=1,scrollItemIntoView:P=!0,itemSizes:A,dense:M=!1,id:k,resetOnPointerLeave:L=!0,externalTree:I}=t,F=In(o),C=Fe(F),_=At(),D=zt(I);Z(()=>{i.current.orientation=w},[i,w]);const T=Qr(s),O=u.useRef(y),N=u.useRef(d??-1),J=u.useRef(null),Y=u.useRef(!0),B=X(z=>{a(N.current===-1?null:N.current,z)}),ce=u.useRef(B),Q=u.useRef(!!o),$=u.useRef(r),H=u.useRef(!1),W=u.useRef(!1),ae=Fe(E),ge=Fe(r),V=Fe(P),ee=Fe(d),q=Fe(L),Se=X(()=>{function z(Re){R?D==null||D.events.emit("virtualfocus",Re):nr(Re,{sync:H.current,preventScroll:!0})}const re=c.current[N.current],K=W.current;re&&z(re),(H.current?Re=>Re():requestAnimationFrame)(()=>{var we;const Re=c.current[N.current]||re;if(!Re)return;re||z(Re);const me=V.current;me&&j&&(K||!Y.current)&&((we=Re.scrollIntoView)==null||we.call(Re,typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))})});Z(()=>{f&&(r&&o?(N.current=d??-1,O.current&&d!=null&&(W.current=!0,B())):Q.current&&(N.current=-1,ce.current()))},[f,r,o,d,B]),Z(()=>{if(f){if(!r){H.current=!1;return}if(o)if(l==null){if(H.current=!1,ee.current!=null)return;if(Q.current&&(N.current=-1,Se()),(!$.current||!Q.current)&&O.current&&(J.current!=null||O.current===!0&&J.current==null)){let z=0;const re=()=>{c.current[0]==null?(z<2&&(z?requestAnimationFrame:queueMicrotask)(re),z+=1):(N.current=J.current==null||Ur(J.current,w,m)||h?er(c):to(c),J.current=null,B())};re()}}else Qt(c,l)||(N.current=l,Se(),W.current=!1)}},[f,r,o,l,ee,h,c,w,m,B,Se,ae]),Z(()=>{var Re,me;if(!f||o||!D||R||!Q.current)return;const z=D.nodesRef.current,re=(me=(Re=z.find(Ee=>Ee.id===_))==null?void 0:Re.context)==null?void 0:me.elements.floating,K=ct(Le(o)),be=z.some(Ee=>Ee.context&&ve(Ee.context.elements.floating,K));re&&!be&&Y.current&&re.focus({preventScroll:!0})},[f,o,D,_,R]),Z(()=>{ce.current=B,$.current=r,Q.current=!!o}),Z(()=>{r||(J.current=null,O.current=y)},[r,y]);const le=l!=null,j=u.useMemo(()=>{function z(K){if(!ge.current)return;const be=c.current.indexOf(K.currentTarget);be!==-1&&N.current!==be&&(N.current=be,B(K))}return{onFocus(K){H.current=!0,z(K)},onClick:({currentTarget:K})=>K.focus({preventScroll:!0}),onMouseMove(K){H.current=!0,W.current=!1,b&&z(K)},onPointerLeave(K){var Re;if(!ge.current||!Y.current||K.pointerType==="touch")return;H.current=!0;const be=K.relatedTarget;!b||c.current.includes(be)||q.current&&(N.current=-1,B(K),R||(Re=C.current)==null||Re.focus({preventScroll:!0}))}}},[ge,C,b,c,B,q,R]),te=u.useCallback(()=>{var z,re,K;return x??((K=(re=(z=D==null?void 0:D.nodesRef.current.find(be=>be.id===_))==null?void 0:z.context)==null?void 0:re.dataRef)==null?void 0:K.current.orientation)},[_,D,x]),ie=X(z=>{if(Y.current=!1,H.current=!0,z.which===229||!ge.current&&z.currentTarget===C.current)return;if(h&&Uf(z.key,w,m,S)){Xn(z.key,te())||je(z),n.setOpen(!1,de(Fr,z.nativeEvent)),Me(s)&&(R?D==null||D.events.emit("virtualfocus",s):s.focus());return}const re=N.current,K=er(c,E),be=to(c,E);if(T||(z.key==="Home"&&(je(z),N.current=K,B(z)),z.key==="End"&&(je(z),N.current=be,B(z))),S>1){const Re=A||Array.from({length:c.current.length},()=>({width:1,height:1})),me=Ti(Re,S,M),Ee=me.findIndex(De=>De!=null&&!Ct(c,De,E)),we=me.reduce((De,_e,qe)=>_e!=null&&!Ct(c,_e,E)?qe:De,-1),ke=me[wi({current:me.map(De=>De!=null?c.current[De]:null)},{event:z,orientation:w,loopFocus:p,rtl:m,cols:S,disabledIndices:Pi([...(typeof E!="function"?E:null)||c.current.map((De,_e)=>Ct(c,_e,E)?_e:void 0),void 0],me),minIndex:Ee,maxIndex:we,prevIndex:Ci(N.current>be?K:N.current,Re,me,S,z.key===An?"bl":z.key===(m?wt:Tt)?"tr":"tl"),stopEvent:!0})];if(ke!=null&&(N.current=ke,B(z)),w==="both")return}if(Xn(z.key,w)){if(je(z),r&&!R&&ct(z.currentTarget.ownerDocument)===z.currentTarget){N.current=Ur(z.key,w,m)?K:be,B(z);return}Ur(z.key,w,m)?p?re>=be?g&&re!==c.current.length?N.current=-1:(H.current=!1,N.current=K):N.current=$e(c,{startingIndex:re,disabledIndices:E}):N.current=Math.min(be,$e(c,{startingIndex:re,disabledIndices:E})):p?re<=K?g&&re!==-1?N.current=c.current.length:(H.current=!1,N.current=be):N.current=$e(c,{startingIndex:re,decrement:!0,disabledIndices:E}):N.current=Math.max(K,$e(c,{startingIndex:re,decrement:!0,disabledIndices:E})),Qt(c,N.current)&&(N.current=-1),B(z)}}),oe=u.useMemo(()=>R&&r&&le&&{"aria-activedescendant":`${k}-${l}`},[R,r,le,k,l]),ue=u.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...T?{}:oe,onKeyDown(z){if(z.key==="Tab"&&z.shiftKey&&r&&!R){const re=Ue(z.nativeEvent);if(re&&!ve(C.current,re))return;je(z),n.setOpen(!1,de(Ut,z.nativeEvent)),Me(s)&&s.focus();return}ie(z)},onPointerMove(){Y.current=!0}}),[oe,ie,C,w,T,n,r,R,s]),U=u.useMemo(()=>{function z(K){y==="auto"&&vi(K.nativeEvent)&&(O.current=!R)}function re(K){O.current=y,y==="auto"&&Ri(K.nativeEvent)&&(O.current=!0)}return{onKeyDown(K){const be=n.select("open");Y.current=!1;const Re=K.key.startsWith("Arrow"),me=jf(K.key,te(),m),Ee=Xn(K.key,w),we=(h?me:Ee)||K.key==="Enter"||K.key.trim()==="";if(R&&be)return ie(K);if(!(!be&&!v&&Re)){if(we){const ke=Xn(K.key,te());J.current=h&&ke?null:K.key}if(h){me&&(je(K),be?(N.current=er(c,ae.current),B(K)):n.setOpen(!0,de(Fr,K.nativeEvent,K.currentTarget)));return}Ee&&(ee.current!=null&&(N.current=ee.current),je(K),!be&&v?n.setOpen(!0,de(Fr,K.nativeEvent,K.currentTarget)):ie(K),be&&B(K))}},onFocus(K){n.select("open")&&!R&&(N.current=-1,B(K))},onPointerDown:re,onPointerEnter:re,onMouseDown:z,onClick:z}},[ie,ae,y,c,h,B,n,v,w,te,m,ee,R]),ne=u.useMemo(()=>({...oe,...U}),[oe,U]);return u.useMemo(()=>f?{reference:ne,floating:ue,item:j,trigger:U}:{},[f,ne,ue,U,j])}const zf=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function gc(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:c=!0,role:l="dialog"}=t,a=vn(),f=(s==null?void 0:s.id)||a,d=u.useMemo(()=>{var v;return((v=In(i))==null?void 0:v.id)||o},[i,o]),g=zf.get(l)??l,h=At()!=null,m=u.useMemo(()=>g==="tooltip"||l==="label"?Be:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,h,l]),R=u.useMemo(()=>g==="tooltip"||l==="label"?{[`aria-${l==="label"?"labelledby":"describedby"}`]:r?d:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?d:void 0,...g==="menu"&&{id:f}},[g,d,r,f,l,m]),y=u.useMemo(()=>{const v={id:d,...g&&{role:g}};return g==="tooltip"||l==="label"?v:{...v,...g==="menu"&&{"aria-labelledby":f}}},[g,d,f,l]),b=u.useCallback(({active:v,selected:E})=>{const w={role:"option",...v&&{id:`${d}-fui-option`}};switch(l){case"select":case"combobox":return{...w,"aria-selected":E}}return{}},[d,l]);return u.useMemo(()=>c?{reference:R,floating:y,item:b,trigger:m}:{},[c,R,y,m,b])}function Yf(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.context.dataRef,{listRef:s,activeIndex:i,onMatch:c,onTypingChange:l,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:g=cn,selectedIndex:p=null}=t,h=We(),m=u.useRef(""),R=u.useRef(p??i??-1),y=u.useRef(null);Z(()=>{r&&(h.clear(),y.current=null,m.current="")},[r,h]),Z(()=>{r&&m.current===""&&(R.current=p??i??-1)},[r,p,i]);const b=X(x=>{x?o.current.typing||(o.current.typing=x,l==null||l(x)):o.current.typing&&(o.current.typing=x,l==null||l(x))}),v=X(x=>{function S(L,I,F){const C=f?f(I,F):I.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf(F.toLocaleLowerCase()))===0);return C?L.indexOf(C):-1}const P=s.current;if(m.current.length>0&&m.current[0]!==" "&&(S(P,P,m.current)===-1?b(!1):x.key===" "&&je(x)),P==null||g.includes(x.key)||x.key.length!==1||x.ctrlKey||x.metaKey||x.altKey)return;r&&x.key!==" "&&(je(x),b(!0)),P.every(L=>{var I,F;return L?((I=L[0])==null?void 0:I.toLocaleLowerCase())!==((F=L[1])==null?void 0:F.toLocaleLowerCase()):!0})&&m.current===x.key&&(m.current="",R.current=y.current),m.current+=x.key,h.start(d,()=>{m.current="",R.current=y.current,b(!1)});const M=R.current,k=S(P,[...P.slice((M||0)+1),...P.slice(0,(M||0)+1)],m.current);k!==-1?(c==null||c(k),y.current=k):x.key!==" "&&(m.current="",b(!1))}),E=u.useMemo(()=>({onKeyDown:v}),[v]),w=u.useMemo(()=>({onKeyDown:v,onKeyUp(x){x.key===" "&&b(!1)}}),[v,b]);return u.useMemo(()=>a?{reference:E,floating:w}:{},[a,E,w])}function Ms(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,c=s-1;i<s;c=i++){const[l,a]=t[i]||[0,0],[f,d]=t[c]||[0,0];a>=r!=d>=r&&n<=(f-l)*(r-a)/(d-a)+l&&(o=!o)}return o}function Kf(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function hc(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o=new ht;let s=!1,i=null,c=null,l=typeof performance<"u"?performance.now():0;function a(d,g){const p=performance.now(),h=p-l;if(i===null||c===null||h===0)return i=d,c=g,l=p,null;const m=d-i,R=g-c,b=Math.sqrt(m*m+R*R)/h;return i=d,c=g,l=p,b}const f=({x:d,y:g,placement:p,elements:h,onClose:m,nodeId:R,tree:y})=>function(v){function E(){o.clear(),m()}if(o.clear(),!h.domReference||!h.floating||p==null||d==null||g==null)return;const{clientX:w,clientY:x}=v,S=[w,x],P=Ue(v),A=v.type==="mouseleave",M=ve(h.floating,P),k=ve(h.domReference,P),L=h.domReference.getBoundingClientRect(),I=h.floating.getBoundingClientRect(),F=p.split("-")[0],C=d>I.right-I.width/2,_=g>I.bottom-I.height/2,D=Kf(S,L),T=I.width>L.width,O=I.height>L.height,N=(T?L:I).left,J=(T?L:I).right,Y=(O?L:I).top,B=(O?L:I).bottom;if(M&&(s=!0,!A))return;if(k&&(s=!1),k&&!A){s=!0;return}if(A&&Ce(v.relatedTarget)&&ve(h.floating,v.relatedTarget)||y&&Bt(y.nodesRef.current,R).some(({context:$})=>$==null?void 0:$.open))return;if(F==="top"&&g>=L.bottom-1||F==="bottom"&&g<=L.top+1||F==="left"&&d>=L.right-1||F==="right"&&d<=L.left+1)return E();let ce=[];switch(F){case"top":ce=[[N,L.top+1],[N,I.bottom-1],[J,I.bottom-1],[J,L.top+1]];break;case"bottom":ce=[[N,I.top+1],[N,L.bottom-1],[J,L.bottom-1],[J,I.top+1]];break;case"left":ce=[[I.right-1,B],[I.right-1,Y],[L.left+1,Y],[L.left+1,B]];break;case"right":ce=[[L.right-1,B],[L.right-1,Y],[I.left+1,Y],[I.left+1,B]];break}function Q([$,H]){switch(F){case"top":{const W=[T?$+t/2:C?$+t*4:$-t*4,H+t+1],ae=[T?$-t/2:C?$+t*4:$-t*4,H+t+1],ge=[[I.left,C||T?I.bottom-t:I.top],[I.right,C?T?I.bottom-t:I.top:I.bottom-t]];return[W,ae,...ge]}case"bottom":{const W=[T?$+t/2:C?$+t*4:$-t*4,H-t],ae=[T?$-t/2:C?$+t*4:$-t*4,H-t],ge=[[I.left,C||T?I.top+t:I.bottom],[I.right,C?T?I.top+t:I.bottom:I.top+t]];return[W,ae,...ge]}case"left":{const W=[$+t+1,O?H+t/2:_?H+t*4:H-t*4],ae=[$+t+1,O?H-t/2:_?H+t*4:H-t*4];return[...[[_||O?I.right-t:I.left,I.top],[_?O?I.right-t:I.left:I.right-t,I.bottom]],W,ae]}case"right":{const W=[$-t,O?H+t/2:_?H+t*4:H-t*4],ae=[$-t,O?H-t/2:_?H+t*4:H-t*4],ge=[[_||O?I.left+t:I.right,I.top],[_?O?I.left+t:I.right:I.left+t,I.bottom]];return[W,ae,...ge]}default:return[]}}if(!Ms([w,x],ce)){if(s&&!D)return E();if(!A&&r){const $=a(v.clientX,v.clientY);if($!==null&&$<.1)return E()}Ms([w,x],Q([d,g]))?!s&&r&&o.start(40,E):E()}};return f.__options={blockPointerEvents:n},f}const Gf={...Vo,disabled:G(e=>e.disabled),instantType:G(e=>e.instantType),isInstantPhase:G(e=>e.isInstantPhase),trackCursorAxis:G(e=>e.trackCursorAxis),disableHoverablePopup:G(e=>e.disableHoverablePopup),lastOpenChangeReason:G(e=>e.openChangeReason),closeDelay:G(e=>e.closeDelay)};class Bo extends Pr{constructor(n){super({...qf(),...n},{popupRef:u.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Dn},Gf);xe(this,"setOpen",(n,r)=>{var a,f;const o=r.reason,s=o===Je,i=n&&o===oo,c=!n&&(o===dt||o===Sr);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(f=(a=this.context).onOpenChange)==null||f.call(a,n,r),r.isCanceled)return;const l=()=>{var p;const d={open:n,openChangeReason:o};i?d.instantType="focus":c?d.instantType="dismiss":o===Je&&(d.instantType=void 0);const g=((p=r.trigger)==null?void 0:p.id)??null;(g||n)&&(d.activeTriggerId=g,d.activeTriggerElement=r.trigger??null),this.update(d)};s?tt.flushSync(l):l()})}static useStore(n,r){const o=Ke(()=>n??new Bo(r)).current,s=Ho({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=s,o}}function qf(){return{..._o(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function Fp(e){const{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:o=!1,trackCursorAxis:s="none",actionsRef:i,onOpenChange:c,onOpenChangeComplete:l,handle:a,triggerId:f,defaultTriggerId:d=null,children:g}=e,p=Bo.useStore(a==null?void 0:a.store,{open:r??n,activeTriggerId:f!==void 0?f:d});p.useControlledProp("open",r,n),p.useControlledProp("activeTriggerId",f,d),p.useContextCallback("onOpenChange",c),p.useContextCallback("onOpenChangeComplete",l);const h=p.useState("open"),m=p.useState("activeTriggerId"),R=p.useState("payload");p.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:o});const y=!t&&h;Z(()=>{h&&t&&p.setOpen(!1,de(Wu))},[h,t,p]),p.useSyncedValue("disabled",t),Fo(p);const{forceUnmount:b,transitionStatus:v}=No(y,p),E=p.useState("isInstantPhase"),w=p.useState("instantType"),x=p.useState("lastOpenChangeReason"),S=u.useRef(null);Z(()=>{v==="ending"&&x===jt||v!=="ending"&&E?(w!=="delay"&&(S.current=w),p.set("instantType","delay")):S.current!==null&&(p.set("instantType",S.current),S.current=null)},[v,E,x,w,p]),Z(()=>{y&&m==null&&p.set("payload",void 0)},[p,m,y]);const P=u.useCallback(()=>{p.setOpen(!1,Xf(p,Co))},[p]);u.useImperativeHandle(i,()=>({unmount:b,close:P}),[b,P]);const A=p.useState("floatingRootContext"),M=Ff(A,{enabled:!t}),k=Tr(A,{enabled:!t,referencePress:!0}),L=oa(A,{enabled:!t&&s!=="none",axis:s==="none"?void 0:s}),{getReferenceProps:I,getFloatingProps:F,getTriggerProps:C}=Fn([M,k,L]),_=u.useMemo(()=>I(),[I]),D=u.useMemo(()=>C(),[C]),T=u.useMemo(()=>F(),[F]);return p.useSyncedValues({floatingRootContext:A,activeTriggerProps:_,inactiveTriggerProps:D,popupProps:T}),se.jsx(ui.Provider,{value:p,children:typeof g=="function"?g({payload:R}):g})}function Xf(e,t){const n=de(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}let pr=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Zf={[pr.startingStyle]:""},Jf={[pr.endingStyle]:""},Rn={transitionStatus(e){return e==="starting"?Zf:e==="ending"?Jf:null}};let Vt=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=pr.startingStyle]="startingStyle",e[e.endingStyle=pr.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),io=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const Qf={[io.popupOpen]:""},ed={[io.popupOpen]:"",[io.pressed]:""},td={[Vt.open]:""},nd={[Vt.closed]:""},rd={[Vt.anchorHidden]:""},$o={open(e){return e?Qf:null}},mc={open(e){return e?ed:null}},kt={open(e){return e?td:nd},anchorHidden(e){return e?rd:null}};function En(e){return vn(e,"base-ui")}const yc=u.createContext(void 0);function od(){return u.useContext(yc)}const sd=600,Np=u.forwardRef(function(t,n){const{className:r,render:o,handle:s,payload:i,disabled:c,delay:l,closeDelay:a,id:f,...d}=t,g=br(!0),p=(s==null?void 0:s.store)??g;if(!p)throw new Error(Ne(82));const h=En(f),m=p.useState("isTriggerActive",h),R=p.useState("floatingRootContext"),y=p.useState("isOpenedByTrigger",h),b=u.useRef(null),v=l??sd,E=a??0,{registerTrigger:w,isMountedByThisTrigger:x}=uc(h,b,p,{payload:i,closeDelay:E}),S=od(),{delayRef:P,isInstantPhase:A,hasProvider:M}=Ku(R,{open:y});p.useSyncedValue("isInstantPhase",A);const k=p.useState("disabled"),L=c??k,I=p.useState("trackCursorAxis"),F=p.useState("disableHoverablePopup"),C=pc(R,{enabled:!L,mouseOnly:!0,move:!1,handleClose:!F&&I!=="both"?hc():null,restMs(){const O=S==null?void 0:S.delay,N=typeof P.current=="object"?P.current.open:void 0;let J=v;return M&&(N!==0?J=l??O??v:J=0),J},delay(){const O=typeof P.current=="object"?P.current.close:void 0;let N=E;return a==null&&M&&(N=O),{close:N}},triggerElementRef:b,isActiveTrigger:m}),_=u.useMemo(()=>({open:y}),[y]),D=p.useState("triggerProps",x);return Ie("button",t,{state:_,ref:[n,w,b],props:[C,D,{id:h},d],stateAttributesMapping:$o})}),bc=u.createContext(void 0);function id(){const e=u.useContext(bc);if(e===void 0)throw new Error(Ne(70));return e}const cd=u.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,...c}=t,{portalNode:l,portalSubtree:a}=Yi({container:o,ref:n,componentProps:t,elementProps:c});return!a&&!l?null:se.jsxs(u.Fragment,{children:[a,l&&tt.createPortal(r,l)]})}),_p=u.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return br().useState("mounted")||r?se.jsx(bc.Provider,{value:r,children:se.jsx(cd,{ref:n,...o})}):null}),vc=u.createContext(void 0);function ld(){const e=u.useContext(vc);if(e===void 0)throw new Error(Ne(71));return e}const ud=u.createContext(void 0);function Nn(){const e=u.useContext(ud);return(e==null?void 0:e.direction)??"ltr"}const ad=e=>({name:"arrow",options:e,async fn(t){var O,N;const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:a,padding:f=0,offsetParent:d="real"}=mt(e,t)||{};if(a==null)return{};const g=Si(f),p={x:n,y:r},h=wo(o),m=So(h),R=await i.getDimensions(a),y=h==="y",b=y?"top":"left",v=y?"bottom":"right",E=y?"clientHeight":"clientWidth",w=s.reference[m]+s.reference[h]-p[h]-s.floating[m],x=p[h]-s.reference[h],S=d==="real"?await((O=i.getOffsetParent)==null?void 0:O.call(i,a)):c.floating;let P=c.floating[E]||s.floating[m];(!P||!await((N=i.isElement)==null?void 0:N.call(i,S)))&&(P=c.floating[E]||s.floating[m]);const A=w/2-x/2,M=P/2-R[m]/2-1,k=Math.min(g[b],M),L=Math.min(g[v],M),I=k,F=P-R[m]-L,C=P/2-R[m]/2+A,_=xi(I,C,F),D=!l.arrow&&Mt(o)!=null&&C!==_&&s.reference[m]/2-(C<I?k:L)-R[m]/2<0,T=D?C<I?C-I:C-F:0;return{[h]:p[h]+T,data:{[h]:_,centerOffset:C-_-T,...D&&{alignmentOffset:T}},reset:D}}}),fd=(e,t)=>({...ad(e),options:[e,t]}),dd={name:"hide",async fn(e){var c;const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:((c=(await Ya().fn(e)).data)==null?void 0:c.referenceHidden)||s}}}},or={sideX:"left",sideY:"top"},Rc={name:"adaptiveOrigin",async fn(e){var b,v;const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:c}=e,l=Ae(o),a=l.getComputedStyle(o);if(!(a.transitionDuration!=="0s"&&a.transitionDuration!==""))return{x:t,y:n,data:or};const d=await((b=s.getOffsetParent)==null?void 0:b.call(s,o));let g={width:0,height:0};if(i==="fixed"&&(l!=null&&l.visualViewport))g={width:l.visualViewport.width,height:l.visualViewport.height};else if(d===l){const E=lt(o);g={width:E.documentElement.clientWidth,height:E.documentElement.clientHeight}}else await((v=s.isElement)==null?void 0:v.call(s,d))&&(g=await s.getDimensions(d));const p=et(c);let h=t,m=n;p==="left"&&(h=g.width-(t+r.width)),p==="top"&&(m=g.height-(n+r.height));const R=p==="left"?"right":or.sideX,y=p==="top"?"bottom":or.sideY;return{x:h,y:m,data:{sideX:R,sideY:y}}}};function Ec(e,t,n){const 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 As(e,t,n){const{rects:r,placement:o}=e;return{side:Ec(t,et(o),n),align:Mt(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function jo(e){var Gt,qt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:l=5,sticky:a=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,keepMounted:g=!1,floatingRootContext:p,mounted:h,collisionAvoidance:m,shiftCrossAxis:R=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:v=!1,externalTree:E}=e,[w,x]=u.useState(null);!h&&w!==null&&x(null);const S=m.side||"flip",P=m.align||"flip",A=m.fallbackAxisSide||"end",M=typeof t=="function"?t:void 0,k=X(M),L=M?k:t,I=Fe(t),C=Nn()==="rtl",_=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":C?"left":"right","inline-start":C?"right":"left"}[r],D=s==="center"?_:`${_}-${s}`;let T=l;const O=1,N=r==="bottom"?O:0,J=r==="top"?O:0,Y=r==="right"?O:0,B=r==="left"?O:0;typeof T=="number"?T={top:T+N,right:T+B,bottom:T+J,left:T+Y}:T&&(T={top:(T.top||0)+N,right:(T.right||0)+B,bottom:(T.bottom||0)+J,left:(T.left||0)+Y});const ce={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:T},Q=u.useRef(null),$=Fe(o),H=Fe(i),ge=[$a(Te=>{const Oe=As(Te,r,C),ze=typeof $.current=="function"?$.current(Oe):$.current,He=typeof H.current=="function"?H.current(Oe):H.current;return{mainAxis:ze,crossAxis:He,alignmentAxis:He}},[typeof o!="function"?o:0,typeof i!="function"?i:0,C,r])],V=P==="none"&&S!=="shift",ee=!V&&(a||R||S==="shift"),q=S==="none"?null:Wa({...ce,padding:{top:T.top+O,right:T.right+O,bottom:T.bottom+O,left:T.left+O},mainAxis:!R&&S==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:A}),Se=V?null:ja(Te=>{const Oe=lt(Te.elements.floating).documentElement;return{...ce,rootBoundary:R?{x:0,y:0,width:Oe.clientWidth,height:Oe.clientHeight}:void 0,mainAxis:P!=="none",crossAxis:ee,limiter:a||R?void 0:Ua(ze=>{if(!Q.current)return{};const{width:He,height:ot}=Q.current.getBoundingClientRect(),Xe=rt(et(ze.placement)),ut=Xe==="y"?He:ot,Ft=Xe==="y"?T.left+T.right:T.top+T.bottom;return{offset:ut/2+Ft/2}})}},[ce,a,R,T,P]);S==="shift"||P==="shift"||s==="center"?ge.push(Se,q):ge.push(q,Se),ge.push(za({...ce,apply({elements:{floating:Te},rects:{reference:Oe},availableWidth:ze,availableHeight:He}){Object.entries({"--available-width":`${ze}px`,"--available-height":`${He}px`,"--anchor-width":`${Oe.width}px`,"--anchor-height":`${Oe.height}px`}).forEach(([ot,Xe])=>{Te.style.setProperty(ot,Xe)})}}),fd(()=>({element:Q.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Te){var Qo,es,ts;const{elements:Oe,middlewareData:ze,placement:He,rects:ot,y:Xe}=Te,ut=et(He),Ft=rt(ut),pe=Q.current,Ve=((Qo=ze.arrow)==null?void 0:Qo.x)||0,Ze=((es=ze.arrow)==null?void 0:es.y)||0,at=(pe==null?void 0:pe.clientWidth)||0,st=(pe==null?void 0:pe.clientHeight)||0,vt=Ve+at/2,Ir=Ze+st/2,qc=Math.abs(((ts=ze.shift)==null?void 0:ts.y)||0),Xc=ot.reference.height/2,xn=typeof o=="function"?o(As(Te,r,C)):o,Zc=qc>xn,Jc={top:`${vt}px calc(100% + ${xn}px)`,bottom:`${vt}px ${-xn}px`,left:`calc(100% + ${xn}px) ${Ir}px`,right:`${-xn}px ${Ir}px`}[ut],Qc=`${vt}px ${ot.reference.y+Xc-Xe}px`;return Oe.floating.style.setProperty("--transform-origin",ee&&Ft==="y"&&Zc?Qc:Jc),{}}},dd,b),Z(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,p]);const le=u.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:j,elements:te,x:ie,y:oe,middlewareData:ue,update:U,placement:ne,context:z,isPositioned:re,floatingStyles:K}=Df({rootContext:p,placement:D,middleware:ge,strategy:n,whileElementsMounted:g?void 0:(...Te)=>Ts(...Te,le),nodeId:y,externalTree:E}),{sideX:be,sideY:Re}=ue.adaptiveOrigin||or,me=re?n:"fixed",Ee=u.useMemo(()=>b?{position:me,[be]:ie,[Re]:oe}:{position:me,...K},[b,me,be,ie,Re,oe,K]),we=u.useRef(null);Z(()=>{if(!h)return;const Te=I.current,Oe=typeof Te=="function"?Te():Te,He=(ks(Oe)?Oe.current:Oe)||null||null;He!==we.current&&(j.setPositionReference(He),we.current=He)},[h,j,L,I]),u.useEffect(()=>{if(!h)return;const Te=I.current;typeof Te!="function"&&ks(Te)&&Te.current!==we.current&&(j.setPositionReference(Te.current),we.current=Te.current)},[h,j,L,I]),u.useEffect(()=>{if(g&&h&&te.domReference&&te.floating)return Ts(te.domReference,te.floating,U,le)},[g,h,te,U,le]);const ke=et(ne),De=Ec(r,ke,C),_e=Mt(ne)||"center",qe=!!((Gt=ue.hide)!=null&&Gt.referenceHidden);Z(()=>{v&&h&&re&&x(ke)},[v,h,re,ke]);const bt=u.useMemo(()=>{var Te,Oe;return{position:"absolute",top:(Te=ue.arrow)==null?void 0:Te.y,left:(Oe=ue.arrow)==null?void 0:Oe.x}},[ue.arrow]),Dt=((qt=ue.arrow)==null?void 0:qt.centerOffset)!==0;return u.useMemo(()=>({positionerStyles:Ee,arrowStyles:bt,arrowRef:Q,arrowUncentered:Dt,side:De,align:_e,physicalSide:ke,anchorHidden:qe,refs:j,context:z,isPositioned:re,update:U}),[Ee,bt,Q,Dt,De,_e,ke,qe,j,z,re,U])}function ks(e){return e!=null&&"current"in e}function _n(e){return e==="starting"?Hl:Be}const Vp=u.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:c="top",align:l="center",sideOffset:a=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:g=5,arrowPadding:p=5,sticky:h=!1,disableAnchorTracking:m=!1,collisionAvoidance:R=li,...y}=t,b=br(),v=id(),E=b.useState("open"),w=b.useState("mounted"),x=b.useState("trackCursorAxis"),S=b.useState("disableHoverablePopup"),P=b.useState("floatingRootContext"),A=b.useState("instantType"),M=b.useState("transitionStatus"),k=jo({anchor:s,positionMethod:i,floatingRootContext:P,mounted:w,side:c,sideOffset:a,align:l,alignOffset:f,collisionBoundary:d,collisionPadding:g,sticky:h,arrowPadding:p,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:R,adaptiveOrigin:Rc}),L=u.useMemo(()=>{const _={};return(!E||x==="both"||S)&&(_.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...k.positionerStyles,..._}}},[E,x,S,w,k.positionerStyles]),I=u.useMemo(()=>({open:E,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:x!=="none"?"tracking-cursor":A}),[E,k.side,k.align,k.anchorHidden,x,A]),F=u.useMemo(()=>({...I,arrowRef:k.arrowRef,arrowStyles:k.arrowStyles,arrowUncentered:k.arrowUncentered}),[I,k.arrowRef,k.arrowStyles,k.arrowUncentered]),C=Ie("div",t,{state:I,props:[L,_n(M),y],ref:[n,b.useStateSetter("positionerElement")],stateAttributesMapping:kt});return se.jsx(vc.Provider,{value:F,children:C})});function Ls(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Me(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r;return(un(n)!==s||un(r)!==i)&&(n=s,r=i),{width:n,height:r}}const pd=typeof ResizeObserver<"u",gd=()=>!0;function xc(e){const{popupElement:t,positionerElement:n,content:r,mounted:o,enabled:s=gd,onMeasureLayout:i,onMeasureLayoutComplete:c,side:l,direction:a}=e,f=u.useRef(!0),d=Do(t,!0,!1),g=Ln(),p=u.useRef(null),h=X(i),m=X(c),R=u.useMemo(()=>{let y=l==="top",b=l==="left";return a==="rtl"?(y=y||l==="inline-end",b=b||l==="inline-end"):(y=y||l==="inline-start",b=b||l==="inline-start"),y?{position:"absolute",[l==="top"?"bottom":"top"]:"0",[b?"right":"left"]:"0"}:Be},[l,a]);Z(()=>{if(!o||!s()||!pd){f.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(R).forEach(([A,M])=>{t.style.setProperty(A,M)});const y=new ResizeObserver(A=>{const M=A[0];M&&(p.current===null?p.current={width:Math.ceil(M.borderBoxSize[0].inlineSize),height:Math.ceil(M.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(M.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(M.borderBoxSize[0].blockSize)))});y.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const b=wn(t,"position","static"),v=wn(t,"transform","none"),E=wn(t,"scale","1"),w=wn(n,"--available-width","max-content"),x=wn(n,"--available-height","max-content");if(h==null||h(),f.current||p.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const A=Ls(t);return n.style.setProperty("--positioner-width",`${A.width}px`),n.style.setProperty("--positioner-height",`${A.height}px`),b(),v(),E(),w(),x(),m==null||m(null,A),f.current=!1,()=>{y.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const S=Ls(t);t.style.setProperty("--popup-width",`${p.current.width}px`),t.style.setProperty("--popup-height",`${p.current.height}px`),b(),v(),w(),x(),m==null||m(p.current,S),n.style.setProperty("--positioner-width",`${S.width}px`),n.style.setProperty("--positioner-height",`${S.height}px`);const P=new AbortController;return g.request(()=>{t.style.setProperty("--popup-width",`${S.width}px`),t.style.setProperty("--popup-height",`${S.height}px`),d(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},P.signal)}),()=>{y.disconnect(),P.abort(),g.cancel()}},[r,t,n,d,g,s,o,h,m,R])}function wn(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}const hd={...kt,...Rn},Hp=u.forwardRef(function(t,n){const{className:r,render:o,...s}=t,i=br(),{side:c,align:l}=ld(),a=i.useState("open"),f=i.useState("mounted"),d=i.useState("instantType"),g=i.useState("transitionStatus"),p=i.useState("popupProps"),h=i.useState("payload"),m=i.useState("popupElement"),R=i.useState("positionerElement"),y=i.useState("floatingRootContext"),b=Nn();Yt({open:a,ref:i.context.popupRef,onComplete(){var M,k;a&&((k=(M=i.context).onOpenChangeComplete)==null||k.call(M,!0))}});function v(){y.context.events.emit("measure-layout")}function E(M,k){y.context.events.emit("measure-layout-complete",{previousDimensions:M,nextDimensions:k})}const w=u.useCallback(()=>i.context.triggerElements.size>1,[i]);xc({popupElement:m,positionerElement:R,mounted:f,content:h,enabled:w,onMeasureLayout:v,onMeasureLayoutComplete:E,side:c,direction:b});const x=i.useState("disabled"),S=i.useState("closeDelay");dc(y,{enabled:!x,closeDelay:S});const P=u.useMemo(()=>({open:a,side:c,align:l,instant:d,transitionStatus:g}),[a,c,l,d,g]);return Ie("div",t,{state:P,ref:[n,i.context.popupRef,i.useStateSetter("popupElement")],props:[p,_n(g),s],stateAttributesMapping:hd})}),Bp=function(t){const{delay:n,closeDelay:r,timeout:o=400}=t,s=u.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),i=u.useMemo(()=>({open:n,close:r}),[n,r]);return se.jsx(yc.Provider,{value:s,children:se.jsx(Yu,{delay:i,timeoutMs:o,children:t.children})})};function Uo(e){return mo(19)?e:e?"true":void 0}const Sc=u.createContext(void 0);function Kt(e){const t=u.useContext(Sc);if(e===!1&&t===void 0)throw new Error(Ne(27));return t}const md={...kt,...Rn},$p=u.forwardRef(function(t,n){const{render:r,className:o,forceRender:s=!1,...i}=t,{store:c}=Kt(),l=c.useState("open"),a=c.useState("nested"),f=c.useState("mounted"),d=c.useState("transitionStatus"),g=u.useMemo(()=>({open:l,transitionStatus:d}),[l,d]);return Ie("div",t,{state:g,ref:[c.context.backdropRef,n],stateAttributesMapping:md,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!a})}),wc=u.createContext(void 0);function Tc(e=!1){const t=u.useContext(wc);if(t===void 0&&!e)throw new Error(Ne(16));return t}function yd(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,c=r&&t===!1;return{props:u.useMemo(()=>{const a={onKeyDown(f){n&&t&&f.key!=="Tab"&&f.preventDefault()}};return r||(a.tabIndex=o,!s&&n&&(a.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(a["aria-disabled"]=n),s&&(!t||c)&&(a.disabled=n),a},[r,n,t,i,c,s,o])}}function Vn(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=u.useRef(null),i=Tc(!0)!==void 0,c=X(()=>{const g=s.current;return!!((g==null?void 0:g.tagName)==="A"&&(g!=null&&g.href))}),{props:l}=yd({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:o}),a=u.useCallback(()=>{const g=s.current;bd(g)&&i&&t&&l.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,l.disabled,i]);Z(a,[a]);const f=u.useCallback((g={})=>{const{onClick:p,onMouseDown:h,onKeyUp:m,onKeyDown:R,onPointerDown:y,...b}=g;return yr({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}p==null||p(E)},onMouseDown(E){t||h==null||h(E)},onKeyDown(E){if(t||(Gr(E),R==null||R(E)),E.baseUIHandlerPrevented)return;const w=E.target===E.currentTarget&&!o&&!c()&&!t,x=E.key==="Enter",S=E.key===" ";w&&((S||x)&&E.preventDefault(),x&&(p==null||p(E)))},onKeyUp(E){t||(Gr(E),m==null||m(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&(p==null||p(E))},onPointerDown(E){if(t){E.preventDefault();return}y==null||y(E)}},o?void 0:{role:"button"},l,b)},[t,l,o,c]),d=X(g=>{s.current=g,a()});return{getButtonProps:f,buttonRef:d}}function bd(e){return Me(e)&&e.tagName==="BUTTON"}const jp=u.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,...c}=t,{store:l}=Kt(),a=l.useState("open");function f(h){a&&l.setOpen(!1,de(ju,h.nativeEvent))}const{getButtonProps:d,buttonRef:g}=Vn({disabled:s,native:i}),p=u.useMemo(()=>({disabled:s}),[s]);return Ie("button",t,{state:p,ref:[n,g],props:[{onClick:f},c,d]})}),Up=u.forwardRef(function(t,n){const{render:r,className:o,id:s,...i}=t,{store:c}=Kt(),l=En(s);return c.useSyncedValueWithCleanup("descriptionElementId",l),Ie("p",t,{ref:n,props:[{id:l},i]})});let vd=function(e){return e.nestedDialogs="--nested-dialogs",e}({}),Rd=function(e){return e[e.open=Vt.open]="open",e[e.closed=Vt.closed]="closed",e[e.startingStyle=Vt.startingStyle]="startingStyle",e[e.endingStyle=Vt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({});const Cc=u.createContext(void 0);function Ed(){const e=u.useContext(Cc);if(e===void 0)throw new Error(Ne(26));return e}const on="ArrowUp",Ht="ArrowDown",Mn="ArrowLeft",sn="ArrowRight",Hn="Home",Bn="End",Pc=new Set([Mn,sn]),xd=new Set([Mn,sn,Hn,Bn]),Oc=new Set([on,Ht]),Sd=new Set([on,Ht,Hn,Bn]),Ic=new Set([...Pc,...Oc]),wd=new Set([...Ic,Hn,Bn]),Wo=new Set([on,Ht,Mn,sn,Hn,Bn]),Td="Shift",Cd="Control",Pd="Alt",Od="Meta",Id=new Set([Td,Cd,Pd,Od]);function Md(e){return Me(e)&&e.tagName==="INPUT"}function Ds(e){return!!(Md(e)&&e.selectionStart!=null||Me(e)&&e.tagName==="TEXTAREA")}function Fs(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const l=Ns(e,t,"left"),a=Zn(e),f=Zn(t);n==="ltr"&&(l+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?o=l+t.offsetWidth+f.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:l-f.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(o=l-f.scrollMarginLeft-a.scrollPaddingLeft)),n==="rtl"&&(l-f.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?o=l-f.scrollMarginLeft-a.scrollPaddingLeft:l+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(o=l+t.offsetWidth+f.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(c&&r!=="horizontal"){const l=Ns(e,t,"top"),a=Zn(e),f=Zn(t);l-f.scrollMarginTop<e.scrollTop+a.scrollPaddingTop?s=l-f.scrollMarginTop-a.scrollPaddingTop:l+t.offsetHeight+f.scrollMarginBottom>e.scrollTop+e.clientHeight-a.scrollPaddingBottom&&(s=l+t.offsetHeight+f.scrollMarginBottom-e.clientHeight+a.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Ns(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function Zn(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Ad={...kt,...Rn,nestedDialogOpen(e){return e?{[Rd.nestedDialogOpen]:""}:null}},Wp=u.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,...c}=t,{store:l}=Kt(),a=l.useState("descriptionElementId"),f=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),g=l.useState("popupProps"),p=l.useState("modal"),h=l.useState("mounted"),m=l.useState("nested"),R=l.useState("nestedOpenDialogCount"),y=l.useState("open"),b=l.useState("openMethod"),v=l.useState("titleElementId"),E=l.useState("transitionStatus"),w=l.useState("role");Ed(),Yt({open:y,ref:l.context.popupRef,onComplete(){var k,L;y&&((L=(k=l.context).onOpenChangeComplete)==null||L.call(k,!0))}});function x(k){return k==="touch"?l.context.popupRef.current:!0}const S=s===void 0?x:s,P=R>0,A=u.useMemo(()=>({open:y,nested:m,transitionStatus:E,nestedDialogOpen:P}),[y,m,E,P]),M=Ie("div",t,{state:A,props:[g,{"aria-labelledby":v??void 0,"aria-describedby":a??void 0,role:w,tabIndex:-1,hidden:!h,onKeyDown(k){Wo.has(k.key)&&k.stopPropagation()},style:{[vd.nestedDialogs]:R}},c],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:Ad});return se.jsx(Mo,{context:d,openInteractionType:b,disabled:!h,closeOnFocusOut:!f,initialFocus:S,returnFocus:o,modal:p!==!1,restoreFocus:"popup",children:M})}),zo=u.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r==null?void 0:r.getBoundingClientRect();s=`polygon(
|
|
45
|
-
0% 0%,
|
|
46
|
-
100% 0%,
|
|
47
|
-
100% 100%,
|
|
48
|
-
0% 100%,
|
|
49
|
-
0% 0%,
|
|
50
|
-
${i.left}px ${i.top}px,
|
|
51
|
-
${i.left}px ${i.bottom}px,
|
|
52
|
-
${i.right}px ${i.bottom}px,
|
|
53
|
-
${i.right}px ${i.top}px,
|
|
54
|
-
${i.left}px ${i.top}px
|
|
55
|
-
)`}return se.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),zp=u.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Kt(),i=s.useState("mounted"),c=s.useState("modal");return i||r?se.jsx(Cc.Provider,{value:r,children:se.jsxs(Oo,{ref:n,...o,children:[i&&c===!0&&se.jsx(zo,{ref:s.context.internalBackdropRef,inert:Uo(!open)}),t.children]})}):null});let _s={},Vs={},Hs="";function kd(e){if(typeof document>"u")return!1;const t=lt(e);return Ae(t).innerWidth-t.documentElement.clientWidth>0}function Ld(e){const t=lt(e),n=t.documentElement,r=t.body,o=mn(n)?n:r,s=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=s}}function Dd(e){var g,p;const t=lt(e),n=t.documentElement,r=t.body,o=Ae(n);let s=0,i=0;const c=ft.create(),l=typeof CSS<"u"&&((g=CSS.supports)==null?void 0:g.call(CSS,"scrollbar-gutter","stable"));if(pi&&(((p=o.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function a(){const h=o.getComputedStyle(n),m=o.getComputedStyle(r),b=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,_s={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Hs=n.style.scrollBehavior,Vs={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const v=n.scrollHeight>n.clientHeight,E=n.scrollWidth>n.clientWidth,w=h.overflowY==="scroll"||m.overflowY==="scroll",x=h.overflowX==="scroll"||m.overflowX==="scroll",S=Math.max(0,o.innerWidth-n.clientWidth),P=Math.max(0,o.innerHeight-n.clientHeight),A=parseFloat(m.marginTop)+parseFloat(m.marginBottom),M=parseFloat(m.marginLeft)+parseFloat(m.marginRight),k=mn(n)?n:r;if(l){n.style.scrollbarGutter=b,k.style.overflowY="hidden",k.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(v||w)&&(n.style.overflowY="scroll"),(E||x)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:A||P?`calc(100dvh - ${A+P}px)`:"100dvh",width:M||S?`calc(100vw - ${M+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,_s),Object.assign(r.style,Vs),l||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Hs)}function d(){f(),c.request(a)}return a(),o.addEventListener("resize",d),()=>{c.cancel(),f(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",d)}}class Fd{constructor(){xe(this,"lockCount",0);xe(this,"restore",null);xe(this,"timeoutLock",ht.create());xe(this,"timeoutUnlock",ht.create());xe(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});xe(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=lt(t).documentElement,o=Ae(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Qe;return}const s=tu||!kd(t);this.restore=s?Ld(t):Dd(t)}}const Nd=new Fd;function Yo(e=!0,t=null){Z(()=>{if(e)return Nd.acquire(t)},[e,t])}function _d(e){const t=u.useRef(""),n=u.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:u.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Ko(e){const[t,n]=u.useState(null),r=X((c,l)=>{e||n(l)}),o=u.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=_d(r);return u.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:i}}),[t,o,s,i])}function Vd(e){const{store:t,parentContext:n,actionsRef:r}=e,o=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),c=t.useState("popupElement"),{openMethod:l,triggerProps:a,reset:f}=Ko(o);Fo(t);const{forceUnmount:d}=No(o,t,()=>{f()}),g=X(M=>{const k=de(M);return k.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},k}),p=u.useCallback(()=>{t.setOpen(!1,g(Co))},[t,g]);u.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);const h=Ho({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,R]=u.useState(0),y=m===0,b=gc(h),v=Tr(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(M){if("button"in M&&M.button!==0||"touches"in M&&M.touches.length!==1)return!1;const k=Ue(M);if(y&&!s){const L=k;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===L||t.context.backdropRef.current===L||ve(L,c)&&!(L!=null&&L.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:y});Yo(o&&i===!0,c);const{getReferenceProps:E,getFloatingProps:w,getTriggerProps:x}=Fn([b,v]);t.useContextCallback("onNestedDialogOpen",M=>{R(M+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),u.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&o&&n.onNestedDialogOpen(m),n!=null&&n.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,m]);const S=u.useMemo(()=>E(a),[E,a]),P=u.useMemo(()=>x(a),[x,a]),A=u.useMemo(()=>w(),[w]);t.useSyncedValues({openMethod:l,activeTriggerProps:S,inactiveTriggerProps:P,popupProps:A,floatingRootContext:h,nestedOpenDialogCount:m})}const Hd={...Vo,modal:G(e=>e.modal),nested:G(e=>e.nested),nestedOpenDialogCount:G(e=>e.nestedOpenDialogCount),disablePointerDismissal:G(e=>e.disablePointerDismissal),openMethod:G(e=>e.openMethod),descriptionElementId:G(e=>e.descriptionElementId),titleElementId:G(e=>e.titleElementId),viewportElement:G(e=>e.viewportElement),role:G(e=>e.role)};class Bd extends Pr{constructor(n){super($d(n),{popupRef:u.createRef(),backdropRef:u.createRef(),internalBackdropRef:u.createRef(),triggerElements:new Dn,onOpenChange:void 0,onOpenChangeComplete:void 0},Hd);xe(this,"setOpen",(n,r)=>{var c,l,a,f;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(l=(c=this.context).onOpenChange)==null||l.call(c,n,r),r.isCanceled)return;const o={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(a=this.state.floatingRootContext.context.events)==null||a.emit("openchange",o);const s={open:n},i=((f=r.trigger)==null?void 0:f.id)??null;(i||n)&&(s.activeTriggerId=i,s.activeTriggerElement=r.trigger??null),this.update(s)})}}function $d(e={}){return{..._o(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function Yp(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:l,handle:a,triggerId:f,defaultTriggerId:d=null}=e,g=Kt(!0),p=!!g,h=Ke(()=>(a==null?void 0:a.store)??new Bd({open:n??r,activeTriggerId:f!==void 0?f:d,modal:c,disablePointerDismissal:i,nested:p})).current;h.useControlledProp("open",n,r),h.useControlledProp("activeTriggerId",f,d),h.useSyncedValues({disablePointerDismissal:i,nested:p,modal:c}),h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",s);const m=h.useState("payload");Vd({store:h,actionsRef:l,parentContext:g==null?void 0:g.store.context});const R=u.useMemo(()=>({store:h}),[h]);return se.jsx(Sc.Provider,{value:R,children:typeof t=="function"?t({payload:m}):t})}const Kp=u.forwardRef(function(t,n){const{render:r,className:o,id:s,...i}=t,{store:c}=Kt(),l=En(s);return c.useSyncedValueWithCleanup("titleElementId",l),Ie("h2",t,{ref:n,props:[{id:l},i]})});function jd(e){const t=u.useRef(!0);t.current&&(t.current=!1,e())}function co({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=u.useRef(e!==void 0),[s,i]=u.useState(t),c=o?e:s,l=u.useCallback(a=>{o||i(a)},[]);return[c,l]}const Mc=u.createContext(null),Ac=u.createContext(null);function Lt(){const e=u.useContext(Mc);if(e===null)throw new Error(Ne(60));return e}function kc(){const e=u.useContext(Ac);if(e===null)throw new Error(Ne(61));return e}let Bs=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const Ud={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Wd={valid(e){return e===null?null:e?{[Bs.valid]:""}:{[Bs.invalid]:""}}},zd=u.createContext({invalid:void 0,name:void 0,validityData:{state:Ud,errors:[],error:"",value:"",initialValue:null},setValidityData:Qe,disabled:void 0,touched:!1,setTouched:Qe,dirty:!1,setDirty:Qe,filled:!1,setFilled:Qe,focused:!1,setFocused:Qe,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Be)=>e,getInputValidationProps:(e=Be)=>e,inputRef:{current:null},commit:async()=>{}}});function Go(e=!0){const t=u.useContext(zd);if(t.setValidityData===Qe&&!e)throw new Error(Ne(28));return t}const Yd=u.createContext({controlId:void 0,setControlId:Qe,labelId:void 0,setLabelId:Qe,messageIds:[],setMessageIds:Qe,getDescriptionProps:e=>e});function qo(){return u.useContext(Yd)}function Kd(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,setControlId:s}=qo(),i=En(t);return Z(()=>{if(!(!n&&!t||s===Qe)){if(n){const c=r==null?void 0:r.current;Ce(c)&&c.closest("label")!=null?s(t??null):s(o??i)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,r,o,s,n,i]),o??i}const Gd=(e,t)=>Object.is(e,t);function gn(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Wr(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:gn(r,t,n))}function lo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:gn(r,t,n))}function qd(e,t,n){return e.filter(r=>!gn(r,t,n))}function uo(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Xd(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Cn(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return uo(e)}function Zt(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?uo(e.value):uo(e)}function Zd(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??Cn(e,n);if(Array.isArray(t)){const r=Xd(t)?t.flatMap(o=>o.items):t;if(e==null){const o=r.find(s=>s.value==null);return o&&o.label!=null?o.label:Cn(e,n)}if(typeof e!="object"){const o=r.find(s=>s&&s.value===e);return o&&o.label!=null?o.label:Cn(e,n)}if("value"in e){const o=r.find(s=>s&&s.value===e.value);if(o&&o.label!=null)return o.label}}return Cn(e,n)}function Jd(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>Cn(n,t)).join(", ")}const he={id:G(e=>e.id),modal:G(e=>e.modal),multiple:G(e=>e.multiple),items:G(e=>e.items),itemToStringLabel:G(e=>e.itemToStringLabel),itemToStringValue:G(e=>e.itemToStringValue),isItemEqualToValue:G(e=>e.isItemEqualToValue),value:G(e=>e.value),open:G(e=>e.open),mounted:G(e=>e.mounted),forceMount:G(e=>e.forceMount),transitionStatus:G(e=>e.transitionStatus),openMethod:G(e=>e.openMethod),activeIndex:G(e=>e.activeIndex),selectedIndex:G(e=>e.selectedIndex),isActive:G((e,t)=>e.activeIndex===t),isSelected:G((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(s=>gn(s,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:gn(o,n,r)}),isSelectedByFocus:G((e,t)=>e.selectedIndex===t),popupProps:G(e=>e.popupProps),triggerProps:G(e=>e.triggerProps),triggerElement:G(e=>e.triggerElement),positionerElement:G(e=>e.positionerElement),listElement:G(e=>e.listElement),scrollUpArrowVisible:G(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:G(e=>e.scrollDownArrowVisible),hasScrollArrows:G(e=>e.hasScrollArrows),serializedValue:G(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?"":Zt(n,r)})},Qd=u.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Qe,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Lc(){return u.useContext(Qd)}function ep(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function tp(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:s,commit:i}=e,{formRef:c}=Lc(),{invalid:l,markedDirtyRef:a,validityData:f,setValidityData:d}=Go(),g=X(e.getValue);Z(()=>{if(!t)return;let p=n;p===void 0&&(p=g()),f.initialValue===null&&p!==null&&d(h=>({...h,initialValue:p}))},[t,d,n,f.initialValue,g]),Z(()=>{!t||!r||c.current.fields.set(r,{getValue:g,name:o,controlRef:s,validityData:ep(f,l),validate(){let p=n;p===void 0&&(p=g()),a.current=!0,tt.flushSync(()=>i(p))}})},[i,s,t,c,g,r,l,a,o,f,n]),Z(()=>{const p=c.current.fields;return()=>{r&&p.delete(r)}},[c,r])}function np(e,t){const n=u.useRef(e),r=X(t);Z(()=>{n.current!==e&&r(n.current)},[e,r]),Z(()=>{n.current=e},[e])}function Gp(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:c,name:l,disabled:a=!1,readOnly:f=!1,required:d=!1,modal:g=!0,actionsRef:p,inputRef:h,onOpenChangeComplete:m,items:R,multiple:y=!1,itemToStringLabel:b,itemToStringValue:v,isItemEqualToValue:E=Gd,highlightItemOnHover:w=!0,children:x}=e,{clearErrors:S}=Lc(),{setDirty:P,shouldValidateOnChange:A,validityData:M,setFilled:k,name:L,disabled:I,validation:F}=Go(),{controlId:C}=qo(),_=Kd({id:t}),D=I||a,T=L??l,[O,N]=co({controlled:n,default:y?r??cn:r,name:"Select",state:"value"}),[J,Y]=co({controlled:s,default:i,name:"Select",state:"open"}),B=u.useRef([]),ce=u.useRef([]),Q=u.useRef(null),$=u.useRef(null),H=u.useRef(0),W=u.useRef(null),ae=u.useRef([]),ge=u.useRef(!1),V=u.useRef(!1),ee=u.useRef(null),q=u.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Se=u.useRef(!1),{mounted:le,setMounted:j,transitionStatus:te}=Lo(J),{openMethod:ie,triggerProps:oe,reset:ue}=Ko(J),U=Ke(()=>new rn({id:_,modal:g,multiple:y,itemToStringLabel:b,itemToStringValue:v,isItemEqualToValue:E,value:O,open:J,mounted:le,transitionStatus:te,items:R,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ne=ye(U,he.activeIndex),z=ye(U,he.selectedIndex),re=ye(U,he.triggerElement),K=ye(U,he.positionerElement),be=u.useMemo(()=>y&&Array.isArray(O)&&O.length===0?"":Zt(O,v),[y,O,v]),Re=u.useMemo(()=>y&&Array.isArray(O)?O.map(pe=>Zt(pe,v)):Zt(O,v),[y,O,v]),me=Fe(U.state.triggerElement);tp({id:_,commit:F.commit,value:O,controlRef:me,name:T,getValue:()=>Re});const Ee=u.useRef(O);Z(()=>{O!==Ee.current&&U.set("forceMount",!0)},[U,O]),Z(()=>{k(O!==null)},[O,k]),Z(function(){if(J)return;const Ve=ae.current;if(y){const at=Array.isArray(O)?O:[];if(at.length===0){U.set("selectedIndex",null);return}const st=at[at.length-1],vt=lo(Ve,st,E);U.set("selectedIndex",vt===-1?null:vt);return}const Ze=lo(Ve,O,E);U.set("selectedIndex",Ze===-1?null:Ze)},[y,J,O,ae,E,U]),np(O,()=>{S(T),P(O!==M.initialValue),A()?F.commit(O):F.commit(O,!0)});const we=X((pe,Ve)=>{if(c==null||c(pe,Ve),!Ve.isCanceled&&(Y(pe),!pe&&U.state.activeIndex!==null)){const Ze=B.current[U.state.activeIndex];queueMicrotask(()=>{Ze==null||Ze.setAttribute("tabindex","-1")})}}),ke=X(()=>{j(!1),U.set("activeIndex",null),ue(),m==null||m(!1)});Yt({enabled:!p,open:J,ref:Q,onComplete(){J||ke()}}),u.useImperativeHandle(p,()=>({unmount:ke}),[ke]);const De=X((pe,Ve)=>{o==null||o(pe,Ve),!Ve.isCanceled&&N(pe)}),_e=X(()=>{const pe=U.state.listElement||Q.current;if(!pe)return;const Ve=pe.scrollTop,Ze=pe.scrollTop+pe.clientHeight,at=Ve>1,st=Ze<pe.scrollHeight-1;U.state.scrollUpArrowVisible!==at&&U.set("scrollUpArrowVisible",at),U.state.scrollDownArrowVisible!==st&&U.set("scrollDownArrowVisible",st)}),qe=ac({open:J,onOpenChange:we,elements:{reference:re,floating:K}}),bt=Ki(qe,{enabled:!f&&!D,event:"mousedown"}),Dt=Tr(qe,{bubbles:!1}),Gt=Wf(qe,{enabled:!f&&!D,listRef:B,activeIndex:ne,selectedIndex:z,disabledIndices:cn,onNavigate(pe){pe===null&&!J||U.set("activeIndex",pe)},focusItemOnHover:!1}),qt=Yf(qe,{enabled:!f&&!D&&(J||!y),listRef:ce,activeIndex:ne,selectedIndex:z,onMatch(pe){J?U.set("activeIndex",pe):De(ae.current[pe],de("none"))},onTypingChange(pe){ge.current=pe}}),{getReferenceProps:Te,getFloatingProps:Oe,getItemProps:ze}=Fn([bt,Dt,Gt,qt]),He=u.useMemo(()=>yr(Te(),oe),[Te,oe]);jd(()=>{U.update({popupProps:Oe(),triggerProps:He})}),Z(()=>{U.update({id:_,modal:g,multiple:y,value:O,open:J,mounted:le,transitionStatus:te,popupProps:Oe(),triggerProps:He,items:R,itemToStringLabel:b,itemToStringValue:v,isItemEqualToValue:E,openMethod:ie})},[U,_,g,y,O,J,le,te,Oe,He,R,b,v,E,ie]);const ot=u.useMemo(()=>({store:U,name:T,required:d,disabled:D,readOnly:f,multiple:y,itemToStringLabel:b,itemToStringValue:v,highlightItemOnHover:w,setValue:De,setOpen:we,listRef:B,popupRef:Q,scrollHandlerRef:$,handleScrollArrowVisibility:_e,scrollArrowsMountedCountRef:H,getItemProps:ze,events:qe.context.events,valueRef:W,valuesRef:ae,labelsRef:ce,typingRef:ge,selectionRef:q,selectedItemTextRef:ee,validation:F,onOpenChangeComplete:m,keyboardActiveRef:V,alignItemWithTriggerActiveRef:Se,initialValueRef:Ee}),[U,T,d,D,f,y,b,v,w,De,we,ze,qe.context.events,F,m,_e]),Xe=Pt(h,F.inputRef),ut=y&&Array.isArray(O)&&O.length>0,Ft=u.useMemo(()=>!y||!Array.isArray(O)||!T?null:O.map(pe=>{const Ve=Zt(pe,v);return se.jsx("input",{type:"hidden",name:T,value:Ve},Ve)}),[y,O,T,v]);return se.jsx(Mc.Provider,{value:ot,children:se.jsxs(Ac.Provider,{value:qe,children:[x,se.jsx("input",{...F.getInputValidationProps({onFocus(){var pe;(pe=U.state.triggerElement)==null||pe.focus()},onChange(pe){if(pe.nativeEvent.defaultPrevented)return;const Ve=pe.target.value,Ze=de(jt,pe.nativeEvent);function at(){if(y)return;const st=ae.current.find(vt=>Zt(vt,v).toLowerCase()===Ve.toLowerCase());st!=null&&(P(st!==M.initialValue),De(st,Ze),A()&&F.commit(st))}U.set("forceMount",!0),queueMicrotask(at)}}),id:t||C||void 0,name:y?void 0:T,value:be,disabled:D,required:d&&!ut,readOnly:f,ref:Xe,style:Po,tabIndex:-1,"aria-hidden":!0}),Ft]})})}function rp(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(r.width)||0,l=parseFloat(r.height)||0,a=Math.max(t.width,s,c),f=Math.max(t.height,i,l),d=a-t.width,g=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-g/2,bottom:t.bottom+g/2}}const Jn=2,op={...mc,...Wd,value:()=>null},qp=u.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,...c}=t,{setTouched:l,setFocused:a,validationMode:f,state:d,disabled:g}=Go(),{labelId:p}=qo(),{store:h,setOpen:m,selectionRef:R,validation:y,readOnly:b,alignItemWithTriggerActiveRef:v,disabled:E,keyboardActiveRef:w}=Lt(),x=g||E||s,S=ye(h,he.open),P=ye(h,he.value),A=ye(h,he.triggerProps),M=ye(h,he.positionerElement),k=ye(h,he.listElement),L=ye(h,he.serializedValue),I=Fe(M),F=u.useRef(null),C=We(),_=We(),{getButtonProps:D,buttonRef:T}=Vn({disabled:x,native:i}),O=X($=>{h.set("triggerElement",$)}),N=Pt(n,F,T,O),J=We(),Y=We();u.useEffect(()=>{if(S)return Y.start(200,()=>{R.current.allowUnselectedMouseUp=!0,J.start(200,()=>{R.current.allowSelectedMouseUp=!0})}),()=>{J.clear(),Y.clear()};R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},_.clear()},[S,R,_,J,Y]);const B=u.useMemo(()=>{var $;return(k==null?void 0:k.id)??(($=In(M))==null?void 0:$.id)},[k,M]),ce=yr(A,{role:"combobox","aria-expanded":S?"true":"false","aria-haspopup":"listbox","aria-controls":S?B:void 0,"aria-labelledby":p,"aria-readonly":b||void 0,tabIndex:x?-1:0,ref:N,onFocus($){a(!0),S&&v.current&&m(!1,de(Ut,$.nativeEvent)),C.start(0,()=>{h.set("forceMount",!0)})},onBlur(){l(!0),a(!1),f==="onBlur"&&y.commit(P)},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown($){if(S)return;const H=lt($.currentTarget);function W(ae){if(!F.current)return;const ge=ae.target;if(ve(F.current,ge)||ve(I.current,ge)||ge===F.current)return;const V=rp(F.current);ae.clientX>=V.left-Jn&&ae.clientX<=V.right+Jn&&ae.clientY>=V.top-Jn&&ae.clientY<=V.bottom+Jn||m(!1,de(Uu,ae))}_.start(0,()=>{H.addEventListener("mouseup",W,{once:!0})})}},y.getValidationProps,c,D);ce.role="combobox";const Q=u.useMemo(()=>({...d,open:S,disabled:x,value:P,readOnly:b,placeholder:!L}),[d,S,x,P,b,L]);return Ie("button",t,{ref:[n,F],state:Q,stateAttributesMapping:op,props:ce})}),sp={value:()=>null},Xp=u.forwardRef(function(t,n){const{className:r,render:o,children:s,...i}=t,{store:c,valueRef:l}=Lt(),a=ye(c,he.value),f=ye(c,he.items),d=ye(c,he.itemToStringLabel),g=ye(c,he.serializedValue),p=u.useMemo(()=>({value:a,placeholder:!g}),[a,g]),h=typeof s=="function"?s(a):s??(Array.isArray(a)?Jd(a,d):Zd(a,f,d));return Ie("span",t,{state:p,ref:[n,l],props:[{children:h},i],stateAttributesMapping:sp})}),Zp=u.forwardRef(function(t,n){const{className:r,render:o,...s}=t,{store:i}=Lt(),c=ye(i,he.open),l=u.useMemo(()=>({open:c}),[c]);return Ie("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:$o})}),ip=u.createContext(void 0),Jp=u.forwardRef(function(t,n){const{store:r}=Lt(),o=ye(r,he.mounted),s=ye(r,he.forceMount);return o||s?se.jsx(ip.Provider,{value:!0,children:se.jsx(Oo,{ref:n,...t})}):null}),Dc=u.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function cp(){return u.useContext(Dc)}function Xo(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=X(o),i=u.useRef(0),c=Ke(up).current,l=Ke(lp).current,[a,f]=u.useState(0),d=u.useRef(a),g=X((y,b)=>{l.set(y,b??null),d.current+=1,f(d.current)}),p=X(y=>{l.delete(y),d.current+=1,f(d.current)}),h=u.useMemo(()=>{const y=new Map;return Array.from(l.keys()).filter(v=>v.isConnected).sort(ap).forEach((v,E)=>{const w=l.get(v)??{};y.set(v,{...w,index:E})}),y},[l,a]);Z(()=>{if(typeof MutationObserver!="function"||h.size===0)return;const y=new MutationObserver(b=>{const v=new Set,E=w=>v.has(w)?v.delete(w):v.add(w);b.forEach(w=>{w.removedNodes.forEach(E),w.addedNodes.forEach(E)}),v.size===0&&(d.current+=1,f(d.current))});return h.forEach((b,v)=>{v.parentElement&&y.observe(v.parentElement,{childList:!0})}),()=>{y.disconnect()}},[h]),Z(()=>{d.current===a&&(n.current.length!==h.size&&(n.current.length=h.size),r&&r.current.length!==h.size&&(r.current.length=h.size),i.current=h.size),s(h)},[s,h,n,r,a]),Z(()=>()=>{n.current=[]},[n]),Z(()=>()=>{r&&(r.current=[])},[r]);const m=X(y=>(c.add(y),()=>{c.delete(y)}));Z(()=>{c.forEach(y=>y(h))},[c,h]);const R=u.useMemo(()=>({register:g,unregister:p,subscribeMapChange:m,elementsRef:n,labelsRef:r,nextIndexRef:i}),[g,p,m,n,r,i]);return se.jsx(Dc.Provider,{value:R,children:t})}function lp(){return new Map}function up(){return new Set}function ap(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 Fc=u.createContext(void 0);function fp(){const e=u.useContext(Fc);if(!e)throw new Error(Ne(59));return e}function gr(e,t){e&&Object.assign(e.style,t)}const dp={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},pp={position:"fixed"},Qp=u.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:c="bottom",align:l="center",sideOffset:a=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:g,arrowPadding:p=5,sticky:h=!1,disableAnchorTracking:m,alignItemWithTrigger:R=!0,collisionAvoidance:y=Bl,...b}=t,{store:v,listRef:E,labelsRef:w,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:P,initialValueRef:A,popupRef:M,setValue:k}=Lt(),L=kc(),I=ye(v,he.open),F=ye(v,he.mounted),C=ye(v,he.modal),_=ye(v,he.value),D=ye(v,he.openMethod),T=ye(v,he.positionerElement),O=ye(v,he.triggerElement),N=ye(v,he.isItemEqualToValue),J=u.useRef(null),Y=u.useRef(null),[B,ce]=u.useState(R),Q=F&&B&&D!=="touch";!F&&B!==R&&ce(R),Z(()=>{F||(he.scrollUpArrowVisible(v.state)&&v.set("scrollUpArrowVisible",!1),he.scrollDownArrowVisible(v.state)&&v.set("scrollDownArrowVisible",!1))},[v,F]),u.useImperativeHandle(x,()=>Q),Yo((Q||C)&&I&&D!=="touch",O);const $=jo({anchor:r,floatingRootContext:L,positionMethod:o,mounted:F,side:c,sideOffset:a,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:d,collisionPadding:g,sticky:h,disableAnchorTracking:m??Q,collisionAvoidance:y,keepMounted:!0}),H=Q?"none":$.side,W=Q?pp:$.positionerStyles,ae=u.useMemo(()=>{const j={};return I||(j.pointerEvents="none"),{role:"presentation",hidden:!F,style:{...W,...j}}},[I,F,W]),ge=u.useMemo(()=>({open:I,side:H,align:$.align,anchorHidden:$.anchorHidden}),[I,H,$.align,$.anchorHidden]),V=X(j=>{v.set("positionerElement",j)}),ee=Ie("div",t,{ref:[n,V],state:ge,stateAttributesMapping:kt,props:[ae,b]}),q=u.useRef(0),Se=X(j=>{if(j.size===0&&q.current===0||P.current.length===0)return;const te=q.current;if(q.current=j.size,j.size===te)return;const ie=de(jt);if(te!==0&&!v.state.multiple&&_!==null&&lo(P.current,_,N)===-1){const ue=A.current,ne=ue!=null&&Wr(P.current,ue,N)?ue:null;k(ne,ie),ne===null&&(v.set("selectedIndex",null),S.current=null)}if(te!==0&&v.state.multiple&&Array.isArray(_)){const oe=_.filter(ue=>Wr(P.current,ue,N));(oe.length!==_.length||oe.some(ue=>!Wr(_,ue,N)))&&(k(oe,ie),oe.length===0&&(v.set("selectedIndex",null),S.current=null))}if(I&&Q){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};gr(T,oe),gr(M.current,oe)}}),le=u.useMemo(()=>({...$,side:H,alignItemWithTriggerActive:Q,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:J,scrollDownArrowRef:Y}),[$,H,Q,ce]);return se.jsx(Xo,{elementsRef:E,labelsRef:w,onMapChange:Se,children:se.jsxs(Fc.Provider,{value:le,children:[F&&C&&se.jsx(zo,{inert:Uo(!I),cutout:O}),ee]})})});function Nc(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Qn="base-ui-disable-scrollbar",$s={className:Qn,element:se.jsx("style",{href:Qn,precedence:"base-ui:low",children:`.${Qn}{scrollbar-width:none}.${Qn}::-webkit-scrollbar{display:none}`})},gp=u.createContext(void 0);function _c(e){return u.useContext(gp)}const hp={...kt,...Rn},eg=u.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{store:i,popupRef:c,onOpenChangeComplete:l,setOpen:a,valueRef:f,selectedItemTextRef:d,keyboardActiveRef:g,multiple:p,handleScrollArrowVisibility:h,scrollHandlerRef:m}=Lt(),{side:R,align:y,alignItemWithTriggerActive:b,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:E,scrollUpArrowRef:w}=fp(),x=_c()!=null,S=kc(),P=We(),A=ye(i,he.id),M=ye(i,he.open),k=ye(i,he.mounted),L=ye(i,he.popupProps),I=ye(i,he.transitionStatus),F=ye(i,he.triggerElement),C=ye(i,he.positionerElement),_=ye(i,he.listElement),D=u.useRef(0),T=u.useRef(!1),O=u.useRef(0),N=u.useRef(!1),J=u.useRef({}),Y=Ln(),B=X(H=>{if(!C||!c.current||!N.current)return;if(T.current||!b){h();return}const W=C.style.top==="0px",ae=C.style.bottom==="0px",ge=C.getBoundingClientRect().height,V=lt(C),ee=getComputedStyle(C),q=parseFloat(ee.marginTop),Se=parseFloat(ee.marginBottom),le=V.documentElement.clientHeight-q-Se,j=H.scrollTop,te=H.scrollHeight,ie=H.clientHeight,oe=te-ie;let ue=null,U=null,ne=!1;if(W){const z=oe-j,re=ge+z,K=Math.min(re,le);ue=K,K!==le?U=oe:ne=!0}else if(ae){const z=j-0,re=ge+z,K=Math.min(re,le),be=re-le;ue=K,K!==le?U=0:(ne=!0,j<oe&&(U=j-(z-be)))}ue!=null&&(C.style.height=`${ue}px`),U!=null&&(H.scrollTop=U),ne&&(T.current=!0),h()});u.useImperativeHandle(m,()=>B,[B]),Yt({open:M,ref:c,onComplete(){M&&(l==null||l(!0))}});const ce=u.useMemo(()=>({open:M,transitionStatus:I,side:R,align:y}),[M,I,R,y]);Z(()=>{!C||!c.current||Object.keys(J.current).length||(J.current={top:C.style.top||"0",left:C.style.left||"0",right:C.style.right,height:C.style.height,bottom:C.style.bottom,minHeight:C.style.minHeight,maxHeight:C.style.maxHeight,marginTop:C.style.marginTop,marginBottom:C.style.marginBottom})},[c,C]),Z(()=>{k||b||(N.current=!1,T.current=!1,D.current=0,O.current=0,gr(C,J.current))},[k,b,C,c]),Z(()=>{const H=c.current;if(!(!k||!F||!C||!H)){if(!b){N.current=!0,Y.request(h);return}queueMicrotask(()=>{var ot;const W=getComputedStyle(C),ae=getComputedStyle(H),ge=lt(F),V=Ae(C),ee=F.getBoundingClientRect(),q=C.getBoundingClientRect(),Se=ee.left,le=ee.height,j=_||H,te=j.scrollHeight,ie=parseFloat(ae.borderBottomWidth),oe=parseFloat(W.marginTop)||10,ue=parseFloat(W.marginBottom)||10,U=parseFloat(W.minHeight)||100,ne=5,z=5,re=20,K=ge.documentElement.clientHeight-oe-ue,be=ge.documentElement.clientWidth,Re=K-ee.bottom+le,me=d.current,Ee=f.current;let we=0,ke=0;if(me&&Ee){const Xe=Ee.getBoundingClientRect(),ut=me.getBoundingClientRect(),Ft=Xe.left-Se,pe=ut.left-q.left,Ve=Xe.top-ee.top+Xe.height/2,Ze=ut.top-q.top+ut.height/2;we=Ft-pe,ke=Ze-Ve}const De=Re+ke+ue+ie;let _e=Math.min(K,De);const qe=K-oe-ue,bt=De-_e,Dt=Math.max(ne,Se+we),Gt=be-z,qt=Math.max(0,Dt+q.width-Gt);C.style.left=`${Dt-qt}px`,C.style.height=`${_e}px`,C.style.maxHeight="auto",C.style.marginTop=`${oe}px`,C.style.marginBottom=`${ue}px`,H.style.height="100%";const Te=j.scrollHeight-j.clientHeight,Oe=bt>=Te;Oe&&(_e=Math.min(K,q.height)-(bt-Te));const ze=ee.top<re||ee.bottom>K-re||_e<Math.min(te,U),He=(((ot=V.visualViewport)==null?void 0:ot.scale)??1)!==1&πif(ze||He){N.current=!0,gr(C,J.current),tt.flushSync(()=>v(!1));return}if(Oe){const Xe=Math.max(0,K-De);C.style.top=q.height>=qe?"0":`${Xe}px`,C.style.height=`${_e}px`,j.scrollTop=j.scrollHeight-j.clientHeight,D.current=Math.max(U,_e)}else C.style.bottom="0",D.current=Math.max(U,_e),j.scrollTop=bt;D.current===K&&(T.current=!0),h(),setTimeout(()=>{N.current=!0})})}},[i,k,C,F,f,d,c,h,b,v,Y,E,w,_]),u.useEffect(()=>{if(!b||!C||!k)return;const H=Ae(C);function W(ae){a(!1,de(zu,ae))}return H.addEventListener("resize",W),()=>{H.removeEventListener("resize",W)}},[a,b,C,k]);const Q={..._?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":p||void 0,id:`${A}-list`},onKeyDown(H){g.current=!0,x&&Wo.has(H.key)&&H.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(H){if(Nc(H)||H.pointerType==="touch")return;const W=H.currentTarget;P.start(0,()=>{i.set("activeIndex",null),W.focus({preventScroll:!0})})},onScroll(H){var W;_||(W=m.current)==null||W.call(m,H.currentTarget)},...b&&{style:_?{height:"100%"}:dp}},$=Ie("div",t,{ref:[n,c],state:ce,stateAttributesMapping:hp,props:[L,Q,_n(I),{className:!_&&b?$s.className:void 0},s]});return se.jsxs(u.Fragment,{children:[$s.element,se.jsx(Mo,{context:S,modal:!1,disabled:!k,restoreFocus:!0,children:$})]})});let Vc=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function Hc(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:c,subscribeMapChange:l,elementsRef:a,labelsRef:f,nextIndexRef:d}=cp(),g=u.useRef(-1),[p,h]=u.useState(s??(o===Vc.GuessFromOrder?()=>{if(g.current===-1){const y=d.current;d.current+=1,g.current=y}return g.current}:-1)),m=u.useRef(null),R=u.useCallback(y=>{var b;if(m.current=y,p!==-1&&y!==null&&(a.current[p]=y,f)){const v=t!==void 0;f.current[p]=v?t:((b=r==null?void 0:r.current)==null?void 0:b.textContent)??y.textContent}},[p,a,f,t,r]);return Z(()=>{if(s!=null)return;const y=m.current;if(y)return i(y,n),()=>{c(y)}},[s,i,c,n]),Z(()=>{if(s==null)return l(y=>{var v;const b=m.current?(v=y.get(m.current))==null?void 0:v.index:null;b!=null&&h(b)})},[s,l,h]),u.useMemo(()=>({ref:R,index:p}),[p,R])}const Bc=u.createContext(void 0);function Zo(){const e=u.useContext(Bc);if(!e)throw new Error(Ne(57));return e}const tg=u.memo(u.forwardRef(function(t,n){const{render:r,className:o,value:s=null,label:i,disabled:c=!1,nativeButton:l=!1,...a}=t,f=u.useRef(null),d=Hc({label:i,textRef:f,indexGuessBehavior:Vc.GuessFromOrder}),{store:g,getItemProps:p,setOpen:h,setValue:m,selectionRef:R,typingRef:y,valuesRef:b,keyboardActiveRef:v,multiple:E,highlightItemOnHover:w}=Lt(),x=We(),S=ye(g,he.isActive,d.index),P=ye(g,he.isSelected,d.index,s),A=ye(g,he.isSelectedByFocus,d.index),M=ye(g,he.isItemEqualToValue),k=d.index,L=k!==-1,I=u.useRef(null),F=Fe(k);Z(()=>{if(!L)return;const $=b.current;return $[k]=s,()=>{delete $[k]}},[L,k,s,b]),Z(()=>{if(!L)return;const $=g.state.value;let H=$;E&&Array.isArray($)&&$.length>0&&(H=$[$.length-1]),H!==void 0&&gn(H,s,M)&&g.set("selectedIndex",k)},[L,k,E,M,g,s]);const C=u.useMemo(()=>({disabled:c,selected:P,highlighted:S}),[c,P,S]),_=p({active:S,selected:P});_.onFocus=void 0,_.id=void 0;const D=u.useRef(null),T=u.useRef("mouse"),O=u.useRef(!1),{getButtonProps:N,buttonRef:J}=Vn({disabled:c,focusableWhenDisabled:!0,native:l});function Y($){const H=g.state.value;if(E){const W=Array.isArray(H)?H:[],ae=P?qd(W,s,M):[...W,s];m(ae,de(Dr,$))}else m(s,de(Dr,$)),h(!1,de(Dr,$))}const B={role:"option","aria-selected":P,"aria-disabled":c||void 0,tabIndex:S?0:-1,onFocus(){g.set("activeIndex",k)},onMouseEnter(){!v.current&&g.state.selectedIndex===null&&g.set("activeIndex",k)},onMouseMove(){w&&g.set("activeIndex",k)},onMouseLeave($){!w||v.current||Nc($)||x.start(0,()=>{g.state.activeIndex===k&&g.set("activeIndex",null)})},onTouchStart(){R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown($){D.current=$.key,g.set("activeIndex",k)},onClick($){O.current=!1,!($.type==="keydown"&&D.current===null)&&(c||D.current===" "&&y.current||T.current!=="touch"&&!S||(D.current=null,Y($.nativeEvent)))},onPointerEnter($){T.current=$.pointerType},onPointerDown($){T.current=$.pointerType,O.current=!0},onMouseUp($){if(c)return;if(O.current){O.current=!1;return}const H=!R.current.allowSelectedMouseUp&&P,W=!R.current.allowUnselectedMouseUp&&!P;H||W||T.current!=="touch"&&!S||Y($.nativeEvent)}},ce=Ie("div",t,{ref:[J,n,d.ref,I],state:C,props:[_,B,a,N]}),Q=u.useMemo(()=>({selected:P,indexRef:F,textRef:f,selectedByFocus:A,hasRegistered:L}),[P,F,f,A,L]);return se.jsx(Bc.Provider,{value:Q,children:ce})})),ng=u.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=Zo();return r||o?se.jsx(mp,{...t,ref:n}):null}),mp=u.memo(u.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...s}=e,{selected:i}=Zo(),c=u.useRef(null),{transitionStatus:l,setMounted:a}=Lo(i),f=u.useMemo(()=>({selected:i,transitionStatus:l}),[i,l]),d=Ie("span",e,{ref:[t,c],state:f,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Rn});return Yt({open:i,ref:c,onComplete(){i||a(!1)}}),d})),rg=u.memo(u.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:s,hasRegistered:i}=Zo(),{selectedItemTextRef:c}=Lt(),{className:l,render:a,...f}=t,d=u.useCallback(p=>{if(!p||!i)return;const h=c.current===null||!c.current.isConnected;(s||h&&r.current===0)&&(c.current=p)},[c,r,s,i]);return Ie("div",t,{ref:[d,n,o],props:f})})),$c=u.createContext(void 0);function jc(){const e=u.useContext($c);if(e===void 0)throw new Error(Ne(64));return e}let yp=function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e}({});const Uc={tabActivationDirection:e=>({[yp.activationDirection]:e})},og=u.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:s,orientation:i="horizontal",render:c,value:l,...a}=t,f=Nn(),d=Object.hasOwn(t,"defaultValue"),g=u.useRef([]),[p,h]=u.useState(()=>new Map),[m,R]=co({controlled:l,default:o,name:"Tabs",state:"value"}),y=l!==void 0,[b,v]=u.useState(()=>new Map),[E,w]=u.useState("none"),x=X((D,T)=>{s==null||s(D,T),!T.isCanceled&&(R(D),w(T.activationDirection))}),S=X((D,T)=>{h(O=>{if(O.get(D)===T)return O;const N=new Map(O);return N.set(D,T),N})}),P=X((D,T)=>{h(O=>{if(!O.has(D)||O.get(D)!==T)return O;const N=new Map(O);return N.delete(D),N})}),A=u.useCallback(D=>p.get(D),[p]),M=u.useCallback(D=>{for(const T of b.values())if(D===(T==null?void 0:T.value))return T==null?void 0:T.id},[b]),k=u.useCallback(D=>{if(D===void 0)return null;for(const[T,O]of b.entries())if(O!=null&&D===(O.value??O.index))return T;return null},[b]),L=u.useMemo(()=>({direction:f,getTabElementBySelectedValue:k,getTabIdByPanelValue:M,getTabPanelIdByValue:A,onValueChange:x,orientation:i,registerMountedTabPanel:S,setTabMap:v,unregisterMountedTabPanel:P,tabActivationDirection:E,value:m}),[f,k,M,A,x,i,S,v,P,E,m]),I=u.useMemo(()=>{for(const D of b.values())if(D!=null&&D.value===m)return D},[b,m]),F=u.useMemo(()=>{for(const D of b.values())if(D!=null&&!D.disabled)return D.value},[b]);Z(()=>{if(y||b.size===0)return;const D=I==null?void 0:I.disabled,T=I==null&&m!==null;if(d&&D&&m===o||!D&&!T)return;const N=F??null;m!==N&&(R(N),w("none"))},[o,F,d,y,I,w,R,b,m]);const _=Ie("div",t,{state:{orientation:i,tabActivationDirection:E},ref:n,props:a,stateAttributesMapping:Uc});return se.jsx($c.Provider,{value:L,children:se.jsx(Xo,{elementsRef:g,children:_})})}),Wc="data-composite-item-active";function bp(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Tc(),{ref:o,index:s}=Hc(e),i=n===s,c=u.useRef(null),l=Pt(o,c);return{compositeProps:u.useMemo(()=>({tabIndex:i?0:-1,onFocus(){r(s)},onMouseMove(){const f=c.current;if(!t||!f)return;const d=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!d&&f.focus()}}),[i,r,s,t]),compositeRef:l,index:s}}const zc=u.createContext(void 0);function vp(){const e=u.useContext(zc);if(e===void 0)throw new Error(Ne(65));return e}const sg=u.forwardRef(function(t,n){const{className:r,disabled:o=!1,render:s,value:i,id:c,nativeButton:l=!0,...a}=t,{value:f,getTabPanelIdByValue:d,orientation:g}=jc(),{activateOnFocus:p,highlightedTabIndex:h,onTabActivation:m,setHighlightedTabIndex:R,tabsListElement:y}=vp(),b=En(c),v=u.useMemo(()=>({disabled:o,id:b,value:i}),[o,b,i]),{compositeProps:E,compositeRef:w,index:x}=bp({metadata:v}),S=i===f,P=u.useRef(!1);Z(()=>{if(P.current){P.current=!1;return}if(!(S&&x>-1&&h!==x))return;const O=y;if(O!=null){const N=ct(lt(O));if(N&&ve(O,N))return}o||R(x)},[S,x,h,R,o,y]);const{getButtonProps:A,buttonRef:M}=Vn({disabled:o,native:l,focusableWhenDisabled:!0}),k=d(i),L=u.useRef(!1),I=u.useRef(!1);function F(O){S||o||m(i,de(jt,O.nativeEvent,void 0,{activationDirection:"none"}))}function C(O){S||(x>-1&&!o&&R(x),!o&&p&&(!L.current||L.current&&I.current)&&m(i,de(jt,O.nativeEvent,void 0,{activationDirection:"none"})))}function _(O){if(S||o)return;L.current=!0;function N(){L.current=!1,I.current=!1}(!O.button||O.button===0)&&(I.current=!0,lt(O.currentTarget).addEventListener("pointerup",N,{once:!0}))}const D=u.useMemo(()=>({disabled:o,active:S,orientation:g}),[o,S,g]);return Ie("button",t,{state:D,ref:[n,M,w],props:[E,{role:"tab","aria-controls":k,"aria-selected":S,id:b,onClick:F,onFocus:C,onPointerDown:_,[Wc]:S?"":void 0,onKeyDownCapture(){P.current=!0}},a,A]})});function Rp(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const Ep=[];function xp(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:o=!1,orientation:s="both",direction:i,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:a,enableHomeAndEndKeys:f=!1,stopEventPropagation:d=!1,disabledIndices:g,modifierKeys:p=Ep}=e,[h,m]=u.useState(0),R=n>1,y=u.useRef(null),b=Pt(y,a),v=u.useRef([]),E=u.useRef(!1),w=c??h,x=X((A,M=!1)=>{if((l??m)(A),M){const k=v.current[A];Fs(y.current,k,i,s)}}),S=X(A=>{if(A.size===0||E.current)return;E.current=!0;const M=Array.from(A.keys()),k=M.find(I=>I==null?void 0:I.hasAttribute(Wc))??null,L=k?M.indexOf(k):-1;L!==-1&&x(L),Fs(y.current,k,i,s)}),P=u.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,ref:b,onFocus(A){!y.current||!Ds(A.target)||A.target.setSelectionRange(0,A.target.value.length??0)},onKeyDown(A){const M=f?wd:Ic;if(!M.has(A.key)||Sp(A,p)||!y.current)return;const L=i==="rtl",I=L?Mn:sn,F={horizontal:I,vertical:Ht,both:I}[s],C=L?sn:Mn,_={horizontal:C,vertical:on,both:C}[s];if(Ds(A.target)&&!Rp(A.target)){const B=A.target.selectionStart,ce=A.target.selectionEnd,Q=A.target.value??"";if(B==null||A.shiftKey||B!==ce||A.key!==_&&B<Q.length||A.key!==F&&B>0)return}let D=w;const T=er(v,g),O=to(v,g);if(R){const B=t||Array.from({length:v.current.length},()=>({width:1,height:1})),ce=Ti(B,n,o),Q=ce.findIndex(H=>H!=null&&!Ct(v,H,g)),$=ce.reduce((H,W,ae)=>W!=null&&!Ct(v,W,g)?ae:H,-1);D=ce[wi({current:ce.map(H=>H?v.current[H]:null)},{event:A,orientation:s,loopFocus:r,cols:n,disabledIndices:Pi([...g||v.current.map((H,W)=>Ct(v,W)?W:void 0),void 0],ce),minIndex:Q,maxIndex:$,prevIndex:Ci(w>O?T:w,B,ce,n,A.key===Ht?"bl":A.key===sn?"tr":"tl"),rtl:L})]}const N={horizontal:[I],vertical:[Ht],both:[I,Ht]}[s],J={horizontal:[C],vertical:[on],both:[C,on]}[s],Y=R?M:{horizontal:f?xd:Pc,vertical:f?Sd:Oc,both:M}[s];f&&(A.key===Hn?D=T:A.key===Bn&&(D=O)),D===w&&(N.includes(A.key)||J.includes(A.key))&&(r&&D===O&&N.includes(A.key)?D=T:r&&D===T&&J.includes(A.key)?D=O:D=$e(v,{startingIndex:D,decrement:J.includes(A.key),disabledIndices:g})),D!==w&&!Qt(v,D)&&(d&&A.stopPropagation(),Y.has(A.key)&&A.preventDefault(),x(D,!0),queueMicrotask(()=>{var B;(B=v.current[D])==null||B.focus()}))}}),[n,o,i,g,v,f,w,R,t,r,b,p,x,s,d]);return u.useMemo(()=>({props:P,highlightedIndex:w,onHighlightedIndexChange:x,elementsRef:v,disabledIndices:g,onMapChange:S,relayKeyboardEvent:P.onKeyDown}),[P,w,x,v,g,S])}function Sp(e,t){for(const n of Id.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function wp(e){const{render:t,className:n,refs:r=cn,props:o=cn,state:s=Be,stateAttributesMapping:i,highlightedIndex:c,onHighlightedIndexChange:l,orientation:a,dense:f,itemSizes:d,loopFocus:g,cols:p,enableHomeAndEndKeys:h,onMapChange:m,stopEventPropagation:R=!0,rootRef:y,disabledIndices:b,modifierKeys:v,highlightItemOnHover:E=!1,tag:w="div",...x}=e,S=Nn(),{props:P,highlightedIndex:A,onHighlightedIndexChange:M,elementsRef:k,onMapChange:L,relayKeyboardEvent:I}=xp({itemSizes:d,cols:p,loopFocus:g,dense:f,orientation:a,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:y,stopEventPropagation:R,enableHomeAndEndKeys:h,direction:S,disabledIndices:b,modifierKeys:v}),F=Ie(w,e,{state:s,ref:r,props:[P,...o,x],stateAttributesMapping:i}),C=u.useMemo(()=>({highlightedIndex:A,onHighlightedIndexChange:M,highlightItemOnHover:E,relayKeyboardEvent:I}),[A,M,E,I]);return se.jsx(wc.Provider,{value:C,children:se.jsx(Xo,{elementsRef:k,onMapChange:_=>{m==null||m(_),L(_)},children:F})})}const ig=u.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:o,loopFocus:s=!0,render:i,...c}=t,{getTabElementBySelectedValue:l,onValueChange:a,orientation:f,value:d,setTabMap:g,tabActivationDirection:p}=jc(),[h,m]=u.useState(0),[R,y]=u.useState(null),b=Tp(d,f,R,l),v=X((S,P)=>{if(S!==d){const A=b(S);P.activationDirection=A,a(S,P)}}),E=u.useMemo(()=>({orientation:f,tabActivationDirection:p}),[f,p]),w={"aria-orientation":f==="vertical"?"vertical":void 0,role:"tablist"},x=u.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:h,onTabActivation:v,setHighlightedTabIndex:m,tabsListElement:R,value:d}),[r,h,v,m,R,d]);return se.jsx(zc.Provider,{value:x,children:se.jsx(wp,{render:i,className:o,state:E,refs:[n,y],props:[w,c],stateAttributesMapping:Uc,highlightedIndex:h,enableHomeAndEndKeys:!0,loopFocus:s,orientation:f,onHighlightedIndexChange:m,onMapChange:g,disabledIndices:cn})})});function js(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:o,top:s}=t.getBoundingClientRect(),i=n-o,c=r-s;return{left:i,top:c}}function Tp(e,t,n,r){const[o,s]=u.useState(null);return Z(()=>{if(e==null||n==null){s(null);return}const i=r(e);if(i==null){s(null);return}const{left:c,top:l}=js(i,n);s(t==="horizontal"?c:l)},[t,r,n,e]),u.useCallback(i=>{if(i===e)return"none";if(i==null)return s(null),"none";if(i!=null&&n!=null){const c=r(i);if(c!=null){const{left:l,top:a}=js(c,n);if(o==null)return s(t==="horizontal"?l:a),"none";if(t==="horizontal"){if(l<o)return s(l),"left";if(l>o)return s(l),"right"}else{if(a<o)return s(a),"up";if(a>o)return s(a),"down"}}}return"none"},[r,t,o,n,e])}const Yc=u.createContext(void 0);function $n(e){const t=u.useContext(Yc);if(t===void 0&&!e)throw new Error(Ne(47));return t}function Cp(){return{..._o(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Pp={...Vo,disabled:G(e=>e.disabled),instantType:G(e=>e.instantType),openMethod:G(e=>e.openMethod),openChangeReason:G(e=>e.openChangeReason),modal:G(e=>e.modal),stickIfOpen:G(e=>e.stickIfOpen),titleElementId:G(e=>e.titleElementId),descriptionElementId:G(e=>e.descriptionElementId),openOnHover:G(e=>e.openOnHover),closeDelay:G(e=>e.closeDelay)};class Jo extends Pr{constructor(n){const r={...Cp(),...n};r.open&&(n==null?void 0:n.mounted)===void 0&&(r.mounted=!0);super(r,{popupRef:u.createRef(),backdropRef:u.createRef(),internalBackdropRef:u.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:u.createRef(),beforeContentFocusGuardRef:u.createRef(),stickIfOpenTimeout:new ht,triggerElements:new Dn},Pp);xe(this,"setOpen",(n,r)=>{var f,d;const o=r.reason===Je,s=r.reason===dt&&r.event.detail===0,i=!n&&(r.reason===Sr||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(d=(f=this.context).onOpenChange)==null||d.call(f,n,r),r.isCanceled)return;const c={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger},l=this.state.floatingRootContext.context.events;l==null||l.emit("openchange",c);const a=()=>{var h;const g={open:n,openChangeReason:r.reason},p=((h=r.trigger)==null?void 0:h.id)??null;(p||n)&&(g.activeTriggerId=p,g.activeTriggerElement=r.trigger??null),this.update(g)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Vl,()=>{this.set("stickIfOpen",!1)}),tt.flushSync(a)):a(),s||i?this.set("instantType",s?"click":"dismiss"):r.reason===Ut?this.set("instantType","focus"):this.set("instantType",void 0)});xe(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const o=Ke(()=>n??new Jo(r)).current;return yo(o.disposeEffect),o}}function Us({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:c,triggerId:l,defaultTriggerId:a=null}=e,f=Jo.useStore(c==null?void 0:c.store,{open:n??r,modal:i,activeTriggerId:l!==void 0?l:a});f.useControlledProp("open",n,r),f.useControlledProp("activeTriggerId",l,a);const d=f.useState("open"),g=f.useState("positionerElement"),p=f.useState("payload"),h=f.useState("openChangeReason");f.useContextCallback("onOpenChange",o),f.useContextCallback("onOpenChangeComplete",s);const{openMethod:m,triggerProps:R,reset:y}=Ko(d);Fo(f);const{forceUnmount:b}=No(d,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null}),y()});Yo(d&&i===!0&&h!==Je&&m!=="touch",g),u.useEffect(()=>{d||f.context.stickIfOpenTimeout.clear()},[f,d]);const v=u.useCallback(C=>{const _=de(C);return _.preventUnmountOnClose=()=>{f.set("preventUnmountingOnClose",!0)},_},[f]),E=u.useCallback(()=>{f.setOpen(!1,v(Co))},[f,v]);u.useImperativeHandle(e.actionsRef,()=>({unmount:b,close:E}),[b,E]);const w=Ho({popupStore:f,onOpenChange:f.setOpen}),x=Tr(w,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),S=gc(w),{getReferenceProps:P,getFloatingProps:A,getTriggerProps:M}=Fn([x,S]),k=u.useMemo(()=>P(R),[P,R]),L=u.useMemo(()=>M(R),[M,R]),I=u.useMemo(()=>A(),[A]);f.useSyncedValues({modal:i,openMethod:m,activeTriggerProps:k,inactiveTriggerProps:L,popupProps:I,floatingRootContext:w,nested:At()!=null});const F=u.useMemo(()=>({store:f}),[f]);return se.jsx(Yc.Provider,{value:F,children:typeof t=="function"?t({payload:p}):t})}function cg(e){return $n(!0)?se.jsx(Us,{props:e}):se.jsx($u,{children:se.jsx(Us,{props:e})})}const Op=300,lg=u.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:c,payload:l,openOnHover:a=!1,delay:f=Op,closeDelay:d=0,id:g,...p}=t,h=$n(!0),m=(c==null?void 0:c.store)??(h==null?void 0:h.store);if(!m)throw new Error(Ne(74));const R=En(g),y=m.useState("isTriggerActive",R),b=m.useState("floatingRootContext"),v=m.useState("isOpenedByTrigger",R),E=u.useRef(null),{registerTrigger:w,isMountedByThisTrigger:x}=uc(R,E,m,{payload:l,disabled:s,openOnHover:a,closeDelay:d}),S=m.useState("openChangeReason"),P=m.useState("stickIfOpen"),A=m.useState("openMethod"),M=pc(b,{enabled:b!=null&&a&&(A!=="touch"||S!==dt),mouseOnly:!0,move:!1,handleClose:hc(),restMs:f,delay:{close:d},triggerElementRef:E,isActiveTrigger:y}),k=Ki(b,{enabled:b!=null,stickIfOpen:P}),L=Fn([k]),I=m.useState("triggerProps",x),F=u.useMemo(()=>({disabled:s,open:v}),[s,v]),{getButtonProps:C,buttonRef:_}=Vn({disabled:s,native:i}),D=u.useMemo(()=>({open(Y){return Y&&S===dt?mc.open(Y):$o.open(Y)}}),[S]),T=Ie("button",t,{state:F,ref:[_,n,w,E],props:[L.getReferenceProps(),M,I,{[ci]:"",id:R},p,C],stateAttributesMapping:D}),O=u.useRef(null),N=X(Y=>{tt.flushSync(()=>{m.setOpen(!1,de(Ut,Y.nativeEvent,Y.currentTarget))});const B=Du(O.current);B==null||B.focus()}),J=X(Y=>{var ce;const B=m.select("positionerElement");if(B&&en(Y,B))(ce=m.context.beforeContentFocusGuardRef.current)==null||ce.focus();else{tt.flushSync(()=>{m.setOpen(!1,de(Ut,Y.nativeEvent,Y.currentTarget))});let Q=Lu(E.current);for(;Q!==null&&ve(B,Q)||Q!=null&&Q.hasAttribute("aria-hidden");){const $=Q;if(Q=To(Q),Q===$)break}Q==null||Q.focus()}});return y?se.jsxs(u.Fragment,{children:[se.jsx(dn,{ref:O,onFocus:N}),se.jsx(u.Fragment,{children:T},R),se.jsx(dn,{ref:m.context.triggerFocusTargetRef,onFocus:J})]}):se.jsx(u.Fragment,{children:T},R)}),Kc=u.createContext(void 0);function Ip(){const e=u.useContext(Kc);if(e===void 0)throw new Error(Ne(45));return e}const ug=u.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=$n();return s.useState("mounted")||r?se.jsx(Kc.Provider,{value:r,children:se.jsx(Oo,{ref:n,...o,renderGuards:!1})}):null}),Gc=u.createContext(void 0);function Mp(){const e=u.useContext(Gc);if(!e)throw new Error(Ne(46));return e}const ag=u.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:c="bottom",align:l="center",sideOffset:a=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:g=5,arrowPadding:p=5,sticky:h=!1,disableAnchorTracking:m=!1,collisionAvoidance:R=li,...y}=t,{store:b}=$n(),v=Ip(),E=Hu(),w=b.useState("floatingRootContext"),x=b.useState("mounted"),S=b.useState("open"),P=b.useState("openChangeReason"),A=b.useState("activeTriggerElement"),M=b.useState("modal"),k=b.useState("positionerElement"),L=b.useState("instantType"),I=b.useState("transitionStatus"),F=u.useRef(null),C=Do(k,!1,!1),_=jo({anchor:s,floatingRootContext:w,positionMethod:i,mounted:x,side:c,sideOffset:a,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:d,collisionPadding:g,sticky:h,disableAnchorTracking:m,keepMounted:v,nodeId:E,collisionAvoidance:R,adaptiveOrigin:Rc}),D=u.useMemo(()=>{const B={};return S||(B.pointerEvents="none"),{role:"presentation",hidden:!x,style:{..._.positionerStyles,...B}}},[S,x,_.positionerStyles]),T=u.useMemo(()=>({props:D,..._}),[D,_]),O=w==null?void 0:w.select("domReferenceElement");Z(()=>{const B=O,ce=F.current;if(B&&(F.current=B),ce&&B&&B!==ce){b.set("instantType",void 0);const Q=new AbortController;return C(()=>{b.set("instantType","trigger-change")},Q.signal),()=>{Q.abort()}}},[O,C,b]);const N=u.useMemo(()=>({open:S,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:L}),[S,T.side,T.align,T.anchorHidden,L]),J=u.useCallback(B=>{b.set("positionerElement",B)},[b]),Y=Ie("div",t,{state:N,props:[T.props,_n(I),y],ref:[n,J],stateAttributesMapping:kt});return se.jsxs(Gc.Provider,{value:T,children:[x&&M===!0&&P!==Je&&se.jsx(zo,{ref:b.context.internalBackdropRef,inert:Uo(!S),cutout:A}),se.jsx(Bu,{id:E,children:Y})]})}),Ap={...kt,...Rn},fg=u.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,...c}=t,{store:l}=$n(),a=Mp(),f=_c()!=null,d=Nn(),g=l.useState("open"),p=l.useState("openMethod"),h=l.useState("instantType"),m=l.useState("transitionStatus"),R=l.useState("popupProps"),y=l.useState("titleElementId"),b=l.useState("descriptionElementId"),v=l.useState("modal"),E=l.useState("mounted"),w=l.useState("openChangeReason"),x=l.useState("popupElement"),S=l.useState("payload"),P=l.useState("positionerElement"),A=l.useState("activeTriggerElement"),M=l.useState("floatingRootContext");Yt({open:g,ref:l.context.popupRef,onComplete(){var Y,B;g&&((B=(Y=l.context).onOpenChangeComplete)==null||B.call(Y,!0))}});const k=l.useState("disabled"),L=l.useState("openOnHover"),I=l.useState("closeDelay");dc(M,{enabled:L&&!k,closeDelay:I});function F(Y){return Y==="touch"?l.context.popupRef.current:!0}const C=s===void 0?F:s,_=u.useMemo(()=>({open:g,side:a.side,align:a.align,instant:h,transitionStatus:m}),[g,a.side,a.align,h,m]),D=u.useCallback(Y=>{l.set("popupElement",Y)},[l]);function T(){M.context.events.emit("measure-layout")}function O(Y,B){M.context.events.emit("measure-layout-complete",{previousDimensions:Y,nextDimensions:B})}const N=u.useCallback(()=>l.context.triggerElements.size>1,[l]);xc({popupElement:x,positionerElement:P,mounted:E,content:S,enabled:N,onMeasureLayout:T,onMeasureLayoutComplete:O,side:a.side,direction:d});const J=Ie("div",t,{state:_,ref:[n,l.context.popupRef,D],props:[R,{"aria-labelledby":y,"aria-describedby":b,onKeyDown(Y){f&&Wo.has(Y.key)&&Y.stopPropagation()}},_n(m),c],stateAttributesMapping:Ap});return se.jsx(Mo,{context:M,openInteractionType:p,modal:v==="trap-focus",disabled:!E||w===Je,initialFocus:C,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Me(A)?A:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:J})});export{Qp as A,eg as B,tg as C,Yp as D,ng as E,rg as F,og as G,ig as H,sg as I,cg as P,Qs as R,Gp as S,Bp as T,tt as a,lg as b,Dp as c,ug as d,ag as e,fg as f,rl as g,Fp as h,Np as i,se as j,_p as k,Vp as l,Hp as m,Kp as n,Up as o,jp as p,zp as q,u as r,$p as s,Wp as t,Lp as u,Xp as v,Cf as w,qp as x,Zp as y,Jp as z};
|