var Oo=Object.defineProperty;var To=(e,t,n)=>t in e?Oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>To(e,typeof t!="symbol"?t+"":t,n);import{r as l,p as yn,e as st,aF as Co,u as q,g as De,au as gr,aG as Rt,aH as Ao,aI as Mo,h as me,d as wn,j as he,aJ as xt,n as vn,f as xe,H as En,E as Rn,b as G,aK as Lo,q as Io,B as $n,G as br,aL as _e,m as Po,D as yr,aM as Ve,k as bt,aN as tt,i as le,aO as Be,aP as Bn,aQ as xn,aR as Sn,M as it,L as Ue,aS as ko,aT as wr,aU as Fo,aV as Gt,l as Do,aw as Vo,y as No,aW as Ho,aX as Wo,aY as vr,I as en,J as $o,aZ as Zn,as as Bo}from"./index-BG1q7iHG.js";const $c=500,Bc=500,Zo={style:{transition:"none"}},_o="data-base-ui-click-trigger",Zc={fallbackAxisSide:"none"},_c={fallbackAxisSide:"end"},jo={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Ko=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),l.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),zo=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM93,180l71-71,11,11-71,71ZM76,163,65,152l71-71,11,11ZM52,173l15.51,15.51h0L83,204H52ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),l.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160,136,75.31,152.69,92,68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188,164,103.31,180.69,120Zm96-96L147.31,64l24-24L216,84.68Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160l90.35-90.35,16.68,16.69L68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188l90.35-90.35h0l16.68,16.69Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM48.49,160,136,72.48,155.51,92,68,179.51ZM46,208V174.48L81.51,210H48A2,2,0,0,1,46,208Zm50-.49L76.49,188,164,100.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160,136,75.31,152.69,92,68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188,164,103.31,180.69,120Zm96-96L147.31,64l24-24L216,84.68Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17ZM45.66,160,136,69.65,158.34,92,68,182.34ZM44,208V169.66l21.17,21.17h0L86.34,212H48A4,4,0,0,1,44,208Zm52,2.34L73.66,188,164,97.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),Yo=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),l.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),Go=l.forwardRef((e,t)=>l.createElement(yn,{ref:t,...e,weights:Ko}));Go.displayName="CheckIcon";const Uo=l.forwardRef((e,t)=>l.createElement(yn,{ref:t,...e,weights:zo}));Uo.displayName="PencilIcon";const qo=l.forwardRef((e,t)=>l.createElement(yn,{ref:t,...e,weights:Yo}));qo.displayName="TrashIcon";const ft=typeof navigator<"u",tn=Qo(),Er=ts(),Rr=es(),Xo=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),xr=tn.platform==="MacIntel"&&tn.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(tn.platform),Jo=ft&&/apple/i.test(navigator.vendor),ln=ft&&/android/i.test(Er)||/android/i.test(Rr),jc=ft&&Er.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Sr=Rr.includes("jsdom/");function Qo(){if(!ft)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function es(){if(!ft)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function ts(){if(!ft)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function dt(e){return(e==null?void 0:e.ownerDocument)||document}const mt=0;class ct{constructor(){de(this,"currentId",mt);de(this,"clear",()=>{this.currentId!==mt&&(clearTimeout(this.currentId),this.currentId=mt)});de(this,"disposeEffect",()=>this.clear)}static create(){return new ct}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=mt,n()},t)}isStarted(){return this.currentId!==mt}}function at(){const e=st(ct.create).current;return Co(e.disposeEffect),e}let _n={},jn={},Kn="";function ns(e){if(typeof document>"u")return!1;const t=dt(e);return De(t).innerWidth-t.documentElement.clientWidth>0}function rs(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=dt(e).documentElement,o={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY};r.style.scrollbarGutter="stable",r.style.overflowY="scroll";const s=r.offsetWidth;r.style.overflowY="hidden";const i=r.offsetWidth;return Object.assign(r.style,o),s===i}function os(e){const t=dt(e),n=t.documentElement,r=t.body,o=Rt(n)?n:r,s=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=s}}function ss(e){var b;const t=dt(e),n=t.documentElement,r=t.body,o=De(n);let s=0,i=0,a=!1;const u=Ao.create();if(Xo&&(((b=o.visualViewport)==null?void 0:b.scale)??1)!==1)return()=>{};function c(){const m=o.getComputedStyle(n),h=o.getComputedStyle(r),p=(m.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,_n={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Kn=n.style.scrollBehavior,jn={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,R=m.overflowY==="scroll"||h.overflowY==="scroll",x=m.overflowX==="scroll"||h.overflowX==="scroll",S=Math.max(0,o.innerWidth-r.clientWidth),M=Math.max(0,o.innerHeight-r.clientHeight),L=parseFloat(h.marginTop)+parseFloat(h.marginBottom),K=parseFloat(h.marginLeft)+parseFloat(h.marginRight),_=Rt(n)?n:r;if(a=rs(e),a){n.style.scrollbarGutter=p,_.style.overflowY="hidden",_.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:p,overflowY:"hidden",overflowX:"hidden"}),(y||R)&&(n.style.overflowY="scroll"),(v||x)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||M?`calc(100dvh - ${L+M}px)`:"100dvh",width:K||S?`calc(100vw - ${K+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,_n),Object.assign(r.style,jn),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Kn)}function d(){f(),u.request(c)}return c(),o.addEventListener("resize",d),()=>{u.cancel(),f(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",d)}}class is{constructor(){de(this,"lockCount",0);de(this,"restore",null);de(this,"timeoutLock",ct.create());de(this,"timeoutUnlock",ct.create());de(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});de(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=dt(t).documentElement,o=De(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=gr;return}const s=xr||!ns(t);this.restore=s?os(t):ss(t)}}const cs=new is;function Kc(e=!0,t=null){q(()=>{if(e)return cs.acquire(t)},[e,t])}function Oe(e){const t=st(as,e).current;return t.next=e,q(t.effect),t}function as(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const un="data-base-ui-focusable",Or="active",Tr="selected",ls="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ze="ArrowLeft",Ye="ArrowRight",On="ArrowUp",St="ArrowDown";function je(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ae(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Mo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Fe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ke(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 us(e){return e.matches("html,body")}function ve(e){return(e==null?void 0:e.ownerDocument)||document}function Cr(e){return me(e)&&e.matches(ls)}function fn(e){return e?e.getAttribute("role")==="combobox"&&Cr(e):!1}function zc(e){if(!e||Sr)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function dn(e){return e?e.hasAttribute(un)?e:e.querySelector(`[${un}]`)||e:null}function nt(e,t,n=!0){return e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...nt(e,o.id,n)])}function zn(e,t){var o;let n=[],r=(o=e.find(s=>s.id===t))==null?void 0:o.parentId;for(;r;){const s=e.find(i=>i.id===r);r=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function Ee(e){e.preventDefault(),e.stopPropagation()}function fs(e){return"nativeEvent"in e}function Ar(e){return e.mozInputSource===0&&e.isTrusted?!0:ln&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Mr(e){return Sr?!1:!ln&&e.width===0&&e.height===0||ln&&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 Yn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Lr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const ds=["top","right","bottom","left"],lt=Math.min,Te=Math.max,Nt=Math.round,et=Math.floor,We=e=>({x:e,y:e}),hs={left:"right",right:"left",bottom:"top",top:"bottom"},ps={start:"end",end:"start"};function hn(e,t,n){return Te(e,lt(t,n))}function $e(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function Ge(e){return e.split("-")[1]}function Tn(e){return e==="x"?"y":"x"}function Cn(e){return e==="y"?"height":"width"}const ms=new Set(["top","bottom"]);function Ie(e){return ms.has(Ce(e))?"y":"x"}function An(e){return Tn(Ie(e))}function gs(e,t,n){n===void 0&&(n=!1);const r=Ge(e),o=An(e),s=Cn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ht(i)),[i,Ht(i)]}function bs(e){const t=Ht(e);return[pn(e),t,pn(t)]}function pn(e){return e.replace(/start|end/g,t=>ps[t])}const Gn=["left","right"],Un=["right","left"],ys=["top","bottom"],ws=["bottom","top"];function vs(e,t,n){switch(e){case"top":case"bottom":return n?t?Un:Gn:t?Gn:Un;case"left":case"right":return t?ys:ws;default:return[]}}function Es(e,t,n,r){const o=Ge(e);let s=vs(Ce(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(pn)))),s}function Ht(e){return e.replace(/left|right|bottom|top/g,t=>hs[t])}function Rs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ir(e){return typeof e!="number"?Rs(e):{top:e,right:e,bottom:e,left:e}}function Wt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Mt(e,t,n){return Math.floor(e/t)!==n}function yt(e,t){return t<0||t>=e.current.length}function nn(e,t){return we(e,{disabledIndices:t})}function qn(e,t){return we(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function we(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.current.length-1&&wt(e,s,r));return s}function xs(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:u,prevIndex:c,stopEvent:f=!1}){let d=c;const b=[],m={};let h=!1;{let p=null,y=-1;e.current.forEach((v,R)=>{if(v==null)return;const x=v.closest('[role="row"]');x&&(h=!0),(x!==p||y===-1)&&(p=x,y+=1,b[y]=[]),b[y].push(R),m[R]=y})}const g=h&&b.length>0&&b.some(p=>p.length!==s);function E(p){if(!g||c===-1)return;const y=m[c];if(y==null)return;const v=b[y].indexOf(c);let R=p==="up"?y-1:y+1;r&&(R<0?R=b.length-1:R>=b.length&&(R=0));const x=new Set;for(;R>=0&&R=0;L-=1){const K=S[L];if(!wt(e,K,i))return K}R=p==="up"?R-1:R+1,r&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===On){const p=E("up");if(p!==void 0)f&&Ee(t),d=p;else{if(f&&Ee(t),c===-1)d=u;else if(d=we(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),r&&(c-sy?R:R-s}yt(e,d)&&(d=c)}}if(t.key===St){const p=E("down");p!==void 0?(f&&Ee(t),d=p):(f&&Ee(t),c===-1?d=a:(d=we(e,{startingIndex:c,amount:s,disabledIndices:i}),r&&c+s>u&&(d=we(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),yt(e,d)&&(d=c))}if(n==="both"){const p=et(c/s);t.key===(o?ze:Ye)&&(f&&Ee(t),c%s!==s-1?(d=we(e,{startingIndex:c,disabledIndices:i}),r&&Mt(d,s,p)&&(d=we(e,{startingIndex:c-c%s-1,disabledIndices:i}))):r&&(d=we(e,{startingIndex:c-c%s-1,disabledIndices:i})),Mt(d,s,p)&&(d=c)),t.key===(o?Ye:ze)&&(f&&Ee(t),c%s!==0?(d=we(e,{startingIndex:c,decrement:!0,disabledIndices:i}),r&&Mt(d,s,p)&&(d=we(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):r&&(d=we(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),Mt(d,s,p)&&(d=c));const y=et(u/s)===p;yt(e,d)&&(r&&y?d=t.key===(o?Ye:ze)?u:we(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function Ss(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},a)=>{let u=!1;for(n&&(o=0);!u;){const c=[];for(let f=0;fr[f]==null)?(c.forEach(f=>{r[f]=a}),u=!0):o+=1}}),[...r]}function Os(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Ts(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function wt(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*! * tabbable 6.4.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var Cs=["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] *)"],$t=Cs.join(","),Pr=typeof Element>"u",ut=Pr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Bt=!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==null?void 0:e.ownerDocument},Zt=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Zt(t.parentNode));return i},As=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},kr=function(t,n,r){if(Zt(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll($t));return n&&ut.call(t,$t)&&o.unshift(t),o=o.filter(r),o},_t=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Zt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),u=a.length?a:i.children,c=_t(u,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var f=ut.call(i,$t);f&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),b=!Zt(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&b){var m=_t(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:i,candidates:m})}else s.unshift.apply(s,i.children)}}return o},Fr=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Dr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||As(t))&&!Fr(t)?0:t.tabIndex},Ms=function(t,n){var r=Dr(t);return r<0&&n&&!Fr(t)?0:r},Ls=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Vr=function(t){return t.tagName==="INPUT"},Is=function(t){return Vr(t)&&t.type==="hidden"},Ps=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ks=function(t,n){for(var r=0;rsummary:first-of-type"),a=i?t.parentElement:t;if(ut.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var c=t.parentElement,f=Bt(t);if(c&&!c.shadowRoot&&o(c)===!0)return Xn(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=u}if(Ns(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Xn(t);return!1},Ws=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},Nr=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,u=Ms(a,i),c=i?Nr(o.candidates):a;u===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:u,item:o,isScope:i,content:c})}),r.sort(Ls).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ot=function(t,n){n=n||{};var r;return n.getShadowRoot?r=_t([t],n.includeContainer,{filter:gn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:$s}):r=kr(t,n.includeContainer,gn.bind(null,n)),Nr(r)},Bs=function(t,n){n=n||{};var r;return n.getShadowRoot?r=_t([t],n.includeContainer,{filter:mn.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=kr(t,n.includeContainer,mn.bind(null,n)),r},Hr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ut.call(t,$t)===!1?!1:gn(n,t)};const ht=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Wr(e,t){const n=Ot(e,ht()),r=n.length;if(r===0)return;const o=je(ve(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function $r(e){return Wr(ve(e).body,1)||e}function Br(e){return Wr(ve(e).body,-1)||e}function Zr(e,t){if(!e)return null;const n=Ot(ve(e).body,ht()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Yc(e){return Zr(e,1)}function Gc(e){return Zr(e,-1)}function vt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ae(n,r)}function Zs(e){Ot(e,ht()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Jn(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function _r(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class _s{constructor(){de(this,"nodesRef",{current:[]});de(this,"events",_r())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const jr=l.createContext(null),Kr=l.createContext(null),Ut=()=>{var e;return((e=l.useContext(jr))==null?void 0:e.id)||null},Tt=e=>{const t=l.useContext(Kr);return e??t};function Uc(e){const t=wn(),n=Tt(e),r=Ut();return q(()=>{if(!t)return;const o={id:t,parentId:r};return n==null||n.addNode(o),()=>{n==null||n.removeNode(o)}},[n,t,r]),t}function qc(e){const{children:t,id:n}=e,r=Ut();return he.jsx(jr.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Xc(e){const{children:t,externalTree:n}=e,r=st(()=>n??new _s).current;return he.jsx(Kr.Provider,{value:r,children:t})}function jt(e){return`data-base-ui-${e}`}const zr={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Yr={...zr,position:"fixed",top:0,left:0},Jc={...zr,position:"absolute"},Kt=l.forwardRef(function(t,n){const[r,o]=l.useState();q(()=>{Jo&&o("button")},[]);const s={tabIndex:0,role:r};return he.jsx("span",{...t,ref:n,style:Yr,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Qn=0;function Dt(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Qn);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Qn=requestAnimationFrame(s)}const rt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function er(e){return e==="inert"?rt.inert:e==="aria-hidden"?rt["aria-hidden"]:rt.none}let Lt=new WeakSet,It={},rn=0;const Gr=e=>e&&(e.host||Gr(e.parentNode)),js=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Gr(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Ks(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,i=js(t,e),a=new Set,u=new Set(i),c=[];It[o]||(It[o]=new WeakMap);const f=It[o];i.forEach(d),b(t),a.clear();function d(m){!m||a.has(m)||(a.add(m),m.parentNode&&d(m.parentNode))}function b(m){!m||u.has(m)||[].forEach.call(m.children,h=>{if(xt(h)!=="script")if(a.has(h))b(h);else{const g=s?h.getAttribute(s):null,E=g!==null&&g!=="false",p=er(s),y=(p.get(h)||0)+1,v=(f.get(h)||0)+1;p.set(h,y),f.set(h,v),c.push(h),y===1&&E&&Lt.add(h),v===1&&h.setAttribute(o,""),!E&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return rn+=1,()=>{c.forEach(m=>{const h=er(s),E=(h.get(m)||0)-1,p=(f.get(m)||0)-1;h.set(m,E),f.set(m,p),E||(!Lt.has(m)&&s&&m.removeAttribute(s),Lt.delete(m)),p||m.removeAttribute(o)}),rn-=1,rn||(rt.inert=new WeakMap,rt["aria-hidden"]=new WeakMap,rt.none=new WeakMap,Lt=new WeakSet,It={})}}function zs(e,t=!1,n=!1){const r=ve(e[0]).body;return Ks(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ur=l.createContext(null),qr=()=>l.useContext(Ur),Ys=jt("portal");function Gs(e={}){const{ref:t,container:n,componentProps:r=Rn,elementProps:o,elementState:s}=e,i=wn(),a=qr(),u=a==null?void 0:a.portalNode,[c,f]=l.useState(null),[d,b]=l.useState(null),m=G(p=>{p!==null&&b(p)}),h=l.useRef(null);q(()=>{if(n===null){h.current&&(h.current=null,b(null),f(null));return}if(i==null)return;const p=(n&&(Lo(n)?n:n.current))??u??document.body;if(p==null){h.current&&(h.current=null,b(null),f(null));return}h.current!==p&&(h.current=p,b(null),f(p))},[n,u,i]);const g=Io("div",r,{ref:[t,m],state:s,props:[{id:i,[Ys]:""},o]});return{portalNode:d,portalSubtree:c&&g?vn.createPortal(g,c):null}}const Qc=l.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,...u}=t,{portalNode:c,portalSubtree:f}=Gs({container:o,ref:n,componentProps:t,elementProps:u}),d=l.useRef(null),b=l.useRef(null),m=l.useRef(null),h=l.useRef(null),[g,E]=l.useState(null),p=g==null?void 0:g.modal,y=g==null?void 0:g.open,v=typeof a=="boolean"?a:!!g&&!g.modal&&g.open&&!!c;l.useEffect(()=>{if(!c||p)return;function x(S){c&&S.relatedTarget&&vt(S)&&(S.type==="focusin"?Jn:Zs)(c)}return c.addEventListener("focusin",x,!0),c.addEventListener("focusout",x,!0),()=>{c.removeEventListener("focusin",x,!0),c.removeEventListener("focusout",x,!0)}},[c,p]),l.useEffect(()=>{!c||y||Jn(c)},[y,c]);const R=l.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:b,beforeInsideRef:m,afterInsideRef:h,portalNode:c,setFocusManagerState:E}),[c]);return he.jsxs(l.Fragment,{children:[f,he.jsxs(Ur.Provider,{value:R,children:[v&&c&&he.jsx(Kt,{"data-type":"outside",ref:d,onFocus:x=>{var S;if(vt(x,c))(S=m.current)==null||S.focus();else{const M=g?g.domReference:null,L=Br(M);L==null||L.focus()}}}),v&&c&&he.jsx("span",{"aria-owns":c.id,style:jo}),c&&vn.createPortal(r,c),v&&c&&he.jsx(Kt,{"data-type":"outside",ref:b,onFocus:x=>{var S;if(vt(x,c))(S=h.current)==null||S.focus();else{const M=g?g.domReference:null,L=$r(M);L==null||L.focus(),g!=null&&g.closeOnFocusOut&&(g==null||g.onOpenChange(!1,xe(En,x.nativeEvent)))}}})]})]})});function Us(e,t){const n=De(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 tr=20;let Ke=[];function Mn(){Ke=Ke.filter(e=>e.isConnected)}function qs(e){Mn(),e&&xt(e)!=="body"&&(Ke.push(e),Ke.length>tr&&(Ke=Ke.slice(-tr)))}function on(){return Mn(),Ke[Ke.length-1]}function Xs(e){if(!e)return null;const t=ht();return Hr(e,t)?e:Ot(e,t)[0]||e}function Js(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ve(e).display!=="none"}function nr(e,t){var i;if(!t.current.includes("floating")&&!((i=e.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=ht(),o=Bs(e,n).filter(a=>{const u=a.getAttribute("data-tabindex")||"";return Hr(a,n)||a.hasAttribute("data-tabindex")&&!u.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ea(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:u=!0,closeOnFocusOut:c=!0,openInteractionType:f="",getInsideElements:d=()=>[],nextFocusableElement:b,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g}=e,E="rootStore"in t?t.rootStore:t,p=E.useState("open"),y=E.useState("domReferenceElement"),v=E.useState("floatingElement"),{events:R,dataRef:x}=E.context,S=G(()=>{var T;return(T=x.current.floatingContext)==null?void 0:T.nodeId}),M=G(d),L=s===!1,K=fn(y)&&L,_=Oe(o),J=Oe(s),Q=Oe(i),z=Oe(f),j=Tt(g),O=qr(),Z=l.useRef(null),U=l.useRef(null),A=l.useRef(!1),$=l.useRef(!1),N=l.useRef(!1),Re=l.useRef(-1),ge=l.useRef(""),X=l.useRef(""),Se=l.useRef(null),ue=l.useRef(null),Ne=$n(Se,h,O==null?void 0:O.beforeInsideRef),fe=$n(ue,O==null?void 0:O.afterInsideRef),Ae=at(),Me=at(),be=br(),Pe=O!=null,w=dn(v),F=G((T=w)=>T?Ot(T,ht()):[]),P=G(T=>{const D=F(T);return _.current.map(()=>D).filter(Boolean).flat()});l.useEffect(()=>{if(r||!u)return;function T(V){V.key==="Tab"&&ae(w,je(ve(w)))&&F().length===0&&!K&&Ee(V)}const D=ve(w);return D.addEventListener("keydown",T),()=>{D.removeEventListener("keydown",T)}},[r,y,w,u,_,K,F,P]),l.useEffect(()=>{if(r||!v)return;function T(D){const V=Fe(D),Y=F().indexOf(V);Y!==-1&&(Re.current=Y)}return v.addEventListener("focusin",T),()=>{v.removeEventListener("focusin",T)}},[r,v,F]),l.useEffect(()=>{if(r||!p)return;const T=ve(w);function D(){N.current=!1}function V(Y){const H=Fe(Y),B=ae(v,H)||ae(y,H)||ae(O==null?void 0:O.portalNode,H);N.current=!B,X.current=Y.pointerType||"keyboard"}function W(){X.current="keyboard"}return T.addEventListener("pointerdown",V,!0),T.addEventListener("pointerup",D,!0),T.addEventListener("pointercancel",D,!0),T.addEventListener("keydown",W,!0),()=>{T.removeEventListener("pointerdown",V,!0),T.removeEventListener("pointerup",D,!0),T.removeEventListener("pointercancel",D,!0),T.removeEventListener("keydown",W,!0)}},[r,v,y,w,p,O]),l.useEffect(()=>{if(r||!c)return;function T(){$.current=!0,Me.start(0,()=>{$.current=!1})}function D(H){const B=H.relatedTarget,C=H.currentTarget,k=Fe(H);queueMicrotask(()=>{const I=S(),ee=E.context.triggerElements,te=(B==null?void 0:B.hasAttribute(jt("focus-guard")))&&[Se.current,ue.current,O==null?void 0:O.beforeInsideRef.current,O==null?void 0:O.afterInsideRef.current,O==null?void 0:O.beforeOutsideRef.current,O==null?void 0:O.afterOutsideRef.current,_e(m),_e(b)].includes(B),re=!(ae(y,B)||ae(v,B)||ae(B,v)||ae(O==null?void 0:O.portalNode,B)||B!=null&&ee.hasElement(B)||ee.hasMatchingElement(ne=>ae(ne,B))||te||j&&(nt(j.nodesRef.current,I).find(ne=>{var oe,ce;return ae((oe=ne.context)==null?void 0:oe.elements.floating,B)||ae((ce=ne.context)==null?void 0:ce.elements.domReference,B)})||zn(j.nodesRef.current,I).find(ne=>{var oe,ce,ye;return[(oe=ne.context)==null?void 0:oe.elements.floating,dn((ce=ne.context)==null?void 0:ce.elements.floating)].includes(B)||((ye=ne.context)==null?void 0:ye.elements.domReference)===B})));if(C===y&&w&&nr(w,_),a&&C!==y&&!Js(k)&&je(ve(w))===ve(w).body){if(me(w)&&(w.focus(),a==="popup")){be.request(()=>{w.focus()});return}const ne=Re.current,oe=F(),ce=oe[ne]||oe[oe.length-1]||w;me(ce)&&ce.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(K||!u)&&B&&re&&!$.current&&(K||B!==on())&&(A.current=!0,E.setOpen(!1,xe(En,H)))})}function V(){N.current||(x.current.insideReactTree=!0,Ae.start(0,()=>{x.current.insideReactTree=!1}))}const W=me(y)?y:null,Y=[];if(!(!v&&!W))return W&&(W.addEventListener("focusout",D),W.addEventListener("pointerdown",T),Y.push(()=>{W.removeEventListener("focusout",D),W.removeEventListener("pointerdown",T)})),v&&(v.addEventListener("focusout",D),O&&(v.addEventListener("focusout",V,!0),Y.push(()=>{v.removeEventListener("focusout",V,!0)})),Y.push(()=>{v.removeEventListener("focusout",D)})),()=>{Y.forEach(H=>{H()})}},[r,y,v,w,u,j,O,E,c,a,F,K,S,_,x,Ae,Me,be,b,m]),l.useEffect(()=>{var H,B,C;if(r||!v||!p)return;const T=Array.from(((H=O==null?void 0:O.portalNode)==null?void 0:H.querySelectorAll(`[${jt("portal")}]`))||[]),V=(C=(B=(j?zn(j.nodesRef.current,S()):[]).find(k=>{var I;return fn(((I=k.context)==null?void 0:I.elements.domReference)||null)}))==null?void 0:B.context)==null?void 0:C.elements.domReference,W=[v,V,...T,...M(),Z.current,U.current,Se.current,ue.current,O==null?void 0:O.beforeOutsideRef.current,O==null?void 0:O.afterOutsideRef.current,_e(m),_e(b),K?y:null].filter(k=>k!=null),Y=zs(W,u||K);return()=>{Y()}},[p,r,y,v,u,_,O,K,j,S,M,b,m]),q(()=>{if(!p||r||!me(w))return;const T=ve(w),D=je(T);queueMicrotask(()=>{const V=P(w),W=J.current,Y=typeof W=="function"?W(z.current||""):W;if(Y===void 0||Y===!1)return;let H;Y===!0||Y===null?H=V[0]||w:H=_e(Y),H=H||V[0]||w,!ae(w,D)&&Dt(H,{preventScroll:H===w})})},[r,p,w,L,P,J,z]),q(()=>{if(r||!w)return;const T=ve(w),D=je(T);qs(D);function V(H){if(H.open||(ge.current=Us(H.nativeEvent,X.current)),H.reason===Po&&H.nativeEvent.type==="mouseleave"&&(A.current=!0),H.reason===yr)if(H.nested)A.current=!1;else if(Ar(H.nativeEvent)||Mr(H.nativeEvent))A.current=!1;else{let B=!1;document.createElement("div").focus({get preventScroll(){return B=!0,!1}}),B?A.current=!1:A.current=!0}}R.on("openchange",V);const W=T.createElement("span");W.setAttribute("tabindex","-1"),W.setAttribute("aria-hidden","true"),Object.assign(W.style,Yr),Pe&&y&&y.insertAdjacentElement("afterend",W);function Y(){const H=Q.current;let B=typeof H=="function"?H(ge.current):H;if(B===void 0||B===!1)return null;if(B===null&&(B=!0),typeof B=="boolean"){const k=y||on();return k&&k.isConnected?k:W}const C=y||on()||W;return _e(B)||C}return()=>{R.off("openchange",V);const H=je(T),B=ae(v,H)||j&&nt(j.nodesRef.current,S(),!1).some(k=>{var I;return ae((I=k.context)==null?void 0:I.elements.floating,H)}),C=Y();queueMicrotask(()=>{const k=Xs(C),I=typeof Q.current!="boolean";Q.current&&!A.current&&me(k)&&(!(!I&&k!==H&&H!==T.body)||B)&&k.focus({preventScroll:!0}),W.remove()})}},[r,v,w,Q,x,R,j,Pe,y,S]),l.useEffect(()=>{queueMicrotask(()=>{A.current=!1})},[r]),l.useEffect(()=>{if(r||!p)return;function T(V){const W=Fe(V);W!=null&&W.closest(`[${_o}]`)&&($.current=!0)}const D=ve(w);return D.addEventListener("pointerdown",T,!0),()=>{D.removeEventListener("pointerdown",T,!0)}},[r,p,w]),q(()=>{if(!r&&O)return O.setFocusManagerState({modal:u,closeOnFocusOut:c,open:p,onOpenChange:E.setOpen,domReference:y}),()=>{O.setFocusManagerState(null)}},[r,O,u,p,E,c,y]),q(()=>{if(!(r||!w))return nr(w,_),()=>{queueMicrotask(Mn)}},[r,w,_]);const ie=!r&&(u?!K:!0)&&(Pe||u);return he.jsxs(l.Fragment,{children:[ie&&he.jsx(Kt,{"data-type":"inside",ref:Ne,onFocus:T=>{var D;if(u){const V=P();Dt(V[V.length-1])}else if(O!=null&&O.portalNode)if(A.current=!1,vt(T,O.portalNode)){const V=$r(y);V==null||V.focus()}else(D=_e(m??O.beforeOutsideRef))==null||D.focus()}}),n,ie&&he.jsx(Kt,{"data-type":"inside",ref:fe,onFocus:T=>{var D;if(u)Dt(P()[0]);else if(O!=null&&O.portalNode)if(c&&(A.current=!0),vt(T,O.portalNode)){const V=Br(y);V==null||V.focus()}else(D=_e(b??O.afterOutsideRef))==null||D.focus()}})]})}function ta(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:u=!0,touchOpenDelay:c=0}=t,f=l.useRef(void 0),d=br(),b=at(),m=l.useMemo(()=>({onPointerDown(h){f.current=h.pointerType},onMouseDown(h){const g=f.current,E=h.nativeEvent,p=n.select("open");if(h.button!==0||s==="click"||Yn(g,!0)&&a)return;const y=r.current.openEvent,v=y==null?void 0:y.type,R=n.select("domReferenceElement")!==h.currentTarget,x=p&&R||!(p&&i&&(!(y&&u)||v==="click"||v==="mousedown"));if(Cr(E.target)){const M=xe(bt,E,E.target);x&&g==="touch"&&c>0?b.start(c,()=>{n.setOpen(!0,M)}):n.setOpen(x,M);return}const S=h.currentTarget;d.request(()=>{const M=xe(bt,E,S);x&&g==="touch"&&c>0?b.start(c,()=>{n.setOpen(!0,M)}):n.setOpen(x,M)})},onClick(h){if(s==="mousedown-only")return;const g=f.current;if(s==="mousedown"&&g){f.current=void 0;return}if(Yn(g,!0)&&a)return;const E=n.select("open"),p=r.current.openEvent,y=n.select("domReferenceElement")!==h.currentTarget,v=E&&y||!(E&&i&&(!(p&&u)||Lr(p))),R=xe(bt,h.nativeEvent,h.currentTarget);v&&g==="touch"&&c>0?b.start(c,()=>{n.setOpen(!0,R)}):n.setOpen(v,R)},onKeyDown(){f.current=void 0}}),[r,s,a,n,u,i,d,b,c]);return l.useMemo(()=>o?{reference:m}:Rn,[o,m])}function rr(e,t,n){let{reference:r,floating:o}=e;const s=Ie(t),i=An(t),a=Cn(i),u=Ce(t),c=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,b=r[a]/2-o[a]/2;let m;switch(u){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ge(t)){case"start":m[i]-=b*(n&&c?-1:1);break;case"end":m[i]+=b*(n&&c?-1:1);break}return m}async function Qs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:b=!1,padding:m=0}=$e(t,e),h=Ir(m),E=a[b?d==="floating"?"reference":"floating":d],p=Wt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(E)))==null||n?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),R=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},x=Wt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:u}):y);return{top:(p.top-x.top+h.top)/R.y,bottom:(x.bottom-p.bottom+h.bottom)/R.y,left:(p.left-x.left+h.left)/R.x,right:(x.right-p.right+h.right)/R.x}}const ei=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=rr(c,r,u),b=r,m={},h=0;for(let E=0;Ej<=0)){var J,Q;const j=(((J=s.flip)==null?void 0:J.index)||0)+1,O=M[j];if(O&&(!(d==="alignment"?y!==Ie(O):!1)||_.every(A=>Ie(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:j,overflows:_},reset:{placement:O}};let Z=(Q=_.filter(U=>U.overflows[0]<=0).sort((U,A)=>U.overflows[1]-A.overflows[1])[0])==null?void 0:Q.placement;if(!Z)switch(m){case"bestFit":{var z;const U=(z=_.filter(A=>{if(S){const $=Ie(A.placement);return $===y||$==="y"}return!0}).map(A=>[A.placement,A.overflows.filter($=>$>0).reduce(($,N)=>$+N,0)]).sort((A,$)=>A[1]-$[1])[0])==null?void 0:z[0];U&&(Z=U);break}case"initialPlacement":Z=a;break}if(o!==Z)return{reset:{placement:Z}}}return{}}}};function or(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sr(e){return ds.some(t=>e[t]>=0)}const ni=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=$e(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=or(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:sr(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=or(i,n.floating);return{data:{escapedOffsets:a,escaped:sr(a)}}}default:return{}}}}},Xr=new Set(["left","top"]);async function ri(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ce(n),a=Ge(n),u=Ie(n)==="y",c=Xr.has(i)?-1:1,f=s&&u?-1:1,d=$e(t,e);let{mainAxis:b,crossAxis:m,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(m=a==="end"?h*-1:h),u?{x:m*f,y:b*c}:{x:b*c,y:m*f}}const oi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await ri(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},si=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:p=>{let{x:y,y:v}=p;return{x:y,y:v}}},...c}=$e(e,t),f={x:n,y:r},d=await s.detectOverflow(t,c),b=Ie(Ce(o)),m=Tn(b);let h=f[m],g=f[b];if(i){const p=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=h+d[p],R=h-d[y];h=hn(v,h,R)}if(a){const p=b==="y"?"top":"left",y=b==="y"?"bottom":"right",v=g+d[p],R=g-d[y];g=hn(v,g,R)}const E=u.fn({...t,[m]:h,[b]:g});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[m]:i,[b]:a}}}}}},ii=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=$e(e,t),f={x:n,y:r},d=Ie(o),b=Tn(d);let m=f[b],h=f[d];const g=$e(a,t),E=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const v=b==="y"?"height":"width",R=s.reference[b]-s.floating[v]+E.mainAxis,x=s.reference[b]+s.reference[v]-E.mainAxis;mx&&(m=x)}if(c){var p,y;const v=b==="y"?"width":"height",R=Xr.has(Ce(o)),x=s.reference[d]-s.floating[v]+(R&&((p=i.offset)==null?void 0:p[d])||0)+(R?0:E.crossAxis),S=s.reference[d]+s.reference[v]+(R?0:((y=i.offset)==null?void 0:y[d])||0)-(R?E.crossAxis:0);hS&&(h=S)}return{[b]:m,[d]:h}}}},ci=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=$e(e,t),f=await i.detectOverflow(t,c),d=Ce(o),b=Ge(o),m=Ie(o)==="y",{width:h,height:g}=s.floating;let E,p;d==="top"||d==="bottom"?(E=d,p=b===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,E=b==="end"?"top":"bottom");const y=g-f.top-f.bottom,v=h-f.left-f.right,R=lt(g-f[E],y),x=lt(h-f[p],v),S=!t.middlewareData.shift;let M=R,L=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=y),S&&!b){const _=Te(f.left,0),J=Te(f.right,0),Q=Te(f.top,0),z=Te(f.bottom,0);m?L=h-2*(_!==0||J!==0?_+J:Te(f.left,f.right)):M=g-2*(Q!==0||z!==0?Q+z:Te(f.top,f.bottom))}await u({...t,availableWidth:L,availableHeight:M});const K=await i.getDimensions(a.floating);return h!==K.width||g!==K.height?{reset:{rects:!0}}:{}}}};function Jr(e){const t=Ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=me(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Nt(n)!==s||Nt(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ln(e){return le(e)?e:e.contextElement}function ot(e){const t=Ln(e);if(!me(t))return We(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Jr(t);let i=(s?Nt(n.width):n.width)/r,a=(s?Nt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ai=We(0);function Qr(e){const t=De(e);return!xn()||!t.visualViewport?ai:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function li(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==De(e)?!1:t}function qe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ln(e);let i=We(1);t&&(r?le(r)&&(i=ot(r)):i=ot(e));const a=li(s,n,r)?Qr(s):We(0);let u=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(s){const b=De(s),m=r&&le(r)?De(r):r;let h=b,g=Bn(h);for(;g&&r&&m!==h;){const E=ot(g),p=g.getBoundingClientRect(),y=Ve(g),v=p.left+(g.clientLeft+parseFloat(y.paddingLeft))*E.x,R=p.top+(g.clientTop+parseFloat(y.paddingTop))*E.y;u*=E.x,c*=E.y,f*=E.x,d*=E.y,u+=v,c+=R,h=De(g),g=Bn(h)}}return Wt({width:f,height:d,x:u,y:c})}function qt(e,t){const n=Gt(e).scrollLeft;return t?t.left+n:qe(Be(e)).left+n}function eo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-qt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ui(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Be(r),a=t?Sn(t.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=We(1);const f=We(0),d=me(r);if((d||!d&&!s)&&((xt(r)!=="body"||Rt(i))&&(u=Gt(r)),me(r))){const m=qe(r);c=ot(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const b=i&&!d&&!s?eo(i,u):We(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+b.x,y:n.y*c.y-u.scrollTop*c.y+f.y+b.y}}function fi(e){return Array.from(e.getClientRects())}function di(e){const t=Be(e),n=Gt(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+qt(e);const a=-n.scrollTop;return Ve(r).direction==="rtl"&&(i+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const ir=25;function hi(e,t){const n=De(e),r=Be(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const f=xn();(!f||f&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const c=qt(r);if(c<=0){const f=r.ownerDocument,d=f.body,b=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-m);h<=ir&&(s-=h)}else c<=ir&&(s+=c);return{width:s,height:i,x:a,y:u}}const pi=new Set(["absolute","fixed"]);function mi(e,t){const n=qe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=me(e)?ot(e):We(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function cr(e,t,n){let r;if(t==="viewport")r=hi(e,n);else if(t==="document")r=di(Be(e));else if(le(t))r=mi(t,n);else{const o=Qr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Wt(r)}function to(e,t){const n=it(e);return n===t||!le(n)||Ue(n)?!1:Ve(n).position==="fixed"||to(n,t)}function gi(e,t){const n=t.get(e);if(n)return n;let r=tt(e,[],!1).filter(a=>le(a)&&xt(a)!=="body"),o=null;const s=Ve(e).position==="fixed";let i=s?it(e):e;for(;le(i)&&!Ue(i);){const a=Ve(i),u=wr(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&pi.has(o.position)||Rt(i)&&!u&&to(e,i))?r=r.filter(f=>f!==i):o=a,i=it(i)}return t.set(e,r),r}function bi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Sn(t)?[]:gi(t,this._c):[].concat(n),r],a=i[0],u=i.reduce((c,f)=>{const d=cr(t,f,o);return c.top=Te(d.top,c.top),c.right=lt(d.right,c.right),c.bottom=lt(d.bottom,c.bottom),c.left=Te(d.left,c.left),c},cr(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function yi(e){const{width:t,height:n}=Jr(e);return{width:t,height:n}}function wi(e,t,n){const r=me(t),o=Be(t),s=n==="fixed",i=qe(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=We(0);function c(){u.x=qt(o)}if(r||!r&&!s)if((xt(t)!=="body"||Rt(o))&&(a=Gt(t)),r){const m=qe(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&c();s&&!r&&o&&c();const f=o&&!r&&!s?eo(o,a):We(0),d=i.left+a.scrollLeft-u.x-f.x,b=i.top+a.scrollTop-u.y-f.y;return{x:d,y:b,width:i.width,height:i.height}}function sn(e){return Ve(e).position==="static"}function ar(e,t){if(!me(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Be(e)===n&&(n=n.ownerDocument.body),n}function no(e,t){const n=De(e);if(Sn(e))return n;if(!me(e)){let o=it(e);for(;o&&!Ue(o);){if(le(o)&&!sn(o))return o;o=it(o)}return n}let r=ar(e,t);for(;r&&ko(r)&&sn(r);)r=ar(r,t);return r&&Ue(r)&&sn(r)&&!wr(r)?n:r||Fo(e)||n}const vi=async function(e){const t=this.getOffsetParent||no,n=this.getDimensions,r=await n(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ei(e){return Ve(e).direction==="rtl"}const Ri={convertOffsetParentRelativeRectToViewportRelativeRect:ui,getDocumentElement:Be,getClippingRect:bi,getOffsetParent:no,getElementRects:vi,getClientRects:fi,getDimensions:yi,getScale:ot,isElement:le,isRTL:Ei};function ro(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xi(e,t){let n=null,r;const o=Be(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const c=e.getBoundingClientRect(),{left:f,top:d,width:b,height:m}=c;if(a||t(),!b||!m)return;const h=et(d),g=et(o.clientWidth-(f+b)),E=et(o.clientHeight-(d+m)),p=et(f),v={rootMargin:-h+"px "+-g+"px "+-E+"px "+-p+"px",threshold:Te(0,lt(1,u))||1};let R=!0;function x(S){const M=S[0].intersectionRatio;if(M!==u){if(!R)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!ro(c,e.getBoundingClientRect())&&i(),R=!1}try{n=new IntersectionObserver(x,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(e)}return i(!0),s}function lr(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Ln(e),f=o||s?[...c?tt(c):[],...tt(t)]:[];f.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=c&&a?xi(c,n):null;let b=-1,m=null;i&&(m=new ResizeObserver(p=>{let[y]=p;y&&y.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let h,g=u?qe(e):null;u&&E();function E(){const p=qe(e);g&&!ro(g,p)&&n(),g=p,h=requestAnimationFrame(E)}return n(),()=>{var p;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(p=m)==null||p.disconnect(),m=null,u&&cancelAnimationFrame(h)}}const Si=oi,Oi=si,Ti=ti,Ci=ci,Ai=ni,Mi=ii,Li=(e,t,n)=>{const r=new Map,o={platform:Ri,...n},s={...o.platform,_c:r};return ei(e,t,{...o,platform:s})};var Ii=typeof document<"u",Pi=function(){},Vt=Ii?l.useLayoutEffect:Pi;function zt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!zt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function oo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ur(e,t){const n=oo(e);return Math.round(t*n)/n}function cn(e){const t=l.useRef(e);return Vt(()=>{t.current=e}),t}function ki(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,d]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=l.useState(r);zt(b,r)||m(r);const[h,g]=l.useState(null),[E,p]=l.useState(null),y=l.useCallback(A=>{A!==S.current&&(S.current=A,g(A))},[]),v=l.useCallback(A=>{A!==M.current&&(M.current=A,p(A))},[]),R=s||h,x=i||E,S=l.useRef(null),M=l.useRef(null),L=l.useRef(f),K=u!=null,_=cn(u),J=cn(o),Q=cn(c),z=l.useCallback(()=>{if(!S.current||!M.current)return;const A={placement:t,strategy:n,middleware:b};J.current&&(A.platform=J.current),Li(S.current,M.current,A).then($=>{const N={...$,isPositioned:Q.current!==!1};j.current&&!zt(L.current,N)&&(L.current=N,vn.flushSync(()=>{d(N)}))})},[b,t,n,J,Q]);Vt(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[c]);const j=l.useRef(!1);Vt(()=>(j.current=!0,()=>{j.current=!1}),[]),Vt(()=>{if(R&&(S.current=R),x&&(M.current=x),R&&x){if(_.current)return _.current(R,x,z);z()}},[R,x,z,_,K]);const O=l.useMemo(()=>({reference:S,floating:M,setReference:y,setFloating:v}),[y,v]),Z=l.useMemo(()=>({reference:R,floating:x}),[R,x]),U=l.useMemo(()=>{const A={position:n,left:0,top:0};if(!Z.floating)return A;const $=ur(Z.floating,f.x),N=ur(Z.floating,f.y);return a?{...A,transform:"translate("+$+"px, "+N+"px)",...oo(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:N}},[n,a,Z.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:z,refs:O,elements:Z,floatingStyles:U}),[f,z,O,Z,U])}const Fi=(e,t)=>({...Si(e),options:[e,t]}),Di=(e,t)=>({...Oi(e),options:[e,t]}),Vi=(e,t)=>({...Mi(e),options:[e,t]}),Ni=(e,t)=>({...Ti(e),options:[e,t]}),Hi=(e,t)=>({...Ci(e),options:[e,t]}),Wi=(e,t)=>({...Ai(e),options:[e,t]}),$i={intentional:"onClick",sloppy:"onPointerDown"};function Bi(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function na(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:u}=n.context,{enabled:c=!0,escapeKey:f=!0,outsidePress:d=!0,outsidePressEvent:b="sloppy",referencePress:m=!1,referencePressEvent:h="sloppy",ancestorScroll:g=!1,bubbles:E,externalTree:p}=t,y=Tt(p),v=G(typeof d=="function"?d:()=>!1),R=typeof d=="function"?v:d,x=l.useRef(!1),{escapeKey:S,outsidePress:M}=Bi(E),L=l.useRef(null),K=at(),_=at(),J=G(()=>{_.clear(),u.current.insideReactTree=!1}),Q=l.useRef(!1),z=l.useRef(""),j=G(w=>{z.current=w.pointerType}),O=G(()=>{const w=z.current,F=w==="pen"||!w?"mouse":w,P=typeof b=="function"?b():b;return typeof P=="string"?P:P[F]}),Z=G(w=>{var D;if(!r||!c||!f||w.key!=="Escape"||Q.current)return;const F=(D=u.current.floatingContext)==null?void 0:D.nodeId,P=y?nt(y.nodesRef.current,F):[];if(!S&&P.length>0){let V=!0;if(P.forEach(W=>{var Y;(Y=W.context)!=null&&Y.open&&!W.context.dataRef.current.__escapeKeyBubbles&&(V=!1)}),!V)return}const ie=fs(w)?w.nativeEvent:w,T=xe(Do,ie);n.setOpen(!1,T),!S&&!T.isPropagationAllowed&&w.stopPropagation()}),U=G(w=>{const F=O();return F==="intentional"&&w.type!=="click"||F==="sloppy"&&w.type==="click"}),A=G(()=>{u.current.insideReactTree=!0,_.start(0,J)}),$=G((w,F=!1)=>{var B;if(U(w)){J();return}if(u.current.insideReactTree){J();return}if(O()==="intentional"&&F||typeof R=="function"&&!R(w))return;const P=Fe(w),ie=`[${jt("inert")}]`,T=ve(n.select("floatingElement")).querySelectorAll(ie),D=n.context.triggerElements;if(P&&(D.hasElement(P)||D.hasMatchingElement(C=>ae(C,P))))return;let V=le(P)?P:null;for(;V&&!Ue(V);){const C=it(V);if(Ue(C)||!le(C))break;V=C}if(T.length&&le(P)&&!us(P)&&!ae(P,n.select("floatingElement"))&&Array.from(T).every(C=>!ae(V,C)))return;if(me(P)&&!("touches"in w)){const C=Ue(P),k=Ve(P),I=/auto|scroll/,ee=C||I.test(k.overflowX),te=C||I.test(k.overflowY),re=ee&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,ne=te&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,oe=k.direction==="rtl",ce=ne&&(oe?w.offsetX<=P.offsetWidth-P.clientWidth:w.offsetX>P.clientWidth),ye=re&&w.offsetY>P.clientHeight;if(ce||ye)return}const W=(B=u.current.floatingContext)==null?void 0:B.nodeId,Y=y&&nt(y.nodesRef.current,W).some(C=>{var k;return ke(w,(k=C.context)==null?void 0:k.elements.floating)});if(ke(w,n.select("floatingElement"))||ke(w,n.select("domReferenceElement"))||Y)return;const H=y?nt(y.nodesRef.current,W):[];if(H.length>0){let C=!0;if(H.forEach(k=>{var I;(I=k.context)!=null&&I.open&&!k.context.dataRef.current.__outsidePressBubbles&&(C=!1)}),!C)return}n.setOpen(!1,xe(yr,w)),J()}),N=G(w=>{O()!=="sloppy"||w.pointerType==="touch"||!n.select("open")||!c||ke(w,n.select("floatingElement"))||ke(w,n.select("domReferenceElement"))||$(w)}),Re=G(w=>{if(O()!=="sloppy"||!n.select("open")||!c||ke(w,n.select("floatingElement"))||ke(w,n.select("domReferenceElement")))return;const F=w.touches[0];F&&(L.current={startTime:Date.now(),startX:F.clientX,startY:F.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},K.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),ge=G(w=>{const F=Fe(w);function P(){Re(w),F==null||F.removeEventListener(w.type,P)}F==null||F.addEventListener(w.type,P)}),X=G(w=>{const F=x.current;if(x.current=!1,K.clear(),w.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const P=Fe(w);function ie(){w.type==="pointerdown"?N(w):$(w,F),P==null||P.removeEventListener(w.type,ie)}P==null||P.addEventListener(w.type,ie)}),Se=G(w=>{if(O()!=="sloppy"||!L.current||ke(w,n.select("floatingElement"))||ke(w,n.select("domReferenceElement")))return;const F=w.touches[0];if(!F)return;const P=Math.abs(F.clientX-L.current.startX),ie=Math.abs(F.clientY-L.current.startY),T=Math.sqrt(P*P+ie*ie);T>5&&(L.current.dismissOnTouchEnd=!0),T>10&&($(w),K.clear(),L.current=null)}),ue=G(w=>{const F=Fe(w);function P(){Se(w),F==null||F.removeEventListener(w.type,P)}F==null||F.addEventListener(w.type,P)}),Ne=G(w=>{O()!=="sloppy"||!L.current||ke(w,n.select("floatingElement"))||ke(w,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&$(w),K.clear(),L.current=null)}),fe=G(w=>{const F=Fe(w);function P(){Ne(w),F==null||F.removeEventListener(w.type,P)}F==null||F.addEventListener(w.type,P)});l.useEffect(()=>{if(!r||!c)return;u.current.__escapeKeyBubbles=S,u.current.__outsidePressBubbles=M;const w=new ct;function F(V){n.setOpen(!1,xe(Vo,V))}function P(){w.clear(),Q.current=!0}function ie(){w.start(xn()?5:0,()=>{Q.current=!1})}const T=ve(o);T.addEventListener("pointerdown",j,!0),f&&(T.addEventListener("keydown",Z),T.addEventListener("compositionstart",P),T.addEventListener("compositionend",ie)),R&&(T.addEventListener("click",X,!0),T.addEventListener("pointerdown",X,!0),T.addEventListener("touchstart",ge,!0),T.addEventListener("touchmove",ue,!0),T.addEventListener("touchend",fe,!0),T.addEventListener("mousedown",X,!0));let D=[];return g&&(le(i)&&(D=tt(i)),le(o)&&(D=D.concat(tt(o))),!le(s)&&s&&s.contextElement&&(D=D.concat(tt(s.contextElement)))),D=D.filter(V=>{var W;return V!==((W=T.defaultView)==null?void 0:W.visualViewport)}),D.forEach(V=>{V.addEventListener("scroll",F,{passive:!0})}),()=>{T.removeEventListener("pointerdown",j,!0),f&&(T.removeEventListener("keydown",Z),T.removeEventListener("compositionstart",P),T.removeEventListener("compositionend",ie)),R&&(T.removeEventListener("click",X,!0),T.removeEventListener("pointerdown",X,!0),T.removeEventListener("touchstart",ge,!0),T.removeEventListener("touchmove",ue,!0),T.removeEventListener("touchend",fe,!0),T.removeEventListener("mousedown",X,!0)),D.forEach(V=>{V.removeEventListener("scroll",F)}),w.clear(),x.current=!1}},[u,o,s,i,f,R,r,a,g,c,S,M,Z,$,X,N,ge,ue,fe,j,n]),l.useEffect(J,[R,J]);const Ae=l.useMemo(()=>({onKeyDown:Z,...m&&{[$i[h]]:w=>{n.setOpen(!1,xe(bt,w.nativeEvent))},...h!=="intentional"&&{onClick(w){n.setOpen(!1,xe(bt,w.nativeEvent))}}}}),[Z,n,m,h]),Me=G(w=>{const F=Fe(w.nativeEvent);!ae(n.select("floatingElement"),F)||w.button!==0||(x.current=!0)}),be=G(w=>{!r||!c||w.button!==0||(x.current=!0)}),Pe=l.useMemo(()=>({onKeyDown:Z,onPointerDown:Me,onMouseDown:Me,onMouseUp:Me,onClickCapture:A,onMouseDownCapture(w){A(),be(w)},onPointerDownCapture(w){A(),be(w)},onMouseUpCapture:A,onTouchEndCapture:A,onTouchMoveCapture:A}),[Z,Me,A,be]);return l.useMemo(()=>c?{reference:Ae,floating:Pe,trigger:Ae}:{},[c,Ae,Pe])}var Yt=Symbol("NOT_FOUND");function Zi(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _i(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ji(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var fr=e=>Array.isArray(e)?e:[e];function Ki(e){const t=Array.isArray(e[0])?e[0]:e;return ji(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function zi(e,t){const n=[],{length:r}=e;for(let o=0;ot(a,c.key));if(u>-1){const c=n[u];return u>0&&(n.splice(u,1),n.unshift(c)),c.value}return Yt}function o(a,u){r(a)===Yt&&(n.unshift({key:a,value:u}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var Ui=(e,t)=>e===t;function qi(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;ss(m.value,f));b&&(f=b.value,a!==0&&a--)}u.put(arguments,f)}return f}return c.clearCache=()=>{u.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var Ji=class{constructor(e){this.value=e}deref(){return this.value}},Qi=typeof WeakRef<"u"?WeakRef:Ji,ec=0,dr=1;function Pt(){return{s:ec,v:void 0,o:null,p:null}}function so(e,t={}){let n=Pt();const{resultEqualityCheck:r}=t;let o,s=0;function i(){var d;let a=n;const{length:u}=arguments;for(let b=0,m=u;b{n=Pt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function io(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,u={},c=o.pop();typeof c=="object"&&(u=c,c=o.pop()),Zi(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const f={...n,...u},{memoize:d,memoizeOptions:b=[],argsMemoize:m=so,argsMemoizeOptions:h=[]}=f,g=fr(b),E=fr(h),p=Ki(o),y=d(function(){return s++,c.apply(null,arguments)},...g),v=m(function(){i++;const x=zi(p,arguments);return a=y.apply(null,x),a},...E);return Object.assign(v,{resultFunc:c,memoizedResultFunc:y,dependencies:p,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var tc=io(so),nc=Object.assign((e,t=tc)=>{_i(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),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,u)=>(i[n[u]]=a,i),{}))},{withTypes:()=>nc});io({memoize:Xi,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const gt=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(No(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a},rc=vr(19),oc=rc?ic:cc;function sc(e,t,n,r,o){return oc(e,t,n,r,o)}function ic(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ho.useSyncExternalStore(e.subscribe,s,s)}function cc(e,t,n,r,o){return Wo.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class Et{constructor(t){de(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));de(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Et.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Et.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Et.prototype.setState.call(this,t)}}class ac extends Et{constructor(n,r={},o){super(n);de(this,"controlledValues",new Map);de(this,"select",(n,r,o,s)=>{const i=this.selectors[n];return i(this.state,r,o,s)});de(this,"useState",(n,r,o,s)=>{l.useDebugValue(n);const i=this.selectors[n];return sc(this,i,r,o,s)});this.context=r,this.selectors=o}useSyncedValue(n,r){l.useDebugValue(n),q(()=>{this.state[n]!==r&&this.set(n,r)},[n,r])}useSyncedValueWithCleanup(n,r){const o=this;q(()=>(o.state[n]!==r&&o.set(n,r),()=>{o.set(n,void 0)}),[o,n,r])}useSyncedValues(n){const r=this,o=Object.values(n);q(()=>{r.update(n)},[r,...o])}useControlledProp(n,r,o){l.useDebugValue(n);const s=this,i=r!==void 0;this.controlledValues.has(n)||(this.controlledValues.set(n,i),!i&&!Object.is(this.state[n],o)&&super.setState({...this.state,[n]:o})),q(()=>{i&&!Object.is(s.state[n],r)&&super.setState({...s.state,[n]:r})},[s,n,r,o,i])}set(n,r){this.controlledValues.get(n)!==!0&&super.set(n,r)}update(n){const r={...n};for(const o in r)if(Object.hasOwn(r,o)&&this.controlledValues.get(o)===!0){delete r[o];continue}super.update(r)}setState(n){const r={...n};for(const o in r)if(Object.hasOwn(r,o)&&this.controlledValues.get(o)===!0){delete r[o];continue}super.setState({...this.state,...r})}useContextCallback(n,r){l.useDebugValue(n);const o=G(r??gr);this.context[n]=o}useStateSetter(n){const r=l.useRef(void 0);return r.current===void 0&&(r.current=o=>{this.set(n,o)}),r.current}observe(n,r){let o;typeof n=="function"?o=n:o=this.selectors[n];let s=o(this.state);return r(s,s,this),this.subscribe(i=>{const a=o(i);if(!Object.is(s,a)){const u=s;s=a,r(a,u,this)}})}}const lc={open:gt(e=>e.open),domReferenceElement:gt(e=>e.domReferenceElement),referenceElement:gt(e=>e.positionReference??e.referenceElement),floatingElement:gt(e=>e.floatingElement),floatingId:gt(e=>e.floatingId)};class uc extends ac{constructor(n){const{nested:r,noEmit:o,onOpenChange:s,triggerElements:i,...a}=n;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:_r(),nested:r,noEmit:o,triggerElements:i},lc);de(this,"setOpen",(n,r)=>{var o,s;if((!n||!this.state.open||Lr(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const i={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",i)}(s=(o=this.context).onOpenChange)==null||s.call(o,n,r)})}}class fc{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function dc(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=wn(),s=Ut()!=null,i=st(()=>new uc({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new fc,floatingId:o,nested:s,noEmit:e.noEmit||!1})).current;return q(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=le(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function hc(e={}){const{nodeId:t,externalTree:n}=e,r=dc(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=l.useState(null),u=l.useRef(null),c=Tt(n);q(()=>{s.domReference&&(u.current=s.domReference)},[s.domReference]);const f=ki({...e,elements:{...s,...i&&{reference:i}}}),d=l.useCallback(M=>{const L=le(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;a(L),f.refs.setReference(L)},[f.refs]),[b,m]=l.useState(null),[h,g]=l.useState(null);o.useSyncedValue("referenceElement",b),o.useSyncedValue("domReferenceElement",le(b)?b:null),o.useSyncedValue("floatingElement",h);const E=l.useCallback(M=>{(le(M)||M===null)&&(u.current=M,m(M)),(le(f.refs.reference.current)||f.refs.reference.current===null||M!==null&&!le(M))&&f.refs.setReference(M)},[f.refs,m]),p=l.useCallback(M=>{g(M),f.refs.setFloating(M)},[f.refs]),y=l.useMemo(()=>({...f.refs,setReference:E,setFloating:p,setPositionReference:d,domReference:u}),[f.refs,E,p,d]),v=l.useMemo(()=>({...f.elements,domReference:s.domReference}),[f.elements,s.domReference]),R=o.useState("open"),x=o.useState("floatingId"),S=l.useMemo(()=>({...f,dataRef:o.context.dataRef,open:R,onOpenChange:o.setOpen,events:o.context.events,floatingId:x,refs:y,elements:v,nodeId:t,rootStore:o}),[f,y,v,t,o,R,x]);return q(()=>{o.context.dataRef.current.floatingContext=S;const M=c==null?void 0:c.nodesRef.current.find(L=>L.id===t);M&&(M.context=S)}),l.useMemo(()=>({...f,context:S,refs:y,elements:v,rootStore:o}),[f,y,v,S,o])}function ra(e=[]){const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=e.map(c=>c==null?void 0:c.trigger),s=l.useCallback(c=>kt(c,e,"reference"),t),i=l.useCallback(c=>kt(c,e,"floating"),n),a=l.useCallback(c=>kt(c,e,"item"),r),u=l.useCallback(c=>kt(c,e,"trigger"),o);return l.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:u}),[s,i,a,u])}function kt(e,t,n){var i;const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[un]="");for(const a in e)o&&e&&(a===Or||a===Tr)||(s[a]=e[a]);for(let a=0;a{var u;return(u=r.get(s))==null?void 0:u.map(c=>c(...a)).find(c=>c!==void 0)})):e[s]=i)}}const pc="Escape";function Xt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ft(e,t){return Xt(t,e===On||e===St,e===ze||e===Ye)}function an(e,t,n){return Xt(t,e===St,n?e===ze:e===Ye)||e==="Enter"||e===" "||e===""}function mc(e,t,n){return Xt(t,n?e===ze:e===Ye,e===St)}function gc(e,t,n,r){const o=n?e===Ye:e===ze,s=e===On;return t==="both"||t==="horizontal"&&r&&r>1?e===pc:Xt(t,o,s)}function oa(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:u,onNavigate:c=()=>{},enabled:f=!0,selectedIndex:d=null,allowEscape:b=!1,loopFocus:m=!1,nested:h=!1,rtl:g=!1,virtual:E=!1,focusItemOnOpen:p="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:v=!0,disabledIndices:R=void 0,orientation:x="vertical",parentOrientation:S,cols:M=1,scrollItemIntoView:L=!0,itemSizes:K,dense:_=!1,id:J,resetOnPointerLeave:Q=!0,externalTree:z}=t,j=dn(o),O=Oe(j),Z=Ut(),U=Tt(z);q(()=>{i.current.orientation=x},[i,x]);const A=fn(s),$=l.useRef(p),N=l.useRef(d??-1),Re=l.useRef(null),ge=l.useRef(!0),X=G(C=>{c(N.current===-1?null:N.current,C)}),Se=l.useRef(X),ue=l.useRef(!!o),Ne=l.useRef(r),fe=l.useRef(!1),Ae=l.useRef(!1),Me=Oe(R),be=Oe(r),Pe=Oe(L),w=Oe(d),F=Oe(Q),P=G(()=>{function C(te){E?U==null||U.events.emit("virtualfocus",te):Dt(te,{sync:fe.current,preventScroll:!0})}const k=a.current[N.current],I=Ae.current;k&&C(k),(fe.current?te=>te():requestAnimationFrame)(()=>{var oe;const te=a.current[N.current]||k;if(!te)return;k||C(te);const re=Pe.current;re&&T&&(I||!ge.current)&&((oe=te.scrollIntoView)==null||oe.call(te,typeof re=="boolean"?{block:"nearest",inline:"nearest"}:re))})});q(()=>{f&&(r&&o?(N.current=d??-1,$.current&&d!=null&&(Ae.current=!0,X())):ue.current&&(N.current=-1,Se.current()))},[f,r,o,d,X]),q(()=>{if(f){if(!r){fe.current=!1;return}if(o)if(u==null){if(fe.current=!1,w.current!=null)return;if(ue.current&&(N.current=-1,P()),(!Ne.current||!ue.current)&&$.current&&(Re.current!=null||$.current===!0&&Re.current==null)){let C=0;const k=()=>{a.current[0]==null?(C<2&&(C?requestAnimationFrame:queueMicrotask)(k),C+=1):(N.current=Re.current==null||an(Re.current,x,g)||h?nn(a):qn(a),Re.current=null,X())};k()}}else yt(a,u)||(N.current=u,P(),Ae.current=!1)}},[f,r,o,u,w,h,a,x,g,X,P,Me]),q(()=>{var te,re;if(!f||o||!U||E||!ue.current)return;const C=U.nodesRef.current,k=(re=(te=C.find(ne=>ne.id===Z))==null?void 0:te.context)==null?void 0:re.elements.floating,I=je(ve(o)),ee=C.some(ne=>ne.context&&ae(ne.context.elements.floating,I));k&&!ee&&ge.current&&k.focus({preventScroll:!0})},[f,o,U,Z,E]),q(()=>{Se.current=X,Ne.current=r,ue.current=!!o}),q(()=>{r||(Re.current=null,$.current=p)},[r,p]);const ie=u!=null,T=l.useMemo(()=>{function C(I){if(!be.current)return;const ee=a.current.indexOf(I.currentTarget);ee!==-1&&N.current!==ee&&(N.current=ee,X(I))}return{onFocus(I){fe.current=!0,C(I)},onClick:({currentTarget:I})=>I.focus({preventScroll:!0}),onMouseMove(I){fe.current=!0,Ae.current=!1,y&&C(I)},onPointerLeave(I){var te;if(!be.current||!ge.current||I.pointerType==="touch")return;fe.current=!0;const ee=I.relatedTarget;!y||a.current.includes(ee)||F.current&&(N.current=-1,X(I),E||(te=O.current)==null||te.focus({preventScroll:!0}))}}},[be,O,y,a,X,F,E]),D=l.useCallback(()=>{var C,k,I;return S??((I=(k=(C=U==null?void 0:U.nodesRef.current.find(ee=>ee.id===Z))==null?void 0:C.context)==null?void 0:k.dataRef)==null?void 0:I.current.orientation)},[Z,U,S]),V=G(C=>{if(ge.current=!1,fe.current=!0,C.which===229||!be.current&&C.currentTarget===O.current)return;if(h&&gc(C.key,x,g,M)){Ft(C.key,D())||Ee(C),n.setOpen(!1,xe(en,C.nativeEvent)),me(s)&&(E?U==null||U.events.emit("virtualfocus",s):s.focus());return}const k=N.current,I=nn(a,R),ee=qn(a,R);if(A||(C.key==="Home"&&(Ee(C),N.current=I,X(C)),C.key==="End"&&(Ee(C),N.current=ee,X(C))),M>1){const te=K||Array.from({length:a.current.length},()=>({width:1,height:1})),re=Ss(te,M,_),ne=re.findIndex(ye=>ye!=null&&!wt(a,ye,R)),oe=re.reduce((ye,Ze,Ct)=>Ze!=null&&!wt(a,Ze,R)?Ct:ye,-1),ce=re[xs({current:re.map(ye=>ye!=null?a.current[ye]:null)},{event:C,orientation:x,loopFocus:m,rtl:g,cols:M,disabledIndices:Ts([...(typeof R!="function"?R:null)||a.current.map((ye,Ze)=>wt(a,Ze,R)?Ze:void 0),void 0],re),minIndex:ne,maxIndex:oe,prevIndex:Os(N.current>ee?I:N.current,te,re,M,C.key===St?"bl":C.key===(g?ze:Ye)?"tr":"tl"),stopEvent:!0})];if(ce!=null&&(N.current=ce,X(C)),x==="both")return}if(Ft(C.key,x)){if(Ee(C),r&&!E&&je(C.currentTarget.ownerDocument)===C.currentTarget){N.current=an(C.key,x,g)?I:ee,X(C);return}an(C.key,x,g)?m?k>=ee?b&&k!==a.current.length?N.current=-1:(fe.current=!1,N.current=I):N.current=we(a,{startingIndex:k,disabledIndices:R}):N.current=Math.min(ee,we(a,{startingIndex:k,disabledIndices:R})):m?k<=I?b&&k!==-1?N.current=a.current.length:(fe.current=!1,N.current=ee):N.current=we(a,{startingIndex:k,decrement:!0,disabledIndices:R}):N.current=Math.max(I,we(a,{startingIndex:k,decrement:!0,disabledIndices:R})),yt(a,N.current)&&(N.current=-1),X(C)}}),W=l.useMemo(()=>E&&r&&ie&&{"aria-activedescendant":`${J}-${u}`},[E,r,ie,J,u]),Y=l.useMemo(()=>({"aria-orientation":x==="both"?void 0:x,...A?{}:W,onKeyDown(C){if(C.key==="Tab"&&C.shiftKey&&r&&!E){const k=Fe(C.nativeEvent);if(k&&!ae(O.current,k))return;Ee(C),n.setOpen(!1,xe(En,C.nativeEvent)),me(s)&&s.focus();return}V(C)},onPointerMove(){ge.current=!0}}),[W,V,O,x,A,n,r,E,s]),H=l.useMemo(()=>{function C(I){p==="auto"&&Ar(I.nativeEvent)&&($.current=!E)}function k(I){$.current=p,p==="auto"&&Mr(I.nativeEvent)&&($.current=!0)}return{onKeyDown(I){const ee=n.select("open");ge.current=!1;const te=I.key.startsWith("Arrow"),re=mc(I.key,D(),g),ne=Ft(I.key,x),oe=(h?re:ne)||I.key==="Enter"||I.key.trim()==="";if(E&&ee)return V(I);if(!(!ee&&!v&&te)){if(oe){const ce=Ft(I.key,D());Re.current=h&&ce?null:I.key}if(h){re&&(Ee(I),ee?(N.current=nn(a,Me.current),X(I)):n.setOpen(!0,xe(en,I.nativeEvent,I.currentTarget)));return}ne&&(w.current!=null&&(N.current=w.current),Ee(I),!ee&&v?n.setOpen(!0,xe(en,I.nativeEvent,I.currentTarget)):V(I),ee&&X(I))}},onFocus(I){n.select("open")&&!E&&(N.current=-1,X(I))},onPointerDown:k,onPointerEnter:k,onMouseDown:C,onClick:C}},[V,Me,p,a,h,X,n,v,x,D,g,w,E]),B=l.useMemo(()=>({...W,...H}),[W,H]);return l.useMemo(()=>f?{reference:B,floating:Y,item:T,trigger:H}:{},[f,B,Y,H,T])}function sa(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.context.dataRef,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:u,enabled:c=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:b=$o,selectedIndex:m=null}=t,h=at(),g=l.useRef(""),E=l.useRef(m??i??-1),p=l.useRef(null);q(()=>{r&&(h.clear(),p.current=null,g.current="")},[r,h]),q(()=>{r&&g.current===""&&(E.current=m??i??-1)},[r,m,i]);const y=G(S=>{S?o.current.typing||(o.current.typing=S,u==null||u(S)):o.current.typing&&(o.current.typing=S,u==null||u(S))}),v=G(S=>{function M(Q,z,j){const O=f?f(z,j):z.find(Z=>(Z==null?void 0:Z.toLocaleLowerCase().indexOf(j.toLocaleLowerCase()))===0);return O?Q.indexOf(O):-1}const L=s.current;if(g.current.length>0&&g.current[0]!==" "&&(M(L,L,g.current)===-1?y(!1):S.key===" "&&Ee(S)),L==null||b.includes(S.key)||S.key.length!==1||S.ctrlKey||S.metaKey||S.altKey)return;r&&S.key!==" "&&(Ee(S),y(!0)),L.every(Q=>{var z,j;return Q?((z=Q[0])==null?void 0:z.toLocaleLowerCase())!==((j=Q[1])==null?void 0:j.toLocaleLowerCase()):!0})&&g.current===S.key&&(g.current="",E.current=p.current),g.current+=S.key,h.start(d,()=>{g.current="",E.current=p.current,y(!1)});const _=E.current,J=M(L,[...L.slice((_||0)+1),...L.slice(0,(_||0)+1)],g.current);J!==-1?(a==null||a(J),p.current=J):S.key!==" "&&(g.current="",y(!1))}),R=l.useMemo(()=>({onKeyDown:v}),[v]),x=l.useMemo(()=>({onKeyDown:v,onKeyUp(S){S.key===" "&&y(!1)}}),[v,y]);return l.useMemo(()=>c?{reference:R,floating:x}:{},[c,R,x])}function bc(e){const t=l.useRef(""),n=l.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:l.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function ia(e){const[t,n]=l.useState(null),r=G((a,u)=>{e||n(u||(xr?"touch":""))}),o=l.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=bc(r);return l.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:i}}),[t,o,s,i])}let In=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zn.startingStyle]="startingStyle",e[e.endingStyle=Zn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),bn=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const yc={[bn.popupOpen]:""},wc={[bn.popupOpen]:"",[bn.pressed]:""},vc={[In.open]:""},Ec={[In.closed]:""},Rc={[In.anchorHidden]:""},ca={open(e){return e?yc:null}},aa={open(e){return e?wc:null}},la={open(e){return e?vc:Ec},anchorHidden(e){return e?Rc:null}},co="ArrowUp",ao="ArrowDown",lo="ArrowLeft",uo="ArrowRight",fo="Home",ho="End",xc=new Set([lo,uo]),Sc=new Set([co,ao]),Oc=new Set([...xc,...Sc]);[...Oc];const ua=new Set([co,ao,lo,uo,fo,ho]);function fa(e){return vr(19)?e:e?"true":void 0}const da=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r==null?void 0:r.getBoundingClientRect();s=`polygon( 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, ${i.left}px ${i.top}px, ${i.left}px ${i.bottom}px, ${i.right}px ${i.bottom}px, ${i.right}px ${i.top}px, ${i.left}px ${i.top}px )`}return he.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function ha({icon:e,items:t,title:n}){return he.jsxs("div",{className:"flex items-center gap-2 py-4 px-6 min-h-16.75 box-border bg-bg-secondary border-b border-border text-sm shrink-0",children:[he.jsxs("span",{className:"flex items-center gap-1.5",children:[he.jsx(e,{}),n]}),t.map((r,o)=>he.jsxs(l.Fragment,{children:[he.jsx(Bo,{className:"w-4 h-4"}),r]},o))]})}const po=l.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Tc(){return l.useContext(po)}let Cc=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function pa(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:u,elementsRef:c,labelsRef:f,nextIndexRef:d}=Tc(),b=l.useRef(-1),[m,h]=l.useState(s??(o===Cc.GuessFromOrder?()=>{if(b.current===-1){const p=d.current;d.current+=1,b.current=p}return b.current}:-1)),g=l.useRef(null),E=l.useCallback(p=>{var y;if(g.current=p,m!==-1&&p!==null&&(c.current[m]=p,f)){const v=t!==void 0;f.current[m]=v?t:((y=r==null?void 0:r.current)==null?void 0:y.textContent)??p.textContent}},[m,c,f,t,r]);return q(()=>{if(s!=null)return;const p=g.current;if(p)return i(p,n),()=>{a(p)}},[s,i,a,n]),q(()=>{if(s==null)return u(p=>{var v;const y=g.current?(v=p.get(g.current))==null?void 0:v.index:null;y!=null&&h(y)})},[s,u,h]),l.useMemo(()=>({ref:E,index:m}),[m,E])}const Ac=l.createContext(void 0);function ma(e){return l.useContext(Ac)}function ga(e){return e==="starting"?Zo:Rn}const Mc=l.createContext(void 0);function Lc(){const e=l.useContext(Mc);return(e==null?void 0:e.direction)??"ltr"}const Ic=e=>({name:"arrow",options:e,async fn(t){var $,N;const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0,offsetParent:d="real"}=$e(e,t)||{};if(c==null)return{};const b=Ir(f),m={x:n,y:r},h=An(o),g=Cn(h),E=await i.getDimensions(c),p=h==="y",y=p?"top":"left",v=p?"bottom":"right",R=p?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[h]-m[h]-s.floating[g],S=m[h]-s.reference[h],M=d==="real"?await(($=i.getOffsetParent)==null?void 0:$.call(i,c)):a.floating;let L=a.floating[R]||s.floating[g];(!L||!await((N=i.isElement)==null?void 0:N.call(i,M)))&&(L=a.floating[R]||s.floating[g]);const K=x/2-S/2,_=L/2-E[g]/2-1,J=Math.min(b[y],_),Q=Math.min(b[v],_),z=J,j=L-E[g]-Q,O=L/2-E[g]/2+K,Z=hn(z,O,j),U=!u.arrow&&Ge(o)!=null&&O!==Z&&s.reference[g]/2-(O({...Ic(e),options:[e,t]}),kc={name:"hide",async fn(e){var a;const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:((a=(await Wi().fn(e)).data)==null?void 0:a.referenceHidden)||s}}}},Fc={sideX:"left",sideY:"top"};function mo(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function pr(e,t,n){const{rects:r,placement:o}=e;return{side:mo(t,Ce(o),n),align:Ge(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ba(e){var Fn,Dn;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,keepMounted:b=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:E=!1,nodeId:p,adaptiveOrigin:y,lazyFlip:v=!1,externalTree:R}=e,[x,S]=l.useState(null);!h&&x!==null&&S(null);const M=g.side||"flip",L=g.align||"flip",K=g.fallbackAxisSide||"end",_=typeof t=="function"?t:void 0,J=G(_),Q=_?J:t,z=Oe(t),O=Lc()==="rtl",Z=x||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[r],U=s==="center"?Z:`${Z}-${s}`;let A=u;const $=1,N=r==="bottom"?$:0,Re=r==="top"?$:0,ge=r==="right"?$:0,X=r==="left"?$:0;typeof A=="number"?A={top:A+N,right:A+X,bottom:A+Re,left:A+ge}:A&&(A={top:(A.top||0)+N,right:(A.right||0)+X,bottom:(A.bottom||0)+Re,left:(A.left||0)+ge});const Se={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:A},ue=l.useRef(null),Ne=Oe(o),fe=Oe(i),be=[Fi(se=>{const pe=pr(se,r,O),He=typeof Ne.current=="function"?Ne.current(pe):Ne.current,Le=typeof fe.current=="function"?fe.current(pe):fe.current;return{mainAxis:He,crossAxis:Le,alignmentAxis:Le}},[typeof o!="function"?o:0,typeof i!="function"?i:0,O,r])],Pe=L==="none"&&M!=="shift",w=!Pe&&(c||E||M==="shift"),F=M==="none"?null:Ni({...Se,padding:{top:A.top+$,right:A.right+$,bottom:A.bottom+$,left:A.left+$},mainAxis:!E&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:K}),P=Pe?null:Di(se=>{const pe=dt(se.elements.floating).documentElement;return{...Se,rootBoundary:E?{x:0,y:0,width:pe.clientWidth,height:pe.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:w,limiter:c||E?void 0:Vi(He=>{if(!ue.current)return{};const{width:Le,height:Xe}=ue.current.getBoundingClientRect(),Je=Ie(Ce(He.placement)),At=Je==="y"?Le:Xe,Jt=Je==="y"?A.left+A.right:A.top+A.bottom;return{offset:At/2+Jt/2}})}},[Se,c,E,A,L]);M==="shift"||L==="shift"||s==="center"?be.push(P,F):be.push(F,P),be.push(Hi({...Se,apply({elements:{floating:se},rects:{reference:pe},availableWidth:He,availableHeight:Le}){Object.entries({"--available-width":`${He}px`,"--available-height":`${Le}px`,"--anchor-width":`${pe.width}px`,"--anchor-height":`${pe.height}px`}).forEach(([Xe,Je])=>{se.style.setProperty(Xe,Je)})}}),Pc(()=>({element:ue.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(se){var Nn,Hn,Wn;const{elements:pe,middlewareData:He,placement:Le,rects:Xe,y:Je}=se,At=Ce(Le),Jt=Ie(At),Qe=ue.current,go=((Nn=He.arrow)==null?void 0:Nn.x)||0,bo=((Hn=He.arrow)==null?void 0:Hn.y)||0,yo=(Qe==null?void 0:Qe.clientWidth)||0,wo=(Qe==null?void 0:Qe.clientHeight)||0,Qt=go+yo/2,Vn=bo+wo/2,vo=Math.abs(((Wn=He.shift)==null?void 0:Wn.y)||0),Eo=Xe.reference.height/2,pt=typeof o=="function"?o(pr(se,r,O)):o,Ro=vo>pt,xo={top:`${Qt}px calc(100% + ${pt}px)`,bottom:`${Qt}px ${-pt}px`,left:`calc(100% + ${pt}px) ${Vn}px`,right:`${-pt}px ${Vn}px`}[At],So=`${Qt}px ${Xe.reference.y+Eo-Je}px`;return pe.floating.style.setProperty("--transform-origin",w&&Jt==="y"&&Ro?So:xo),{}}},kc,y),q(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);const ie=l.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:T,elements:D,x:V,y:W,middlewareData:Y,update:H,placement:B,context:C,isPositioned:k,floatingStyles:I}=hc({rootContext:m,placement:U,middleware:be,strategy:n,whileElementsMounted:b?void 0:(...se)=>lr(...se,ie),nodeId:p,externalTree:R}),{sideX:ee,sideY:te}=Y.adaptiveOrigin||Fc,re=k?n:"fixed",ne=l.useMemo(()=>y?{position:re,[ee]:V,[te]:W}:{position:re,...I},[y,re,ee,V,te,W,I]),oe=l.useRef(null);q(()=>{if(!h)return;const se=z.current,pe=typeof se=="function"?se():se,Le=(mr(pe)?pe.current:pe)||null||null;Le!==oe.current&&(T.setPositionReference(Le),oe.current=Le)},[h,T,Q,z]),l.useEffect(()=>{if(!h)return;const se=z.current;typeof se!="function"&&mr(se)&&se.current!==oe.current&&(T.setPositionReference(se.current),oe.current=se.current)},[h,T,Q,z]),l.useEffect(()=>{if(b&&h&&D.domReference&&D.floating)return lr(D.domReference,D.floating,H,ie)},[b,h,D,H,ie]);const ce=Ce(B),ye=mo(r,ce,O),Ze=Ge(B)||"center",Ct=!!((Fn=Y.hide)!=null&&Fn.referenceHidden);q(()=>{v&&h&&k&&S(ce)},[v,h,k,ce]);const Pn=l.useMemo(()=>{var se,pe;return{position:"absolute",top:(se=Y.arrow)==null?void 0:se.y,left:(pe=Y.arrow)==null?void 0:pe.x}},[Y.arrow]),kn=((Dn=Y.arrow)==null?void 0:Dn.centerOffset)!==0;return l.useMemo(()=>({positionerStyles:ne,arrowStyles:Pn,arrowRef:ue,arrowUncentered:kn,side:ye,align:Ze,physicalSide:ce,anchorHidden:Ct,refs:T,context:C,isPositioned:k,update:H}),[ne,Pn,ue,kn,ye,Ze,ce,Ct,T,C,k,H])}function mr(e){return e!=null&&"current"in e}function ya(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=G(o),i=l.useRef(0),a=st(Vc).current,u=st(Dc).current,[c,f]=l.useState(0),d=l.useRef(c),b=G((p,y)=>{u.set(p,y??null),d.current+=1,f(d.current)}),m=G(p=>{u.delete(p),d.current+=1,f(d.current)}),h=l.useMemo(()=>{const p=new Map;return Array.from(u.keys()).filter(v=>v.isConnected).sort(Nc).forEach((v,R)=>{const x=u.get(v)??{};p.set(v,{...x,index:R})}),p},[u,c]);q(()=>{if(typeof MutationObserver!="function"||h.size===0)return;const p=new MutationObserver(y=>{const v=new Set,R=x=>v.has(x)?v.delete(x):v.add(x);y.forEach(x=>{x.removedNodes.forEach(R),x.addedNodes.forEach(R)}),v.size===0&&(d.current+=1,f(d.current))});return h.forEach((y,v)=>{v.parentElement&&p.observe(v.parentElement,{childList:!0})}),()=>{p.disconnect()}},[h]),q(()=>{d.current===c&&(n.current.length!==h.size&&(n.current.length=h.size),r&&r.current.length!==h.size&&(r.current.length=h.size),i.current=h.size),s(h)},[s,h,n,r,c]),q(()=>()=>{n.current=[]},[n]),q(()=>()=>{r&&(r.current=[])},[r]);const g=G(p=>(a.add(p),()=>{a.delete(p)}));q(()=>{a.forEach(p=>p(h))},[a,h]);const E=l.useMemo(()=>({register:b,unregister:m,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:i}),[b,m,g,n,r,i]);return he.jsx(po.Provider,{value:E,children:t})}function Dc(){return new Map}function Vc(){return new Set}function Nc(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function wa(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,a=parseFloat(r.width)||0,u=parseFloat(r.height)||0,c=Math.max(t.width,s,a),f=Math.max(t.height,i,u),d=c-t.width,b=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-b/2,bottom:t.bottom+b/2}}export{Bc as $,fa as A,pa as B,In as C,ma as D,ga as E,uc as F,Zc as G,_c as H,da as I,ba as J,qc as K,ya as L,_s as M,Uc as N,Lc as O,fc as P,oa as Q,ac as R,sa as S,ls as T,Xc as U,$c as V,dt as W,ta as X,aa as Y,Kt as Z,wa as _,at as a,Gc as a0,vt as a1,Yc as a2,$r as a3,Go as a4,Uo as a5,qo as a6,ha as a7,Et as a8,sc as a9,dc as aa,Jc as ab,Yr as ac,ca as ad,Xo as ae,Cc as af,jt as b,gt as c,je as d,ae as e,Cr as f,Fe as g,ve as h,Yn as i,jc as j,Jo as k,Tt as l,zc as m,Oe as n,dn as o,ct as p,nt as q,ia as r,na as s,Kc as t,Ut as u,ra as v,la as w,ua as x,ea as y,Qc as z};