tokentracker-cli 0.22.2 → 0.23.0

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.
Files changed (39) hide show
  1. package/README.md +6 -3
  2. package/README.zh-CN.md +6 -3
  3. package/dashboard/dist/assets/{Card-CscwVKze.js → Card-BgXt23Ak.js} +1 -1
  4. package/dashboard/dist/assets/{DashboardPage-OvHyt-9C.js → DashboardPage-NVAsY99I.js} +1 -1
  5. package/dashboard/dist/assets/{DevicePage-DPTf4W0C.js → DevicePage-CWTFzGYj.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-DtrbU2Wr.js → FadeIn-r11-zwBU.js} +1 -1
  7. package/dashboard/dist/assets/{HeaderGithubStar-BpUvUDa5.js → HeaderGithubStar-ZDYMF__6.js} +1 -1
  8. package/dashboard/dist/assets/{IpCheckPage-38pFyxXR.js → IpCheckPage-cCSBXnv2.js} +1 -1
  9. package/dashboard/dist/assets/{LandingPage-C5K7S2K7.js → LandingPage-DDUROVcN.js} +1 -1
  10. package/dashboard/dist/assets/{LeaderboardPage-K2nTz_3S.js → LeaderboardPage-BaETRtBF.js} +1 -1
  11. package/dashboard/dist/assets/{LeaderboardProfilePage-CruIkbE_.js → LeaderboardProfilePage-BthYFghU.js} +1 -1
  12. package/dashboard/dist/assets/{LimitsPage-mCTt95Hc.js → LimitsPage-BQpint0k.js} +1 -1
  13. package/dashboard/dist/assets/{LoginPage-CluZmxnu.js → LoginPage-EUjSrjOv.js} +1 -1
  14. package/dashboard/dist/assets/{PopoverPopup-4vJpuKH2.js → PopoverPopup-DyjmUoRY.js} +1 -1
  15. package/dashboard/dist/assets/{ProviderIcon-BXyyvrZJ.js → ProviderIcon-D7GhGvvD.js} +1 -1
  16. package/dashboard/dist/assets/{SettingsPage-Dtf6298d.js → SettingsPage-9lfQ1c28.js} +1 -1
  17. package/dashboard/dist/assets/{SkillsPage-BLG6MKhL.js → SkillsPage-Bt7d1kd0.js} +1 -1
  18. package/dashboard/dist/assets/{WidgetsPage-BI7FAndR.js → WidgetsPage-QfPgS0dO.js} +1 -1
  19. package/dashboard/dist/assets/{WrappedPage-CkYP3idc.js → WrappedPage-0iiBrhBo.js} +1 -1
  20. package/dashboard/dist/assets/check-CtXuxG1H.js +1 -0
  21. package/dashboard/dist/assets/{chevron-down-CuDMdlva.js → chevron-down-Br4ZSPLP.js} +1 -1
  22. package/dashboard/dist/assets/{download-VkW-KQnx.js → download-CnQNKpma.js} +1 -1
  23. package/dashboard/dist/assets/{leaderboard-columns-Dua0OjaV.js → leaderboard-columns-Bdgb7vS7.js} +1 -1
  24. package/dashboard/dist/assets/{main-A_x5MMU-.css → main-0bSXJNLn.css} +1 -1
  25. package/dashboard/dist/assets/{main-Cd6l4iGD.js → main-D7f_DoMp.js} +2 -2
  26. package/dashboard/dist/assets/{use-limits-display-prefs-C6hf4Yu0.js → use-limits-display-prefs-B5TQdyrf.js} +1 -1
  27. package/dashboard/dist/assets/{use-native-settings-BoQWWwfz.js → use-native-settings-CSxKG_Na.js} +1 -1
  28. package/dashboard/dist/assets/{use-reduced-motion-D747bJyl.js → use-reduced-motion-C9rLBEnX.js} +1 -1
  29. package/dashboard/dist/assets/{use-usage-limits-Dtk6Ae6q.js → use-usage-limits-Bmok4oKO.js} +1 -1
  30. package/dashboard/dist/index.html +2 -2
  31. package/dashboard/dist/share.html +2 -2
  32. package/package.json +1 -1
  33. package/src/lib/antigravity-paths.js +48 -0
  34. package/src/lib/cursor-config.js +41 -55
  35. package/src/lib/pricing/seed-snapshot.json +1 -1
  36. package/src/lib/rollout.js +81 -157
  37. package/src/lib/skills-manager.js +78 -48
  38. package/src/lib/sqlite-reader.js +136 -0
  39. package/dashboard/dist/assets/check-Bw-uNvT1.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as Wn,r as d,ay as qo,az as Ko,C as ee,a7 as Ke}from"./main-Cd6l4iGD.js";const ks=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Nl=Wn("chevron-right",ks);const Ms=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$l=Wn("info",Ms);const As=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Bl=Wn("loader-circle",As),Go={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Xo={...Go,position:"fixed",top:0,left:0},Wl={...Go,position:"absolute"},lo={};function ke(e,t){const n=d.useRef(lo);return n.current===lo&&(n.current=e(t)),n}function Ut(e,t,n,o){const r=ke(Zo).current;return Fs(r,e,t,n,o)&&Jo(r,[e,t,n,o]),r.callback}function Ls(e){const t=ke(Zo).current;return Ds(t,e)&&Jo(t,e),t.callback}function Zo(){return{callback:null,cleanup:null,refs:[]}}function Fs(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Ds(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Jo(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 o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Ns=()=>{},se=typeof document<"u"?d.useLayoutEffect:Ns,fn=qo[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],$s=fn&&fn!==d.useLayoutEffect?fn:e=>e();function Y(e){const t=ke(Bs).current;return t.next=e,$s(t.effect),t.trampoline}function Bs(){const e={next:void 0,callback:Ws,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ws(){}function De(e){const t=ke(Vs,e).current;return t.next=e,se(t.effect),t}function Vs(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ye(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}var zt=Symbol("NOT_FOUND");function js(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Hs(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _s(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var uo=e=>Array.isArray(e)?e:[e];function Ys(e){const t=Array.isArray(e[0])?e[0]:e;return _s(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Us(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function zs(e){let t;return{get(n){return t&&e(t.key,n)?t.value:zt},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function qs(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return zt}function r(a,c){o(a)===zt&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Ks=(e,t)=>e===t;function Gs(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Xs(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Ks,maxSize:r=1,resultEqualityCheck:s}=n,i=Gs(o);let a=0;const c=r<=1?zs(i):qs(r,i);function l(){let u=c.get(arguments);if(u===zt){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(g=>s(g.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Zs=class{constructor(e){this.value=e}deref(){return this.value}},Js=typeof WeakRef<"u"?WeakRef:Zs,Qs=0,fo=1;function Nt(){return{s:Qs,v:void 0,o:null,p:null}}function Qo(e,t={}){let n=Nt();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}else{let m=a.p;m===null&&(a.p=m=new Map);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}}const l=a;let u;if(a.s===fo)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Js(u):u}return l.s=fo,l.v=u,u}return i.clearCache=()=>{n=Nt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function er(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),js(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:g=Qo,argsMemoizeOptions:m=[]}=u,h=uo(p),y=uo(m),E=Ys(r),b=f(function(){return s++,l.apply(null,arguments)},...h),R=g(function(){i++;const S=Us(E,arguments);return a=b.apply(null,S),a},...y);return Object.assign(R,{resultFunc:l,memoizedResultFunc:b,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:g})};return Object.assign(o,{withTypes:()=>o}),o}var ei=er(Qo),ti=Object.assign((e,t=ei)=>{Hs(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>ti});er({memoize:Xs,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const K=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(Ye(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var dn={exports:{}},pn={};var po;function ni(){if(po)return pn;po=1;var e=Ko();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var g=p(),m=o({inst:{value:g,getSnapshot:p}}),h=m[0].inst,y=m[1];return s(function(){h.value=g,h.getSnapshot=p,c(h)&&y({inst:h})},[f,g,p]),r(function(){return c(h)&&y({inst:h}),f(function(){c(h)&&y({inst:h})})},[f]),i(g),g}function c(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return pn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,pn}var go;function tr(){return go||(go=1,dn.exports=ni()),dn.exports}var oi=tr(),gn={exports:{}},mn={};var mo;function ri(){if(mo)return mn;mo=1;var e=Ko(),t=tr();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return mn.useSyncExternalStoreWithSelector=function(l,u,f,p,g){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function E(C){if(!b){if(b=!0,R=C,C=p(C),g!==void 0&&h.hasValue){var T=h.value;if(g(T,C))return v=T}return v=C}if(T=v,o(R,C))return T;var I=p(C);return g!==void 0&&g(T,I)?(R=C,T):(R=C,v=I)}var b=!1,R,v,S=f===void 0?null:f;return[function(){return E(u())},S===null?void 0:function(){return E(S())}]},[u,f,p,g]);var y=r(l,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=y},[y]),c(y),y},mn}var ho;function si(){return ho||(ho=1,gn.exports=ri()),gn.exports}var ii=si();const ci=parseInt(d.version,10);function Vn(e){return ci>=e}const ai=Vn(19),li=ai?fi:di;function ui(e,t,n,o,r){return li(e,t,n,o,r)}function fi(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return oi.useSyncExternalStore(e.subscribe,s,s)}function di(e,t,n,o,r){return ii.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Ot{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Ot.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Ot.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Ot.prototype.setState.call(this,t)}}function nr(){}const Vl=Object.freeze([]),Ee=Object.freeze({});class jn extends Ot{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return ui(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=Y(n??nr);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const pi=[];function Hn(e){d.useEffect(e,pi)}const $t=null;class gi{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(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 Bt=new gi;class Fe{static create(){return new Fe}static request(t){return Bt.request(t)}static cancel(t){return Bt.cancel(t)}currentId=$t;request(t){this.cancel(),this.currentId=Bt.request(()=>{this.currentId=$t,t()})}cancel=()=>{this.currentId!==$t&&(Bt.cancel(this.currentId),this.currentId=$t)};disposeEffect=()=>this.cancel}function _n(){const e=ke(Fe.create).current;return Hn(e.disposeEffect),e}const Ct=0;class Ge{static create(){return new Ge}currentId=Ct;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ct,n()},t)}isStarted(){return this.currentId!==Ct}clear=()=>{this.currentId!==Ct&&(clearTimeout(this.currentId),this.currentId=Ct)};disposeEffect=()=>this.clear}function ot(){const e=ke(Ge.create).current;return Hn(e.disposeEffect),e}function tn(){return typeof window<"u"}function Xe(e){return Yn(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $e(e){var t;return(t=(Yn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yn(e){return tn()?e instanceof Node||e instanceof he(e).Node:!1}function ie(e){return tn()?e instanceof Element||e instanceof he(e).Element:!1}function me(e){return tn()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function Cn(e){return!tn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function mi(e){return/^(table|td|th)$/.test(Xe(e))}function nn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const hi=/transform|translate|scale|rotate|perspective|filter/,bi=/paint|layout|strict|content/,tt=e=>!!e&&e!=="none";let hn;function Un(e){const t=ie(e)?Ce(e):e;return tt(t.transform)||tt(t.translate)||tt(t.scale)||tt(t.rotate)||tt(t.perspective)||!on()&&(tt(t.backdropFilter)||tt(t.filter))||hi.test(t.willChange||"")||bi.test(t.contain||"")}function yi(e){let t=He(e);for(;me(t)&&!je(t);){if(Un(t))return t;if(nn(t))return null;t=He(t)}return null}function on(){return hn==null&&(hn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),hn}function je(e){return/^(html|body|#document)$/.test(Xe(e))}function Ce(e){return he(e).getComputedStyle(e)}function rn(e){return ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(Xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||$e(e);return Cn(t)?t.host:t}function or(e){const t=He(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:me(t)&&st(t)?t:or(t)}function ze(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=or(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=he(r);if(s){const a=Tn(i);return t.concat(i,i.visualViewport||[],st(r)?r:[],a&&n?ze(a):[])}else return t.concat(r,ze(r,[],n))}function Tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const vt=typeof navigator<"u",bn=xi(),rr=Si(),sr=wi(),vi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ir=bn.platform==="MacIntel"&&bn.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(bn.platform),Ei=vt&&/apple/i.test(navigator.vendor),On=vt&&/android/i.test(rr)||/android/i.test(sr);vt&&rr.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ri=sr.includes("jsdom/");function xi(){if(!vt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function wi(){if(!vt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Si(){if(!vt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Pn="data-base-ui-focusable",cr="active",ar="selected",lr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",jl="ArrowLeft",Hl="ArrowRight",_l="ArrowUp",Yl="ArrowDown";function ft(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Cn(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function xe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pe(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 Ci(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function ur(e){return me(e)&&e.matches(lr)}function bo(e){return e?e.getAttribute("role")==="combobox"&&ur(e):!1}function In(e){return e?e.hasAttribute(Pn)?e:e.querySelector(`[${Pn}]`)||e:null}function nt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...nt(e,r.id,n)])}function yo(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ti(e){e.preventDefault(),e.stopPropagation()}function Oi(e){return"nativeEvent"in e}function Pi(e){return e.mozInputSource===0&&e.isTrusted?!0:On&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ii(e){return Ri?!1:!On&&e.width===0&&e.height===0||On&&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 mt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const ki=["top","right","bottom","left"],ht=Math.min,we=Math.max,qt=Math.round,Wt=Math.floor,Ne=e=>({x:e,y:e}),Mi={left:"right",right:"left",bottom:"top",top:"bottom"};function kn(e,t,n){return we(e,ht(t,n))}function _e(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function zn(e){return e==="x"?"y":"x"}function qn(e){return e==="y"?"height":"width"}function Oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Kn(e){return zn(Oe(e))}function Ai(e,t,n){n===void 0&&(n=!1);const o=Ze(e),r=Kn(e),s=qn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Kt(i)),[i,Kt(i)]}function Li(e){const t=Kt(e);return[Mn(e),t,Mn(t)]}function Mn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vo=["left","right"],Eo=["right","left"],Fi=["top","bottom"],Di=["bottom","top"];function Ni(e,t,n){switch(e){case"top":case"bottom":return n?t?Eo:vo:t?vo:Eo;case"left":case"right":return t?Fi:Di;default:return[]}}function $i(e,t,n,o){const r=Ze(e);let s=Ni(Re(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Mn)))),s}function Kt(e){const t=Re(e);return Mi[t]+e.slice(t.length)}function Bi(e){return{top:0,right:0,bottom:0,left:0,...e}}function dr(e){return typeof e!="number"?Bi(e):{top:e,right:e,bottom:e,left:e}}function Gt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var Wi=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[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] *)"],Xt=Wi.join(","),pr=typeof Element>"u",bt=pr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zt=!pr&&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?.ownerDocument},Jt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Jt(t.parentNode));return i},Vi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},gr=function(t,n,o){if(Jt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Xt));return n&&bt.call(t,Xt)&&r.unshift(t),r=r.filter(o),r},Qt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Jt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Qt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=bt.call(i,Xt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Jt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var g=Qt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,g):r.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return r},mr=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Vi(t))&&!mr(t)?0:t.tabIndex},ji=function(t,n){var o=hr(t);return o<0&&n&&!mr(t)?0:o},Hi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},br=function(t){return t.tagName==="INPUT"},_i=function(t){return br(t)&&t.type==="hidden"},Yi=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Ui=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},zi=function(t){if(!t.name)return!0;var n=t.form||Zt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(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=Ui(r,t.form);return!s||s===t},qi=function(t){return br(t)&&t.type==="radio"},Ki=function(t){return qi(t)&&!zi(t)},Gi=function(t){var n,o=t&&Zt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=Zt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},Ro=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Xi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=bt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(bt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=Zt(t);if(l&&!l.shadowRoot&&r(l)===!0)return Ro(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Gi(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Ro(t);return!1},Zi=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return bt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},An=function(t,n){return!(n.disabled||_i(n)||Xi(n,t)||Yi(n)||Zi(n))},Ln=function(t,n){return!(Ki(n)||hr(n)<0||!An(t,n))},Ji=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},yr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=ji(a,i),l=i?yr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(Hi).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},At=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:Ln.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ji}):o=gr(t,n.includeContainer,Ln.bind(null,n)),yr(o)},Qi=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:An.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=gr(t,n.includeContainer,An.bind(null,n)),o},vr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bt.call(t,Xt)===!1?!1:Ln(n,t)};const Et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Er(e,t){const n=At(e,Et()),o=n.length;if(o===0)return;const r=ft(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Gn(e){return Er(fe(e).body,1)||e}function Rr(e){return Er(fe(e).body,-1)||e}function xr(e,t){if(!e)return null;const n=At(fe(e).body,Et()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function ec(e){return xr(e,1)}function tc(e){return xr(e,-1)}function dt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function nc(e){At(e,Et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function xo(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const oc={...qo};let wo=0;function rc(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(wo+=1,o(`${t}-${wo}`))},[n,t]),r}const So=oc.useId;function Rt(e,t){if(So!==void 0){const n=So();return e??(t?`${t}-${n}`:n)}return rc(e,t)}function wr(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class sc{nodesRef={current:[]};events=wr();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Sr=d.createContext(null),Cr=d.createContext(null),it=()=>d.useContext(Sr)?.id||null,xt=e=>{const t=d.useContext(Cr);return e??t};function ic(e){const t=Rt(),n=xt(e),o=it();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function cc(e){const{children:t,id:n}=e,o=it();return ee.jsx(Sr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function ac(e){const{children:t,externalTree:n}=e,o=ke(()=>n??new sc).current;return ee.jsx(Cr.Provider,{value:o,children:t})}const lc=500,uc={style:{transition:"none"}},Tr="data-base-ui-click-trigger",Ul={fallbackAxisSide:"none"},fc={fallbackAxisSide:"end"},dc={clipPath:"inset(50%)",position:"fixed",top:0,left:0},pc="none",qe="trigger-press",Se="trigger-hover",Or="outside-press",zl="item-press",ql="close-press",It="focus-out",Pr="escape-key",Kl="list-navigation",Gl="cancel-open",Ir="imperative-action",Xl="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=Ee;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function kt(e){return`data-base-ui-${e}`}function yn(e,t,n){if(n&&!mt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function ct(e){return e?.ownerDocument||document}const yt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{Ei&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Xo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Co=0;function vn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Co);const s=()=>e?.focus({preventScroll:n});r?s():Co=requestAnimationFrame(s)}const pt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function To(e){return e==="inert"?pt.inert:e==="aria-hidden"?pt["aria-hidden"]:pt.none}let Vt=new WeakSet,jt={},En=0;const kr=e=>e&&(e.host||kr(e.parentNode)),gc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=kr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function mc(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=gc(t,e),a=new Set,c=new Set(i),l=[];jt[r]||(jt[r]=new WeakMap);const u=jt[r];i.forEach(f),p(t),a.clear();function f(g){!g||a.has(g)||(a.add(g),g.parentNode&&f(g.parentNode))}function p(g){!g||c.has(g)||[].forEach.call(g.children,m=>{if(Xe(m)!=="script")if(a.has(m))p(m);else{const h=s?m.getAttribute(s):null,y=h!==null&&h!=="false",E=To(s),b=(E.get(m)||0)+1,R=(u.get(m)||0)+1;E.set(m,b),u.set(m,R),l.push(m),b===1&&y&&Vt.add(m),R===1&&m.setAttribute(r,""),!y&&s&&m.setAttribute(s,s==="inert"?"":"true")}})}return En+=1,()=>{l.forEach(g=>{const m=To(s),y=(m.get(g)||0)-1,E=(u.get(g)||0)-1;m.set(g,y),u.set(g,E),y||(!Vt.has(g)&&s&&g.removeAttribute(s),Vt.delete(g)),E||g.removeAttribute(r)}),En-=1,En||(pt.inert=new WeakMap,pt["aria-hidden"]=new WeakMap,pt.none=new WeakMap,Vt=new WeakSet,jt={})}}function hc(e,t=!1,n=!1){const o=fe(e[0]).body;return mc(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}function Oo(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(Vn(19)?n?.ref:t.ref)??null}function Fn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function bc(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function yc(e,t){return typeof e=="function"?e(t):e}function vc(e,t){return typeof e=="function"?e(t):e}const Pt={};function Mr(e,t,n,o,r){let s={...Dn(e,Pt)};return t&&(s=Tt(s,t)),n&&(s=Tt(s,n)),o&&(s=Tt(s,o)),r&&(s=Tt(s,r)),s}function Ec(e){if(e.length===0)return Pt;if(e.length===1)return Dn(e[0],Pt);let t={...Dn(e[0],Pt)};for(let n=1;n<e.length;n+=1)t=Tt(t,e[n]);return t}function Tt(e,t){return Ar(t)?t(e):Rc(e,t)}function Rc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Fn(e.style,o);break}case"className":{e[n]=Lr(e.className,o);break}default:xc(n,o)?e[n]=wc(e[n],o):e[n]=o}}return e}function xc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function Ar(e){return typeof e=="function"}function Dn(e,t){return Ar(e)?e(t):e??Pt}function wc(e,t){return t?e?n=>{if(Sc(n)){const r=n;Nn(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Nn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Lr(e,t){return t?e?t+" "+e:t:e}function Sc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Je(e,t,n={}){const o=t.render,r=Cc(t,n);if(n.enabled===!1)return null;const s=n.state??Ee;return Tc(e,o,r,s)}function Cc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=Ee,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?yc(n,s):void 0,f=l?vc(o,s):void 0,p=l?bc(s,c):Ee,g=l?Fn(p,Array.isArray(a)?Ec(a):a)??Ee:Ee;return typeof document<"u"&&(l?Array.isArray(i)?g.ref=Ls([g.ref,Oo(r),...i]):g.ref=Ut(g.ref,Oo(r),i):Ut(null,null)),l?(u!==void 0&&(g.className=Lr(g.className,u)),f!==void 0&&(g.style=Fn(g.style,f)),g):Ee}function Tc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Mr(n,t.props);return r.ref=n.ref,d.cloneElement(t,r)}if(e&&typeof e=="string")return Oc(e,n);throw new Error(Ye(8))}function Oc(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}const Fr=d.createContext(null),Dr=()=>d.useContext(Fr),Pc=kt("portal");function Ic(e={}){const{ref:t,container:n,componentProps:o=Ee,elementProps:r,elementState:s}=e,i=Rt(),c=Dr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),g=Y(E=>{E!==null&&p(E)}),m=d.useRef(null);se(()=>{if(n===null){m.current&&(m.current=null,p(null),u(null));return}if(i==null)return;const E=(n&&(Yn(n)?n:n.current))??c??document.body;if(E==null){m.current&&(m.current=null,p(null),u(null));return}m.current!==E&&(m.current=E,p(null),u(E))},[n,c,i]);const h=Je("div",o,{ref:[t,g],state:s,props:[{id:i,[Pc]:""},r]});return{portalNode:f,portalSubtree:l&&h?Ke.createPortal(h,l):null}}const Nr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Ic({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),g=d.useRef(null),m=d.useRef(null),[h,y]=d.useState(null),E=h?.modal,b=h?.open,R=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||E)return;function S(C){l&&C.relatedTarget&&dt(C)&&(C.type==="focusin"?xo:nc)(l)}return l.addEventListener("focusin",S,!0),l.addEventListener("focusout",S,!0),()=>{l.removeEventListener("focusin",S,!0),l.removeEventListener("focusout",S,!0)}},[l,E]),d.useEffect(()=>{!l||b||xo(l)},[b,l]);const v=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:l,setFocusManagerState:y}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(Fr.Provider,{value:v,children:[R&&l&&ee.jsx(yt,{"data-type":"outside",ref:f,onFocus:S=>{if(dt(S,l))g.current?.focus();else{const C=h?h.domReference:null;Rr(C)?.focus()}}}),R&&l&&ee.jsx("span",{"aria-owns":l.id,style:dc}),l&&Ke.createPortal(o,l),R&&l&&ee.jsx(yt,{"data-type":"outside",ref:p,onFocus:S=>{if(dt(S,l))m.current?.focus();else{const C=h?h.domReference:null;Gn(C)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(It,S.nativeEvent))}}})]})]})});function Ve(e){return e==null?e:"current"in e?e.current:e}function kc(e,t){const n=he(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 Po=20;let Ue=[];function Xn(){Ue=Ue.filter(e=>e.isConnected)}function Mc(e){Xn(),e&&Xe(e)!=="body"&&(Ue.push(e),Ue.length>Po&&(Ue=Ue.slice(-Po)))}function Rn(){return Xn(),Ue[Ue.length-1]}function Ac(e){if(!e)return null;const t=Et();return vr(e,t)?e:At(e,t)[0]||e}function Lc(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ce(e).display!=="none"}function Io(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Et(),r=Qi(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return vr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.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 $r(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:g,beforeContentFocusGuardRef:m,externalTree:h}=e,y="rootStore"in t?t.rootStore:t,E=y.useState("open"),b=y.useState("domReferenceElement"),R=y.useState("floatingElement"),{events:v,dataRef:S}=y.context,C=Y(()=>S.current.floatingContext?.nodeId),T=Y(f),I=s===!1,N=bo(b)&&I,k=De(r),F=De(s),A=De(i),O=De(u),D=xt(h),P=Dr(),V=d.useRef(null),$=d.useRef(null),w=d.useRef(!1),L=d.useRef(!1),Q=d.useRef(!1),G=d.useRef(-1),X=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),z=Ut(_,m,P?.beforeInsideRef),J=Ut(ne,P?.afterInsideRef),de=ot(),pe=ot(),ge=_n(),Be=P!=null,x=In(R),U=Y((M=x)=>M?At(M,Et()):[]),B=Y(M=>{const W=U(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(q){q.key==="Tab"&&re(x,ft(fe(x)))&&U().length===0&&!N&&Ti(q)}const W=fe(x);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,x,c,k,N,U,B]),d.useEffect(()=>{if(o||!R)return;function M(W){const q=xe(W),oe=U().indexOf(q);oe!==-1&&(G.current=oe)}return R.addEventListener("focusin",M),()=>{R.removeEventListener("focusin",M)}},[o,R,U]),d.useEffect(()=>{if(o||!E)return;const M=fe(x);function W(){Q.current=!1}function q(oe){const H=xe(oe),j=re(R,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",q,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",q,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,R,b,x,E,P]),d.useEffect(()=>{if(o||!l)return;function M(){L.current=!0,pe.start(0,()=>{L.current=!1})}function W(H){const j=H.relatedTarget,be=H.currentTarget,ae=xe(H);queueMicrotask(()=>{const We=C(),Qe=y.context.triggerElements,at=j?.hasAttribute(kt("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p)].includes(j),et=!(re(b,j)||re(R,j)||re(j,R)||re(P?.portalNode,j)||j!=null&&Qe.hasElement(j)||Qe.hasMatchingElement(ye=>re(ye,j))||at||D&&(nt(D.nodesRef.current,We).find(ye=>re(ye.context?.elements.floating,j)||re(ye.context?.elements.domReference,j))||yo(D.nodesRef.current,We).find(ye=>[ye.context?.elements.floating,In(ye.context?.elements.floating)].includes(j)||ye.context?.elements.domReference===j)));if(be===b&&x&&Io(x,k),a&&be!==b&&!Lc(ae)&&ft(fe(x))===fe(x).body){if(me(x)&&(x.focus(),a==="popup")){ge.request(()=>{x.focus()});return}const ye=G.current,Me=U(),Ae=Me[ye]||Me[Me.length-1]||x;me(Ae)&&Ae.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(N||!c)&&j&&et&&!L.current&&(N||j!==Rn())&&(w.current=!0,y.setOpen(!1,ce(It,H)))})}function q(){Q.current||(S.current.insideReactTree=!0,de.start(0,()=>{S.current.insideReactTree=!1}))}const te=me(b)?b:null,oe=[];if(!(!R&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),R&&(R.addEventListener("focusout",W),P&&(R.addEventListener("focusout",q,!0),oe.push(()=>{R.removeEventListener("focusout",q,!0)})),oe.push(()=>{R.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,R,x,c,D,P,y,l,a,U,N,C,k,S,de,pe,ge,p,g]),d.useEffect(()=>{if(o||!R||!E)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${kt("portal")}]`)||[]),q=(D?yo(D.nodesRef.current,C()):[]).find(H=>bo(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[R,q,...M,...T(),V.current,$.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p),N?b:null].filter(H=>H!=null),oe=hc(te,c||N);return()=>{oe()}},[E,o,b,R,c,k,P,N,D,C,T,p,g]),se(()=>{if(!E||o||!me(x))return;const M=fe(x),W=ft(M);queueMicrotask(()=>{const q=B(x),te=F.current,oe=typeof te=="function"?te(O.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=q[0]||x:H=Ve(oe),H=H||q[0]||x,!re(x,W)&&vn(H,{preventScroll:H===x})})},[o,E,x,I,B,F,O]),se(()=>{if(o||!x)return;const M=fe(x),W=ft(M);Mc(W);function q(H){if(H.open||(X.current=kc(H.nativeEvent,Z.current)),H.reason===Se&&H.nativeEvent.type==="mouseleave"&&(w.current=!0),H.reason===Or)if(H.nested)w.current=!1;else if(Pi(H.nativeEvent)||Ii(H.nativeEvent))w.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?w.current=!1:w.current=!0}}v.on("openchange",q);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Xo),Be&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(X.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||Rn();return ae&&ae.isConnected?ae:te}const be=b||Rn()||te;return Ve(j)||be}return()=>{v.off("openchange",q);const H=ft(M),j=re(R,H)||D&&nt(D.nodesRef.current,C(),!1).some(ae=>re(ae.context?.elements.floating,H)),be=oe();queueMicrotask(()=>{const ae=Ac(be),We=typeof A.current!="boolean";A.current&&!w.current&&me(ae)&&(!(!We&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,R,x,A,S,v,D,Be,b,C]),d.useEffect(()=>{queueMicrotask(()=>{w.current=!1})},[o]),d.useEffect(()=>{if(o||!E)return;function M(q){xe(q)?.closest(`[${Tr}]`)&&(L.current=!0)}const W=fe(x);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,E,x]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:E,onOpenChange:y.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,E,y,l,b]),se(()=>{if(!(o||!x))return Io(x,k),()=>{queueMicrotask(Xn)}},[o,x,k]);const ue=!o&&(c?!N:!0)&&(Be||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(yt,{"data-type":"inside",ref:z,onFocus:M=>{if(c){const W=B();vn(W[W.length-1])}else P?.portalNode&&(w.current=!1,dt(M,P.portalNode)?Gn(b)?.focus():Ve(g??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(yt,{"data-type":"inside",ref:J,onFocus:M=>{c?vn(B()[0]):P?.portalNode&&(l&&(w.current=!0),dt(M,P.portalNode)?Rr(b)?.focus():Ve(p??P.afterOutsideRef)?.focus())}})]})}function Fc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=_n(),p=ot(),g=d.useMemo(()=>({onPointerDown(m){u.current=m.pointerType},onMouseDown(m){const h=u.current,y=m.nativeEvent,E=n.select("open");if(m.button!==0||s==="click"||mt(h,!0)&&a)return;const b=o.current.openEvent,R=b?.type,v=n.select("domReferenceElement")!==m.currentTarget,S=E&&v||!(E&&i&&(!(b&&c)||R==="click"||R==="mousedown"));if(ur(y.target)){const T=ce(qe,y,y.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T);return}const C=m.currentTarget;f.request(()=>{const T=ce(qe,y,C);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T)})},onClick(m){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(mt(h,!0)&&a)return;const y=n.select("open"),E=o.current.openEvent,b=n.select("domReferenceElement")!==m.currentTarget,R=y&&b||!(y&&i&&(!(E&&c)||fr(E))),v=ce(qe,m.nativeEvent,m.currentTarget);R&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,v)}):n.setOpen(R,v)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:g}:Ee,[r,g])}function ko(e,t,n){let{reference:o,floating:r}=e;const s=Oe(t),i=Kn(t),a=qn(i),c=Re(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let g;switch(c){case"top":g={x:u,y:o.y-r.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}switch(Ze(t)){case"start":g[i]-=p*(n&&l?-1:1);break;case"end":g[i]+=p*(n&&l?-1:1);break}return g}async function Dc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=_e(t,e),m=dr(g),y=a[p?f==="floating"?"reference":"floating":f],E=Gt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),v=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},S=Gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:R,strategy:c}):b);return{top:(E.top-S.top+m.top)/v.y,bottom:(S.bottom-E.bottom+m.bottom)/v.y,left:(E.left-S.left+m.left)/v.x,right:(S.right-E.right+m.right)/v.x}}const Nc=50,$c=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Dc},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=ko(l,o,c),p=o,g=0;const m={};for(let h=0;h<s.length;h++){const y=s[h];if(!y)continue;const{name:E,fn:b}=y,{x:R,y:v,data:S,reset:C}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=R??u,f=v??f,m[E]={...m[E],...S},C&&g<Nc&&(g++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:u,y:f}=ko(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:m}},Bc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...y}=_e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Re(r),b=Oe(a),R=Re(a)===a,v=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(R||!h?[Kt(a)]:Li(a)),C=m!=="none";!p&&C&&S.push(...$i(a,h,m,v));const T=[a,...S],I=await c.detectOverflow(t,y),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[E]),f){const D=Ai(r,i,v);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var F,A;const D=(((F=s.flip)==null?void 0:F.index)||0)+1,P=T[D];if(P&&(!(f==="alignment"?b!==Oe(P):!1)||k.every(w=>Oe(w.placement)===b?w.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter($=>$.overflows[0]<=0).sort(($,w)=>$.overflows[1]-w.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(g){case"bestFit":{var O;const $=(O=k.filter(w=>{if(C){const L=Oe(w.placement);return L===b||L==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(L=>L>0).reduce((L,Q)=>L+Q,0)]).sort((w,L)=>w[1]-L[1])[0])==null?void 0:O[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function Mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ao(e){return ki.some(t=>e[t]>=0)}const Wc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=_e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=Mo(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ao(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=Mo(i,n.floating);return{data:{escapedOffsets:a,escaped:Ao(a)}}}default:return{}}}}},Br=new Set(["left","top"]);async function Vc(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Re(n),a=Ze(n),c=Oe(n)==="y",l=Br.has(i)?-1:1,u=s&&c?-1:1,f=_e(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(g=a==="end"?m*-1:m),c?{x:g*u,y:p*l}:{x:p*l,y:g*u}}const jc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Vc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},Hc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:E=>{let{x:b,y:R}=E;return{x:b,y:R}}},...l}=_e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=Oe(Re(r)),g=zn(p);let m=u[g],h=u[p];if(i){const E=g==="y"?"top":"left",b=g==="y"?"bottom":"right",R=m+f[E],v=m-f[b];m=kn(R,m,v)}if(a){const E=p==="y"?"top":"left",b=p==="y"?"bottom":"right",R=h+f[E],v=h-f[b];h=kn(R,h,v)}const y=c.fn({...t,[g]:m,[p]:h});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[g]:i,[p]:a}}}}}},_c=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=_e(e,t),u={x:n,y:o},f=Oe(r),p=zn(f);let g=u[p],m=u[f];const h=_e(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const R=p==="y"?"height":"width",v=s.reference[p]-s.floating[R]+y.mainAxis,S=s.reference[p]+s.reference[R]-y.mainAxis;g<v?g=v:g>S&&(g=S)}if(l){var E,b;const R=p==="y"?"width":"height",v=Br.has(Re(r)),S=s.reference[f]-s.floating[R]+(v&&((E=i.offset)==null?void 0:E[f])||0)+(v?0:y.crossAxis),C=s.reference[f]+s.reference[R]+(v?0:((b=i.offset)==null?void 0:b[f])||0)-(v?y.crossAxis:0);m<S?m=S:m>C&&(m=C)}return{[p]:g,[f]:m}}}},Yc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=_e(e,t),u=await i.detectOverflow(t,l),f=Re(r),p=Ze(r),g=Oe(r)==="y",{width:m,height:h}=s.floating;let y,E;f==="top"||f==="bottom"?(y=f,E=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(E=f,y=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,R=m-u.left-u.right,v=ht(h-u[y],b),S=ht(m-u[E],R),C=!t.middlewareData.shift;let T=v,I=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=b),C&&!p){const k=we(u.left,0),F=we(u.right,0),A=we(u.top,0),O=we(u.bottom,0);g?I=m-2*(k!==0||F!==0?k+F:we(u.left,u.right)):T=h-2*(A!==0||O!==0?A+O:we(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:T});const N=await i.getDimensions(a.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Wr(e){const t=Ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=me(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=qt(n)!==s||qt(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Zn(e){return ie(e)?e:e.contextElement}function gt(e){const t=Zn(e);if(!me(t))return Ne(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Wr(t);let i=(s?qt(n.width):n.width)/o,a=(s?qt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Uc=Ne(0);function Vr(e){const t=he(e);return!on()||!t.visualViewport?Uc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==he(e)?!1:t}function rt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Zn(e);let i=Ne(1);t&&(o?ie(o)&&(i=gt(o)):i=gt(e));const a=zc(s,n,o)?Vr(s):Ne(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=he(s),g=o&&ie(o)?he(o):o;let m=p,h=Tn(m);for(;h&&o&&g!==m;){const y=gt(h),E=h.getBoundingClientRect(),b=Ce(h),R=E.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,v=E.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,f*=y.y,c+=R,l+=v,m=he(h),h=Tn(m)}}return Gt({width:u,height:f,x:c,y:l})}function sn(e,t){const n=rn(e).scrollLeft;return t?t.left+n:rt($e(e)).left+n}function jr(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-sn(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function qc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=$e(o),a=t?nn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Ne(1);const u=Ne(0),f=me(o);if((f||!f&&!s)&&((Xe(o)!=="body"||st(i))&&(c=rn(o)),f)){const g=rt(o);l=gt(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}const p=i&&!f&&!s?jr(i,c):Ne(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function Kc(e){return Array.from(e.getClientRects())}function Gc(e){const t=$e(e),n=rn(e),o=e.ownerDocument.body,r=we(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=we(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+sn(e);const a=-n.scrollTop;return Ce(o).direction==="rtl"&&(i+=we(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const Lo=25;function Xc(e,t){const n=he(e),o=$e(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=on();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=sn(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-f.clientWidth-g);m<=Lo&&(s-=m)}else l<=Lo&&(s+=l);return{width:s,height:i,x:a,y:c}}function Zc(e,t){const n=rt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=me(e)?gt(e):Ne(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function Fo(e,t,n){let o;if(t==="viewport")o=Xc(e,n);else if(t==="document")o=Gc($e(e));else if(ie(t))o=Zc(t,n);else{const r=Vr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Gt(o)}function Hr(e,t){const n=He(e);return n===t||!ie(n)||je(n)?!1:Ce(n).position==="fixed"||Hr(n,t)}function Jc(e,t){const n=t.get(e);if(n)return n;let o=ze(e,[],!1).filter(a=>ie(a)&&Xe(a)!=="body"),r=null;const s=Ce(e).position==="fixed";let i=s?He(e):e;for(;ie(i)&&!je(i);){const a=Ce(i),c=Un(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||st(i)&&!c&&Hr(e,i))?o=o.filter(u=>u!==i):r=a,i=He(i)}return t.set(e,o),o}function Qc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?nn(t)?[]:Jc(t,this._c):[].concat(n),o],a=Fo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const g=Fo(t,i[p],r);c=we(g.top,c),l=ht(g.right,l),u=ht(g.bottom,u),f=we(g.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function ea(e){const{width:t,height:n}=Wr(e);return{width:t,height:n}}function ta(e,t,n){const o=me(t),r=$e(t),s=n==="fixed",i=rt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Ne(0);function l(){c.x=sn(r)}if(o||!o&&!s)if((Xe(t)!=="body"||st(r))&&(a=rn(t)),o){const g=rt(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?jr(r,a):Ne(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function xn(e){return Ce(e).position==="static"}function Do(e,t){if(!me(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $e(e)===n&&(n=n.ownerDocument.body),n}function _r(e,t){const n=he(e);if(nn(e))return n;if(!me(e)){let r=He(e);for(;r&&!je(r);){if(ie(r)&&!xn(r))return r;r=He(r)}return n}let o=Do(e,t);for(;o&&mi(o)&&xn(o);)o=Do(o,t);return o&&je(o)&&xn(o)&&!Un(o)?n:o||yi(e)||n}const na=async function(e){const t=this.getOffsetParent||_r,n=this.getDimensions,o=await n(e.floating);return{reference:ta(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oa(e){return Ce(e).direction==="rtl"}const ra={convertOffsetParentRelativeRectToViewportRelativeRect:qc,getDocumentElement:$e,getClippingRect:Qc,getOffsetParent:_r,getElementRects:na,getClientRects:Kc,getDimensions:ea,getScale:gt,isElement:ie,isRTL:oa};function Yr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sa(e,t){let n=null,o;const r=$e(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:g}=l;if(a||t(),!p||!g)return;const m=Wt(f),h=Wt(r.clientWidth-(u+p)),y=Wt(r.clientHeight-(f+g)),E=Wt(u),R={rootMargin:-m+"px "+-h+"px "+-y+"px "+-E+"px",threshold:we(0,ht(1,c))||1};let v=!0;function S(C){const T=C[0].intersectionRatio;if(T!==c){if(!v)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Yr(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(S,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,R)}n.observe(e)}return i(!0),s}function No(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Zn(e),u=r||s?[...l?ze(l):[],...t?ze(t):[]]:[];u.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=l&&a?sa(l,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(E=>{let[b]=E;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let m,h=c?rt(e):null;c&&y();function y(){const E=rt(e);h&&!Yr(h,E)&&n(),h=E,m=requestAnimationFrame(y)}return n(),()=>{var E;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(E=g)==null||E.disconnect(),g=null,c&&cancelAnimationFrame(m)}}const ia=jc,ca=Hc,aa=Bc,la=Yc,ua=Wc,fa=_c,da=(e,t,n)=>{const o=new Map,r={platform:ra,...n},s={...r.platform,_c:o};return $c(e,t,{...r,platform:s})};var pa=typeof document<"u",ga=function(){},_t=pa?d.useLayoutEffect:ga;function en(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!en(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ur(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $o(e,t){const n=Ur(e);return Math.round(t*n)/n}function wn(e){const t=d.useRef(e);return _t(()=>{t.current=e}),t}function ma(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=d.useState(o);en(p,o)||g(o);const[m,h]=d.useState(null),[y,E]=d.useState(null),b=d.useCallback(w=>{w!==C.current&&(C.current=w,h(w))},[]),R=d.useCallback(w=>{w!==T.current&&(T.current=w,E(w))},[]),v=s||m,S=i||y,C=d.useRef(null),T=d.useRef(null),I=d.useRef(u),N=c!=null,k=wn(c),F=wn(r),A=wn(l),O=d.useCallback(()=>{if(!C.current||!T.current)return;const w={placement:t,strategy:n,middleware:p};F.current&&(w.platform=F.current),da(C.current,T.current,w).then(L=>{const Q={...L,isPositioned:A.current!==!1};D.current&&!en(I.current,Q)&&(I.current=Q,Ke.flushSync(()=>{f(Q)}))})},[p,t,n,F,A]);_t(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(w=>({...w,isPositioned:!1})))},[l]);const D=d.useRef(!1);_t(()=>(D.current=!0,()=>{D.current=!1}),[]),_t(()=>{if(v&&(C.current=v),S&&(T.current=S),v&&S){if(k.current)return k.current(v,S,O);O()}},[v,S,O,k,N]);const P=d.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:R}),[b,R]),V=d.useMemo(()=>({reference:v,floating:S}),[v,S]),$=d.useMemo(()=>{const w={position:n,left:0,top:0};if(!V.floating)return w;const L=$o(V.floating,u.x),Q=$o(V.floating,u.y);return a?{...w,transform:"translate("+L+"px, "+Q+"px)",...Ur(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:O,refs:P,elements:V,floatingStyles:$}),[u,O,P,V,$])}const ha=(e,t)=>{const n=ia(e);return{name:n.name,fn:n.fn,options:[e,t]}},ba=(e,t)=>{const n=ca(e);return{name:n.name,fn:n.fn,options:[e,t]}},ya=(e,t)=>({fn:fa(e).fn,options:[e,t]}),va=(e,t)=>{const n=aa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ea=(e,t)=>{const n=la(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ra=(e,t)=>{const n=ua(e);return{name:n.name,fn:n.fn,options:[e,t]}},xa={intentional:"onClick",sloppy:"onPointerDown"};function wa(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function zr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:g=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:y,externalTree:E}=t,b=xt(E),R=Y(typeof f=="function"?f:()=>!1),v=typeof f=="function"?R:f,S=d.useRef(!1),{escapeKey:C,outsidePress:T}=wa(y),I=d.useRef(null),N=ot(),k=ot(),F=Y(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),O=d.useRef(""),D=Y(x=>{O.current=x.pointerType}),P=Y(()=>{const x=O.current,U=x==="pen"||!x?"mouse":x,B=typeof p=="function"?p():p;return typeof B=="string"?B:B[U]}),V=Y(x=>{if(!o||!l||!u||x.key!=="Escape"||A.current)return;const U=c.current.floatingContext?.nodeId,B=b?nt(b.nodesRef.current,U):[];if(!C&&B.length>0){let W=!0;if(B.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=Oi(x)?x.nativeEvent:x,M=ce(Pr,ue);n.setOpen(!1,M),!C&&!M.isPropagationAllowed&&x.stopPropagation()}),$=Y(x=>{const U=P();return U==="intentional"&&x.type!=="click"||U==="sloppy"&&x.type==="click"}),w=Y(()=>{c.current.insideReactTree=!0,k.start(0,F)}),L=Y((x,U=!1)=>{if($(x)){F();return}if(c.current.insideReactTree){F();return}if(P()==="intentional"&&U||typeof v=="function"&&!v(x))return;const B=xe(x),ue=`[${kt("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if(B&&(W.hasElement(B)||W.hasMatchingElement(j=>re(j,B))))return;let q=ie(B)?B:null;for(;q&&!je(q);){const j=He(q);if(je(j)||!ie(j))break;q=j}if(M.length&&ie(B)&&!Ci(B)&&!re(B,n.select("floatingElement"))&&Array.from(M).every(j=>!re(q,j)))return;if(me(B)&&!("touches"in x)){const j=je(B),be=Ce(B),ae=/auto|scroll/,We=j||ae.test(be.overflowX),Qe=j||ae.test(be.overflowY),at=We&&B.clientWidth>0&&B.scrollWidth>B.clientWidth,et=Qe&&B.clientHeight>0&&B.scrollHeight>B.clientHeight,ye=be.direction==="rtl",Me=et&&(ye?x.offsetX<=B.offsetWidth-B.clientWidth:x.offsetX>B.clientWidth),Ae=at&&x.offsetY>B.clientHeight;if(Me||Ae)return}const te=c.current.floatingContext?.nodeId,oe=b&&nt(b.nodesRef.current,te).some(j=>Pe(x,j.context?.elements.floating));if(Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||oe)return;const H=b?nt(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(Or,x)),F()}),Q=Y(x=>{P()!=="sloppy"||x.pointerType==="touch"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||L(x)}),G=Y(x=>{if(P()!=="sloppy"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];U&&(I.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),X=Y(x=>{const U=xe(x);function B(){G(x),U?.removeEventListener(x.type,B)}U?.addEventListener(x.type,B)}),Z=Y(x=>{const U=S.current;if(S.current=!1,N.clear(),x.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const B=xe(x);function ue(){x.type==="pointerdown"?Q(x):L(x,U),B?.removeEventListener(x.type,ue)}B?.addEventListener(x.type,ue)}),_=Y(x=>{if(P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];if(!U)return;const B=Math.abs(U.clientX-I.current.startX),ue=Math.abs(U.clientY-I.current.startY),M=Math.sqrt(B*B+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(L(x),N.clear(),I.current=null)}),ne=Y(x=>{const U=xe(x);function B(){_(x),U?.removeEventListener(x.type,B)}U?.addEventListener(x.type,B)}),z=Y(x=>{P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&L(x),N.clear(),I.current=null)}),J=Y(x=>{const U=xe(x);function B(){z(x),U?.removeEventListener(x.type,B)}U?.addEventListener(x.type,B)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=C,c.current.__outsidePressBubbles=T;const x=new Ge;function U(q){n.setOpen(!1,ce(pc,q))}function B(){x.clear(),A.current=!0}function ue(){x.start(on()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",B),M.addEventListener("compositionend",ue)),v&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",X,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=ze(i)),ie(r)&&(W=W.concat(ze(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(ze(s.contextElement)))),W=W.filter(q=>q!==M.defaultView?.visualViewport),W.forEach(q=>{q.addEventListener("scroll",U,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",B),M.removeEventListener("compositionend",ue)),v&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",X,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(q=>{q.removeEventListener("scroll",U)}),x.clear(),S.current=!1}},[c,r,s,i,u,v,o,a,h,l,C,T,V,L,Z,Q,X,ne,J,D,n]),d.useEffect(F,[v,F]);const de=d.useMemo(()=>({onKeyDown:V,...g&&{[xa[m]]:x=>{n.setOpen(!1,ce(qe,x.nativeEvent))},...m!=="intentional"&&{onClick(x){n.setOpen(!1,ce(qe,x.nativeEvent))}}}}),[V,n,g,m]),pe=Y(x=>{const U=xe(x.nativeEvent);!re(n.select("floatingElement"),U)||x.button!==0||(S.current=!0)}),ge=Y(x=>{!o||!l||x.button!==0||(S.current=!0)}),Be=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:w,onMouseDownCapture(x){w(),ge(x)},onPointerDownCapture(x){w(),ge(x)},onMouseUpCapture:w,onTouchEndCapture:w,onTouchMoveCapture:w}),[V,pe,w,ge]);return d.useMemo(()=>l?{reference:de,floating:Be,trigger:de}:{},[l,de,Be])}const Sa={open:K(e=>e.open),domReferenceElement:K(e=>e.domReferenceElement),referenceElement:K(e=>e.positionReference??e.referenceElement),floatingElement:K(e=>e.floatingElement),floatingId:K(e=>e.floatingId)};class Jn extends jn{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:wr(),nested:n,noEmit:o,triggerElements:s},Sa)}setOpen=(t,n)=>{if((!t||!this.state.open||fr(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function Ca(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Fe.request(()=>{r("ending")});return()=>{Fe.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Fe.request(()=>{r(void 0)});return()=>{Fe.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Fe.request(()=>{r("idle")});return()=>{Fe.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Mt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Ta={[Mt.startingStyle]:""},Oa={[Mt.endingStyle]:""},cn={transitionStatus(e){return e==="starting"?Ta:e==="ending"?Oa:null}};function qr(e,t=!1,n=!0){const o=_n();return Y((r,s=null)=>{o.cancel();function i(){Ke.flushSync(r)}const a=Ve(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Mt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Qn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=qr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function Pa(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Ia(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Pa(e,n),i=Y(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Kr(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Gr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=Ca(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=Y(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Qn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class an{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),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 ka(){return new Jn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new an,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Xr(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:ka(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Ee,inactiveTriggerProps:Ee,popupProps:Ee}}const Zr={open:K(e=>e.open),mounted:K(e=>e.mounted),transitionStatus:K(e=>e.transitionStatus),floatingRootContext:K(e=>e.floatingRootContext),preventUnmountingOnClose:K(e=>e.preventUnmountingOnClose),payload:K(e=>e.payload),activeTriggerId:K(e=>e.activeTriggerId),activeTriggerElement:K(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:K((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:K((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:K(e=>e.popupProps),popupElement:K(e=>e.popupElement),positionerElement:K(e=>e.positionerElement)};function Ma(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Rt(),s=it()!=null,i=ke(()=>new Jn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new an,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Aa(e={}){const{nodeId:t,externalTree:n}=e,o=Ma(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=xt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=ma({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(T=>{const I=ie(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;a(I),u.refs.setReference(I)},[u.refs]),[p,g]=d.useState(null),[m,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",m);const y=d.useCallback(T=>{(ie(T)||T===null)&&(c.current=T,g(T)),(ie(u.refs.reference.current)||u.refs.reference.current===null||T!==null&&!ie(T))&&u.refs.setReference(T)},[u.refs,g]),E=d.useCallback(T=>{h(T),u.refs.setFloating(T)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:y,setFloating:E,setPositionReference:f,domReference:c}),[u.refs,y,E,f]),R=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),v=r.useState("open"),S=r.useState("floatingId"),C=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:v,onOpenChange:r.setOpen,events:r.context.events,floatingId:S,refs:b,elements:R,nodeId:t,rootStore:r}),[u,b,R,t,r,v,S]);return se(()=>{r.context.dataRef.current.floatingContext=C;const T=l?.nodesRef.current.find(I=>I.id===t);T&&(T.context=C)}),d.useMemo(()=>({...u,context:C,refs:b,elements:R,rootStore:r}),[u,b,R,C,r])}function Jr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Rt(),i=it()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=ke(()=>new Jn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const $n=kt("safe-polygon"),La=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${lr}`;function Fa(e){return e?!!e.closest(La):!1}function Qr(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=ot(),l=ot(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Da=new Set(["click","mousedown"]);function Na(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:g,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:y,handleCloseOptionsRef:E}=Qr(n),b=xt(l),R=it(),v=Y(()=>f.current?!0:i.current.openEvent?Da.has(i.current.openEvent.type):!1),S=Y(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),C=d.useCallback((k,F=!0)=>{const A=$a(c,u.current);A&&!p.current?y.start(A,()=>n.setOpen(!1,ce(Se,k))):F&&(y.clear(),n.setOpen(!1,ce(Se,k)))},[c,p,n,u,y]),T=Y(()=>{m.current(),p.current=void 0}),I=Y(()=>{if(g.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute($n),g.current=!1}}),N=Y(k=>{const F=xe(k);if(!Fa(F)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,T(),I())},[o,u,h,f,T,I]),d.useEffect(()=>()=>{T()},[T]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&E.current?.blockPointerEvents&&S()&&ie(s)&&r){g.current=!0;const k=fe(r).body;k.setAttribute($n,"");const F=s,A=r,O=b?.nodesRef.current.find(D=>D.id===R)?.context?.elements.floating;return O&&(O.style.pointerEvents=""),k.style.pointerEvents="none",F.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",F.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,E,S,b,R,g]),d.useEffect(()=>{if(!a)return;function k(D){if(v()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),T(),v()||C(D))}function F(D){y.clear(),I(),p.current?.(D),T()}function A(D){v()||C(D,!1)}const O=r;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",A),O.addEventListener("pointerdown",N,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",A),O.removeEventListener("pointerdown",N,!0))}})}function $a(e,t){return t&&!mt(t)?0:typeof e=="function"?e():e}function Sn(e){return typeof e=="function"?e():e}const Ba={current:null};function Wa(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Ba,externalTree:p,isActiveTrigger:g=!0}=t,m=xt(p),{pointerTypeRef:h,interactedInsideRef:y,handlerRef:E,blockMouseMoveRef:b,performedPointerEventsMutationRef:R,unbindMouseMoveRef:v,restTimeoutPendingRef:S,openChangeTimeout:C,restTimeout:T,handleCloseOptionsRef:I}=Qr(n),N=De(a),k=De(i),F=De(l);g&&(I.current=N.current?.__options);const A=Y(()=>y.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),O=d.useCallback(($,w=!0)=>{const L=yn(k.current,"close",h.current);L&&!E.current?C.start(L,()=>n.setOpen(!1,ce(Se,$))):w&&(C.clear(),n.setOpen(!1,ce(Se,$)))},[k,E,n,h,C]),D=Y(()=>{v.current(),E.current=void 0}),P=Y(()=>{if(R.current){const $=fe(n.select("domReferenceElement")).body;$.style.pointerEvents="",$.removeAttribute($n),R.current=!1}});d.useEffect(()=>{if(!s)return;function $(w){w.open||(C.clear(),T.clear(),b.current=!0,S.current=!1)}return r.on("openchange",$),()=>{r.off("openchange",$)}},[s,r,C,T,b,S]);const V=Y($=>{if(A()||!o.current.floatingContext)return;const w=n.context.triggerElements;if($.relatedTarget&&w.hasElement($.relatedTarget))return;const L=f.current;N.current?.({...o.current.floatingContext,tree:m,x:$.clientX,y:$.clientY,onClose(){P(),D(),!A()&&L===n.select("domReferenceElement")&&O($)}})($)});return d.useEffect(()=>{if(!s)return;const $=f.current??(g?n.select("domReferenceElement"):null);if(!ie($))return;function w(G){if(C.clear(),b.current=!1,c&&!mt(h.current)||Sn(F.current)>0&&!yn(k.current,"open"))return;const X=yn(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(G.target)||_.hasMatchingElement(pe=>re(pe,G.target)))&&(!Z||!re(Z,G.target)),z=G.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(Se,G,z)):X?C.start(X,()=>{de&&n.setOpen(!0,ce(Se,G,z))}):de&&n.setOpen(!0,ce(Se,G,z))}function L(G){if(A()){P();return}v.current();const X=n.select("domReferenceElement"),Z=fe(X);T.clear(),S.current=!1;const _=n.context.triggerElements;if(G.relatedTarget&&_.hasElement(G.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||C.clear();const z=f.current;E.current=N.current({...o.current.floatingContext,tree:m,x:G.clientX,y:G.clientY,onClose(){P(),D(),!A()&&z===n.select("domReferenceElement")&&O(G,!0)}});const J=E.current;J(G),Z.addEventListener("mousemove",J),v.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),G.relatedTarget))&&O(G)}function Q(G){V(G)}return n.select("open")&&$.addEventListener("mouseleave",Q),u&&$.addEventListener("mousemove",w,{once:!0}),$.addEventListener("mouseenter",w),$.addEventListener("mouseleave",L),()=>{$.removeEventListener("mouseleave",Q),u&&$.removeEventListener("mousemove",w),$.removeEventListener("mouseenter",w),$.removeEventListener("mouseleave",L)}},[D,P,b,o,k,O,n,s,N,V,g,A,c,u,h,F,T,S,C,f,m,v,E]),d.useMemo(()=>{function $(w){h.current=w.pointerType}return{onPointerDown:$,onPointerEnter:$,onMouseMove(w){const{nativeEvent:L}=w,Q=w.currentTarget,G=n.select("domReferenceElement"),X=n.context.triggerElements,Z=n.select("open"),_=(X.hasElement(w.target)||X.hasMatchingElement(z=>re(z,w.target)))&&(!G||!re(G,w.target));if(c&&!mt(h.current)||Z&&!_||Sn(F.current)===0||!_&&S.current&&w.movementX**2+w.movementY**2<2)return;T.clear();function ne(){if(S.current=!1,A())return;const z=n.select("open");!b.current&&(!z||_)&&n.setOpen(!0,ce(Se,L,Q))}h.current==="touch"?Ke.flushSync(()=>{ne()}):_&&Z?ne():(S.current=!0,T.start(Sn(F.current),ne))}}},[b,A,c,n,h,F,T,S])}function eo(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Ht(l,e,"reference"),t),i=d.useCallback(l=>Ht(l,e,"floating"),n),a=d.useCallback(l=>Ht(l,e,"item"),o),c=d.useCallback(l=>Ht(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Ht(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Pn]="");for(const i in e)r&&e&&(i===cr||i===ar)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Bo(s,a,r,o)}return Bo(s,e,r,o),s}function Bo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===cr||r===ar)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Va=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function es(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=Rt(),u=s?.id||l,f=d.useMemo(()=>In(i)?.id||r,[i,r]),p=Va.get(c)??c,m=it()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?Ee:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,m,c]),y=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),E=d.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:R,selected:v})=>{const S={role:"option",...R&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...S,"aria-selected":v}}return{}},[f,c]);return d.useMemo(()=>a?{reference:y,floating:E,item:b,trigger:h}:{},[a,y,E,h,b])}function Wo(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function ja(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ha(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ge;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const g=performance.now(),m=g-c;if(i===null||a===null||m===0)return i=f,a=p,c=g,null;const h=f-i,y=p-a,b=Math.sqrt(h*h+y*y)/m;return i=f,a=p,c=g,b}const u=({x:f,y:p,placement:g,elements:m,onClose:h,nodeId:y,tree:E})=>function(R){function v(){r.clear(),h()}if(r.clear(),!m.domReference||!m.floating||g==null||f==null||p==null)return;const{clientX:S,clientY:C}=R,T=[S,C],I=xe(R),N=R.type==="mouseleave",k=re(m.floating,I),F=re(m.domReference,I),A=m.domReference.getBoundingClientRect(),O=m.floating.getBoundingClientRect(),D=g.split("-")[0],P=f>O.right-O.width/2,V=p>O.bottom-O.height/2,$=ja(T,A),w=O.width>A.width,L=O.height>A.height,Q=(w?A:O).left,G=(w?A:O).right,X=(L?A:O).top,Z=(L?A:O).bottom;if(k&&(s=!0,!N))return;if(F&&(s=!1),F&&!N){s=!0;return}if(N&&ie(R.relatedTarget)&&re(m.floating,R.relatedTarget)||E&&nt(E.nodesRef.current,y).some(({context:z})=>z?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return v();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,O.bottom-1],[G,O.bottom-1],[G,A.top+1]];break;case"bottom":_=[[Q,O.top+1],[Q,A.bottom-1],[G,A.bottom-1],[G,O.top+1]];break;case"left":_=[[O.right-1,Z],[O.right-1,X],[A.left+1,X],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,X],[O.left+1,X],[O.left+1,Z]];break}function ne([z,J]){switch(D){case"top":{const de=[w?z+t/2:P?z+t*4:z-t*4,J+t+1],pe=[w?z-t/2:P?z+t*4:z-t*4,J+t+1],ge=[[O.left,P||w?O.bottom-t:O.top],[O.right,P?w?O.bottom-t:O.top:O.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[w?z+t/2:P?z+t*4:z-t*4,J-t],pe=[w?z-t/2:P?z+t*4:z-t*4,J-t],ge=[[O.left,P||w?O.top+t:O.bottom],[O.right,P?w?O.top+t:O.bottom:O.top+t]];return[de,pe,...ge]}case"left":{const de=[z+t+1,L?J+t/2:V?J+t*4:J-t*4],pe=[z+t+1,L?J-t/2:V?J+t*4:J-t*4];return[...[[V||L?O.right-t:O.left,O.top],[V?L?O.right-t:O.left:O.right-t,O.bottom]],de,pe]}case"right":{const de=[z-t,L?J+t/2:V?J+t*4:J-t*4],pe=[z-t,L?J-t/2:V?J+t*4:J-t*4],ge=[[V||L?O.left+t:O.right,O.top],[V?L?O.left+t:O.right:O.left+t,O.bottom]];return[de,pe,...ge]}default:return[]}}if(!Wo([S,C],_)){if(s&&!$)return v();if(!N&&o){const z=l(R.clientX,R.clientY);if(z!==null&&z<.1)return v()}Wo([S,C],ne([f,p]))?!s&&o&&r.start(40,v):v()}};return u.__options={blockPointerEvents:n},u}function ts(e){return Rt(e,"base-ui")}function _a(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function ns(e){const[t,n]=d.useState(null),o=Y((a,c)=>{e||n(c||(ir?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=_a(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ie=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Mt.startingStyle]="startingStyle",e[e.endingStyle=Mt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Bn=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Ya={[Bn.popupOpen]:""},Ua={[Bn.popupOpen]:"",[Bn.pressed]:""},za={[Ie.open]:""},qa={[Ie.closed]:""},Ka={[Ie.anchorHidden]:""},Ga={open(e){return e?Ya:null}},Xa={open(e){return e?Ua:null}},Lt={open(e){return e?za:qa},anchorHidden(e){return e?Ka:null}},Za=d.createContext(void 0);function Ja(e=!1){const t=d.useContext(Za);if(t===void 0&&!e)throw new Error(Ye(16));return t}function Qa(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,a=o&&t===!1;return{props:d.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[o,n,t,i,a,s,r])}}function el(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=d.useRef(null),i=Ja(!0)!==void 0,a=Y(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:c}=Qa({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r}),l=d.useCallback(()=>{const p=s.current;tl(p)&&i&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,i]);se(l,[l]);const u=d.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:h,onKeyDown:y,onPointerDown:E,...b}=p;return Mr({type:r?"button":void 0,onClick(v){if(t){v.preventDefault();return}g?.(v)},onMouseDown(v){t||m?.(v)},onKeyDown(v){if(t||(Nn(v),y?.(v)),v.baseUIHandlerPrevented)return;const S=v.target===v.currentTarget&&!r&&!a()&&!t,C=v.key==="Enter",T=v.key===" ";S&&((T||C)&&v.preventDefault(),C&&g?.(v))},onKeyUp(v){t||(Nn(v),h?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!r&&!t&&v.key===" "&&g?.(v)},onPointerDown(v){if(t){v.preventDefault();return}E?.(v)}},r?void 0:{role:"button"},c,b)},[t,c,r,a]),f=Y(p=>{s.current=p,l()});return{getButtonProps:u,buttonRef:f}}function tl(e){return me(e)&&e.tagName==="BUTTON"}function os(e){return Vn(19)?e:e?"true":void 0}let Vo={},jo={},Ho="";function nl(e){if(typeof document>"u")return!1;const t=ct(e);return he(t).innerWidth-t.documentElement.clientWidth>0}function ol(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=ct(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function rl(e){const t=ct(e),n=t.documentElement,o=t.body,r=st(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function sl(e){const t=ct(e),n=t.documentElement,o=t.body,r=he(n);let s=0,i=0,a=!1;const c=Fe.create();if(vi&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),g=r.getComputedStyle(o),y=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Vo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ho=n.style.scrollBehavior,jo={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||g.overflowY==="scroll",v=p.overflowX==="scroll"||g.overflowX==="scroll",S=Math.max(0,r.innerWidth-o.clientWidth),C=Math.max(0,r.innerHeight-o.clientHeight),T=parseFloat(g.marginTop)+parseFloat(g.marginBottom),I=parseFloat(g.marginLeft)+parseFloat(g.marginRight),N=st(n)?n:o;if(a=ol(e),a){n.style.scrollbarGutter=y,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(E||R)&&(n.style.overflowY="scroll"),(b||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:T||C?`calc(100dvh - ${T+C}px)`:"100dvh",width:I||S?`calc(100vw - ${I+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Vo),Object.assign(o.style,jo),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ho)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class il{lockCount=0;restore=null;timeoutLock=Ge.create();timeoutUnlock=Ge.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=ct(t).documentElement,r=he(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=nr;return}const s=ir||!nl(t);this.restore=s?rl(t):sl(t)}}const cl=new il;function rs(e=!0,t=null){se(()=>{if(e)return cl.acquire(t)},[e,t])}const al=d.createContext(void 0);function ll(){return d.useContext(al)?.direction??"ltr"}const ul=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=_e(e,t)||{};if(l==null)return{};const p=dr(u),g={x:n,y:o},m=Kn(r),h=qn(m),y=await i.getDimensions(l),E=m==="y",b=E?"top":"left",R=E?"bottom":"right",v=E?"clientHeight":"clientWidth",S=s.reference[h]+s.reference[m]-g[m]-s.floating[h],C=g[m]-s.reference[m],T=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[v]||s.floating[h];(!I||!await i.isElement?.(T))&&(I=a.floating[v]||s.floating[h]);const N=S/2-C/2,k=I/2-y[h]/2-1,F=Math.min(p[b],k),A=Math.min(p[R],k),O=F,D=I-y[h]-A,P=I/2-y[h]/2+N,V=kn(O,P,D),$=!c.arrow&&Ze(r)!=null&&P!==V&&s.reference[h]/2-(P<O?F:A)-y[h]/2<0,w=$?P<O?P-O:P-D:0;return{[m]:g[m]+w,data:{[m]:V,centerOffset:P-V-w,...$&&{alignmentOffset:w}},reset:$}}}),fl=(e,t)=>({...ul(e),options:[e,t]}),dl={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Ra().fn(e)).data?.referenceHidden||s}}}},Yt={sideX:"left",sideY:"top"},pl={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=he(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Yt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=ct(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const g=Re(a);let m=t,h=n;g==="left"&&(m=p.width-(t+o.width)),g==="top"&&(h=p.height-(n+o.height));const y=g==="left"?"right":Yt.sideX,E=g==="top"?"bottom":Yt.sideY;return{x:m,y:h,data:{sideX:y,sideY:E}}}};function ss(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function _o(e,t,n){const{rects:o,placement:r}=e;return{side:ss(t,Re(r),n),align:Ze(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function gl(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:g,mounted:m,collisionAvoidance:h,shiftCrossAxis:y=!1,nodeId:E,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:v}=e,[S,C]=d.useState(null);!m&&S!==null&&C(null);const T=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,F=Y(k),A=k?F:t,O=De(t),P=ll()==="rtl",V=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],$=s==="center"?V:`${V}-${s}`;let w=c;const L=1,Q=o==="bottom"?L:0,G=o==="top"?L:0,X=o==="right"?L:0,Z=o==="left"?L:0;typeof w=="number"?w={top:w+Q,right:w+Z,bottom:w+G,left:w+X}:w&&(w={top:(w.top||0)+Q,right:(w.right||0)+Z,bottom:(w.bottom||0)+G,left:(w.left||0)+X});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:w},ne=d.useRef(null),z=De(r),J=De(i),ge=[ha(le=>{const ve=_o(le,o,P),Le=typeof z.current=="function"?z.current(ve):z.current,Te=typeof J.current=="function"?J.current(ve):J.current;return{mainAxis:Le,crossAxis:Te,alignmentAxis:Te}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],Be=I==="none"&&T!=="shift",x=!Be&&(l||y||T==="shift"),U=T==="none"?null:va({..._,padding:{top:w.top+L,right:w.right+L,bottom:w.bottom+L,left:w.left+L},mainAxis:!y&&T==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),B=Be?null:ba(le=>{const ve=ct(le.elements.floating).documentElement;return{..._,rootBoundary:y?{x:0,y:0,width:ve.clientWidth,height:ve.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:x,limiter:l||y?void 0:ya(Le=>{if(!ne.current)return{};const{width:Te,height:lt}=ne.current.getBoundingClientRect(),ut=Oe(Re(Le.placement)),Dt=ut==="y"?Te:lt,ln=ut==="y"?w.left+w.right:w.top+w.bottom;return{offset:Dt/2+ln/2}})}},[_,l,y,w,I]);T==="shift"||I==="shift"||s==="center"?ge.push(B,U):ge.push(U,B),ge.push(Ea({..._,apply({elements:{floating:le},rects:{reference:ve},availableWidth:Le,availableHeight:Te}){Object.entries({"--available-width":`${Le}px`,"--available-height":`${Te}px`,"--anchor-width":`${ve.width}px`,"--anchor-height":`${ve.height}px`}).forEach(([lt,ut])=>{le.style.setProperty(lt,ut)})}}),fl(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ve,middlewareData:Le,placement:Te,rects:lt,y:ut}=le,Dt=Re(Te),ln=Oe(Dt),co=ne.current,Rs=Le.arrow?.x||0,xs=Le.arrow?.y||0,ws=co?.clientWidth||0,Ss=co?.clientHeight||0,un=Rs+ws/2,ao=xs+Ss/2,Cs=Math.abs(Le.shift?.y||0),Ts=lt.reference.height/2,St=typeof r=="function"?r(_o(le,o,P)):r,Os=Cs>St,Ps={top:`${un}px calc(100% + ${St}px)`,bottom:`${un}px ${-St}px`,left:`calc(100% + ${St}px) ${ao}px`,right:`${-St}px ${ao}px`}[Dt],Is=`${un}px ${lt.reference.y+Ts-ut}px`;return ve.floating.style.setProperty("--transform-origin",x&&ln==="y"&&Os?Is:Ps),{}}},dl,b),se(()=>{!m&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,g]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:q,y:te,middlewareData:oe,update:H,placement:j,context:be,isPositioned:ae,floatingStyles:We}=Aa({rootContext:g,placement:$,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>No(...le,ue),nodeId:E,externalTree:v}),{sideX:Qe,sideY:at}=oe.adaptiveOrigin||Yt,et=ae?n:"fixed",ye=d.useMemo(()=>b?{position:et,[Qe]:q,[at]:te}:{position:et,...We},[b,et,Qe,q,at,te,We]),Me=d.useRef(null);se(()=>{if(!m)return;const le=O.current,ve=typeof le=="function"?le():le,Te=(Yo(ve)?ve.current:ve)||null||null;Te!==Me.current&&(M.setPositionReference(Te),Me.current=Te)},[m,M,A,O]),d.useEffect(()=>{if(!m)return;const le=O.current;typeof le!="function"&&Yo(le)&&le.current!==Me.current&&(M.setPositionReference(le.current),Me.current=le.current)},[m,M,A,O]),d.useEffect(()=>{if(p&&m&&W.domReference&&W.floating)return No(W.domReference,W.floating,H,ue)},[p,m,W,H,ue]);const Ae=Re(j),no=ss(o,Ae,P),oo=Ze(j)||"center",ro=!!oe.hide?.referenceHidden;se(()=>{R&&m&&ae&&C(Ae)},[R,m,ae,Ae]);const so=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),io=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ye,arrowStyles:so,arrowRef:ne,arrowUncentered:io,side:no,align:oo,physicalSide:Ae,anchorHidden:ro,refs:M,context:be,isPositioned:ae,update:H}),[ye,so,ne,io,no,oo,Ae,ro,M,be,ae,H])}function Yo(e){return e!=null&&"current"in e}const is=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
1
+ import{c as Wn,r as d,ay as qo,az as Ko,C as ee,a7 as Ke}from"./main-D7f_DoMp.js";const ks=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Nl=Wn("chevron-right",ks);const Ms=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$l=Wn("info",Ms);const As=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Bl=Wn("loader-circle",As),Go={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Xo={...Go,position:"fixed",top:0,left:0},Wl={...Go,position:"absolute"},lo={};function ke(e,t){const n=d.useRef(lo);return n.current===lo&&(n.current=e(t)),n}function Ut(e,t,n,o){const r=ke(Zo).current;return Fs(r,e,t,n,o)&&Jo(r,[e,t,n,o]),r.callback}function Ls(e){const t=ke(Zo).current;return Ds(t,e)&&Jo(t,e),t.callback}function Zo(){return{callback:null,cleanup:null,refs:[]}}function Fs(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Ds(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Jo(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 o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Ns=()=>{},se=typeof document<"u"?d.useLayoutEffect:Ns,fn=qo[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],$s=fn&&fn!==d.useLayoutEffect?fn:e=>e();function Y(e){const t=ke(Bs).current;return t.next=e,$s(t.effect),t.trampoline}function Bs(){const e={next:void 0,callback:Ws,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ws(){}function De(e){const t=ke(Vs,e).current;return t.next=e,se(t.effect),t}function Vs(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ye(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}var zt=Symbol("NOT_FOUND");function js(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Hs(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _s(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var uo=e=>Array.isArray(e)?e:[e];function Ys(e){const t=Array.isArray(e[0])?e[0]:e;return _s(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Us(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function zs(e){let t;return{get(n){return t&&e(t.key,n)?t.value:zt},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function qs(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return zt}function r(a,c){o(a)===zt&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Ks=(e,t)=>e===t;function Gs(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Xs(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Ks,maxSize:r=1,resultEqualityCheck:s}=n,i=Gs(o);let a=0;const c=r<=1?zs(i):qs(r,i);function l(){let u=c.get(arguments);if(u===zt){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(g=>s(g.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Zs=class{constructor(e){this.value=e}deref(){return this.value}},Js=typeof WeakRef<"u"?WeakRef:Zs,Qs=0,fo=1;function Nt(){return{s:Qs,v:void 0,o:null,p:null}}function Qo(e,t={}){let n=Nt();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}else{let m=a.p;m===null&&(a.p=m=new Map);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}}const l=a;let u;if(a.s===fo)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Js(u):u}return l.s=fo,l.v=u,u}return i.clearCache=()=>{n=Nt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function er(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),js(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:g=Qo,argsMemoizeOptions:m=[]}=u,h=uo(p),y=uo(m),E=Ys(r),b=f(function(){return s++,l.apply(null,arguments)},...h),R=g(function(){i++;const S=Us(E,arguments);return a=b.apply(null,S),a},...y);return Object.assign(R,{resultFunc:l,memoizedResultFunc:b,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:g})};return Object.assign(o,{withTypes:()=>o}),o}var ei=er(Qo),ti=Object.assign((e,t=ei)=>{Hs(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>ti});er({memoize:Xs,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const K=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(Ye(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var dn={exports:{}},pn={};var po;function ni(){if(po)return pn;po=1;var e=Ko();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var g=p(),m=o({inst:{value:g,getSnapshot:p}}),h=m[0].inst,y=m[1];return s(function(){h.value=g,h.getSnapshot=p,c(h)&&y({inst:h})},[f,g,p]),r(function(){return c(h)&&y({inst:h}),f(function(){c(h)&&y({inst:h})})},[f]),i(g),g}function c(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return pn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,pn}var go;function tr(){return go||(go=1,dn.exports=ni()),dn.exports}var oi=tr(),gn={exports:{}},mn={};var mo;function ri(){if(mo)return mn;mo=1;var e=Ko(),t=tr();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return mn.useSyncExternalStoreWithSelector=function(l,u,f,p,g){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function E(C){if(!b){if(b=!0,R=C,C=p(C),g!==void 0&&h.hasValue){var T=h.value;if(g(T,C))return v=T}return v=C}if(T=v,o(R,C))return T;var I=p(C);return g!==void 0&&g(T,I)?(R=C,T):(R=C,v=I)}var b=!1,R,v,S=f===void 0?null:f;return[function(){return E(u())},S===null?void 0:function(){return E(S())}]},[u,f,p,g]);var y=r(l,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=y},[y]),c(y),y},mn}var ho;function si(){return ho||(ho=1,gn.exports=ri()),gn.exports}var ii=si();const ci=parseInt(d.version,10);function Vn(e){return ci>=e}const ai=Vn(19),li=ai?fi:di;function ui(e,t,n,o,r){return li(e,t,n,o,r)}function fi(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return oi.useSyncExternalStore(e.subscribe,s,s)}function di(e,t,n,o,r){return ii.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Ot{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Ot.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Ot.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Ot.prototype.setState.call(this,t)}}function nr(){}const Vl=Object.freeze([]),Ee=Object.freeze({});class jn extends Ot{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return ui(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=Y(n??nr);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const pi=[];function Hn(e){d.useEffect(e,pi)}const $t=null;class gi{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(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 Bt=new gi;class Fe{static create(){return new Fe}static request(t){return Bt.request(t)}static cancel(t){return Bt.cancel(t)}currentId=$t;request(t){this.cancel(),this.currentId=Bt.request(()=>{this.currentId=$t,t()})}cancel=()=>{this.currentId!==$t&&(Bt.cancel(this.currentId),this.currentId=$t)};disposeEffect=()=>this.cancel}function _n(){const e=ke(Fe.create).current;return Hn(e.disposeEffect),e}const Ct=0;class Ge{static create(){return new Ge}currentId=Ct;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ct,n()},t)}isStarted(){return this.currentId!==Ct}clear=()=>{this.currentId!==Ct&&(clearTimeout(this.currentId),this.currentId=Ct)};disposeEffect=()=>this.clear}function ot(){const e=ke(Ge.create).current;return Hn(e.disposeEffect),e}function tn(){return typeof window<"u"}function Xe(e){return Yn(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $e(e){var t;return(t=(Yn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yn(e){return tn()?e instanceof Node||e instanceof he(e).Node:!1}function ie(e){return tn()?e instanceof Element||e instanceof he(e).Element:!1}function me(e){return tn()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function Cn(e){return!tn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function mi(e){return/^(table|td|th)$/.test(Xe(e))}function nn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const hi=/transform|translate|scale|rotate|perspective|filter/,bi=/paint|layout|strict|content/,tt=e=>!!e&&e!=="none";let hn;function Un(e){const t=ie(e)?Ce(e):e;return tt(t.transform)||tt(t.translate)||tt(t.scale)||tt(t.rotate)||tt(t.perspective)||!on()&&(tt(t.backdropFilter)||tt(t.filter))||hi.test(t.willChange||"")||bi.test(t.contain||"")}function yi(e){let t=He(e);for(;me(t)&&!je(t);){if(Un(t))return t;if(nn(t))return null;t=He(t)}return null}function on(){return hn==null&&(hn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),hn}function je(e){return/^(html|body|#document)$/.test(Xe(e))}function Ce(e){return he(e).getComputedStyle(e)}function rn(e){return ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(Xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||$e(e);return Cn(t)?t.host:t}function or(e){const t=He(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:me(t)&&st(t)?t:or(t)}function ze(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=or(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=he(r);if(s){const a=Tn(i);return t.concat(i,i.visualViewport||[],st(r)?r:[],a&&n?ze(a):[])}else return t.concat(r,ze(r,[],n))}function Tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const vt=typeof navigator<"u",bn=xi(),rr=Si(),sr=wi(),vi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ir=bn.platform==="MacIntel"&&bn.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(bn.platform),Ei=vt&&/apple/i.test(navigator.vendor),On=vt&&/android/i.test(rr)||/android/i.test(sr);vt&&rr.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ri=sr.includes("jsdom/");function xi(){if(!vt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function wi(){if(!vt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Si(){if(!vt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Pn="data-base-ui-focusable",cr="active",ar="selected",lr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",jl="ArrowLeft",Hl="ArrowRight",_l="ArrowUp",Yl="ArrowDown";function ft(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Cn(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function xe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pe(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 Ci(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function ur(e){return me(e)&&e.matches(lr)}function bo(e){return e?e.getAttribute("role")==="combobox"&&ur(e):!1}function In(e){return e?e.hasAttribute(Pn)?e:e.querySelector(`[${Pn}]`)||e:null}function nt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...nt(e,r.id,n)])}function yo(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ti(e){e.preventDefault(),e.stopPropagation()}function Oi(e){return"nativeEvent"in e}function Pi(e){return e.mozInputSource===0&&e.isTrusted?!0:On&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ii(e){return Ri?!1:!On&&e.width===0&&e.height===0||On&&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 mt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const ki=["top","right","bottom","left"],ht=Math.min,we=Math.max,qt=Math.round,Wt=Math.floor,Ne=e=>({x:e,y:e}),Mi={left:"right",right:"left",bottom:"top",top:"bottom"};function kn(e,t,n){return we(e,ht(t,n))}function _e(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function zn(e){return e==="x"?"y":"x"}function qn(e){return e==="y"?"height":"width"}function Oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Kn(e){return zn(Oe(e))}function Ai(e,t,n){n===void 0&&(n=!1);const o=Ze(e),r=Kn(e),s=qn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Kt(i)),[i,Kt(i)]}function Li(e){const t=Kt(e);return[Mn(e),t,Mn(t)]}function Mn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vo=["left","right"],Eo=["right","left"],Fi=["top","bottom"],Di=["bottom","top"];function Ni(e,t,n){switch(e){case"top":case"bottom":return n?t?Eo:vo:t?vo:Eo;case"left":case"right":return t?Fi:Di;default:return[]}}function $i(e,t,n,o){const r=Ze(e);let s=Ni(Re(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Mn)))),s}function Kt(e){const t=Re(e);return Mi[t]+e.slice(t.length)}function Bi(e){return{top:0,right:0,bottom:0,left:0,...e}}function dr(e){return typeof e!="number"?Bi(e):{top:e,right:e,bottom:e,left:e}}function Gt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var Wi=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[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] *)"],Xt=Wi.join(","),pr=typeof Element>"u",bt=pr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zt=!pr&&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?.ownerDocument},Jt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Jt(t.parentNode));return i},Vi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},gr=function(t,n,o){if(Jt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Xt));return n&&bt.call(t,Xt)&&r.unshift(t),r=r.filter(o),r},Qt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Jt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Qt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=bt.call(i,Xt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Jt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var g=Qt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,g):r.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return r},mr=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Vi(t))&&!mr(t)?0:t.tabIndex},ji=function(t,n){var o=hr(t);return o<0&&n&&!mr(t)?0:o},Hi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},br=function(t){return t.tagName==="INPUT"},_i=function(t){return br(t)&&t.type==="hidden"},Yi=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Ui=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},zi=function(t){if(!t.name)return!0;var n=t.form||Zt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(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=Ui(r,t.form);return!s||s===t},qi=function(t){return br(t)&&t.type==="radio"},Ki=function(t){return qi(t)&&!zi(t)},Gi=function(t){var n,o=t&&Zt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=Zt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},Ro=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Xi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=bt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(bt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=Zt(t);if(l&&!l.shadowRoot&&r(l)===!0)return Ro(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Gi(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Ro(t);return!1},Zi=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return bt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},An=function(t,n){return!(n.disabled||_i(n)||Xi(n,t)||Yi(n)||Zi(n))},Ln=function(t,n){return!(Ki(n)||hr(n)<0||!An(t,n))},Ji=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},yr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=ji(a,i),l=i?yr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(Hi).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},At=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:Ln.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ji}):o=gr(t,n.includeContainer,Ln.bind(null,n)),yr(o)},Qi=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:An.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=gr(t,n.includeContainer,An.bind(null,n)),o},vr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bt.call(t,Xt)===!1?!1:Ln(n,t)};const Et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Er(e,t){const n=At(e,Et()),o=n.length;if(o===0)return;const r=ft(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Gn(e){return Er(fe(e).body,1)||e}function Rr(e){return Er(fe(e).body,-1)||e}function xr(e,t){if(!e)return null;const n=At(fe(e).body,Et()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function ec(e){return xr(e,1)}function tc(e){return xr(e,-1)}function dt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function nc(e){At(e,Et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function xo(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const oc={...qo};let wo=0;function rc(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(wo+=1,o(`${t}-${wo}`))},[n,t]),r}const So=oc.useId;function Rt(e,t){if(So!==void 0){const n=So();return e??(t?`${t}-${n}`:n)}return rc(e,t)}function wr(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class sc{nodesRef={current:[]};events=wr();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Sr=d.createContext(null),Cr=d.createContext(null),it=()=>d.useContext(Sr)?.id||null,xt=e=>{const t=d.useContext(Cr);return e??t};function ic(e){const t=Rt(),n=xt(e),o=it();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function cc(e){const{children:t,id:n}=e,o=it();return ee.jsx(Sr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function ac(e){const{children:t,externalTree:n}=e,o=ke(()=>n??new sc).current;return ee.jsx(Cr.Provider,{value:o,children:t})}const lc=500,uc={style:{transition:"none"}},Tr="data-base-ui-click-trigger",Ul={fallbackAxisSide:"none"},fc={fallbackAxisSide:"end"},dc={clipPath:"inset(50%)",position:"fixed",top:0,left:0},pc="none",qe="trigger-press",Se="trigger-hover",Or="outside-press",zl="item-press",ql="close-press",It="focus-out",Pr="escape-key",Kl="list-navigation",Gl="cancel-open",Ir="imperative-action",Xl="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=Ee;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function kt(e){return`data-base-ui-${e}`}function yn(e,t,n){if(n&&!mt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function ct(e){return e?.ownerDocument||document}const yt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{Ei&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Xo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Co=0;function vn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Co);const s=()=>e?.focus({preventScroll:n});r?s():Co=requestAnimationFrame(s)}const pt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function To(e){return e==="inert"?pt.inert:e==="aria-hidden"?pt["aria-hidden"]:pt.none}let Vt=new WeakSet,jt={},En=0;const kr=e=>e&&(e.host||kr(e.parentNode)),gc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=kr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function mc(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=gc(t,e),a=new Set,c=new Set(i),l=[];jt[r]||(jt[r]=new WeakMap);const u=jt[r];i.forEach(f),p(t),a.clear();function f(g){!g||a.has(g)||(a.add(g),g.parentNode&&f(g.parentNode))}function p(g){!g||c.has(g)||[].forEach.call(g.children,m=>{if(Xe(m)!=="script")if(a.has(m))p(m);else{const h=s?m.getAttribute(s):null,y=h!==null&&h!=="false",E=To(s),b=(E.get(m)||0)+1,R=(u.get(m)||0)+1;E.set(m,b),u.set(m,R),l.push(m),b===1&&y&&Vt.add(m),R===1&&m.setAttribute(r,""),!y&&s&&m.setAttribute(s,s==="inert"?"":"true")}})}return En+=1,()=>{l.forEach(g=>{const m=To(s),y=(m.get(g)||0)-1,E=(u.get(g)||0)-1;m.set(g,y),u.set(g,E),y||(!Vt.has(g)&&s&&g.removeAttribute(s),Vt.delete(g)),E||g.removeAttribute(r)}),En-=1,En||(pt.inert=new WeakMap,pt["aria-hidden"]=new WeakMap,pt.none=new WeakMap,Vt=new WeakSet,jt={})}}function hc(e,t=!1,n=!1){const o=fe(e[0]).body;return mc(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}function Oo(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(Vn(19)?n?.ref:t.ref)??null}function Fn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function bc(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function yc(e,t){return typeof e=="function"?e(t):e}function vc(e,t){return typeof e=="function"?e(t):e}const Pt={};function Mr(e,t,n,o,r){let s={...Dn(e,Pt)};return t&&(s=Tt(s,t)),n&&(s=Tt(s,n)),o&&(s=Tt(s,o)),r&&(s=Tt(s,r)),s}function Ec(e){if(e.length===0)return Pt;if(e.length===1)return Dn(e[0],Pt);let t={...Dn(e[0],Pt)};for(let n=1;n<e.length;n+=1)t=Tt(t,e[n]);return t}function Tt(e,t){return Ar(t)?t(e):Rc(e,t)}function Rc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Fn(e.style,o);break}case"className":{e[n]=Lr(e.className,o);break}default:xc(n,o)?e[n]=wc(e[n],o):e[n]=o}}return e}function xc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function Ar(e){return typeof e=="function"}function Dn(e,t){return Ar(e)?e(t):e??Pt}function wc(e,t){return t?e?n=>{if(Sc(n)){const r=n;Nn(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Nn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Lr(e,t){return t?e?t+" "+e:t:e}function Sc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Je(e,t,n={}){const o=t.render,r=Cc(t,n);if(n.enabled===!1)return null;const s=n.state??Ee;return Tc(e,o,r,s)}function Cc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=Ee,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?yc(n,s):void 0,f=l?vc(o,s):void 0,p=l?bc(s,c):Ee,g=l?Fn(p,Array.isArray(a)?Ec(a):a)??Ee:Ee;return typeof document<"u"&&(l?Array.isArray(i)?g.ref=Ls([g.ref,Oo(r),...i]):g.ref=Ut(g.ref,Oo(r),i):Ut(null,null)),l?(u!==void 0&&(g.className=Lr(g.className,u)),f!==void 0&&(g.style=Fn(g.style,f)),g):Ee}function Tc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Mr(n,t.props);return r.ref=n.ref,d.cloneElement(t,r)}if(e&&typeof e=="string")return Oc(e,n);throw new Error(Ye(8))}function Oc(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}const Fr=d.createContext(null),Dr=()=>d.useContext(Fr),Pc=kt("portal");function Ic(e={}){const{ref:t,container:n,componentProps:o=Ee,elementProps:r,elementState:s}=e,i=Rt(),c=Dr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),g=Y(E=>{E!==null&&p(E)}),m=d.useRef(null);se(()=>{if(n===null){m.current&&(m.current=null,p(null),u(null));return}if(i==null)return;const E=(n&&(Yn(n)?n:n.current))??c??document.body;if(E==null){m.current&&(m.current=null,p(null),u(null));return}m.current!==E&&(m.current=E,p(null),u(E))},[n,c,i]);const h=Je("div",o,{ref:[t,g],state:s,props:[{id:i,[Pc]:""},r]});return{portalNode:f,portalSubtree:l&&h?Ke.createPortal(h,l):null}}const Nr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Ic({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),g=d.useRef(null),m=d.useRef(null),[h,y]=d.useState(null),E=h?.modal,b=h?.open,R=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||E)return;function S(C){l&&C.relatedTarget&&dt(C)&&(C.type==="focusin"?xo:nc)(l)}return l.addEventListener("focusin",S,!0),l.addEventListener("focusout",S,!0),()=>{l.removeEventListener("focusin",S,!0),l.removeEventListener("focusout",S,!0)}},[l,E]),d.useEffect(()=>{!l||b||xo(l)},[b,l]);const v=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:l,setFocusManagerState:y}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(Fr.Provider,{value:v,children:[R&&l&&ee.jsx(yt,{"data-type":"outside",ref:f,onFocus:S=>{if(dt(S,l))g.current?.focus();else{const C=h?h.domReference:null;Rr(C)?.focus()}}}),R&&l&&ee.jsx("span",{"aria-owns":l.id,style:dc}),l&&Ke.createPortal(o,l),R&&l&&ee.jsx(yt,{"data-type":"outside",ref:p,onFocus:S=>{if(dt(S,l))m.current?.focus();else{const C=h?h.domReference:null;Gn(C)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(It,S.nativeEvent))}}})]})]})});function Ve(e){return e==null?e:"current"in e?e.current:e}function kc(e,t){const n=he(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 Po=20;let Ue=[];function Xn(){Ue=Ue.filter(e=>e.isConnected)}function Mc(e){Xn(),e&&Xe(e)!=="body"&&(Ue.push(e),Ue.length>Po&&(Ue=Ue.slice(-Po)))}function Rn(){return Xn(),Ue[Ue.length-1]}function Ac(e){if(!e)return null;const t=Et();return vr(e,t)?e:At(e,t)[0]||e}function Lc(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ce(e).display!=="none"}function Io(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Et(),r=Qi(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return vr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.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 $r(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:g,beforeContentFocusGuardRef:m,externalTree:h}=e,y="rootStore"in t?t.rootStore:t,E=y.useState("open"),b=y.useState("domReferenceElement"),R=y.useState("floatingElement"),{events:v,dataRef:S}=y.context,C=Y(()=>S.current.floatingContext?.nodeId),T=Y(f),I=s===!1,N=bo(b)&&I,k=De(r),F=De(s),A=De(i),O=De(u),D=xt(h),P=Dr(),V=d.useRef(null),$=d.useRef(null),w=d.useRef(!1),L=d.useRef(!1),Q=d.useRef(!1),G=d.useRef(-1),X=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),z=Ut(_,m,P?.beforeInsideRef),J=Ut(ne,P?.afterInsideRef),de=ot(),pe=ot(),ge=_n(),Be=P!=null,x=In(R),U=Y((M=x)=>M?At(M,Et()):[]),B=Y(M=>{const W=U(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(q){q.key==="Tab"&&re(x,ft(fe(x)))&&U().length===0&&!N&&Ti(q)}const W=fe(x);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,x,c,k,N,U,B]),d.useEffect(()=>{if(o||!R)return;function M(W){const q=xe(W),oe=U().indexOf(q);oe!==-1&&(G.current=oe)}return R.addEventListener("focusin",M),()=>{R.removeEventListener("focusin",M)}},[o,R,U]),d.useEffect(()=>{if(o||!E)return;const M=fe(x);function W(){Q.current=!1}function q(oe){const H=xe(oe),j=re(R,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",q,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",q,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,R,b,x,E,P]),d.useEffect(()=>{if(o||!l)return;function M(){L.current=!0,pe.start(0,()=>{L.current=!1})}function W(H){const j=H.relatedTarget,be=H.currentTarget,ae=xe(H);queueMicrotask(()=>{const We=C(),Qe=y.context.triggerElements,at=j?.hasAttribute(kt("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p)].includes(j),et=!(re(b,j)||re(R,j)||re(j,R)||re(P?.portalNode,j)||j!=null&&Qe.hasElement(j)||Qe.hasMatchingElement(ye=>re(ye,j))||at||D&&(nt(D.nodesRef.current,We).find(ye=>re(ye.context?.elements.floating,j)||re(ye.context?.elements.domReference,j))||yo(D.nodesRef.current,We).find(ye=>[ye.context?.elements.floating,In(ye.context?.elements.floating)].includes(j)||ye.context?.elements.domReference===j)));if(be===b&&x&&Io(x,k),a&&be!==b&&!Lc(ae)&&ft(fe(x))===fe(x).body){if(me(x)&&(x.focus(),a==="popup")){ge.request(()=>{x.focus()});return}const ye=G.current,Me=U(),Ae=Me[ye]||Me[Me.length-1]||x;me(Ae)&&Ae.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(N||!c)&&j&&et&&!L.current&&(N||j!==Rn())&&(w.current=!0,y.setOpen(!1,ce(It,H)))})}function q(){Q.current||(S.current.insideReactTree=!0,de.start(0,()=>{S.current.insideReactTree=!1}))}const te=me(b)?b:null,oe=[];if(!(!R&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),R&&(R.addEventListener("focusout",W),P&&(R.addEventListener("focusout",q,!0),oe.push(()=>{R.removeEventListener("focusout",q,!0)})),oe.push(()=>{R.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,R,x,c,D,P,y,l,a,U,N,C,k,S,de,pe,ge,p,g]),d.useEffect(()=>{if(o||!R||!E)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${kt("portal")}]`)||[]),q=(D?yo(D.nodesRef.current,C()):[]).find(H=>bo(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[R,q,...M,...T(),V.current,$.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p),N?b:null].filter(H=>H!=null),oe=hc(te,c||N);return()=>{oe()}},[E,o,b,R,c,k,P,N,D,C,T,p,g]),se(()=>{if(!E||o||!me(x))return;const M=fe(x),W=ft(M);queueMicrotask(()=>{const q=B(x),te=F.current,oe=typeof te=="function"?te(O.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=q[0]||x:H=Ve(oe),H=H||q[0]||x,!re(x,W)&&vn(H,{preventScroll:H===x})})},[o,E,x,I,B,F,O]),se(()=>{if(o||!x)return;const M=fe(x),W=ft(M);Mc(W);function q(H){if(H.open||(X.current=kc(H.nativeEvent,Z.current)),H.reason===Se&&H.nativeEvent.type==="mouseleave"&&(w.current=!0),H.reason===Or)if(H.nested)w.current=!1;else if(Pi(H.nativeEvent)||Ii(H.nativeEvent))w.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?w.current=!1:w.current=!0}}v.on("openchange",q);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Xo),Be&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(X.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||Rn();return ae&&ae.isConnected?ae:te}const be=b||Rn()||te;return Ve(j)||be}return()=>{v.off("openchange",q);const H=ft(M),j=re(R,H)||D&&nt(D.nodesRef.current,C(),!1).some(ae=>re(ae.context?.elements.floating,H)),be=oe();queueMicrotask(()=>{const ae=Ac(be),We=typeof A.current!="boolean";A.current&&!w.current&&me(ae)&&(!(!We&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,R,x,A,S,v,D,Be,b,C]),d.useEffect(()=>{queueMicrotask(()=>{w.current=!1})},[o]),d.useEffect(()=>{if(o||!E)return;function M(q){xe(q)?.closest(`[${Tr}]`)&&(L.current=!0)}const W=fe(x);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,E,x]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:E,onOpenChange:y.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,E,y,l,b]),se(()=>{if(!(o||!x))return Io(x,k),()=>{queueMicrotask(Xn)}},[o,x,k]);const ue=!o&&(c?!N:!0)&&(Be||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(yt,{"data-type":"inside",ref:z,onFocus:M=>{if(c){const W=B();vn(W[W.length-1])}else P?.portalNode&&(w.current=!1,dt(M,P.portalNode)?Gn(b)?.focus():Ve(g??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(yt,{"data-type":"inside",ref:J,onFocus:M=>{c?vn(B()[0]):P?.portalNode&&(l&&(w.current=!0),dt(M,P.portalNode)?Rr(b)?.focus():Ve(p??P.afterOutsideRef)?.focus())}})]})}function Fc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=_n(),p=ot(),g=d.useMemo(()=>({onPointerDown(m){u.current=m.pointerType},onMouseDown(m){const h=u.current,y=m.nativeEvent,E=n.select("open");if(m.button!==0||s==="click"||mt(h,!0)&&a)return;const b=o.current.openEvent,R=b?.type,v=n.select("domReferenceElement")!==m.currentTarget,S=E&&v||!(E&&i&&(!(b&&c)||R==="click"||R==="mousedown"));if(ur(y.target)){const T=ce(qe,y,y.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T);return}const C=m.currentTarget;f.request(()=>{const T=ce(qe,y,C);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T)})},onClick(m){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(mt(h,!0)&&a)return;const y=n.select("open"),E=o.current.openEvent,b=n.select("domReferenceElement")!==m.currentTarget,R=y&&b||!(y&&i&&(!(E&&c)||fr(E))),v=ce(qe,m.nativeEvent,m.currentTarget);R&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,v)}):n.setOpen(R,v)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:g}:Ee,[r,g])}function ko(e,t,n){let{reference:o,floating:r}=e;const s=Oe(t),i=Kn(t),a=qn(i),c=Re(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let g;switch(c){case"top":g={x:u,y:o.y-r.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}switch(Ze(t)){case"start":g[i]-=p*(n&&l?-1:1);break;case"end":g[i]+=p*(n&&l?-1:1);break}return g}async function Dc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=_e(t,e),m=dr(g),y=a[p?f==="floating"?"reference":"floating":f],E=Gt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),v=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},S=Gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:R,strategy:c}):b);return{top:(E.top-S.top+m.top)/v.y,bottom:(S.bottom-E.bottom+m.bottom)/v.y,left:(E.left-S.left+m.left)/v.x,right:(S.right-E.right+m.right)/v.x}}const Nc=50,$c=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Dc},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=ko(l,o,c),p=o,g=0;const m={};for(let h=0;h<s.length;h++){const y=s[h];if(!y)continue;const{name:E,fn:b}=y,{x:R,y:v,data:S,reset:C}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=R??u,f=v??f,m[E]={...m[E],...S},C&&g<Nc&&(g++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:u,y:f}=ko(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:m}},Bc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...y}=_e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Re(r),b=Oe(a),R=Re(a)===a,v=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(R||!h?[Kt(a)]:Li(a)),C=m!=="none";!p&&C&&S.push(...$i(a,h,m,v));const T=[a,...S],I=await c.detectOverflow(t,y),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[E]),f){const D=Ai(r,i,v);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var F,A;const D=(((F=s.flip)==null?void 0:F.index)||0)+1,P=T[D];if(P&&(!(f==="alignment"?b!==Oe(P):!1)||k.every(w=>Oe(w.placement)===b?w.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter($=>$.overflows[0]<=0).sort(($,w)=>$.overflows[1]-w.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(g){case"bestFit":{var O;const $=(O=k.filter(w=>{if(C){const L=Oe(w.placement);return L===b||L==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(L=>L>0).reduce((L,Q)=>L+Q,0)]).sort((w,L)=>w[1]-L[1])[0])==null?void 0:O[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function Mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ao(e){return ki.some(t=>e[t]>=0)}const Wc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=_e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=Mo(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ao(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=Mo(i,n.floating);return{data:{escapedOffsets:a,escaped:Ao(a)}}}default:return{}}}}},Br=new Set(["left","top"]);async function Vc(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Re(n),a=Ze(n),c=Oe(n)==="y",l=Br.has(i)?-1:1,u=s&&c?-1:1,f=_e(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(g=a==="end"?m*-1:m),c?{x:g*u,y:p*l}:{x:p*l,y:g*u}}const jc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Vc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},Hc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:E=>{let{x:b,y:R}=E;return{x:b,y:R}}},...l}=_e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=Oe(Re(r)),g=zn(p);let m=u[g],h=u[p];if(i){const E=g==="y"?"top":"left",b=g==="y"?"bottom":"right",R=m+f[E],v=m-f[b];m=kn(R,m,v)}if(a){const E=p==="y"?"top":"left",b=p==="y"?"bottom":"right",R=h+f[E],v=h-f[b];h=kn(R,h,v)}const y=c.fn({...t,[g]:m,[p]:h});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[g]:i,[p]:a}}}}}},_c=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=_e(e,t),u={x:n,y:o},f=Oe(r),p=zn(f);let g=u[p],m=u[f];const h=_e(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const R=p==="y"?"height":"width",v=s.reference[p]-s.floating[R]+y.mainAxis,S=s.reference[p]+s.reference[R]-y.mainAxis;g<v?g=v:g>S&&(g=S)}if(l){var E,b;const R=p==="y"?"width":"height",v=Br.has(Re(r)),S=s.reference[f]-s.floating[R]+(v&&((E=i.offset)==null?void 0:E[f])||0)+(v?0:y.crossAxis),C=s.reference[f]+s.reference[R]+(v?0:((b=i.offset)==null?void 0:b[f])||0)-(v?y.crossAxis:0);m<S?m=S:m>C&&(m=C)}return{[p]:g,[f]:m}}}},Yc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=_e(e,t),u=await i.detectOverflow(t,l),f=Re(r),p=Ze(r),g=Oe(r)==="y",{width:m,height:h}=s.floating;let y,E;f==="top"||f==="bottom"?(y=f,E=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(E=f,y=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,R=m-u.left-u.right,v=ht(h-u[y],b),S=ht(m-u[E],R),C=!t.middlewareData.shift;let T=v,I=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=b),C&&!p){const k=we(u.left,0),F=we(u.right,0),A=we(u.top,0),O=we(u.bottom,0);g?I=m-2*(k!==0||F!==0?k+F:we(u.left,u.right)):T=h-2*(A!==0||O!==0?A+O:we(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:T});const N=await i.getDimensions(a.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Wr(e){const t=Ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=me(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=qt(n)!==s||qt(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Zn(e){return ie(e)?e:e.contextElement}function gt(e){const t=Zn(e);if(!me(t))return Ne(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Wr(t);let i=(s?qt(n.width):n.width)/o,a=(s?qt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Uc=Ne(0);function Vr(e){const t=he(e);return!on()||!t.visualViewport?Uc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==he(e)?!1:t}function rt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Zn(e);let i=Ne(1);t&&(o?ie(o)&&(i=gt(o)):i=gt(e));const a=zc(s,n,o)?Vr(s):Ne(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=he(s),g=o&&ie(o)?he(o):o;let m=p,h=Tn(m);for(;h&&o&&g!==m;){const y=gt(h),E=h.getBoundingClientRect(),b=Ce(h),R=E.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,v=E.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,f*=y.y,c+=R,l+=v,m=he(h),h=Tn(m)}}return Gt({width:u,height:f,x:c,y:l})}function sn(e,t){const n=rn(e).scrollLeft;return t?t.left+n:rt($e(e)).left+n}function jr(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-sn(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function qc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=$e(o),a=t?nn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Ne(1);const u=Ne(0),f=me(o);if((f||!f&&!s)&&((Xe(o)!=="body"||st(i))&&(c=rn(o)),f)){const g=rt(o);l=gt(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}const p=i&&!f&&!s?jr(i,c):Ne(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function Kc(e){return Array.from(e.getClientRects())}function Gc(e){const t=$e(e),n=rn(e),o=e.ownerDocument.body,r=we(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=we(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+sn(e);const a=-n.scrollTop;return Ce(o).direction==="rtl"&&(i+=we(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const Lo=25;function Xc(e,t){const n=he(e),o=$e(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=on();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=sn(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-f.clientWidth-g);m<=Lo&&(s-=m)}else l<=Lo&&(s+=l);return{width:s,height:i,x:a,y:c}}function Zc(e,t){const n=rt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=me(e)?gt(e):Ne(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function Fo(e,t,n){let o;if(t==="viewport")o=Xc(e,n);else if(t==="document")o=Gc($e(e));else if(ie(t))o=Zc(t,n);else{const r=Vr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Gt(o)}function Hr(e,t){const n=He(e);return n===t||!ie(n)||je(n)?!1:Ce(n).position==="fixed"||Hr(n,t)}function Jc(e,t){const n=t.get(e);if(n)return n;let o=ze(e,[],!1).filter(a=>ie(a)&&Xe(a)!=="body"),r=null;const s=Ce(e).position==="fixed";let i=s?He(e):e;for(;ie(i)&&!je(i);){const a=Ce(i),c=Un(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||st(i)&&!c&&Hr(e,i))?o=o.filter(u=>u!==i):r=a,i=He(i)}return t.set(e,o),o}function Qc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?nn(t)?[]:Jc(t,this._c):[].concat(n),o],a=Fo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const g=Fo(t,i[p],r);c=we(g.top,c),l=ht(g.right,l),u=ht(g.bottom,u),f=we(g.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function ea(e){const{width:t,height:n}=Wr(e);return{width:t,height:n}}function ta(e,t,n){const o=me(t),r=$e(t),s=n==="fixed",i=rt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Ne(0);function l(){c.x=sn(r)}if(o||!o&&!s)if((Xe(t)!=="body"||st(r))&&(a=rn(t)),o){const g=rt(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?jr(r,a):Ne(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function xn(e){return Ce(e).position==="static"}function Do(e,t){if(!me(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $e(e)===n&&(n=n.ownerDocument.body),n}function _r(e,t){const n=he(e);if(nn(e))return n;if(!me(e)){let r=He(e);for(;r&&!je(r);){if(ie(r)&&!xn(r))return r;r=He(r)}return n}let o=Do(e,t);for(;o&&mi(o)&&xn(o);)o=Do(o,t);return o&&je(o)&&xn(o)&&!Un(o)?n:o||yi(e)||n}const na=async function(e){const t=this.getOffsetParent||_r,n=this.getDimensions,o=await n(e.floating);return{reference:ta(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oa(e){return Ce(e).direction==="rtl"}const ra={convertOffsetParentRelativeRectToViewportRelativeRect:qc,getDocumentElement:$e,getClippingRect:Qc,getOffsetParent:_r,getElementRects:na,getClientRects:Kc,getDimensions:ea,getScale:gt,isElement:ie,isRTL:oa};function Yr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sa(e,t){let n=null,o;const r=$e(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:g}=l;if(a||t(),!p||!g)return;const m=Wt(f),h=Wt(r.clientWidth-(u+p)),y=Wt(r.clientHeight-(f+g)),E=Wt(u),R={rootMargin:-m+"px "+-h+"px "+-y+"px "+-E+"px",threshold:we(0,ht(1,c))||1};let v=!0;function S(C){const T=C[0].intersectionRatio;if(T!==c){if(!v)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Yr(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(S,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,R)}n.observe(e)}return i(!0),s}function No(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Zn(e),u=r||s?[...l?ze(l):[],...t?ze(t):[]]:[];u.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=l&&a?sa(l,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(E=>{let[b]=E;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let m,h=c?rt(e):null;c&&y();function y(){const E=rt(e);h&&!Yr(h,E)&&n(),h=E,m=requestAnimationFrame(y)}return n(),()=>{var E;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(E=g)==null||E.disconnect(),g=null,c&&cancelAnimationFrame(m)}}const ia=jc,ca=Hc,aa=Bc,la=Yc,ua=Wc,fa=_c,da=(e,t,n)=>{const o=new Map,r={platform:ra,...n},s={...r.platform,_c:o};return $c(e,t,{...r,platform:s})};var pa=typeof document<"u",ga=function(){},_t=pa?d.useLayoutEffect:ga;function en(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!en(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ur(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $o(e,t){const n=Ur(e);return Math.round(t*n)/n}function wn(e){const t=d.useRef(e);return _t(()=>{t.current=e}),t}function ma(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=d.useState(o);en(p,o)||g(o);const[m,h]=d.useState(null),[y,E]=d.useState(null),b=d.useCallback(w=>{w!==C.current&&(C.current=w,h(w))},[]),R=d.useCallback(w=>{w!==T.current&&(T.current=w,E(w))},[]),v=s||m,S=i||y,C=d.useRef(null),T=d.useRef(null),I=d.useRef(u),N=c!=null,k=wn(c),F=wn(r),A=wn(l),O=d.useCallback(()=>{if(!C.current||!T.current)return;const w={placement:t,strategy:n,middleware:p};F.current&&(w.platform=F.current),da(C.current,T.current,w).then(L=>{const Q={...L,isPositioned:A.current!==!1};D.current&&!en(I.current,Q)&&(I.current=Q,Ke.flushSync(()=>{f(Q)}))})},[p,t,n,F,A]);_t(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(w=>({...w,isPositioned:!1})))},[l]);const D=d.useRef(!1);_t(()=>(D.current=!0,()=>{D.current=!1}),[]),_t(()=>{if(v&&(C.current=v),S&&(T.current=S),v&&S){if(k.current)return k.current(v,S,O);O()}},[v,S,O,k,N]);const P=d.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:R}),[b,R]),V=d.useMemo(()=>({reference:v,floating:S}),[v,S]),$=d.useMemo(()=>{const w={position:n,left:0,top:0};if(!V.floating)return w;const L=$o(V.floating,u.x),Q=$o(V.floating,u.y);return a?{...w,transform:"translate("+L+"px, "+Q+"px)",...Ur(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:O,refs:P,elements:V,floatingStyles:$}),[u,O,P,V,$])}const ha=(e,t)=>{const n=ia(e);return{name:n.name,fn:n.fn,options:[e,t]}},ba=(e,t)=>{const n=ca(e);return{name:n.name,fn:n.fn,options:[e,t]}},ya=(e,t)=>({fn:fa(e).fn,options:[e,t]}),va=(e,t)=>{const n=aa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ea=(e,t)=>{const n=la(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ra=(e,t)=>{const n=ua(e);return{name:n.name,fn:n.fn,options:[e,t]}},xa={intentional:"onClick",sloppy:"onPointerDown"};function wa(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function zr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:g=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:y,externalTree:E}=t,b=xt(E),R=Y(typeof f=="function"?f:()=>!1),v=typeof f=="function"?R:f,S=d.useRef(!1),{escapeKey:C,outsidePress:T}=wa(y),I=d.useRef(null),N=ot(),k=ot(),F=Y(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),O=d.useRef(""),D=Y(x=>{O.current=x.pointerType}),P=Y(()=>{const x=O.current,U=x==="pen"||!x?"mouse":x,B=typeof p=="function"?p():p;return typeof B=="string"?B:B[U]}),V=Y(x=>{if(!o||!l||!u||x.key!=="Escape"||A.current)return;const U=c.current.floatingContext?.nodeId,B=b?nt(b.nodesRef.current,U):[];if(!C&&B.length>0){let W=!0;if(B.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=Oi(x)?x.nativeEvent:x,M=ce(Pr,ue);n.setOpen(!1,M),!C&&!M.isPropagationAllowed&&x.stopPropagation()}),$=Y(x=>{const U=P();return U==="intentional"&&x.type!=="click"||U==="sloppy"&&x.type==="click"}),w=Y(()=>{c.current.insideReactTree=!0,k.start(0,F)}),L=Y((x,U=!1)=>{if($(x)){F();return}if(c.current.insideReactTree){F();return}if(P()==="intentional"&&U||typeof v=="function"&&!v(x))return;const B=xe(x),ue=`[${kt("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if(B&&(W.hasElement(B)||W.hasMatchingElement(j=>re(j,B))))return;let q=ie(B)?B:null;for(;q&&!je(q);){const j=He(q);if(je(j)||!ie(j))break;q=j}if(M.length&&ie(B)&&!Ci(B)&&!re(B,n.select("floatingElement"))&&Array.from(M).every(j=>!re(q,j)))return;if(me(B)&&!("touches"in x)){const j=je(B),be=Ce(B),ae=/auto|scroll/,We=j||ae.test(be.overflowX),Qe=j||ae.test(be.overflowY),at=We&&B.clientWidth>0&&B.scrollWidth>B.clientWidth,et=Qe&&B.clientHeight>0&&B.scrollHeight>B.clientHeight,ye=be.direction==="rtl",Me=et&&(ye?x.offsetX<=B.offsetWidth-B.clientWidth:x.offsetX>B.clientWidth),Ae=at&&x.offsetY>B.clientHeight;if(Me||Ae)return}const te=c.current.floatingContext?.nodeId,oe=b&&nt(b.nodesRef.current,te).some(j=>Pe(x,j.context?.elements.floating));if(Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||oe)return;const H=b?nt(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(Or,x)),F()}),Q=Y(x=>{P()!=="sloppy"||x.pointerType==="touch"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||L(x)}),G=Y(x=>{if(P()!=="sloppy"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];U&&(I.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),X=Y(x=>{const U=xe(x);function B(){G(x),U?.removeEventListener(x.type,B)}U?.addEventListener(x.type,B)}),Z=Y(x=>{const U=S.current;if(S.current=!1,N.clear(),x.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const B=xe(x);function ue(){x.type==="pointerdown"?Q(x):L(x,U),B?.removeEventListener(x.type,ue)}B?.addEventListener(x.type,ue)}),_=Y(x=>{if(P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];if(!U)return;const B=Math.abs(U.clientX-I.current.startX),ue=Math.abs(U.clientY-I.current.startY),M=Math.sqrt(B*B+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(L(x),N.clear(),I.current=null)}),ne=Y(x=>{const U=xe(x);function B(){_(x),U?.removeEventListener(x.type,B)}U?.addEventListener(x.type,B)}),z=Y(x=>{P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&L(x),N.clear(),I.current=null)}),J=Y(x=>{const U=xe(x);function B(){z(x),U?.removeEventListener(x.type,B)}U?.addEventListener(x.type,B)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=C,c.current.__outsidePressBubbles=T;const x=new Ge;function U(q){n.setOpen(!1,ce(pc,q))}function B(){x.clear(),A.current=!0}function ue(){x.start(on()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",B),M.addEventListener("compositionend",ue)),v&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",X,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=ze(i)),ie(r)&&(W=W.concat(ze(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(ze(s.contextElement)))),W=W.filter(q=>q!==M.defaultView?.visualViewport),W.forEach(q=>{q.addEventListener("scroll",U,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",B),M.removeEventListener("compositionend",ue)),v&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",X,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(q=>{q.removeEventListener("scroll",U)}),x.clear(),S.current=!1}},[c,r,s,i,u,v,o,a,h,l,C,T,V,L,Z,Q,X,ne,J,D,n]),d.useEffect(F,[v,F]);const de=d.useMemo(()=>({onKeyDown:V,...g&&{[xa[m]]:x=>{n.setOpen(!1,ce(qe,x.nativeEvent))},...m!=="intentional"&&{onClick(x){n.setOpen(!1,ce(qe,x.nativeEvent))}}}}),[V,n,g,m]),pe=Y(x=>{const U=xe(x.nativeEvent);!re(n.select("floatingElement"),U)||x.button!==0||(S.current=!0)}),ge=Y(x=>{!o||!l||x.button!==0||(S.current=!0)}),Be=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:w,onMouseDownCapture(x){w(),ge(x)},onPointerDownCapture(x){w(),ge(x)},onMouseUpCapture:w,onTouchEndCapture:w,onTouchMoveCapture:w}),[V,pe,w,ge]);return d.useMemo(()=>l?{reference:de,floating:Be,trigger:de}:{},[l,de,Be])}const Sa={open:K(e=>e.open),domReferenceElement:K(e=>e.domReferenceElement),referenceElement:K(e=>e.positionReference??e.referenceElement),floatingElement:K(e=>e.floatingElement),floatingId:K(e=>e.floatingId)};class Jn extends jn{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:wr(),nested:n,noEmit:o,triggerElements:s},Sa)}setOpen=(t,n)=>{if((!t||!this.state.open||fr(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function Ca(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Fe.request(()=>{r("ending")});return()=>{Fe.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Fe.request(()=>{r(void 0)});return()=>{Fe.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Fe.request(()=>{r("idle")});return()=>{Fe.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Mt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Ta={[Mt.startingStyle]:""},Oa={[Mt.endingStyle]:""},cn={transitionStatus(e){return e==="starting"?Ta:e==="ending"?Oa:null}};function qr(e,t=!1,n=!0){const o=_n();return Y((r,s=null)=>{o.cancel();function i(){Ke.flushSync(r)}const a=Ve(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Mt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Qn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=qr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function Pa(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Ia(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Pa(e,n),i=Y(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Kr(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Gr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=Ca(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=Y(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Qn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class an{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),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 ka(){return new Jn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new an,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Xr(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:ka(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Ee,inactiveTriggerProps:Ee,popupProps:Ee}}const Zr={open:K(e=>e.open),mounted:K(e=>e.mounted),transitionStatus:K(e=>e.transitionStatus),floatingRootContext:K(e=>e.floatingRootContext),preventUnmountingOnClose:K(e=>e.preventUnmountingOnClose),payload:K(e=>e.payload),activeTriggerId:K(e=>e.activeTriggerId),activeTriggerElement:K(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:K((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:K((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:K(e=>e.popupProps),popupElement:K(e=>e.popupElement),positionerElement:K(e=>e.positionerElement)};function Ma(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Rt(),s=it()!=null,i=ke(()=>new Jn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new an,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Aa(e={}){const{nodeId:t,externalTree:n}=e,o=Ma(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=xt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=ma({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(T=>{const I=ie(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;a(I),u.refs.setReference(I)},[u.refs]),[p,g]=d.useState(null),[m,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",m);const y=d.useCallback(T=>{(ie(T)||T===null)&&(c.current=T,g(T)),(ie(u.refs.reference.current)||u.refs.reference.current===null||T!==null&&!ie(T))&&u.refs.setReference(T)},[u.refs,g]),E=d.useCallback(T=>{h(T),u.refs.setFloating(T)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:y,setFloating:E,setPositionReference:f,domReference:c}),[u.refs,y,E,f]),R=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),v=r.useState("open"),S=r.useState("floatingId"),C=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:v,onOpenChange:r.setOpen,events:r.context.events,floatingId:S,refs:b,elements:R,nodeId:t,rootStore:r}),[u,b,R,t,r,v,S]);return se(()=>{r.context.dataRef.current.floatingContext=C;const T=l?.nodesRef.current.find(I=>I.id===t);T&&(T.context=C)}),d.useMemo(()=>({...u,context:C,refs:b,elements:R,rootStore:r}),[u,b,R,C,r])}function Jr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Rt(),i=it()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=ke(()=>new Jn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const $n=kt("safe-polygon"),La=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${lr}`;function Fa(e){return e?!!e.closest(La):!1}function Qr(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=ot(),l=ot(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Da=new Set(["click","mousedown"]);function Na(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:g,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:y,handleCloseOptionsRef:E}=Qr(n),b=xt(l),R=it(),v=Y(()=>f.current?!0:i.current.openEvent?Da.has(i.current.openEvent.type):!1),S=Y(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),C=d.useCallback((k,F=!0)=>{const A=$a(c,u.current);A&&!p.current?y.start(A,()=>n.setOpen(!1,ce(Se,k))):F&&(y.clear(),n.setOpen(!1,ce(Se,k)))},[c,p,n,u,y]),T=Y(()=>{m.current(),p.current=void 0}),I=Y(()=>{if(g.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute($n),g.current=!1}}),N=Y(k=>{const F=xe(k);if(!Fa(F)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,T(),I())},[o,u,h,f,T,I]),d.useEffect(()=>()=>{T()},[T]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&E.current?.blockPointerEvents&&S()&&ie(s)&&r){g.current=!0;const k=fe(r).body;k.setAttribute($n,"");const F=s,A=r,O=b?.nodesRef.current.find(D=>D.id===R)?.context?.elements.floating;return O&&(O.style.pointerEvents=""),k.style.pointerEvents="none",F.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",F.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,E,S,b,R,g]),d.useEffect(()=>{if(!a)return;function k(D){if(v()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),T(),v()||C(D))}function F(D){y.clear(),I(),p.current?.(D),T()}function A(D){v()||C(D,!1)}const O=r;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",A),O.addEventListener("pointerdown",N,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",A),O.removeEventListener("pointerdown",N,!0))}})}function $a(e,t){return t&&!mt(t)?0:typeof e=="function"?e():e}function Sn(e){return typeof e=="function"?e():e}const Ba={current:null};function Wa(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Ba,externalTree:p,isActiveTrigger:g=!0}=t,m=xt(p),{pointerTypeRef:h,interactedInsideRef:y,handlerRef:E,blockMouseMoveRef:b,performedPointerEventsMutationRef:R,unbindMouseMoveRef:v,restTimeoutPendingRef:S,openChangeTimeout:C,restTimeout:T,handleCloseOptionsRef:I}=Qr(n),N=De(a),k=De(i),F=De(l);g&&(I.current=N.current?.__options);const A=Y(()=>y.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),O=d.useCallback(($,w=!0)=>{const L=yn(k.current,"close",h.current);L&&!E.current?C.start(L,()=>n.setOpen(!1,ce(Se,$))):w&&(C.clear(),n.setOpen(!1,ce(Se,$)))},[k,E,n,h,C]),D=Y(()=>{v.current(),E.current=void 0}),P=Y(()=>{if(R.current){const $=fe(n.select("domReferenceElement")).body;$.style.pointerEvents="",$.removeAttribute($n),R.current=!1}});d.useEffect(()=>{if(!s)return;function $(w){w.open||(C.clear(),T.clear(),b.current=!0,S.current=!1)}return r.on("openchange",$),()=>{r.off("openchange",$)}},[s,r,C,T,b,S]);const V=Y($=>{if(A()||!o.current.floatingContext)return;const w=n.context.triggerElements;if($.relatedTarget&&w.hasElement($.relatedTarget))return;const L=f.current;N.current?.({...o.current.floatingContext,tree:m,x:$.clientX,y:$.clientY,onClose(){P(),D(),!A()&&L===n.select("domReferenceElement")&&O($)}})($)});return d.useEffect(()=>{if(!s)return;const $=f.current??(g?n.select("domReferenceElement"):null);if(!ie($))return;function w(G){if(C.clear(),b.current=!1,c&&!mt(h.current)||Sn(F.current)>0&&!yn(k.current,"open"))return;const X=yn(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(G.target)||_.hasMatchingElement(pe=>re(pe,G.target)))&&(!Z||!re(Z,G.target)),z=G.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(Se,G,z)):X?C.start(X,()=>{de&&n.setOpen(!0,ce(Se,G,z))}):de&&n.setOpen(!0,ce(Se,G,z))}function L(G){if(A()){P();return}v.current();const X=n.select("domReferenceElement"),Z=fe(X);T.clear(),S.current=!1;const _=n.context.triggerElements;if(G.relatedTarget&&_.hasElement(G.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||C.clear();const z=f.current;E.current=N.current({...o.current.floatingContext,tree:m,x:G.clientX,y:G.clientY,onClose(){P(),D(),!A()&&z===n.select("domReferenceElement")&&O(G,!0)}});const J=E.current;J(G),Z.addEventListener("mousemove",J),v.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),G.relatedTarget))&&O(G)}function Q(G){V(G)}return n.select("open")&&$.addEventListener("mouseleave",Q),u&&$.addEventListener("mousemove",w,{once:!0}),$.addEventListener("mouseenter",w),$.addEventListener("mouseleave",L),()=>{$.removeEventListener("mouseleave",Q),u&&$.removeEventListener("mousemove",w),$.removeEventListener("mouseenter",w),$.removeEventListener("mouseleave",L)}},[D,P,b,o,k,O,n,s,N,V,g,A,c,u,h,F,T,S,C,f,m,v,E]),d.useMemo(()=>{function $(w){h.current=w.pointerType}return{onPointerDown:$,onPointerEnter:$,onMouseMove(w){const{nativeEvent:L}=w,Q=w.currentTarget,G=n.select("domReferenceElement"),X=n.context.triggerElements,Z=n.select("open"),_=(X.hasElement(w.target)||X.hasMatchingElement(z=>re(z,w.target)))&&(!G||!re(G,w.target));if(c&&!mt(h.current)||Z&&!_||Sn(F.current)===0||!_&&S.current&&w.movementX**2+w.movementY**2<2)return;T.clear();function ne(){if(S.current=!1,A())return;const z=n.select("open");!b.current&&(!z||_)&&n.setOpen(!0,ce(Se,L,Q))}h.current==="touch"?Ke.flushSync(()=>{ne()}):_&&Z?ne():(S.current=!0,T.start(Sn(F.current),ne))}}},[b,A,c,n,h,F,T,S])}function eo(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Ht(l,e,"reference"),t),i=d.useCallback(l=>Ht(l,e,"floating"),n),a=d.useCallback(l=>Ht(l,e,"item"),o),c=d.useCallback(l=>Ht(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Ht(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Pn]="");for(const i in e)r&&e&&(i===cr||i===ar)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Bo(s,a,r,o)}return Bo(s,e,r,o),s}function Bo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===cr||r===ar)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Va=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function es(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=Rt(),u=s?.id||l,f=d.useMemo(()=>In(i)?.id||r,[i,r]),p=Va.get(c)??c,m=it()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?Ee:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,m,c]),y=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),E=d.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:R,selected:v})=>{const S={role:"option",...R&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...S,"aria-selected":v}}return{}},[f,c]);return d.useMemo(()=>a?{reference:y,floating:E,item:b,trigger:h}:{},[a,y,E,h,b])}function Wo(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function ja(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ha(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ge;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const g=performance.now(),m=g-c;if(i===null||a===null||m===0)return i=f,a=p,c=g,null;const h=f-i,y=p-a,b=Math.sqrt(h*h+y*y)/m;return i=f,a=p,c=g,b}const u=({x:f,y:p,placement:g,elements:m,onClose:h,nodeId:y,tree:E})=>function(R){function v(){r.clear(),h()}if(r.clear(),!m.domReference||!m.floating||g==null||f==null||p==null)return;const{clientX:S,clientY:C}=R,T=[S,C],I=xe(R),N=R.type==="mouseleave",k=re(m.floating,I),F=re(m.domReference,I),A=m.domReference.getBoundingClientRect(),O=m.floating.getBoundingClientRect(),D=g.split("-")[0],P=f>O.right-O.width/2,V=p>O.bottom-O.height/2,$=ja(T,A),w=O.width>A.width,L=O.height>A.height,Q=(w?A:O).left,G=(w?A:O).right,X=(L?A:O).top,Z=(L?A:O).bottom;if(k&&(s=!0,!N))return;if(F&&(s=!1),F&&!N){s=!0;return}if(N&&ie(R.relatedTarget)&&re(m.floating,R.relatedTarget)||E&&nt(E.nodesRef.current,y).some(({context:z})=>z?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return v();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,O.bottom-1],[G,O.bottom-1],[G,A.top+1]];break;case"bottom":_=[[Q,O.top+1],[Q,A.bottom-1],[G,A.bottom-1],[G,O.top+1]];break;case"left":_=[[O.right-1,Z],[O.right-1,X],[A.left+1,X],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,X],[O.left+1,X],[O.left+1,Z]];break}function ne([z,J]){switch(D){case"top":{const de=[w?z+t/2:P?z+t*4:z-t*4,J+t+1],pe=[w?z-t/2:P?z+t*4:z-t*4,J+t+1],ge=[[O.left,P||w?O.bottom-t:O.top],[O.right,P?w?O.bottom-t:O.top:O.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[w?z+t/2:P?z+t*4:z-t*4,J-t],pe=[w?z-t/2:P?z+t*4:z-t*4,J-t],ge=[[O.left,P||w?O.top+t:O.bottom],[O.right,P?w?O.top+t:O.bottom:O.top+t]];return[de,pe,...ge]}case"left":{const de=[z+t+1,L?J+t/2:V?J+t*4:J-t*4],pe=[z+t+1,L?J-t/2:V?J+t*4:J-t*4];return[...[[V||L?O.right-t:O.left,O.top],[V?L?O.right-t:O.left:O.right-t,O.bottom]],de,pe]}case"right":{const de=[z-t,L?J+t/2:V?J+t*4:J-t*4],pe=[z-t,L?J-t/2:V?J+t*4:J-t*4],ge=[[V||L?O.left+t:O.right,O.top],[V?L?O.left+t:O.right:O.left+t,O.bottom]];return[de,pe,...ge]}default:return[]}}if(!Wo([S,C],_)){if(s&&!$)return v();if(!N&&o){const z=l(R.clientX,R.clientY);if(z!==null&&z<.1)return v()}Wo([S,C],ne([f,p]))?!s&&o&&r.start(40,v):v()}};return u.__options={blockPointerEvents:n},u}function ts(e){return Rt(e,"base-ui")}function _a(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function ns(e){const[t,n]=d.useState(null),o=Y((a,c)=>{e||n(c||(ir?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=_a(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ie=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Mt.startingStyle]="startingStyle",e[e.endingStyle=Mt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Bn=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Ya={[Bn.popupOpen]:""},Ua={[Bn.popupOpen]:"",[Bn.pressed]:""},za={[Ie.open]:""},qa={[Ie.closed]:""},Ka={[Ie.anchorHidden]:""},Ga={open(e){return e?Ya:null}},Xa={open(e){return e?Ua:null}},Lt={open(e){return e?za:qa},anchorHidden(e){return e?Ka:null}},Za=d.createContext(void 0);function Ja(e=!1){const t=d.useContext(Za);if(t===void 0&&!e)throw new Error(Ye(16));return t}function Qa(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,a=o&&t===!1;return{props:d.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[o,n,t,i,a,s,r])}}function el(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=d.useRef(null),i=Ja(!0)!==void 0,a=Y(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:c}=Qa({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r}),l=d.useCallback(()=>{const p=s.current;tl(p)&&i&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,i]);se(l,[l]);const u=d.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:h,onKeyDown:y,onPointerDown:E,...b}=p;return Mr({type:r?"button":void 0,onClick(v){if(t){v.preventDefault();return}g?.(v)},onMouseDown(v){t||m?.(v)},onKeyDown(v){if(t||(Nn(v),y?.(v)),v.baseUIHandlerPrevented)return;const S=v.target===v.currentTarget&&!r&&!a()&&!t,C=v.key==="Enter",T=v.key===" ";S&&((T||C)&&v.preventDefault(),C&&g?.(v))},onKeyUp(v){t||(Nn(v),h?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!r&&!t&&v.key===" "&&g?.(v)},onPointerDown(v){if(t){v.preventDefault();return}E?.(v)}},r?void 0:{role:"button"},c,b)},[t,c,r,a]),f=Y(p=>{s.current=p,l()});return{getButtonProps:u,buttonRef:f}}function tl(e){return me(e)&&e.tagName==="BUTTON"}function os(e){return Vn(19)?e:e?"true":void 0}let Vo={},jo={},Ho="";function nl(e){if(typeof document>"u")return!1;const t=ct(e);return he(t).innerWidth-t.documentElement.clientWidth>0}function ol(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=ct(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function rl(e){const t=ct(e),n=t.documentElement,o=t.body,r=st(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function sl(e){const t=ct(e),n=t.documentElement,o=t.body,r=he(n);let s=0,i=0,a=!1;const c=Fe.create();if(vi&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),g=r.getComputedStyle(o),y=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Vo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ho=n.style.scrollBehavior,jo={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||g.overflowY==="scroll",v=p.overflowX==="scroll"||g.overflowX==="scroll",S=Math.max(0,r.innerWidth-o.clientWidth),C=Math.max(0,r.innerHeight-o.clientHeight),T=parseFloat(g.marginTop)+parseFloat(g.marginBottom),I=parseFloat(g.marginLeft)+parseFloat(g.marginRight),N=st(n)?n:o;if(a=ol(e),a){n.style.scrollbarGutter=y,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(E||R)&&(n.style.overflowY="scroll"),(b||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:T||C?`calc(100dvh - ${T+C}px)`:"100dvh",width:I||S?`calc(100vw - ${I+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Vo),Object.assign(o.style,jo),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ho)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class il{lockCount=0;restore=null;timeoutLock=Ge.create();timeoutUnlock=Ge.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=ct(t).documentElement,r=he(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=nr;return}const s=ir||!nl(t);this.restore=s?rl(t):sl(t)}}const cl=new il;function rs(e=!0,t=null){se(()=>{if(e)return cl.acquire(t)},[e,t])}const al=d.createContext(void 0);function ll(){return d.useContext(al)?.direction??"ltr"}const ul=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=_e(e,t)||{};if(l==null)return{};const p=dr(u),g={x:n,y:o},m=Kn(r),h=qn(m),y=await i.getDimensions(l),E=m==="y",b=E?"top":"left",R=E?"bottom":"right",v=E?"clientHeight":"clientWidth",S=s.reference[h]+s.reference[m]-g[m]-s.floating[h],C=g[m]-s.reference[m],T=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[v]||s.floating[h];(!I||!await i.isElement?.(T))&&(I=a.floating[v]||s.floating[h]);const N=S/2-C/2,k=I/2-y[h]/2-1,F=Math.min(p[b],k),A=Math.min(p[R],k),O=F,D=I-y[h]-A,P=I/2-y[h]/2+N,V=kn(O,P,D),$=!c.arrow&&Ze(r)!=null&&P!==V&&s.reference[h]/2-(P<O?F:A)-y[h]/2<0,w=$?P<O?P-O:P-D:0;return{[m]:g[m]+w,data:{[m]:V,centerOffset:P-V-w,...$&&{alignmentOffset:w}},reset:$}}}),fl=(e,t)=>({...ul(e),options:[e,t]}),dl={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Ra().fn(e)).data?.referenceHidden||s}}}},Yt={sideX:"left",sideY:"top"},pl={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=he(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Yt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=ct(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const g=Re(a);let m=t,h=n;g==="left"&&(m=p.width-(t+o.width)),g==="top"&&(h=p.height-(n+o.height));const y=g==="left"?"right":Yt.sideX,E=g==="top"?"bottom":Yt.sideY;return{x:m,y:h,data:{sideX:y,sideY:E}}}};function ss(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function _o(e,t,n){const{rects:o,placement:r}=e;return{side:ss(t,Re(r),n),align:Ze(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function gl(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:g,mounted:m,collisionAvoidance:h,shiftCrossAxis:y=!1,nodeId:E,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:v}=e,[S,C]=d.useState(null);!m&&S!==null&&C(null);const T=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,F=Y(k),A=k?F:t,O=De(t),P=ll()==="rtl",V=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],$=s==="center"?V:`${V}-${s}`;let w=c;const L=1,Q=o==="bottom"?L:0,G=o==="top"?L:0,X=o==="right"?L:0,Z=o==="left"?L:0;typeof w=="number"?w={top:w+Q,right:w+Z,bottom:w+G,left:w+X}:w&&(w={top:(w.top||0)+Q,right:(w.right||0)+Z,bottom:(w.bottom||0)+G,left:(w.left||0)+X});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:w},ne=d.useRef(null),z=De(r),J=De(i),ge=[ha(le=>{const ve=_o(le,o,P),Le=typeof z.current=="function"?z.current(ve):z.current,Te=typeof J.current=="function"?J.current(ve):J.current;return{mainAxis:Le,crossAxis:Te,alignmentAxis:Te}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],Be=I==="none"&&T!=="shift",x=!Be&&(l||y||T==="shift"),U=T==="none"?null:va({..._,padding:{top:w.top+L,right:w.right+L,bottom:w.bottom+L,left:w.left+L},mainAxis:!y&&T==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),B=Be?null:ba(le=>{const ve=ct(le.elements.floating).documentElement;return{..._,rootBoundary:y?{x:0,y:0,width:ve.clientWidth,height:ve.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:x,limiter:l||y?void 0:ya(Le=>{if(!ne.current)return{};const{width:Te,height:lt}=ne.current.getBoundingClientRect(),ut=Oe(Re(Le.placement)),Dt=ut==="y"?Te:lt,ln=ut==="y"?w.left+w.right:w.top+w.bottom;return{offset:Dt/2+ln/2}})}},[_,l,y,w,I]);T==="shift"||I==="shift"||s==="center"?ge.push(B,U):ge.push(U,B),ge.push(Ea({..._,apply({elements:{floating:le},rects:{reference:ve},availableWidth:Le,availableHeight:Te}){Object.entries({"--available-width":`${Le}px`,"--available-height":`${Te}px`,"--anchor-width":`${ve.width}px`,"--anchor-height":`${ve.height}px`}).forEach(([lt,ut])=>{le.style.setProperty(lt,ut)})}}),fl(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ve,middlewareData:Le,placement:Te,rects:lt,y:ut}=le,Dt=Re(Te),ln=Oe(Dt),co=ne.current,Rs=Le.arrow?.x||0,xs=Le.arrow?.y||0,ws=co?.clientWidth||0,Ss=co?.clientHeight||0,un=Rs+ws/2,ao=xs+Ss/2,Cs=Math.abs(Le.shift?.y||0),Ts=lt.reference.height/2,St=typeof r=="function"?r(_o(le,o,P)):r,Os=Cs>St,Ps={top:`${un}px calc(100% + ${St}px)`,bottom:`${un}px ${-St}px`,left:`calc(100% + ${St}px) ${ao}px`,right:`${-St}px ${ao}px`}[Dt],Is=`${un}px ${lt.reference.y+Ts-ut}px`;return ve.floating.style.setProperty("--transform-origin",x&&ln==="y"&&Os?Is:Ps),{}}},dl,b),se(()=>{!m&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,g]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:q,y:te,middlewareData:oe,update:H,placement:j,context:be,isPositioned:ae,floatingStyles:We}=Aa({rootContext:g,placement:$,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>No(...le,ue),nodeId:E,externalTree:v}),{sideX:Qe,sideY:at}=oe.adaptiveOrigin||Yt,et=ae?n:"fixed",ye=d.useMemo(()=>b?{position:et,[Qe]:q,[at]:te}:{position:et,...We},[b,et,Qe,q,at,te,We]),Me=d.useRef(null);se(()=>{if(!m)return;const le=O.current,ve=typeof le=="function"?le():le,Te=(Yo(ve)?ve.current:ve)||null||null;Te!==Me.current&&(M.setPositionReference(Te),Me.current=Te)},[m,M,A,O]),d.useEffect(()=>{if(!m)return;const le=O.current;typeof le!="function"&&Yo(le)&&le.current!==Me.current&&(M.setPositionReference(le.current),Me.current=le.current)},[m,M,A,O]),d.useEffect(()=>{if(p&&m&&W.domReference&&W.floating)return No(W.domReference,W.floating,H,ue)},[p,m,W,H,ue]);const Ae=Re(j),no=ss(o,Ae,P),oo=Ze(j)||"center",ro=!!oe.hide?.referenceHidden;se(()=>{R&&m&&ae&&C(Ae)},[R,m,ae,Ae]);const so=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),io=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ye,arrowStyles:so,arrowRef:ne,arrowUncentered:io,side:no,align:oo,physicalSide:Ae,anchorHidden:ro,refs:M,context:be,isPositioned:ae,update:H}),[ye,so,ne,io,no,oo,Ae,ro,M,be,ae,H])}function Yo(e){return e!=null&&"current"in e}const is=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
2
2
  0% 0%,
3
3
  100% 0%,
4
4
  100% 100%,