@g4rcez/components 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/form/input-field.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
*/var gp;function PI(){return gp||(gp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=b,t=Uv();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,h,f,p){var m=s(null),v;m.current===null?(v={hasValue:!1,value:null},m.current=v):v=m.current;var g=a(function(){var S=!1,E,k,P=function(M){if(!S){S=!0,E=M;var F=f(M);if(p!==void 0&&v.hasValue){var R=v.value;if(p(R,F))return k=R,R}return k=F,F}var A=E,D=k;if(r(A,M))return D;var L=f(M);return p!==void 0&&p(D,L)?D:(E=M,k=L,L)},I=h===void 0?null:h,C=function(){return P(d())},N=I===null?void 0:function(){return P(I())};return[C,N]},[d,h,f,p]),x=g[0],y=g[1],T=o(u,x,y);return i(function(){v.hasValue=!0,v.value=T},[T]),l(T),T}mp.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mp}process.env.NODE_ENV==="production"?CI():PI();const Yr=e=>{const t=b.useRef(e??{});return b.useEffect(()=>void(t.current=e),[e]),t},RI=e=>{const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current},kI=e=>Object.entries(e),Gv=e=>e instanceof Promise,Yv=(e,t,n,r)=>t===e?n.reduce((o,s)=>s(o,t,r),e):e.constructor.name===Object.name?n.reduce((o,s)=>s(o,t,r),{...t,...e}):n.reduce((o,s)=>s(o,t,r),e),II=(e,t,n,r,o,s)=>(...i)=>{const a=performance.now(),l=t(...i),c=(u,d)=>n(h=>Yv(u,h,s,d));return Gv(l)?l.then(u=>{o.current={method:e,props:r(),time:performance.now()-a},c(u,o.current)}):(o.current={method:e,props:r(),time:performance.now()-a},void c(l,o.current))},OI=(e,t,n,r,o,s)=>(...i)=>{o.current={method:e,time:0,props:r()};const a=t(...i),l=c=>n(u=>Yv(c,u,s,o.current));return Gv(a)?a.then(c=>l(c)):l(a)},gd=(e,t,n)=>{const[r,o]=b.useState(()=>e),s=Yr(r),i=Yr((n==null?void 0:n.props)??{}),a=Yr(t),l=Yr((n==null?void 0:n.postMiddleware)??[]),c=Yr((n==null?void 0:n.interceptor)??[]),u=b.useRef(e),d=RI(r),h=Yr(d),f=b.useRef(null);b.useEffect(()=>{if(f.current===null)return;const m=f.current;l.current.forEach(v=>{v(r,d,m)})},[r,l,d]);const[p]=b.useState(()=>{const m=()=>i.current,v=a.current({props:m,state:()=>s.current,initialState:u.current,previousState:()=>h.current});return kI(v).reduce((g,[x,y])=>({...g,[x]:n!=null&&n.debug?II(x,y,o,m,f,c.current):OI(x,y,o,m,f,c.current)}),{})});return[r,p,i.current]},AI=(e,t=0)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e(...o),t)}};function _I(e,t){return b.useRef(AI(e,t)).current}const yd={cssVariable:(e,t,n)=>`var(--${n})`,rgba:e=>`rgba(${e})`,rgb:e=>`rgb(${e})`,hsl:e=>`hsl(${e})`,hsla:e=>`hsla(${e})`,hex:e=>e,raw:e=>e,formatWithVar:e=>(t,n,r)=>`${e}(var(--${r}), <alpha-value>)`},ws=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return o.concat(t(i,l,a))}return o.concat(ws(i,t,n,a))},[]),qv=(e,t,n="",r="")=>Object.entries(e).reduce((o,[s,i])=>{const a=r===""?`${n}${s}`:`${r}-${s}`;if(typeof i=="string"){const l=r===""?`${n}${s}`:s;return{...o,[l]:t(i,s,a)}}return{...o,[s]:qv(i,t,n,a)}},{}),yp={default:e=>`:root { ${e} }`,dark:e=>`html.dark {${e}}`},Hc=(e,t)=>{const n=t.value||((o,s)=>s),r=e.map(o=>`${o.key}: ${n(o.key,o.value)}`).join(";");return t.result(r)},MI={default:e=>Hc(e,{result:yp.default}),dark:e=>Hc(e,{result:yp.dark})},DI=(e,t)=>{const n=(i,a,l)=>({key:`--${l}`,value:`${i}`}),r=ws(e.colors,n),o=ws(e.spacing,n),s=ws(e.rounded,n);return Hc(r.concat(o,s),{result:i=>`html${t?`.${t}`:""} {${i}}`,value:(i,a)=>a.replace("hsla(","").replace(")","")})},Kv={button:"0.4rem",pill:"2rem",card:"0.75rem",full:"9999px"},Zv={base:"1rem",lg:"1.5rem",sm:"0.75rem","input-height":"2.5rem","input-x":"0.5rem","input-y":"0.25rem","input-inline":"0.25rem","input-gap":"0.3rem"},jI={name:"dark",rounded:Kv,spacing:Zv,shadow:{floating:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px"},colors:{foreground:"hsla(210, 50%, 98%)",background:"hsla(0, 0%, 9%)",disabled:"hsla(240, 4%, 33%)",primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(200,98%,39%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{DEFAULT:"hsla(210, 32%, 70%)",background:"hsla(210, 30%, 81%)",subtle:"hsla(210, 27%, 88%)",hover:"hsla(210, 10%, 58%)",foreground:"hsla(210, 20%, 30%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 93%, 77%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(219, 91%, 59%)"},warn:{DEFAULT:"hsla(27, 96%, 61%)",subtle:"hsla(45, 95%, 66%)",hover:"hsla(21, 90%, 48%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(32, 65%, 75%)"},danger:{DEFAULT:"hsla(358, 65%, 57%)",subtle:"hsla(0, 94%, 81%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 40%, 98%)",notification:"hsla(358, 40%, 23%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 75%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 50%)",notification:"hsla(161,62%,17%)"},input:{border:"hsla(240, 4%, 25%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 9%)",switch:"hsla(0, 0%, 100%)"},card:{background:"hsla(0, 0%, 15%)",border:"hsla(240, 7%, 27%)"},floating:{background:"hsla(0, 0%, 14%)",border:"hsla(240, 7%, 27%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(210, 40%, 98%)",background:"hsla(0, 0%, 8%)",border:"hsla(0, 0%, 19%)"},table:{background:"hsla(0, 0%, 15%)",border:"hsla(240, 4%, 33%)"},button:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,90%)",bg:"hsla(5,62%,23%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{primary:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},warn:{text:"hsla(26,100%,67%)",bg:"hsla(37,100%,15%)"},info:{text:"hsla(200,80%,70%)",bg:"hsla(206,66%,24%)"},success:{text:"hsla(151,65%,54%)",bg:"hsla(154,52%,19%)"},danger:{text:"hsla(2,100%,79%)",bg:"hsla(5,62%,23%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}}}},NI={name:"light",rounded:Kv,spacing:Zv,shadow:{floating:"rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px"},colors:{foreground:"hsla(217, 15%, 30%)",background:"hsla(210, 34%, 96%)",disabled:"hsla(240, 10%, 78%)",primary:{foreground:"hsla(210, 40%, 98%)",DEFAULT:"hsla(199, 89%, 54%)",subtle:"hsla(199, 95%, 87%)",hover:"hsla(199, 97%, 40%)"},secondary:{background:"hsla(210, 25%, 35%)",DEFAULT:"hsla(210, 25%, 35%)",subtle:"hsla(207, 29%, 39%)",hover:"hsla(210, 21%, 67%)",foreground:"hsla(210, 40%, 98%)"},info:{DEFAULT:"hsla(219, 91%, 59%)",subtle:"hsla(219, 70%, 90%)",hover:"hsla(219, 83%, 41%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(219, 91%, 59%)"},danger:{DEFAULT:"hsla(0, 82%, 63%)",subtle:"hsla(0, 96%, 95%)",hover:"hsla(0, 82%, 47%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(0, 100%, 87%)"},warn:{DEFAULT:"hsla(27, 100%, 70%)",subtle:"hsla(45, 95%, 80%)",hover:"hsla(29, 85%, 50%)",foreground:"hsla(210, 34%, 96%)",notification:"hsla(27, 85%, 92%)"},success:{DEFAULT:"hsla(160, 73%, 36%)",subtle:"hsla(160, 75%, 90%)",hover:"hsla(160, 91%, 27%)",foreground:"hsla(160, 91%, 17%)",notification:"hsla(160, 75%, 80%)"},input:{border:"hsla(218, 22%, 85%)",placeholder:"hsla(210, 24%, 71%)","mask-error":"hsla(0, 94%, 81%)","switch-bg":"hsla(0, 0%, 45%)",switch:"hsla(0, 0%, 100%)"},card:{background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)"},floating:{background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)",overlay:"hsla(0, 0%, 0%)"},tooltip:{foreground:"hsla(217, 15%, 20%)",background:"hsla(210, 25%, 98%)",border:"hsla(200, 1%, 80%)"},table:{background:"hsla(0, 0%, 100%)",border:"hsla(210, 25%, 88%)"},button:{primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,96%,48%)"},warn:{bg:"hsla(26,90%,60%)",text:"hsla(0, 0%, 100%)"},info:{text:"hsla(0, 0%, 100%)",bg:"hsla(210,60%,60%)"},success:{text:"hsla(0, 0%, 100%)",bg:"hsla(152,56%,39%)"},danger:{text:"hsla(0, 0%, 100%)",bg:"hsla(10,78%,54%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}},tag:{primary:{text:"hsla(0, 0%, 100%)",bg:"hsla(207,70%,55%)"},warn:{bg:"hsla(30,100%,82%)",text:"hsla(23,100%,40%)"},info:{text:"hsla(196,100%,20%)",bg:"hsla(197,65%,80%)"},success:{text:"hsla(154,52%,19%)",bg:"hsla(152,56%,80%)"},danger:{text:"hsla(10,82%,45%)",bg:"hsla(359,94%,92%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)"},secondary:{text:"hsla(216,10%,90%)",bg:"hsla(214,7%,19%)"}}}},FI=jI,LI=NI,vd={inputCaretDown:"Click to see all options",datePickerCalendarButtonLabel:"Click to open a date picker",inputOptionalLabel:"Optional",tableGroupLabel:"Group",tableGroupLabelWithCount:"Group",tableSortAsc:"Ascending",tableSortOrderByLabel:"Order by",tableSortOrderInputPlaceholder:"Order by",tableSortOrderInputTitle:"Order by",tableSortTypeInputPlaceholder:"Ascending",tableSortTypeInputTitle:"Sort type",tableSortAddButton:"Add sort",tableSortDropdownTitle:"Order by",tableSortDesc:"Descending",tableFilterTypeContains:"Contains",tableFilterTypeIs:"Is",tableFilterTypeIsNot:"Is not",tableFilterTypeNotContains:"Not contains",tableFilterTypeLessThan:"Less than",tableFilterTypeGreaterThan:"Greater than",tableFilterTypeStartsWith:"Starts with",tableFilterTypeEndsWith:"Ends with",tableFilterNewFilter:"New filter",tableFilterColumnTitle:"Filter by",tableFilterColumnPlaceholder:"Filter by",tableFilterOperatorTitle:"Operation",tableFilterOperatorPlaceholder:"Equals to...",tableFilterValueTitle:"Value",tableFilterValuePlaceholder:"Something...",tableFilterLabel:"Filters",tableFilterDropdownTitle:"Filters",tableFilterDropdownTitleUnique:"Filter by",tablePaginationPrevious:"Previous",tablePaginationNext:"Next",tablePaginationSelectLabel:"Select the size of page",tablePaginationFooter:e=>w.jsxs(b.Fragment,{children:[e.current," to ",e.pages," of ",e.totalItems," items.",Array.isArray(e.sizes)?e.select:null," per page."]}),calendarFromDate:"From",calendarToDate:"To"},Xv=b.createContext({translations:vd,colorTokenParser:yd.hsla}),VI=e=>{const t=b.useMemo(()=>({translations:{...vd,...e.map},colorTokenParser:e.parser||yd.hsla}),[e.map]);return w.jsx(Xv.Provider,{value:t,children:e.children})},zt=()=>{const e=b.useContext(Xv);return e?e.translations:vd},Wa=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)}),vp=(e,t,n)=>e.split(t).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,n),bp={basic:/[,[\]]+?/,extend:/[,[\].]+?/},bd=(e,t)=>{const n=vp(t,bp.basic,e)||vp(t,bp.extend,e);return n===void 0||n===e?void 0:n},Qi=()=>typeof window>"u",Uc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Qv=(e,t)=>{const n=[];for(let r=0;r<t;r++){const o=r*t,s=e.slice(o,o+t);s.length>0&&n.push(s)}return n},$I={type:"spring",bounce:.3,duration:.6},xp=e=>(t=1)=>({x:`${100*e*t}%`,opacity:.25}),wp={middle:{x:"0%",opacity:1},enter:xp(1),exit:xp(-1)},Sp={exit:{visibility:"hidden"}},BI=e=>{const t=Cn(kv(e));return Rv({start:t,end:Vo(t,41)})},Jv=(e,t)=>e.toLocaleDateString(t,{month:"long"}),WI=(e,t)=>Array.from({length:12}).map((n,r)=>{const o=kv(new Date(e).setMonth(r)),s=Jv(o,t);return w.jsx("option",{value:s,"data-index":r,children:s},s)}),Fl={ArrowLeft:(e,t)=>t==="days"?rI(e,1):Vv(e,1),ArrowRight:(e,t)=>t==="days"?Vo(e,1):Ba(e,1),ArrowUp:(e,t)=>t==="days"?oI(e,1):sI(e,1),ArrowDown:(e,t)=>t==="days"?Ev(e,1):Cv(e,1)},Tp=(e,t,n,r=0)=>{const o=n.toISOString(),s=()=>{var i;if(e!=null&&e.dataset.focustrap){const a=(i=t.current)==null?void 0:i.querySelector(`button[data-focustrap="${e==null?void 0:e.dataset.focustrap}"]`);return setTimeout(()=>a==null?void 0:a.focus({preventScroll:!1}),r)}if(t.current){const a=t.current.querySelector(`button[data-date="${o}"]`);if(a)return a.focus({preventScroll:!1})}};r===0&&s(),setTimeout(s,r)},yr=e=>e.getFullYear().toString().padStart(4,"0"),zI=(e,t,n)=>e===void 0||n===void 0?!1:ok(t,e)&&sk(t,n),eb=({RenderOnDay:e,changeOnlyOnClick:t=!1,disabledDate:n,locale:r,markToday:o=!0,onChangeMonth:s,onChangeYear:i,rangeMode:a=!1,onChange:l,styles:c,...u})=>{const d=zt(),h=b.useRef(null),{date:f,range:p}=u,m=f||new Date,v=b.useRef(null),[g,x]=gd({date:m,isAnimating:!1,year:yr(m),months:WI(m,r),direction:void 0,range:{from:p==null?void 0:p.from,to:p==null?void 0:p.to},selectMode:a?"from":void 0,week:Rv({start:Cn(m),end:cR(m)})},P=>({onChangeYear:I=>({year:I}),setToday:()=>({date:So(new Date)}),onExitComplete:()=>(Tp(v.current||null,h,P.state().date,200),v.current=null,{isAnimating:!1}),date:I=>{const C=I(P.state().date);return{date:C,year:yr(C)}},nextMonth:I=>{v.current=I.currentTarget;const C=P.state();if(C.isAnimating)return C;const N=Ba(C.date,1);return{date:N,isAnimating:!0,direction:1,year:yr(N)}},previousMonth:I=>{v.current=I.currentTarget;const C=P.state();if(C.isAnimating)return C;const N=Vv(C.date,1);return{date:N,isAnimating:!0,direction:-1,year:yr(N)}},onSelectDate:I=>{const C=P.state(),N=I.currentTarget.dataset.range==="true",M=I.currentTarget.dataset.date||"",F=new Date(M);return{date:F,year:yr(F),selectMode:C.selectMode===void 0?void 0:C.selectMode==="from"?"to":"from",range:N?{from:C.selectMode==="from"?F:C.range.from,to:C.selectMode==="to"?F:C.range.to}:C.range}},onChangeMonth:I=>{const C=I.target.value,M=Array.from(I.target.options).find(R=>R.value===C),F=P.state();if(M){const R=M.dataset.index||"",A=new Date(P.state().date);return A.setMonth(+R),{...F,date:A,year:yr(A)}}return F},onKeyDown:I=>{const C=I.key,N=P.state();if(C in Fl){(C==="ArrowUp"||C==="ArrowDown")&&I.preventDefault();const M=P.state().date,F=bn.keyof(Fl,C)?Fl[C](M,I.shiftKey?"month":"days"):null;if(F!==null)return Tp(I.target,h,F),{...N,date:F,year:yr(F)}}return P.state()}}),{props:{onChangeMonth:s,onChangeYear:i},postMiddleware:[(P,I,C)=>{var M,F;return(C.method==="onChangeMonth"||C.method==="previousMonth"||C.method==="nextMonth")&&((F=(M=C.props).onChangeMonth)==null||F.call(M,P.date)),P},(P,I,C)=>{var M,F;return C.method==="onChangeYear"&&((F=(M=C.props).onChangeYear)==null||F.call(M,P.date)),P},(P,I,C)=>{const N=C.method==="onSelectDate"||C.method==="setToday"||C.method==="onKeyDown";return a&&N&&t?(l==null||l(P.range),P):(N&&t&&(l==null||l(P.date)),P)}]}),y=Qv(BI(g.date),7),T=g.date.toISOString(),S=Jv(g.date,r);b.useEffect(()=>{t||l==null||l(g.date)},[T]);const E=_I(P=>{x.date(I=>{const C=new Date(I);return C.setFullYear(+P),C})},1200),k=P=>{const I=P.currentTarget.value;x.onChangeYear(I),i==null||i(new Date(I)),E(I)};return w.jsx(GC,{transition:$I,children:w.jsxs("div",{ref:h,className:He("relative overflow-hidden",c==null?void 0:c.calendar),children:[w.jsx("div",{className:"flex flex-col justify-center rounded text-center",children:w.jsx(ei,{initial:!1,mode:"popLayout",custom:g.direction,onExitComplete:x.onExitComplete,children:w.jsxs(Ct.div,{initial:"enter",animate:"middle",exit:"exit",children:[w.jsxs("header",{className:"relative flex justify-between",children:[w.jsx(Ct.button,{layout:!0,"data-focustrap":"prev",variants:Sp,onClick:x.previousMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary",children:w.jsx(VP,{className:"h-4 w-4"})}),w.jsx(Ct.span,{layout:!0,variants:wp,custom:g.direction,className:"absolute inset-0 isolate z-normal flex items-center justify-center font-semibold",children:w.jsxs("span",{className:"flex w-fit items-center justify-center gap-0.5 py-1",children:[w.jsx("select",{style:{width:`${S.length}ch`},value:S,onChange:x.onChangeMonth,className:"w-fit cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary",children:g.months}),w.jsx(Hv,{mask:"int",value:g.year,maxLength:4,placeholder:"YYYY",onChange:k,style:{width:`${g.year.length}ch`},className:"w-16 cursor-pointer appearance-none bg-transparent hover:text-primary"})]})}),w.jsx(Ct.button,{layout:!0,"data-focustrap":"next",variants:Sp,className:"z-calendar rounded-full p-1.5 hover:bg-primary",onClick:x.nextMonth,children:w.jsx(ud,{className:"h-4 w-4"})}),w.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)"}})]}),w.jsxs(Ct.table,{className:"mt-2 table min-w-full table-auto border-0",children:[w.jsx("thead",{children:w.jsx("tr",{children:g.week.map(P=>w.jsx("th",{className:He("py-2 text-sm font-medium capitalize",c==null?void 0:c.weekDay),children:P.toLocaleDateString(r,{weekday:"short"})},P.toString()))})}),w.jsx(Ct.tbody,{layout:!0,variants:wp,custom:g.direction,onKeyDown:x.onKeyDown,className:He(c==null?void 0:c.week),children:y.map((P,I)=>w.jsx("tr",{className:c==null?void 0:c.week,children:P.map(C=>{var L,H,U,O;const N=C.toISOString(),M=a?N===((L=p==null?void 0:p.to)==null?void 0:L.toISOString())||N===((H=p==null?void 0:p.from)==null?void 0:H.toISOString()):N===(f==null?void 0:f.toISOString()),F=nI(C)&&o,R=(n==null?void 0:n(C))||!1,A=!tI(C,g.date)||R,D=a?zI(p==null?void 0:p.from,C,p==null?void 0:p.to):!1;return w.jsxs("td",{align:"center",className:He("relative",c==null?void 0:c.dayFrame),children:[w.jsxs("button",{type:"button","data-date":N,disabled:R,"data-range":a,onClick:x.onSelectDate,"data-view":g.date.getMonth().toString(),className:He(`flex size-10 items-center justify-center rounded-full font-semibold proportional-nums disabled:cursor-not-allowed ${F?"text-primary":""} ${A?"text-disabled":""} ${M?"bg-primary text-primary-foreground":""}`,c==null?void 0:c.day,D?"size-10 border border-dashed border-card-border":""),children:[C.getDate(),M&&((U=g.range.from)==null?void 0:U.toISOString())===N?w.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:w.jsx("span",{className:"text-xs",children:d.calendarFromDate})}):null,M&&((O=g.range.to)==null?void 0:O.toISOString())===N?w.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:w.jsx("span",{className:"text-xs",children:d.calendarToDate})}):null]}),e?w.jsx(e,{date:C}):null]},N)})},`week-${P.length}-${I}`))})]})]},S)})}),w.jsx("footer",{className:"mt-2 text-center text-primary",children:w.jsx("button",{className:"duration-300 transition-transform hover:scale-105",type:"button",onClick:x.setToday,children:"Today"})})]})})},tb=({children:e,title:t,as:n="div",container:r="",header:o=null,className:s="",...i})=>w.jsxs(No,{...i,as:n,className:He("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow",r),children:[t?w.jsx("header",{className:"mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium",children:t}):o,w.jsx("div",{className:He("min-w-full px-8",s),children:e})]}),HI=e=>w.jsxs("div",{className:"divide-y divide-card-border bg-card-background shadow border border-card-border rounded-card",children:[w.jsxs("header",{className:"p-6 items-start flex gap-4",children:[w.jsx("div",{className:He("size-10 p-8 rounded-card flex items-center justify-center aspect-square bg-primary",e.iconContainer),children:w.jsx("div",{children:w.jsx(e.Icon,{className:"size-10 aspect-square text-primary-foreground"})})}),w.jsxs("div",{className:"flex flex-col gap-1",children:[w.jsx("header",{children:w.jsx("h3",{className:"text-base leading-none",children:e.title})}),w.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?w.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),nb=(e,t)=>{const[n,r]=b.useState(()=>t||e);return b.useEffect(()=>{r(e)},[e]),[n,r]},UI=e=>{const t=b.useRef(e);return b.useEffect(()=>{t.current=e},[e]),t},rb=b.createContext(""),GI=e=>{const[t,n]=nb(e.active),r=bo(0),o=bo(0),s=b.useRef(null),i=e.useHash?"a":"button";b.useLayoutEffect(()=>{const u=s.current;if(u===null)return;const d=m=>{if(!m)return;const v=m.getBoundingClientRect();o.set(v.width),r.set(m.offsetLeft)},h=()=>{const m=u.querySelector("li[data-active=true]");return void d(m)};window.addEventListener("resize",h);let f=u.querySelector("li[data-active=true]");const p=window.location.hash.replace(/^#/,"");if(e.active===""&&p!==""&&(f=u.querySelector(`li[data-id=${p}]`),n(p)),f===null){f=u.querySelector("li[data-id]");const m=f.getAttribute("data-id")||"";n(m)}return d(f),()=>window.removeEventListener("resize",h)},[]);const a=UI(e.onChange);b.useEffect(()=>{a.current&&a.current(t)},[a,t]);const l=b.Children.toArray(e.children),c=u=>{const d=u.currentTarget,h=d.getBoundingClientRect();o.set(h.width),r.set(d.offsetLeft),n(d.dataset.id||"")};return w.jsx(rb.Provider,{value:t,children:w.jsx(tb,{className:e.className,container:"pt-0 max-w-full w-full min-w-0",header:w.jsx("header",{ref:s,className:"relative mb-2 overflow-x-auto border-b border-card-border",children:w.jsx("nav",{className:"min-w-0",children:w.jsx("ul",{className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:l.map(u=>{const d=u.props;return w.jsx("li",{"data-id":d.id,"data-active":t===d.id,className:"w-full border-b-2 border-card-border data-[active=true]:border-primary data-[active=true]:font-bold data-[active=true]:text-primary",children:w.jsx(i,{"data-id":d.id,onClick:c,"aria-current":"page",href:e.useHash?`#${d.id}`:void 0,className:"block w-full whitespace-nowrap px-10 py-4",children:d.title})},`tab-header-${d.id}`)})})})}),children:e.children})})},YI=()=>b.useContext(rb),qI=e=>{const t=YI();return w.jsx(b.Fragment,{children:e.id===t?e.children:null})};function cr(e){return ob(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $n(e){var t;return(t=(ob(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ob(e){return e instanceof Node||e instanceof Nt(e).Node}function $e(e){return e instanceof Element||e instanceof Nt(e).Element}function ut(e){return e instanceof HTMLElement||e instanceof Nt(e).HTMLElement}function Gc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot}function ti(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function KI(e){return["table","td","th"].includes(cr(e))}function za(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function xd(e){const t=wd(),n=$e(e)?Zt(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ZI(e){let t=Fn(e);for(;ut(t)&&!tr(t);){if(xd(t))return t;if(za(t))return null;t=Fn(t)}return null}function wd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tr(e){return["html","body","#document"].includes(cr(e))}function Zt(e){return Nt(e).getComputedStyle(e)}function Ha(e){return $e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fn(e){if(cr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gc(e)&&e.host||$n(e);return Gc(t)?t.host:t}function sb(e){const t=Fn(e);return tr(t)?e.ownerDocument?e.ownerDocument.body:e.body:ut(t)&&ti(t)?t:sb(t)}function Xn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sb(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Nt(o);if(s){const a=Yc(i);return t.concat(i,i.visualViewport||[],ti(o)?o:[],a&&n?Xn(a):[])}return t.concat(o,Xn(o,[],n))}function Yc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tn(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function nt(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Gc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Sd(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ib(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function ab(e){return e.mozInputSource===0&&e.isTrusted?!0:qc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Td(e){return XI()?!1:!qc()&&e.width===0&&e.height===0||qc()&&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 Ed(){return/apple/i.test(navigator.vendor)}function qc(){const e=/android/i;return e.test(Sd())||e.test(ib())}function lb(){return Sd().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function XI(){return ib().includes("jsdom/")}function To(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function QI(e){return"nativeEvent"in e}function JI(e){return e.matches("html,body")}function xt(e){return(e==null?void 0:e.ownerDocument)||document}function Ll(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 gn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const eO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Cd(e){return ut(e)&&e.matches(eO)}function Et(e){e.preventDefault(),e.stopPropagation()}function cb(e){return e?e.getAttribute("role")==="combobox"&&Cd(e):!1}const yn=Math.min,Ht=Math.max,Ji=Math.round,no=Math.floor,nr=e=>({x:e,y:e}),tO={left:"right",right:"left",bottom:"top",top:"bottom"},nO={start:"end",end:"start"};function Kc(e,t,n){return Ht(e,yn(t,n))}function $o(e,t){return typeof e=="function"?e(t):e}function rr(e){return e.split("-")[0]}function Bo(e){return e.split("-")[1]}function ub(e){return e==="x"?"y":"x"}function Pd(e){return e==="y"?"height":"width"}function Mr(e){return["top","bottom"].includes(rr(e))?"y":"x"}function Rd(e){return ub(Mr(e))}function rO(e,t,n){n===void 0&&(n=!1);const r=Bo(e),o=Rd(e),s=Pd(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ea(i)),[i,ea(i)]}function oO(e){const t=ea(e);return[Zc(e),t,Zc(t)]}function Zc(e){return e.replace(/start|end/g,t=>nO[t])}function sO(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function iO(e,t,n,r){const o=Bo(e);let s=sO(rr(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Zc)))),s}function ea(e){return e.replace(/left|right|bottom|top/g,t=>tO[t])}function aO(e){return{top:0,right:0,bottom:0,left:0,...e}}function db(e){return typeof e!="number"?aO(e):{top:e,right:e,bottom:e,left:e}}function ta(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}}/*!
|
|
175
175
|
* tabbable 6.2.0
|
|
176
176
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
177
|
-
*/var lO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],na=lO.join(","),fb=typeof Element>"u",Eo=fb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ra=!fb&&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},oa=function e(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&&e(t.parentNode);return i},cO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},uO=function(t,n,r){if(oa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(na));return n&&Eo.call(t,na)&&o.unshift(t),o=o.filter(r),o},dO=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!oa(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Eo.call(i,na);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),h=!oa(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&h){var f=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},hb=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},pb=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||cO(t))&&!hb(t)?0:t.tabIndex},fO=function(t,n){var r=pb(t);return r<0&&n&&!hb(t)?0:r},hO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},mb=function(t){return t.tagName==="INPUT"},pO=function(t){return mb(t)&&t.type==="hidden"},mO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},gO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},yO=function(t){if(!t.name)return!0;var n=t.form||ra(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=gO(o,t.form);return!s||s===t},vO=function(t){return mb(t)&&t.type==="radio"},bO=function(t){return vO(t)&&!yO(t)},xO=function(t){var n,r=t&&ra(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=ra(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},Ep=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},wO=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Eo.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Eo.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=ra(t);if(l&&!l.shadowRoot&&o(l)===!0)return Ep(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(xO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ep(t);return!1},SO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Eo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},TO=function(t,n){return!(n.disabled||oa(n)||pO(n)||wO(n,t)||mO(n)||SO(n))},Xc=function(t,n){return!(bO(n)||pb(n)<0||!TO(t,n))},EO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},CO=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=fO(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(hO).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ds=function(t,n){n=n||{};var r;return n.getShadowRoot?r=dO([t],n.includeContainer,{filter:Xc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:EO}):r=uO(t,n.includeContainer,Xc.bind(null,n)),CO(r)},PO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Eo.call(t,na)===!1?!1:Xc(n,t)};function Cp(e,t,n){let{reference:r,floating:o}=e;const s=Mr(t),i=Rd(t),a=Pd(i),l=rr(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Bo(t)){case"start":f[i]-=h*(n&&c?-1:1);break;case"end":f[i]+=h*(n&&c?-1:1);break}return f}const RO=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Cp(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:v,fn:g}=a[m],{x,y,data:T,reset:S}=await g({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});u=x??u,d=y??d,f={...f,[v]:{...f[v],...T}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=Cp(c,h,l)),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}};async function kd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=$o(t,e),p=db(f),v=a[h?d==="floating"?"reference":"floating":d],g=ta(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},S=ta(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:y,strategy:l}):x);return{top:(g.top-S.top+p.top)/T.y,bottom:(S.bottom-g.bottom+p.bottom)/T.y,left:(g.left-S.left+p.left)/T.x,right:(S.right-g.right+p.right)/T.x}}const kO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=$o(e,t)||{};if(c==null)return{};const d=db(u),h={x:n,y:r},f=Rd(o),p=Pd(f),m=await i.getDimensions(c),v=f==="y",g=v?"top":"left",x=v?"bottom":"right",y=v?"clientHeight":"clientWidth",T=s.reference[p]+s.reference[f]-h[f]-s.floating[p],S=h[f]-s.reference[f],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let k=E?E[y]:0;(!k||!await(i.isElement==null?void 0:i.isElement(E)))&&(k=a.floating[y]||s.floating[p]);const P=T/2-S/2,I=k/2-m[p]/2-1,C=yn(d[g],I),N=yn(d[x],I),M=C,F=k-m[p]-N,R=k/2-m[p]/2+P,A=Kc(M,R,F),D=!l.arrow&&Bo(o)!=null&&R!==A&&s.reference[p]/2-(R<M?C:N)-m[p]/2<0,L=D?R<M?R-M:R-F:0;return{[f]:h[f]+L,data:{[f]:A,centerOffset:R-A-L,...D&&{alignmentOffset:L}},reset:D}}}),IO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=$o(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=rr(o),x=Mr(a),y=rr(a)===a,T=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=h||(y||!m?[ea(a)]:oO(a)),E=p!=="none";!h&&E&&S.push(...iO(a,m,p,T));const k=[a,...S],P=await kd(t,v),I=[];let C=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&I.push(P[g]),d){const R=rO(o,i,T);I.push(P[R[0]],P[R[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every(R=>R<=0)){var N,M;const R=(((N=s.flip)==null?void 0:N.index)||0)+1,A=k[R];if(A)return{data:{index:R,overflows:C},reset:{placement:A}};let D=(M=C.filter(L=>L.overflows[0]<=0).sort((L,H)=>L.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!D)switch(f){case"bestFit":{var F;const L=(F=C.filter(H=>{if(E){const U=Mr(H.placement);return U===x||U==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(U=>U>0).reduce((U,O)=>U+O,0)]).sort((H,U)=>H[1]-U[1])[0])==null?void 0:F[0];L&&(D=L);break}case"initialPlacement":D=a;break}if(o!==D)return{reset:{placement:D}}}return{}}}};async function OO(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=rr(n),a=Bo(n),l=Mr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=$o(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const AO=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,l=await OO(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},_O=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:v=>{let{x:g,y:x}=v;return{x:g,y:x}}},...l}=$o(e,t),c={x:n,y:r},u=await kd(t,l),d=Mr(rr(o)),h=ub(d);let f=c[h],p=c[d];if(s){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",x=f+u[v],y=f-u[g];f=Kc(x,f,y)}if(i){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",x=p+u[v],y=p-u[g];p=Kc(x,p,y)}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},MO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=$o(e,t),l=await kd(t,a),c=rr(n),u=Bo(n),d=Mr(n)==="y",{width:h,height:f}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const v=f-l.top-l.bottom,g=h-l.left-l.right,x=yn(f-l[p],v),y=yn(h-l[m],g),T=!t.middlewareData.shift;let S=x,E=y;if(d?E=u||T?yn(y,g):g:S=u||T?yn(x,v):v,T&&!u){const P=Ht(l.left,0),I=Ht(l.right,0),C=Ht(l.top,0),N=Ht(l.bottom,0);d?E=h-2*(P!==0||I!==0?P+I:Ht(l.left,l.right)):S=f-2*(C!==0||N!==0?C+N:Ht(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:S});const k=await o.getDimensions(s.floating);return h!==k.width||f!==k.height?{reset:{rects:!0}}:{}}}};function gb(e){const t=Zt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ut(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ji(n)!==s||Ji(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Id(e){return $e(e)?e:e.contextElement}function so(e){const t=Id(e);if(!ut(t))return nr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gb(t);let i=(s?Ji(n.width):n.width)/r,a=(s?Ji(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const DO=nr(0);function yb(e){const t=Nt(e);return!wd()||!t.visualViewport?DO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nt(e)?!1:t}function Dr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Id(e);let i=nr(1);t&&(r?$e(r)&&(i=so(r)):i=so(e));const a=jO(s,n,r)?yb(s):nr(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const h=Nt(s),f=r&&$e(r)?Nt(r):r;let p=h,m=Yc(p);for(;m&&r&&f!==p;){const v=so(m),g=m.getBoundingClientRect(),x=Zt(m),y=g.left+(m.clientLeft+parseFloat(x.paddingLeft))*v.x,T=g.top+(m.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=y,c+=T,p=Nt(m),m=Yc(p)}}return ta({width:u,height:d,x:l,y:c})}function NO(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=$n(r),a=t?za(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=nr(1);const u=nr(0),d=ut(r);if((d||!d&&!s)&&((cr(r)!=="body"||ti(i))&&(l=Ha(r)),ut(r))){const h=Dr(r);c=so(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function FO(e){return Array.from(e.getClientRects())}function vb(e){return Dr($n(e)).left+Ha(e).scrollLeft}function LO(e){const t=$n(e),n=Ha(e),r=e.ownerDocument.body,o=Ht(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ht(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+vb(e);const a=-n.scrollTop;return Zt(r).direction==="rtl"&&(i+=Ht(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function VO(e,t){const n=Nt(e),r=$n(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=wd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function $O(e,t){const n=Dr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ut(e)?so(e):nr(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Pp(e,t,n){let r;if(t==="viewport")r=VO(e,n);else if(t==="document")r=LO($n(e));else if($e(t))r=$O(t,n);else{const o=yb(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ta(r)}function bb(e,t){const n=Fn(e);return n===t||!$e(n)||tr(n)?!1:Zt(n).position==="fixed"||bb(n,t)}function BO(e,t){const n=t.get(e);if(n)return n;let r=Xn(e,[],!1).filter(a=>$e(a)&&cr(a)!=="body"),o=null;const s=Zt(e).position==="fixed";let i=s?Fn(e):e;for(;$e(i)&&!tr(i);){const a=Zt(i),l=xd(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ti(i)&&!l&&bb(e,i))?r=r.filter(u=>u!==i):o=a,i=Fn(i)}return t.set(e,r),r}function WO(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?za(t)?[]:BO(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Pp(t,u,o);return c.top=Ht(d.top,c.top),c.right=yn(d.right,c.right),c.bottom=yn(d.bottom,c.bottom),c.left=Ht(d.left,c.left),c},Pp(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zO(e){const{width:t,height:n}=gb(e);return{width:t,height:n}}function HO(e,t,n){const r=ut(t),o=$n(t),s=n==="fixed",i=Dr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=nr(0);if(r||!r&&!s)if((cr(t)!=="body"||ti(o))&&(a=Ha(t)),r){const d=Dr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=vb(o));const c=i.left+a.scrollLeft-l.x,u=i.top+a.scrollTop-l.y;return{x:c,y:u,width:i.width,height:i.height}}function Vl(e){return Zt(e).position==="static"}function Rp(e,t){return!ut(e)||Zt(e).position==="fixed"?null:t?t(e):e.offsetParent}function xb(e,t){const n=Nt(e);if(za(e))return n;if(!ut(e)){let o=Fn(e);for(;o&&!tr(o);){if($e(o)&&!Vl(o))return o;o=Fn(o)}return n}let r=Rp(e,t);for(;r&&KI(r)&&Vl(r);)r=Rp(r,t);return r&&tr(r)&&Vl(r)&&!xd(r)?n:r||ZI(e)||n}const UO=async function(e){const t=this.getOffsetParent||xb,n=this.getDimensions,r=await n(e.floating);return{reference:HO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GO(e){return Zt(e).direction==="rtl"}const YO={convertOffsetParentRelativeRectToViewportRelativeRect:NO,getDocumentElement:$n,getClippingRect:WO,getOffsetParent:xb,getElementRects:UO,getClientRects:FO,getDimensions:zO,getScale:so,isElement:$e,isRTL:GO};function qO(e,t){let n=null,r;const o=$n(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=no(u),p=no(o.clientWidth-(c+d)),m=no(o.clientHeight-(u+h)),v=no(c),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Ht(0,yn(1,l))||1};let y=!0;function T(S){const E=S[0].intersectionRatio;if(E!==l){if(!y)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(T,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,x)}n.observe(e)}return i(!0),s}function Ua(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:l=!1}=r,c=Id(e),u=o||s?[...c?Xn(c):[],...Xn(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=c&&a?qO(c,n):null;let h=-1,f=null;i&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,m=l?Dr(e):null;l&&v();function v(){const g=Dr(e);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(v)}return n(),()=>{var g;u.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),d==null||d(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const KO=AO,ZO=_O,XO=IO,QO=MO,kp=kO,JO=(e,t,n)=>{const r=new Map,o={platform:YO,...n},s={...o.platform,_c:r};return RO(e,t,{...o,platform:s})};var _i=typeof document<"u"?b.useLayoutEffect:b.useEffect;function sa(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(!sa(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)&&!sa(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function wb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ip(e,t){const n=wb(e);return Math.round(t*n)/n}function Op(e){const t=_.useRef(e);return _i(()=>{t.current=e}),t}function eA(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:l,open:c}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=_.useState(r);sa(h,r)||f(r);const[p,m]=_.useState(null),[v,g]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,m(L))},[]),y=_.useCallback(L=>{L!==k.current&&(k.current=L,g(L))},[]),T=s||p,S=i||v,E=_.useRef(null),k=_.useRef(null),P=_.useRef(u),I=l!=null,C=Op(l),N=Op(o),M=_.useCallback(()=>{if(!E.current||!k.current)return;const L={placement:t,strategy:n,middleware:h};N.current&&(L.platform=N.current),JO(E.current,k.current,L).then(H=>{const U={...H,isPositioned:!0};F.current&&!sa(P.current,U)&&(P.current=U,ig.flushSync(()=>{d(U)}))})},[h,t,n,N]);_i(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const F=_.useRef(!1);_i(()=>(F.current=!0,()=>{F.current=!1}),[]),_i(()=>{if(T&&(E.current=T),S&&(k.current=S),T&&S){if(C.current)return C.current(T,S,M);M()}},[T,S,M,C,I]);const R=_.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:y}),[x,y]),A=_.useMemo(()=>({reference:T,floating:S}),[T,S]),D=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!A.floating)return L;const H=Ip(A.floating,u.x),U=Ip(A.floating,u.y);return a?{...L,transform:"translate("+H+"px, "+U+"px)",...wb(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,A.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:M,refs:R,elements:A,floatingStyles:D}),[u,M,R,A,D])}const tA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?kp({element:r.current,padding:o}).fn(n):{}:r?kp({element:r,padding:o}).fn(n):{}}}},Ga=(e,t)=>({...KO(e),options:[e,t]}),Od=(e,t)=>({...ZO(e),options:[e,t]}),Ad=(e,t)=>({...XO(e),options:[e,t]}),nA=(e,t)=>({...QO(e),options:[e,t]}),Sb=(e,t)=>({...tA(e),options:[e,t]});function Qc(e){return _.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Tb={..._},rA=Tb.useInsertionEffect,oA=rA||(e=>e());function yt(e){const t=_.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return oA(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const _d="ArrowUp",ni="ArrowDown",Co="ArrowLeft",Wo="ArrowRight";function bi(e,t,n){return Math.floor(e/t)!==n}function Ss(e,t){return t<0||t>=e.current.length}function $l(e,t){return Ot(e,{disabledIndices:t})}function Ap(e,t){return Ot(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ot(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t;const i=e.current;let a=n;do a+=r?-s:s;while(a>=0&&a<=i.length-1&&Mi(i,a,o));return a}function sA(e,t){let{event:n,orientation:r,loop:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===_d){if(u&&Et(n),c===-1)d=l;else if(d=Ot(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||d<0)){const h=c%s,f=l%s,p=l-(f-h);f===h?d=l:d=f>h?p:p-s}Ss(e,d)&&(d=c)}if(n.key===ni&&(u&&Et(n),c===-1?d=a:(d=Ot(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=Ot(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),Ss(e,d)&&(d=c)),r==="both"){const h=no(c/s);n.key===Wo&&(u&&Et(n),c%s!==s-1?(d=Ot(e,{startingIndex:c,disabledIndices:i}),o&&bi(d,s,h)&&(d=Ot(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=Ot(e,{startingIndex:c-c%s-1,disabledIndices:i})),bi(d,s,h)&&(d=c)),n.key===Co&&(u&&Et(n),c%s!==0?(d=Ot(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&bi(d,s,h)&&(d=Ot(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=Ot(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),bi(d,s,h)&&(d=c));const f=no(l/s)===h;Ss(e,d)&&(o&&f?d=n.key===Co?l:Ot(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function iA(e,t,n){const r=[];let o=0;return e.forEach((s,i)=>{let{width:a,height:l}=s;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const u=[];for(let d=0;d<a;d++)for(let h=0;h<l;h++)u.push(o+d+h*t);o%t+a<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=i}),c=!0):o++}}),[...r]}function aA(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)}}function lA(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Mi(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}let _p=0;function Yn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(_p);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():_p=requestAnimationFrame(s)}var ke=typeof document<"u"?b.useLayoutEffect:b.useEffect;function cA(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 uA(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const Eb=_.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function dA(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,s]=_.useState(()=>new Map),i=_.useCallback(l=>{s(c=>new Map(c).set(l,null))},[]),a=_.useCallback(l=>{s(c=>{const u=new Map(c);return u.delete(l),u})},[]);return ke(()=>{const l=new Map(o);Array.from(l.keys()).sort(cA).forEach((u,d)=>{l.set(u,d)}),uA(o,l)||s(l)},[o]),_.createElement(Eb.Provider,{value:_.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function Cb(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=_.useContext(Eb),[a,l]=_.useState(null),c=_.useRef(null),u=_.useCallback(d=>{if(c.current=d,a!==null&&(s.current[a]=d,i)){var h;const f=t!==void 0;i.current[a]=f?t:(h=d==null?void 0:d.textContent)!=null?h:null}},[a,s,i,t]);return ke(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),ke(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),_.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}let Mp=!1,fA=0;const Dp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fA++;function hA(){const[e,t]=_.useState(()=>Mp?Dp():void 0);return ke(()=>{e==null&&t(Dp())},[]),_.useEffect(()=>{Mp=!0},[]),e}const pA=Tb.useId,zo=pA||hA;let js;process.env.NODE_ENV!=="production"&&(js=new Set);function Di(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=js)!=null&&e.has(o))){var s;(s=js)==null||s.add(o),console.warn(o)}}function mA(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=js)!=null&&e.has(o))){var s;(s=js)==null||s.add(o),console.error(o)}}const Pb=_.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:h,style:{transform:f,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||Di("The `ref` prop is required for `FloatingArrow`."));const v=zo(),[g,x]=_.useState(!1);if(ke(()=>{if(!o)return;Zt(o).direction==="rtl"&&x(!0)},[o]),!o)return null;const y=c*2,T=y/2,S=i/2*(l/-8+1),E=a/2*l/4,[k,P]=r.split("-"),I=!!h,C=k==="top"||k==="bottom",N=u&&P==="end"?"bottom":"top";let M=u&&P==="end"?"right":"left";u&&g&&(M=P==="end"?"left":"right");const F=(s==null?void 0:s.x)!=null?u||s.x:"",R=(s==null?void 0:s.y)!=null?u||s.y:"",A=h||"M0,0"+(" H"+i)+(" L"+(i-S)+","+(a-E))+(" Q"+i/2+","+a+" "+S+","+(a-E))+" Z",D={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[k];return _.createElement("svg",Po({},m,{"aria-hidden":!0,ref:n,width:I?i:i+y,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[M]:F,[N]:R,[k]:C||I?"100%":"calc(100% - "+y/2+"px)",transform:""+D+(f??""),...p}}),y>0&&_.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:d,strokeWidth:y+(h?0:1),d:A}),_.createElement("path",{stroke:y&&!h?m.fill:"none",d:A}),_.createElement("clipPath",{id:v},_.createElement("rect",{x:-T,y:T*(I?-1:1),width:i+y,height:i})))});function Rb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const kb=_.createContext(null),Ib=_.createContext(null),ur=()=>{var e;return((e=_.useContext(kb))==null?void 0:e.id)||null},dr=()=>_.useContext(Ib);function gA(e){const t=zo(),n=dr(),o=ur();return ke(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function yA(e){const{children:t,id:n}=e,r=ur();return _.createElement(kb.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function vA(e){const{children:t}=e,n=_.useRef([]),r=_.useCallback(i=>{n.current=[...n.current,i]},[]),o=_.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),s=_.useState(()=>Rb())[0];return _.createElement(Ib.Provider,{value:_.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function or(e){return"data-floating-ui-"+e}function Pt(e){const t=b.useRef(e);return ke(()=>{t.current=e}),t}const jp=or("safe-polygon");function Bl(e,t,n){return n&&!To(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function Ob(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:h=!0}=t,f=dr(),p=ur(),m=Pt(c),v=Pt(l),g=Pt(n),x=_.useRef(),y=_.useRef(-1),T=_.useRef(),S=_.useRef(-1),E=_.useRef(!0),k=_.useRef(!1),P=_.useRef(()=>{}),I=_.useCallback(()=>{var A;const D=(A=o.current.openEvent)==null?void 0:A.type;return(D==null?void 0:D.includes("mouse"))&&D!=="mousedown"},[o]);_.useEffect(()=>{if(!a)return;function A(D){let{open:L}=D;L||(clearTimeout(y.current),clearTimeout(S.current),E.current=!0)}return s.on("openchange",A),()=>{s.off("openchange",A)}},[a,s]),_.useEffect(()=>{if(!a||!m.current||!n)return;function A(L){I()&&r(!1,L,"hover")}const D=xt(i.floating).documentElement;return D.addEventListener("mouseleave",A),()=>{D.removeEventListener("mouseleave",A)}},[i.floating,n,r,a,m,I]);const C=_.useCallback(function(A,D,L){D===void 0&&(D=!0),L===void 0&&(L="hover");const H=Bl(v.current,"close",x.current);H&&!T.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,A,L),H)):D&&(clearTimeout(y.current),r(!1,A,L))},[v,r]),N=yt(()=>{P.current(),T.current=void 0}),M=yt(()=>{if(k.current){const A=xt(i.floating).body;A.style.pointerEvents="",A.removeAttribute(jp),k.current=!1}});_.useEffect(()=>{if(!a)return;function A(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function D(O){if(clearTimeout(y.current),E.current=!1,u&&!To(x.current)||d>0&&!Bl(v.current,"open"))return;const $=Bl(v.current,"open",x.current);$?y.current=window.setTimeout(()=>{g.current||r(!0,O,"hover")},$):r(!0,O,"hover")}function L(O){if(A())return;P.current();const $=xt(i.floating);if(clearTimeout(S.current),m.current&&o.current.floatingContext){n||clearTimeout(y.current),T.current=m.current({...o.current.floatingContext,tree:f,x:O.clientX,y:O.clientY,onClose(){M(),N(),C(O,!0,"safe-polygon")}});const te=T.current;$.addEventListener("mousemove",te),P.current=()=>{$.removeEventListener("mousemove",te)};return}(x.current==="touch"?!nt(i.floating,O.relatedTarget):!0)&&C(O)}function H(O){A()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:f,x:O.clientX,y:O.clientY,onClose(){M(),N(),C(O)}})(O))}if($e(i.domReference)){var U;const O=i.domReference;return n&&O.addEventListener("mouseleave",H),(U=i.floating)==null||U.addEventListener("mouseleave",H),h&&O.addEventListener("mousemove",D,{once:!0}),O.addEventListener("mouseenter",D),O.addEventListener("mouseleave",L),()=>{var $;n&&O.removeEventListener("mouseleave",H),($=i.floating)==null||$.removeEventListener("mouseleave",H),h&&O.removeEventListener("mousemove",D),O.removeEventListener("mouseenter",D),O.removeEventListener("mouseleave",L)}}},[i,a,e,u,d,h,C,N,M,r,n,g,f,v,m,o]),ke(()=>{var A;if(a&&n&&(A=m.current)!=null&&A.__options.blockPointerEvents&&I()){const L=xt(i.floating).body;L.setAttribute(jp,""),L.style.pointerEvents="none",k.current=!0;const H=i.floating;if($e(i.domReference)&&H){var D;const U=i.domReference,O=f==null||(D=f.nodesRef.current.find($=>$.id===p))==null||(D=D.context)==null?void 0:D.elements.floating;return O&&(O.style.pointerEvents=""),U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,i,f,m,I]),ke(()=>{n||(x.current=void 0,N(),M())},[n,N,M]),_.useEffect(()=>()=>{N(),clearTimeout(y.current),clearTimeout(S.current),M()},[a,i.domReference,N,M]);const F=_.useMemo(()=>{function A(D){x.current=D.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(D){const{nativeEvent:L}=D;function H(){!E.current&&!g.current&&r(!0,L,"hover")}u&&!To(x.current)||n||d===0||(clearTimeout(S.current),x.current==="touch"?H():S.current=window.setTimeout(H,d))}}},[u,r,n,g,d]),R=_.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(A){C(A.nativeEvent,!1)}}),[C]);return _.useMemo(()=>a?{reference:F,floating:R}:{},[a,F,R])}function bA(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function _r(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function xA(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),_r(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let qr=new WeakMap,xi=new WeakSet,wi={},Wl=0;const wA=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ab=e=>e&&(e.host||Ab(e.parentNode)),SA=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ab(n);return e.contains(r)?r:null}).filter(n=>n!=null);function TA(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=SA(t,e),a=new Set,l=new Set(i),c=[];wi[o]||(wi[o]=new WeakMap);const u=wi[o];i.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||[].forEach.call(f.children,p=>{if(cr(p)!=="script")if(a.has(p))h(p);else{const m=s?p.getAttribute(s):null,v=m!==null&&m!=="false",g=(qr.get(p)||0)+1,x=(u.get(p)||0)+1;qr.set(p,g),u.set(p,x),c.push(p),g===1&&v&&xi.add(p),x===1&&p.setAttribute(o,""),!v&&s&&p.setAttribute(s,"true")}})}return Wl++,()=>{c.forEach(f=>{const p=(qr.get(f)||0)-1,m=(u.get(f)||0)-1;qr.set(f,p),u.set(f,m),p||(!xi.has(f)&&s&&f.removeAttribute(s),xi.delete(f)),m||f.removeAttribute(o)}),Wl--,Wl||(qr=new WeakMap,qr=new WeakMap,xi=new WeakSet,wi={})}}function Np(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=xt(e[0]).body;return TA(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ro=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _b(e,t){const n=Ds(e,Ro());t==="prev"&&n.reverse();const r=n.indexOf(tn(xt(e)));return n.slice(r+1)[0]}function Mb(){return _b(document.body,"next")}function Db(){return _b(document.body,"prev")}function Ts(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!nt(n,r)}function EA(e){Ds(e,Ro()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function CA(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 PA(e,t,n){const r=e.indexOf(t);function o(i){const a=or("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||nt(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const Md={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let RA;function Fp(e){e.key==="Tab"&&(e.target,clearTimeout(RA))}const ia=_.forwardRef(function(t,n){const[r,o]=_.useState();ke(()=>(Ed()&&o("button"),document.addEventListener("keydown",Fp),()=>{document.removeEventListener("keydown",Fp)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[or("focus-guard")]:"",style:Md};return _.createElement("span",Po({},t,s))}),jb=_.createContext(null),Lp=or("portal");function kA(e){e===void 0&&(e={});const{id:t,root:n}=e,r=zo(),o=Nb(),[s,i]=_.useState(null),a=_.useRef(null);return ke(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),ke(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Lp,""),l.appendChild(c),a.current=c,i(c)},[t,r]),ke(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!$e(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Lp,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Ho(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=kA({id:n,root:r}),[i,a]=_.useState(null),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return _.useEffect(()=>{if(!s||!o||i!=null&&i.modal)return;function f(p){s&&Ts(p)&&(p.type==="focusin"?CA:EA)(s)}return s.addEventListener("focusin",f,!0),s.addEventListener("focusout",f,!0),()=>{s.removeEventListener("focusin",f,!0),s.removeEventListener("focusout",f,!0)}},[s,o,i==null?void 0:i.modal]),_.createElement(jb.Provider,{value:_.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},h&&s&&_.createElement(ia,{"data-type":"outside",ref:l,onFocus:f=>{if(Ts(f,s)){var p;(p=u.current)==null||p.focus()}else{const m=Db()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus()}}}),h&&s&&_.createElement("span",{"aria-owns":s.id,style:Md}),s&&ig.createPortal(t,s),h&&s&&_.createElement(ia,{"data-type":"outside",ref:c,onFocus:f=>{if(Ts(f,s)){var p;(p=d.current)==null||p.focus()}else{const m=Mb()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,f.nativeEvent))}}}))}const Nb=()=>_.useContext(jb),Vp=20;let Sr=[];function zl(e){Sr=Sr.filter(n=>n.isConnected);let t=e;if(!(!t||cr(t)==="body")){if(!PO(t,Ro())){const n=Ds(t,Ro())[0];n&&(t=n)}Sr.push(t),Sr.length>Vp&&(Sr=Sr.slice(-Vp))}}function $p(){return Sr.slice().reverse().find(e=>e.isConnected)}const IA=_.forwardRef(function(t,n){return _.createElement("button",Po({},t,{type:"button",ref:n,tabIndex:-1,style:Md}))});function ri(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:h,refs:f,nodeId:p,onOpenChange:m,events:v,dataRef:g,floatingId:x,elements:{domReference:y,floating:T}}=t,S=typeof i=="number"&&i<0,E=cb(y)&&S,k=wA()?s:!0,P=Pt(o),I=Pt(i),C=Pt(a),N=dr(),M=Nb(),F=_.useRef(null),R=_.useRef(null),A=_.useRef(!1),D=_.useRef(!1),L=_.useRef(-1),H=M!=null,U=T==null?void 0:T.firstElementChild,O=(U==null?void 0:U.id)===x?U:T,$=yt(function(G){return G===void 0&&(G=O),G?Ds(G,Ro()):[]}),Z=yt(G=>{const j=$(G);return P.current.map(B=>y&&B==="reference"?y:O&&B==="floating"?O:j).filter(Boolean).flat()});_.useEffect(()=>{if(r||!c)return;function G(B){if(B.key==="Tab"){nt(O,tn(xt(O)))&&$().length===0&&!E&&Et(B);const z=Z(),V=gn(B);P.current[0]==="reference"&&V===y&&(Et(B),B.shiftKey?Yn(z[z.length-1]):Yn(z[1])),P.current[1]==="floating"&&V===O&&B.shiftKey&&(Et(B),Yn(z[0]))}}const j=xt(O);return j.addEventListener("keydown",G),()=>{j.removeEventListener("keydown",G)}},[r,y,O,c,P,E,$,Z]),_.useEffect(()=>{if(r||!T)return;function G(j){const B=gn(j),V=$().indexOf(B);V!==-1&&(L.current=V)}return T.addEventListener("focusin",G),()=>{T.removeEventListener("focusin",G)}},[r,T,$]),_.useEffect(()=>{if(r||!d)return;function G(){D.current=!0,setTimeout(()=>{D.current=!1})}function j(B){const z=B.relatedTarget;queueMicrotask(()=>{const V=!(nt(y,z)||nt(T,z)||nt(z,T)||nt(M==null?void 0:M.portalNode,z)||z!=null&&z.hasAttribute(or("focus-guard"))||N&&(_r(N.nodesRef.current,p).find(Y=>{var ne,W;return nt((ne=Y.context)==null?void 0:ne.elements.floating,z)||nt((W=Y.context)==null?void 0:W.elements.domReference,z)})||bA(N.nodesRef.current,p).find(Y=>{var ne,W;return((ne=Y.context)==null?void 0:ne.elements.floating)===z||((W=Y.context)==null?void 0:W.elements.domReference)===z})));if(l&&V&&tn(xt(O))===xt(O).body){ut(O)&&(O==null||O.focus());const Y=L.current,ne=$(),W=ne[Y]||ne[ne.length-1]||O;ut(W)&&W.focus()}(E||!c)&&z&&V&&!D.current&&z!==$p()&&(A.current=!0,m(!1,B))})}if(T&&ut(y))return y.addEventListener("focusout",j),y.addEventListener("pointerdown",G),T.addEventListener("focusout",j),()=>{y.removeEventListener("focusout",j),y.removeEventListener("pointerdown",G),T.removeEventListener("focusout",j)}},[r,y,T,O,c,p,N,M,m,d,l,$,E]),_.useEffect(()=>{var G;if(r)return;const j=Array.from((M==null||(G=M.portalNode)==null?void 0:G.querySelectorAll("["+or("portal")+"]"))||[]);if(T){const B=[T,...j,F.current,R.current,P.current.includes("reference")||E?y:null].filter(V=>V!=null),z=c||E?Np(B,k,!k):Np(B);return()=>{z()}}},[r,y,T,c,P,M,E,k]),ke(()=>{if(r||!ut(O))return;const G=xt(O),j=tn(G);queueMicrotask(()=>{const B=Z(O),z=I.current,V=(typeof z=="number"?B[z]:z.current)||O,Y=nt(O,j);!S&&!Y&&h&&Yn(V,{preventScroll:V===O})})},[r,h,O,S,Z,I]),ke(()=>{if(r||!O)return;let G=!1;const j=xt(O),B=tn(j);let V=g.current.openEvent;const Y=f.domReference.current;zl(B);function ne(W){let{open:Ee,reason:et,event:ze,nested:tt}=W;Ee&&(V=ze),et==="escape-key"&&f.domReference.current&&zl(f.domReference.current),et==="hover"&&ze.type==="mouseleave"&&(A.current=!0),et==="outside-press"&&(tt?(A.current=!1,G=!0):A.current=!(ab(ze)||Td(ze)))}return v.on("openchange",ne),()=>{v.off("openchange",ne);const W=tn(j),Ee=nt(T,W)||N&&_r(N.nodesRef.current,p).some(ce=>{var Te;return nt((Te=ce.context)==null?void 0:Te.elements.floating,W)});(Ee||V&&["click","mousedown"].includes(V.type))&&f.domReference.current&&zl(f.domReference.current);const ze=Y||B,tt=Ds(xt(ze).body,Ro());queueMicrotask(()=>{let ce=$p();!ce&&ut(ze)&&T&&(ce=PA(tt,ze,T)),C.current&&!A.current&&ut(ce)&&(!(ce!==W&&W!==j.body)||Ee)&&ce.focus({preventScroll:G})})}},[r,T,O,C,g,f,v,N,p]),ke(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:d,open:h,onOpenChange:m,refs:f}),()=>{M.setFocusManagerState(null)}},[r,M,c,h,m,f,d]),ke(()=>{if(r||!O||typeof MutationObserver!="function"||S)return;const G=()=>{const B=O.getAttribute("tabindex"),z=$(),V=tn(xt(T)),Y=z.indexOf(V);Y!==-1&&(L.current=Y),P.current.includes("floating")||V!==f.domReference.current&&z.length===0?B!=="0"&&O.setAttribute("tabindex","0"):B!=="-1"&&O.setAttribute("tabindex","-1")};G();const j=new MutationObserver(G);return j.observe(O,{childList:!0,subtree:!0,attributes:!0}),()=>{j.disconnect()}},[r,T,O,f,P,$,S]);function te(G){return r||!u||!c?null:_.createElement(IA,{ref:G==="start"?F:R,onClick:j=>m(!1,j.nativeEvent)},typeof u=="string"?u:"Dismiss")}const Q=!r&&k&&(c?!E:!0)&&(H||c);return _.createElement(_.Fragment,null,Q&&_.createElement(ia,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:G=>{if(c){const B=Z();Yn(o[0]==="reference"?B[0]:B[B.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(A.current=!1,Ts(G,M.portalNode)){const B=Mb()||y;B==null||B.focus()}else{var j;(j=M.beforeOutsideRef.current)==null||j.focus()}}}),!E&&te("start"),n,te("end"),Q&&_.createElement(ia,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:G=>{if(c)Yn(Z()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(d&&(A.current=!0),Ts(G,M.portalNode)){const B=Db()||y;B==null||B.focus()}else{var j;(j=M.afterOutsideRef.current)==null||j.focus()}}}))}const Hl=new Set,OA=_.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=zo();return ke(()=>{if(!r)return;Hl.add(s);const i=/iP(hone|ad|od)|iOS/.test(Sd()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,d=a.left?parseFloat(a.left):window.scrollX,h=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[c]=u+"px"),i){var f,p;const m=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,v=((p=window.visualViewport)==null?void 0:p.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(h-Math.floor(v))+"px",left:-(d-Math.floor(m))+"px",right:"0"})}return()=>{Hl.delete(s),Hl.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,h)))}},[s,r]),_.createElement("div",Po({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function Bp(e){return ut(e.target)&&e.target.tagName==="BUTTON"}function Wp(e){return Cd(e)}function Ya(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=_.useRef(),h=_.useRef(!1),f=_.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(To(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}To(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||Bp(p))&&(p.key===" "&&!Wp(s)&&(p.preventDefault(),h.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Bp(p)||Wp(s)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,l]);return _.useMemo(()=>i?{reference:f}:{},[i,f])}function AA(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var s;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((s=t.dataRef.current.openEvent)==null?void 0:s.type)||"")&&t.pointerType!=="touch";let u=i.width,d=i.height,h=i.x,f=i.y;return n==null&&t.x&&a&&(n=i.x-t.x),r==null&&t.y&&l&&(r=i.y-t.y),h-=n||0,f-=r||0,u=0,d=0,!o||c?(u=t.axis==="y"?i.width:0,d=t.axis==="x"?i.height:0,h=a&&t.x!=null?t.x:h,f=l&&t.y!=null?t.y:f):o&&!c&&(d=t.axis==="x"?i.height:d,u=t.axis==="y"?i.width:u),o=!0,{width:u,height:d,x:h,y:f,top:f,right:h+u,bottom:f+d,left:h}}}}function zp(e){return e!=null&&e.clientX!=null}function _A(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:s},refs:i}=e,{enabled:a=!0,axis:l="both",x:c=null,y:u=null}=t,d=_.useRef(!1),h=_.useRef(null),[f,p]=_.useState(),[m,v]=_.useState([]),g=yt((E,k)=>{d.current||r.current.openEvent&&!zp(r.current.openEvent)||i.setPositionReference(AA(s,{x:E,y:k,axis:l,dataRef:r,pointerType:f}))}),x=yt(E=>{c!=null||u!=null||(n?h.current||v([]):g(E.clientX,E.clientY))}),y=To(f)?o:n,T=_.useCallback(()=>{if(!y||!a||c!=null||u!=null)return;const E=Nt(o);function k(P){const I=gn(P);nt(o,I)?(E.removeEventListener("mousemove",k),h.current=null):g(P.clientX,P.clientY)}if(!r.current.openEvent||zp(r.current.openEvent)){E.addEventListener("mousemove",k);const P=()=>{E.removeEventListener("mousemove",k),h.current=null};return h.current=P,P}i.setPositionReference(s)},[y,a,c,u,o,r,i,s,g]);_.useEffect(()=>T(),[T,m]),_.useEffect(()=>{a&&!o&&(d.current=!1)},[a,o]),_.useEffect(()=>{!a&&n&&(d.current=!0)},[a,n]),ke(()=>{a&&(c!=null||u!=null)&&(d.current=!1,g(c,u))},[a,c,u,g]);const S=_.useMemo(()=>{function E(k){let{pointerType:P}=k;p(P)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:x,onMouseEnter:x}},[x]);return _.useMemo(()=>a?{reference:S}:{},[a,S])}const MA={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},DA={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Hp=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Uo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:p}=t,m=dr(),v=yt(typeof l=="function"?l:()=>!1),g=typeof l=="function"?v:l,x=_.useRef(!1),y=_.useRef(!1),{escapeKey:T,outsidePress:S}=Hp(f),{escapeKey:E,outsidePress:k}=Hp(p),P=yt(R=>{var A;if(!n||!i||!a||R.key!=="Escape")return;const D=(A=s.current.floatingContext)==null?void 0:A.nodeId,L=m?_r(m.nodesRef.current,D):[];if(!T&&(R.stopPropagation(),L.length>0)){let H=!0;if(L.forEach(U=>{var O;if((O=U.context)!=null&&O.open&&!U.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,QI(R)?R.nativeEvent:R,"escape-key")}),I=yt(R=>{var A;const D=()=>{var L;P(R),(L=gn(R))==null||L.removeEventListener("keydown",D)};(A=gn(R))==null||A.addEventListener("keydown",D)}),C=yt(R=>{var A;const D=x.current;x.current=!1;const L=y.current;if(y.current=!1,c==="click"&&L||D||typeof g=="function"&&!g(R))return;const H=gn(R),U="["+or("inert")+"]",O=xt(o.floating).querySelectorAll(U);let $=$e(H)?H:null;for(;$&&!tr($);){const G=Fn($);if(tr(G)||!$e(G))break;$=G}if(O.length&&$e(H)&&!JI(H)&&!nt(H,o.floating)&&Array.from(O).every(G=>!nt($,G)))return;if(ut(H)&&F){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,j=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let B=j&&R.offsetX>H.clientWidth;if(j&&Zt(H).direction==="rtl"&&(B=R.offsetX<=H.offsetWidth-H.clientWidth),B||G&&R.offsetY>H.clientHeight)return}const Z=(A=s.current.floatingContext)==null?void 0:A.nodeId,te=m&&_r(m.nodesRef.current,Z).some(G=>{var j;return Ll(R,(j=G.context)==null?void 0:j.elements.floating)});if(Ll(R,o.floating)||Ll(R,o.domReference)||te)return;const Q=m?_r(m.nodesRef.current,Z):[];if(Q.length>0){let G=!0;if(Q.forEach(j=>{var B;if((B=j.context)!=null&&B.open&&!j.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,R,"outside-press")}),N=yt(R=>{var A;const D=()=>{var L;C(R),(L=gn(R))==null||L.removeEventListener(c,D)};(A=gn(R))==null||A.addEventListener(c,D)});_.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=S;function R(L){r(!1,L,"ancestor-scroll")}const A=xt(o.floating);a&&A.addEventListener("keydown",E?I:P,E),g&&A.addEventListener(c,k?N:C,k);let D=[];return h&&($e(o.domReference)&&(D=Xn(o.domReference)),$e(o.floating)&&(D=D.concat(Xn(o.floating))),!$e(o.reference)&&o.reference&&o.reference.contextElement&&(D=D.concat(Xn(o.reference.contextElement)))),D=D.filter(L=>{var H;return L!==((H=A.defaultView)==null?void 0:H.visualViewport)}),D.forEach(L=>{L.addEventListener("scroll",R,{passive:!0})}),()=>{a&&A.removeEventListener("keydown",E?I:P,E),g&&A.removeEventListener(c,k?N:C,k),D.forEach(L=>{L.removeEventListener("scroll",R)})}},[s,o,a,g,c,n,r,h,i,T,S,P,E,I,C,k,N]),_.useEffect(()=>{x.current=!1},[g,c]);const M=_.useMemo(()=>({onKeyDown:P,[MA[d]]:R=>{u&&r(!1,R.nativeEvent,"reference-press")}}),[P,r,u,d]),F=_.useMemo(()=>({onKeyDown:P,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[DA[c]]:()=>{x.current=!0}}),[P,c]);return _.useMemo(()=>i?{reference:M,floating:F}:{},[i,M,F])}function jA(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=zo(),s=_.useRef({}),[i]=_.useState(()=>Rb()),a=ur()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!$e(f)&&mA("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=_.useState(r.reference),u=yt((f,p,m)=>{s.current.openEvent=f?p:void 0,i.emit("openchange",{open:f,event:p,reason:m,nested:a}),n==null||n(f,p,m)}),d=_.useMemo(()=>({setPositionReference:c}),[]),h=_.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return _.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:h,events:i,floatingId:o,refs:d}),[t,u,h,i,o,d])}function Go(e){e===void 0&&(e={});const{nodeId:t}=e,n=jA({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=_.useState(null),[a,l]=_.useState(null),u=(o==null?void 0:o.reference)||s,d=_.useRef(null),h=dr();ke(()=>{u&&(d.current=u)},[u]);const f=eA({...e,elements:{...o,...a&&{reference:a}}}),p=_.useCallback(y=>{const T=$e(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(T),f.refs.setReference(T)},[f.refs]),m=_.useCallback(y=>{($e(y)||y===null)&&(d.current=y,i(y)),($e(f.refs.reference.current)||f.refs.reference.current===null||y!==null&&!$e(y))&&f.refs.setReference(y)},[f.refs]),v=_.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:d}),[f.refs,m,p]),g=_.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),x=_.useMemo(()=>({...f,...r,refs:v,elements:g,nodeId:t}),[f,v,g,t,r]);return ke(()=>{r.dataRef.current.floatingContext=x;const y=h==null?void 0:h.nodesRef.current.find(T=>T.id===t);y&&(y.context=x)}),_.useMemo(()=>({...f,context:x,refs:v,elements:g}),[f,v,g,x])}function NA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=_.useRef(!1),u=_.useRef(),d=_.useRef(!0);_.useEffect(()=>{if(!a)return;const f=Nt(i.domReference);function p(){!n&&ut(i.domReference)&&i.domReference===tn(xt(i.domReference))&&(c.current=!0)}function m(){d.current=!0}return f.addEventListener("blur",p),f.addEventListener("keydown",m,!0),()=>{f.removeEventListener("blur",p),f.removeEventListener("keydown",m,!0)}},[i.domReference,n,a]),_.useEffect(()=>{if(!a)return;function f(p){let{reason:m}=p;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,a]),_.useEffect(()=>()=>{clearTimeout(u.current)},[]);const h=_.useMemo(()=>({onPointerDown(f){Td(f.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(f){if(c.current)return;const p=gn(f.nativeEvent);if(l&&$e(p))try{if(Ed()&&lb())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!d.current&&!Cd(p))return}r(!0,f.nativeEvent,"focus")},onBlur(f){c.current=!1;const p=f.relatedTarget,m=f.nativeEvent,v=$e(p)&&p.hasAttribute(or("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var g;const x=tn(i.domReference?i.domReference.ownerDocument:document);!p&&x===i.domReference||nt((g=s.current.floatingContext)==null?void 0:g.refs.floating.current,x)||nt(i.domReference,x)||v||r(!1,m,"focus")})}}),[s,i.domReference,r,l]);return _.useMemo(()=>a?{reference:h}:{},[a,h])}const Up="active",Gp="selected";function Ul(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Up]:i,[Gp]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[Up,Gp].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var h,f=arguments.length,p=new Array(f),m=0;m<f;m++)p[m]=arguments[m];return(h=r.get(c))==null?void 0:h.map(v=>v(...p)).find(v=>v!==void 0)}}}else i[c]=u}),i),{})}}function Yo(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=_.useCallback(a=>Ul(a,e,"reference"),t),s=_.useCallback(a=>Ul(a,e,"floating"),n),i=_.useCallback(a=>Ul(a,e,"item"),r);return _.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let Yp=!1;function qa(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qp(e,t){return qa(t,e===_d||e===ni,e===Co||e===Wo)}function Gl(e,t,n){return qa(t,e===ni,n?e===Co:e===Wo)||e==="Enter"||e===" "||e===""}function FA(e,t,n){return qa(t,n?e===Co:e===Wo,e===ni)}function Kp(e,t,n){return qa(t,n?e===Wo:e===Co,e===_d)}function Fb(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:h=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:g=!0,disabledIndices:x=void 0,orientation:y="vertical",cols:T=1,scrollItemIntoView:S=!0,virtualItemRef:E,itemSizes:k,dense:P=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||Di("`useListNavigation` looping must be enabled to allow escaping."),p||Di("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&T>1&&Di("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const I=ur(),C=dr(),N=yt(a),M=_.useRef(m),F=_.useRef(c??-1),R=_.useRef(null),A=_.useRef(!0),D=_.useRef(N),L=_.useRef(!!o.floating),H=_.useRef(n),U=_.useRef(!1),O=_.useRef(!1),$=Pt(x),Z=Pt(n),te=Pt(S),Q=Pt(o.floating),G=Pt(c),[j,B]=_.useState(),[z,V]=_.useState(),Y=yt(function(ce,Te,le){le===void 0&&(le=!1);function Pe(Re){p?(B(Re.id),C==null||C.events.emit("virtualfocus",Re),E&&(E.current=Re)):Yn(Re,{preventScroll:!0,sync:lb()&&Ed()?Yp||U.current:!1})}const at=ce.current[Te.current];at&&Pe(at),requestAnimationFrame(()=>{const Re=ce.current[Te.current]||at;if(!Re)return;at||Pe(Re);const pt=te.current;pt&&W&&(le||!A.current)&&(Re.scrollIntoView==null||Re.scrollIntoView(typeof pt=="boolean"?{block:"nearest",inline:"nearest"}:pt))})});ke(()=>{document.createElement("div").focus({get preventScroll(){return Yp=!0,!1}})},[]),ke(()=>{l&&(n&&o.floating?M.current&&c!=null&&(O.current=!0,F.current=c,N(c)):L.current&&(F.current=-1,D.current(null)))},[l,n,o.floating,c,N]),ke(()=>{if(l&&n&&o.floating)if(i==null){if(U.current=!1,G.current!=null)return;if(L.current&&(F.current=-1,Y(s,F)),(!H.current||!L.current)&&M.current&&(R.current!=null||M.current===!0&&R.current==null)){let ce=0;const Te=()=>{s.current[0]==null?(ce<2&&(ce?requestAnimationFrame:queueMicrotask)(Te),ce++):(F.current=R.current==null||Gl(R.current,y,f)||h?$l(s,$.current):Ap(s,$.current),R.current=null,N(F.current))};Te()}}else Ss(s,i)||(F.current=i,Y(s,F,O.current),O.current=!1)},[l,n,o.floating,i,G,h,s,y,f,N,Y,$]),ke(()=>{var ce;if(!l||o.floating||!C||p||!L.current)return;const Te=C.nodesRef.current,le=(ce=Te.find(Re=>Re.id===I))==null||(ce=ce.context)==null?void 0:ce.elements.floating,Pe=tn(xt(o.floating)),at=Te.some(Re=>Re.context&&nt(Re.context.elements.floating,Pe));le&&!at&&A.current&&le.focus({preventScroll:!0})},[l,o.floating,C,I,p]),ke(()=>{if(!l||!C||!p||I)return;function ce(Te){V(Te.id),E&&(E.current=Te)}return C.events.on("virtualfocus",ce),()=>{C.events.off("virtualfocus",ce)}},[l,C,p,I,E]),ke(()=>{D.current=N,L.current=!!o.floating}),ke(()=>{n||(R.current=null)},[n]),ke(()=>{H.current=n},[n]);const ne=i!=null,W=_.useMemo(()=>{function ce(le){if(!n)return;const Pe=s.current.indexOf(le);Pe!==-1&&N(Pe)}return{onFocus(le){let{currentTarget:Pe}=le;ce(Pe)},onClick:le=>{let{currentTarget:Pe}=le;return Pe.focus({preventScroll:!0})},...v&&{onMouseMove(le){let{currentTarget:Pe}=le;ce(Pe)},onPointerLeave(le){let{pointerType:Pe}=le;!A.current||Pe==="touch"||(F.current=-1,Y(s,F),N(null),p||Yn(Q.current,{preventScroll:!0}))}}}},[n,Q,Y,v,s,N,p]),Ee=yt(ce=>{if(A.current=!1,U.current=!0,!Z.current&&ce.currentTarget===Q.current)return;if(h&&Kp(ce.key,y,f)){Et(ce),r(!1,ce.nativeEvent,"list-navigation"),ut(o.domReference)&&!p&&o.domReference.focus();return}const Te=F.current,le=$l(s,x),Pe=Ap(s,x);if(ce.key==="Home"&&(Et(ce),F.current=le,N(F.current)),ce.key==="End"&&(Et(ce),F.current=Pe,N(F.current)),T>1){const at=k||Array.from({length:s.current.length},()=>({width:1,height:1})),Re=iA(at,T,P),pt=Re.findIndex(ie=>ie!=null&&!Mi(s.current,ie,x)),J=Re.reduce((ie,Oe,Ue)=>Oe!=null&&!Mi(s.current,Oe,x)?Ue:ie,-1);if(F.current=Re[sA({current:Re.map(ie=>ie!=null?s.current[ie]:null)},{event:ce,orientation:y,loop:d,cols:T,disabledIndices:lA([...x||s.current.map((ie,Oe)=>Mi(s.current,Oe)?Oe:void 0),void 0],Re),minIndex:pt,maxIndex:J,prevIndex:aA(F.current>Pe?le:F.current,at,Re,T,ce.key===ni?"bl":ce.key===Wo?"tr":"tl"),stopEvent:!0})],N(F.current),y==="both")return}if(qp(ce.key,y)){if(Et(ce),n&&!p&&tn(ce.currentTarget.ownerDocument)===ce.currentTarget){F.current=Gl(ce.key,y,f)?le:Pe,N(F.current);return}Gl(ce.key,y,f)?d?F.current=Te>=Pe?u&&Te!==s.current.length?-1:le:Ot(s,{startingIndex:Te,disabledIndices:x}):F.current=Math.min(Pe,Ot(s,{startingIndex:Te,disabledIndices:x})):d?F.current=Te<=le?u&&Te!==-1?s.current.length:Pe:Ot(s,{startingIndex:Te,decrement:!0,disabledIndices:x}):F.current=Math.max(le,Ot(s,{startingIndex:Te,decrement:!0,disabledIndices:x})),Ss(s,F.current)?N(null):N(F.current)}}),et=_.useMemo(()=>p&&n&&ne&&{"aria-activedescendant":z||j},[p,n,ne,z,j]),ze=_.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!cb(o.domReference)&&et,onKeyDown:Ee,onPointerMove(){A.current=!0}}),[et,Ee,o.domReference,y]),tt=_.useMemo(()=>{function ce(le){m==="auto"&&ab(le.nativeEvent)&&(M.current=!0)}function Te(le){M.current=m,m==="auto"&&Td(le.nativeEvent)&&(M.current=!0)}return{...et,onKeyDown(le){A.current=!1;const Pe=le.key.indexOf("Arrow")===0,at=FA(le.key,y,f),Re=Kp(le.key,y,f),pt=qp(le.key,y),J=(h?at:pt)||le.key==="Enter"||le.key.trim()==="";if(p&&n){const St=C==null?void 0:C.nodesRef.current.find(jt=>jt.parentId==null),kt=C&&St?xA(C.nodesRef.current,St.id):null;if(Pe&&kt&&E){const jt=new KeyboardEvent("keydown",{key:le.key,bubbles:!0});if(at||Re){var ie,Oe;const mr=((ie=kt.context)==null?void 0:ie.elements.domReference)===le.currentTarget,Wr=Re&&!mr?(Oe=kt.context)==null?void 0:Oe.elements.domReference:at?s.current.find(zr=>(zr==null?void 0:zr.id)===j):null;Wr&&(Et(le),Wr.dispatchEvent(jt),V(void 0))}if(pt&&kt.context&&kt.context.open&&kt.parentId&&le.currentTarget!==kt.context.elements.domReference){var Ue;Et(le),(Ue=kt.context.elements.domReference)==null||Ue.dispatchEvent(jt);return}}return Ee(le)}if(!(!n&&!g&&Pe)){if(J&&(R.current=h&&pt?null:le.key),h){at&&(Et(le),n?(F.current=$l(s,$.current),N(F.current)):r(!0,le.nativeEvent,"list-navigation"));return}pt&&(c!=null&&(F.current=c),Et(le),!n&&g?r(!0,le.nativeEvent,"list-navigation"):Ee(le),n&&N(F.current))}},onFocus(){n&&!p&&N(null)},onPointerDown:Te,onMouseDown:ce,onClick:ce}},[j,et,Ee,$,m,s,h,N,r,n,g,y,f,c,C,p,E]);return _.useMemo(()=>l?{reference:tt,floating:ze,item:W}:{},[l,tt,ze,W])}const LA=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function qo(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=LA.get(i))!=null?n:i,l=zo(),u=ur()!=null,d=_.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,l,i]),h=_.useMemo(()=>{const p={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?p:{...p,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),f=_.useCallback(p=>{let{active:m,selected:v}=p;const g={role:"option",...m&&{id:o+"-option"}};switch(i){case"select":return{...g,"aria-selected":m&&v};case"combobox":return{...g,...m&&{"aria-selected":!0}}}return{}},[o,i]);return _.useMemo(()=>s?{reference:d,floating:h,item:f}:{},[s,d,h,f])}const Zp=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Kr(e,t){return typeof e=="function"?e(t):e}function VA(e,t){const[n,r]=_.useState(e);return e&&!n&&r(!0),_.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function $A(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[a,l]=_.useState("unmounted"),c=VA(n,i);return!c&&a==="close"&&l("unmounted"),ke(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function BA(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=_.useMemo(()=>({side:l,placement:a}),[l,a]),u=typeof i=="number",d=(u?i:i.open)||0,h=(u?i:i.close)||0,[f,p]=_.useState(()=>({...Kr(s,c),...Kr(n,c)})),{isMounted:m,status:v}=$A(e,{duration:i}),g=Pt(n),x=Pt(r),y=Pt(o),T=Pt(s);return ke(()=>{const S=Kr(g.current,c),E=Kr(y.current,c),k=Kr(T.current,c),P=Kr(x.current,c)||Object.keys(S).reduce((I,C)=>(I[C]="",I),{});if(v==="initial"&&p(I=>({transitionProperty:I.transitionProperty,...k,...S})),v==="open"&&p({transitionProperty:Object.keys(P).map(Zp).join(","),transitionDuration:d+"ms",...k,...P}),v==="close"){const I=E||S;p({transitionProperty:Object.keys(I).map(Zp).join(","),transitionDuration:h+"ms",...k,...I})}},[h,y,g,x,T,d,v,c]),{isMounted:m,styles:f}}function WA(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=_.useRef(),m=_.useRef(""),v=_.useRef((n=f??i)!=null?n:-1),g=_.useRef(null),x=yt(a),y=yt(l),T=Pt(u),S=Pt(h);ke(()=>{r&&(clearTimeout(p.current),g.current=null,m.current="")},[r]),ke(()=>{if(r&&m.current===""){var C;v.current=(C=f??i)!=null?C:-1}},[r,f,i]);const E=yt(C=>{C?o.current.typing||(o.current.typing=C,y(C)):o.current.typing&&(o.current.typing=C,y(C))}),k=yt(C=>{function N(D,L,H){const U=T.current?T.current(L,H):L.find(O=>(O==null?void 0:O.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return U?D.indexOf(U):-1}const M=s.current;if(m.current.length>0&&m.current[0]!==" "&&(N(M,M,m.current)===-1?E(!1):C.key===" "&&Et(C)),M==null||S.current.includes(C.key)||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;r&&C.key!==" "&&(Et(C),E(!0)),M.every(D=>{var L,H;return D?((L=D[0])==null?void 0:L.toLocaleLowerCase())!==((H=D[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===C.key&&(m.current="",v.current=g.current),m.current+=C.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",v.current=g.current,E(!1)},d);const R=v.current,A=N(M,[...M.slice((R||0)+1),...M.slice(0,(R||0)+1)],m.current);A!==-1?(x(A),g.current=A):C.key!==" "&&(m.current="",E(!1))}),P=_.useMemo(()=>({onKeyDown:k}),[k]),I=_.useMemo(()=>({onKeyDown:k,onKeyUp(C){C.key===" "&&E(!1)}}),[k,E]);return _.useMemo(()=>c?{reference:P,floating:I}:{},[c,P,I])}function Xp(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function zA(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){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();function c(d,h){const f=performance.now(),p=f-l;if(i===null||a===null||p===0)return i=d,a=h,l=f,null;const m=d-i,v=h-a,x=Math.sqrt(m*m+v*v)/p;return i=d,a=h,l=f,x}const u=d=>{let{x:h,y:f,placement:p,elements:m,onClose:v,nodeId:g,tree:x}=d;return function(T){function S(){clearTimeout(o),v()}if(clearTimeout(o),!m.domReference||!m.floating||p==null||h==null||f==null)return;const{clientX:E,clientY:k}=T,P=[E,k],I=gn(T),C=T.type==="mouseleave",N=nt(m.floating,I),M=nt(m.domReference,I),F=m.domReference.getBoundingClientRect(),R=m.floating.getBoundingClientRect(),A=p.split("-")[0],D=h>R.right-R.width/2,L=f>R.bottom-R.height/2,H=zA(P,F),U=R.width>F.width,O=R.height>F.height,$=(U?F:R).left,Z=(U?F:R).right,te=(O?F:R).top,Q=(O?F:R).bottom;if(N&&(s=!0,!C))return;if(M&&(s=!1),M&&!C){s=!0;return}if(C&&$e(T.relatedTarget)&&nt(m.floating,T.relatedTarget)||x&&_r(x.nodesRef.current,g).some(B=>{let{context:z}=B;return z==null?void 0:z.open}))return;if(A==="top"&&f>=F.bottom-1||A==="bottom"&&f<=F.top+1||A==="left"&&h>=F.right-1||A==="right"&&h<=F.left+1)return S();let G=[];switch(A){case"top":G=[[$,F.top+1],[$,R.bottom-1],[Z,R.bottom-1],[Z,F.top+1]];break;case"bottom":G=[[$,R.top+1],[$,F.bottom-1],[Z,F.bottom-1],[Z,R.top+1]];break;case"left":G=[[R.right-1,Q],[R.right-1,te],[F.left+1,te],[F.left+1,Q]];break;case"right":G=[[F.right-1,Q],[F.right-1,te],[R.left+1,te],[R.left+1,Q]];break}function j(B){let[z,V]=B;switch(A){case"top":{const Y=[U?z+t/2:D?z+t*4:z-t*4,V+t+1],ne=[U?z-t/2:D?z+t*4:z-t*4,V+t+1],W=[[R.left,D||U?R.bottom-t:R.top],[R.right,D?U?R.bottom-t:R.top:R.bottom-t]];return[Y,ne,...W]}case"bottom":{const Y=[U?z+t/2:D?z+t*4:z-t*4,V-t],ne=[U?z-t/2:D?z+t*4:z-t*4,V-t],W=[[R.left,D||U?R.top+t:R.bottom],[R.right,D?U?R.top+t:R.bottom:R.top+t]];return[Y,ne,...W]}case"left":{const Y=[z+t+1,O?V+t/2:L?V+t*4:V-t*4],ne=[z+t+1,O?V-t/2:L?V+t*4:V-t*4];return[...[[L||O?R.right-t:R.left,R.top],[L?O?R.right-t:R.left:R.right-t,R.bottom]],Y,ne]}case"right":{const Y=[z-t,O?V+t/2:L?V+t*4:V-t*4],ne=[z-t,O?V-t/2:L?V+t*4:V-t*4],W=[[L||O?R.left+t:R.right,R.top],[L?O?R.left+t:R.right:R.left+t,R.bottom]];return[Y,ne,...W]}}}if(!Xp([E,k],G)){if(s&&!H)return S();if(!C&&r){const B=c(T.clientX,T.clientY);if(B!==null&&B<.1)return S()}Xp([E,k],j([h,f]))?!s&&r&&(o=window.setTimeout(S,40)):S()}}};return u.__options={blockPointerEvents:n},u}const Ko=e=>{const t=b.useId(),[n,r]=b.useState(e.open),o=b.useRef(null),s=b.useMemo(()=>[Ga(10),Ad({fallbackAxisSideDirection:"end"}),Od(),Sb({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=Go({open:n,middleware:s,transform:!0,whileElementsMounted:Ua,onOpenChange:(p,m)=>{var g;const v=m==null?void 0:m.relatedTarget;v&&v.dataset.floating==="true"&&!p||(r(p),(g=e.onChange)==null||g.call(e,p))}}),c=Ya(l),u=Uo(l),d=qo(l),{getReferenceProps:h,getFloatingProps:f}=Yo([c,u,d]);return w.jsxs(b.Fragment,{children:[w.jsx("button",{ref:i.setReference,...h(e.buttonProps),type:"button",children:e.trigger}),n&&w.jsx(Ho,{preserveTabOrder:!0,id:`${t}-portal`,children:w.jsx(ri,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:w.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:i.setFloating,style:a,"aria-labelledby":t,...f(),children:[w.jsx(Pb,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),w.jsx("header",{className:"mb-2",children:w.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},UA=e=>{const t=b.useRef(null),n=b.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=b.useState(!1),{context:a,refs:l}=Go({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=Ya(a),u=qo(a),d=Uo(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:h,getReferenceProps:f}=Yo([c,u,d]);return w.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[w.jsx(ho,{...f(e),as:Ct.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>i(!0),children:w.jsx(Ct.span,{layoutId:o,children:e.trigger})}),w.jsx(ei,{children:s?w.jsx(Ho,{root:t,children:w.jsx(ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:w.jsx(Ct.div,{...h(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})};function GA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function YA(...e){return t=>e.forEach(n=>GA(n,t))}var Dd=_.forwardRef((e,t)=>{const{children:n,...r}=e,o=_.Children.toArray(n),s=o.find(KA);if(s){const i=s.props.children,a=o.map(l=>l===s?_.Children.count(i)>1?_.Children.only(null):_.isValidElement(i)?i.props.children:null:l);return w.jsx(Jc,{...r,ref:t,children:_.isValidElement(i)?_.cloneElement(i,void 0,a):null})}return w.jsx(Jc,{...r,ref:t,children:n})});Dd.displayName="Slot";var Jc=_.forwardRef((e,t)=>{const{children:n,...r}=e;if(_.isValidElement(n)){const o=XA(n);return _.cloneElement(n,{...ZA(r,n.props),ref:t?YA(t,o):o})}return _.Children.count(n)>1?_.Children.only(null):null});Jc.displayName="SlotClone";var qA=({children:e})=>w.jsx(w.Fragment,{children:e});function KA(e){return _.isValidElement(e)&&e.type===qA}function ZA(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function XA(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Lb=300,QA=500,Vb=(e="")=>He("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary data-[open]:bg-primary focus:bg-primary aria-expanded:opacity-80","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),eu=b.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),Qp=b.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const l=ur(),c=l!==null,[u,d]=b.useState(!1),[h,f]=b.useState(!1),[p,m]=b.useState(null),v=b.useRef([]),g=b.useRef([]),x=b.useContext(eu),y=dr(),T=gA(),S=Cb(),{floatingStyles:E,refs:k,context:P}=Go({nodeId:T,open:u,transform:!0,onOpenChange:d,whileElementsMounted:Ua,placement:c?"right":"bottom-start",strategy:"absolute",middleware:[Ga({mainAxis:c?0:4,alignmentAxis:c?-4:0}),Ad(),Od()]}),I=qo(P,{role:"menu",enabled:!0}),C=Uo(P,{bubbles:!0}),N=Ob(P,{enabled:n,delay:{open:Lb},handleClose:HA({blockPointerEvents:!0})}),M=Ya(P,{event:"mousedown",toggle:!c,ignoreMouse:c,keyboardHandlers:!0}),F=Fb(P,{loop:!0,activeIndex:p,virtual:!0,nested:c,allowEscape:!0,listRef:v,scrollItemIntoView:!0,onNavigate:m}),R=WA(P,{activeIndex:p,listRef:g,resetMs:QA,onMatch:u?m:void 0}),{getReferenceProps:A,getFloatingProps:D,getItemProps:L}=Yo([N,M,I,C,F,R]);b.useEffect(()=>{if(!y)return;const U=()=>d(!1),O=$=>{$.nodeId!==T&&$.parentId===l&&d(!1)};return y.events.on("click",U),y.events.on("menuopen",O),()=>{y.events.off("click",U),y.events.off("menuopen",O)}},[y,T,l]),b.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:l,nodeId:T})},[y,u,T,l]);const H=r?i.className:He(Vb(i.className));return w.jsxs(yA,{id:T,children:[w.jsx(b.Fragment,{children:i.asChild?w.jsx(Dd,{children:s,ref:Qc([k.setReference,S.ref,a]),tabIndex:c?x.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...A(x.getItemProps({...i,onFocus(U){var O;(O=i.onFocus)==null||O.call(i,U),f(!1),x.setHasFocusInside(!0)}}))}):w.jsxs("button",{type:"button",ref:Qc([k.setReference,S.ref,a]),tabIndex:c?x.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...A(x.getItemProps({...i,onFocus(U){var O;(O=i.onFocus)==null||O.call(i,U),f(!1),x.setHasFocusInside(!0)}})),children:[s,c&&w.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[w.jsx("span",{className:"sr-only",children:"Next menu"}),w.jsx(ud,{size:14})]})]})}),w.jsx(eu.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:L,setHasFocusInside:f,isOpen:u},children:w.jsx(dA,{elementsRef:v,labelsRef:g,children:u&&w.jsx(Ho,{preserveTabOrder:!0,children:w.jsx(ri,{context:P,modal:!1,initialFocus:c?-1:0,returnFocus:!c,children:w.jsx(t,{...D(),ref:k.setFloating,style:{...i.style,...E},className:He("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none",o),children:e})})})})})]})}),JA=b.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=b.useContext(eu),a=Cb({label:r?null:typeof e=="string"?e:t}),l=dr(),c=a.index===i.activeIndex;return w.jsxs("button",{...o,ref:Qc([a.ref,s]),"data-active":c,type:"button",role:"menuitem",disabled:r,tabIndex:c?0:-1,className:Vb(o.className),...i.getItemProps({onClick(u){var d;(d=o.onClick)==null||d.call(o,u),l==null||l.events.emit("click")},onFocus(u){var d;(d=o.onFocus)==null||d.call(o,u),i.setHasFocusInside(!0)}}),children:[e,n?w.jsx(n,{size:16}):null]})}),e_=b.forwardRef((e,t)=>ur()!==null?w.jsx(Qp,{...e,isParent:!1,ref:t}):w.jsx(vA,{children:w.jsx(Qp,{...e,isParent:!0,ref:t})})),t_=(e,t)=>Qi()?t:window.matchMedia(e).matches,n_=(e,t=!0)=>{const[n,r]=b.useState(t);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(t_(e,t));return s(),o.addListener?(o.addListener(s),()=>o.removeListener?o.removeListener(s):void 0):(o.addEventListener("change",s),()=>o.removeEventListener("change",s))},[e]),n},nn="600ms",r_={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:nn},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:nn},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:nn}},o_={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:nn},exit:{translateX:["0%","30%"],opacity:0,animationDuration:nn}},Yl={drawer:e=>e==="left"?r_:o_,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:nn,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:nn,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:nn,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:nn},enter:{opacity:1,scale:[1.05,1],animationDuration:nn},exit:{opacity:0,scale:.97,animationDuration:nn}}},s_=Gs("isolate z-floating border border-card-border ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background",{variants:{type:{drawer:"max-h-screen max-w-[90%] absolute w-fit h-screen min-h-0",dialog:"max-h-[calc(100lvh-10%)] relative container h-min rounded-lg py-4",sheet:"w-screen absolute bottom-0 h-[85vh] max-h-[85vh] max-h-[85svh] pt-6 pb-4 rounded-t-lg"},position:{none:"",right:"py-4 absolute right-0 top-0 rounded-l-lg",left:"py-4 absolute left-0 top-0 rounded-r-lg"}},defaultVariants:{position:"right",type:"dialog"}}),i_={top:0,left:0,right:0,bottom:-1},a_=e=>e*.62,l_=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const c=e.parent.current,u=e.value.get()||c.getBoundingClientRect().width,d=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+d))}const s=e.parent.current.getBoundingClientRect(),i=e.value.get()||s.height,a=Math.abs(i-r.delta.y),l=a_(window.outerHeight);return a<l?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return w.jsx(Ct.div,{draggable:!0,dragMomentum:!0,dragListener:!0,dragPropagation:!0,onDrag:t,animate:!1,initial:!1,dragElastic:0,dragDirectionLock:!0,dragSnapToOrigin:!0,drag:e.sheet?"y":"x",dragConstraints:i_,whileDrag:{cursor:"grabbing"},className:He("absolute rounded-lg",e.sheet?"cursor-row-resize":"cursor-col-resize bg-floating-border",e.sheet?"top-1 flex h-3 w-full justify-center py-2":e.position==="left"?"right-5 top-1/2 h-10 w-2":"left-2 top-1/2 h-10 w-2"),children:e.sheet?w.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},ql={drawer:"right",sheet:"none",dialog:"none"},c_=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...s})=>{const i=b.useId(),a=b.useId(),l=n_("(min-width: 64rem)"),c=e!=="dialog",u=l?e==="drawer"?s.position:ql[e]:r?ql[e]:ql.sheet,d=l||r?Yl[e]:Yl.sheet,h=typeof d=="function"?d(u):d,f=l||r?e:"sheet",{refs:p,context:m}=Go({open:s.open,onOpenChange:s.onChange}),v=Ya(m),g=qo(m),x=Uo(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:T}=Yo([v,g,x]),S=s.trigger,E=bo(void 0),k=()=>s.onChange(!1);return w.jsxs(b.Fragment,{children:[s.trigger?w.jsx(b.Fragment,{children:s.asChild?w.jsx(Dd,{ref:p.setReference,...y({layoutId:s.layoutId}),children:S}):w.jsx(Ct.button,{ref:p.setReference,...y(),layoutId:s.layoutId,type:"button",children:S})}):null,w.jsx(Ho,{children:w.jsx(ei,{presenceAffectsLayout:!0,children:s.open?w.jsx(OA,{lockScroll:!0,className:`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${f==="drawer"?"":"grid items-end justify-center lg:items-center"}`,children:w.jsx(ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:m,children:w.jsxs(Ct.div,{animate:"enter","aria-describedby":a,"aria-labelledby":i,className:s_({position:u,type:f}),exit:"exit",layoutId:s.layoutId,initial:"initial",ref:p.setFloating,style:f==="drawer"?{width:E}:{height:E},variants:h,...T(),children:[s.title?w.jsx("header",{className:"relative w-full",children:s.title?w.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:s.title}):null}):null,w.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:s.children}),s.footer?w.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:s.footer}):null,o?w.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:w.jsx("button",{type:"button",onClick:k,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:w.jsx(xv,{})})}):null,c&&t?w.jsx(l_,{onChange:s.onChange,parent:p.floating,position:u,sheet:f==="sheet",value:E}):null]})})}):null})})]})},u_=e=>w.jsx(Ct.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),$b=({children:e,followCursor:t=!1,placement:n,enabled:r,as:o,title:s,...i})=>{const[a,l]=b.useState(!1),c=b.useRef(null),u=o||"span",{refs:d,floatingStyles:h,context:f}=Go({open:a,placement:n,transform:!0,onOpenChange:l,whileElementsMounted:Ua,middleware:[Ga(5),Ad({fallbackAxisSideDirection:"start"}),Od(),Sb({element:c,padding:5})]}),p=Ob(f,{move:!0,enabled:r,delay:{open:Lb}}),m=NA(f,{enabled:r}),v=Uo(f,{enabled:r}),g=qo(f,{role:"tooltip",enabled:r}),x=_A(f,{enabled:!!r&&!!t}),{getReferenceProps:y,getFloatingProps:T}=Yo([p,m,v,g,x]);return w.jsxs(b.Fragment,{children:[w.jsx(u,{ref:d.setReference,...y(i),children:s}),w.jsx(Ho,{children:a&&w.jsxs(No,{...T(),ref:d.setFloating,style:h,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[w.jsx(Pb,{ref:c,context:f,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),e]})})]})};class aa{static getDescendantProperty(t,n,r=[]){let o,s,i,a,l,c;if(n){if(i=n.indexOf("."),i===-1?o=n:(o=n.slice(0,i),s=n.slice(i+1)),a=t[o],a!==null&&typeof a<"u")if(!s&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(l=0,c=a.length;l<c;l++)aa.getDescendantProperty(a[l],s,r);else s&&aa.getDescendantProperty(a,s,r)}else r.push(t);return r}}class ro{constructor(t=[],n=[],r={}){Array.isArray(n)||(r=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},r)}search(t=""){if(t==="")return this.haystack;const n=[];for(let r=0;r<this.haystack.length;r++){const o=this.haystack[r];if(this.keys.length===0){const s=ro.isMatch(o,t,this.options.caseSensitive);s&&n.push({item:o,score:s})}else for(let s=0;s<this.keys.length;s++){const i=aa.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=ro.isMatch(i[l],t,this.options.caseSensitive);if(c){a=!0,n.push({item:o,score:c});break}}if(a)break}}return this.options.sort&&n.sort((r,o)=>r.score-o.score),n.map(r=>r.item)}static isMatch(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());const o=ro.nearestIndexesFor(t,n);return o?t===n?1:o.length>1?2+(o[o.length-1]-o[0]):2+o[0]:!1}static nearestIndexesFor(t,n){const r=n.split("");let o=[];return ro.indexesOfFirstLetter(t,n).forEach((i,a)=>{let l=i+1;o[a]=[i];for(let c=1;c<r.length;c++){const u=r[c];if(l=t.indexOf(u,l),l===-1){o[a]=!1;break}o[a].push(l),l++}}),o=o.filter(i=>i!==!1),o.length?o.sort((i,a)=>i.length===1?i[0]-a[0]:(i=i[i.length-1]-i[0],a=a[a.length-1]-a[0],i-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,s)=>o!==r?!1:s).filter(o=>o!==!1)}}const Bb=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>w.jsxs("div",{className:He("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:w.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-error:text-danger",children:[s,e||r?w.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?w.jsx($b,{title:w.jsxs("span",{className:"cursor-help",children:[w.jsx("span",{className:"sr-only",children:r}),w.jsx(bv,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:r}):null,e?w.jsxs(b.Fragment,{children:[w.jsx(vv,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0}),w.jsx(BP,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),Ka=({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:s,right:i,info:a,children:l,error:c,form:u,id:d,labelClassName:h="",name:f,title:p,placeholder:m,hideLeft:v,required:g})=>{const x=d??f,y=zt(),T=e??y.inputOptionalLabel;return w.jsxs("fieldset",{form:u,"data-error":!!c,"data-interactive":!!s,className:He("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[w.jsxs("label",{form:u,htmlFor:x,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-error:text-danger",children:[!v&&!n?w.jsx(Bb,{info:a,hideLeft:v,reportStatus:!0,title:p,placeholder:m,children:T||n?w.jsxs(b.Fragment,{children:[g?null:w.jsx("span",{className:"text-opacity-70",children:T}),n?w.jsx(b.Fragment,{children:n}):null]}):null}):null,w.jsxs("div",{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-error:border-danger ${h}`,children:[t?w.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,l,i?w.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-1",children:i}):null]})]}),w.jsx("p",{className:"mt-input-gap hidden flex-shrink-0 flex-grow-0 whitespace-pre-wrap text-wrap text-xs empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:inline-block group-error:inline-block group-error:text-danger",children:'"erro'}),w.jsx("p",{className:"mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden",children:o})]})},Wb=b.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},s)=>w.jsx("li",{...o,ref:s,role:"option","aria-selected":t,className:"w-full border-b border-tooltip-border last:border-transparent",children:w.jsxs("button",{type:"button","data-value":r.value,onClick:n,"aria-selected":t,"aria-checked":t,"aria-current":t,className:`flex w-full cursor-pointer justify-between p-2 text-left ${t?"bg-primary text-primary-foreground":""} ${e?"bg-primary/70 text-primary-foreground":""}`,children:[r.label??r.value,t?w.jsx("span",{children:w.jsx(LP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})),d_={duration:300,initial:{transform:"scaleY(0)",opacity:.4},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},f_={caseSensitive:!1,sort:!1},h_=[],p_=b.forwardRef(({options:e,dynamicOption:t=!1,feedback:n=null,labelClassName:r,interactive:o,rightLabel:s,optionalText:i,container:a,hideLeft:l=!1,right:c,left:u,error:d,required:h=!1,...f},p)=>{const m=zt(),v=b.useRef(null),[g,x]=b.useState(!1),[y,T]=b.useState(""),[S,E]=b.useState(f.value??f.defaultValue??""),[k,P]=b.useState(f.value??f.defaultValue??""),[I,C]=b.useState(null),N=b.useRef(h_),M=t&&y!==""?[{value:y,label:y,"data-dynamic":"true"},...e]:e,F=new ro(M,["value","label"],f_).search(y),R=t?void 0:`^(${e.map(V=>`${Uc(V.value)}${V.label?"|"+Uc(V.label):""}`).join("|")})$`;b.useEffect(()=>{if(f.value){const V=e.find(Y=>Y.value===f.value);E((V==null?void 0:V.label)??f.value)}},[f.value]);const{x:A,y:D,strategy:L,refs:H,context:U}=Go({open:g,transform:!0,strategy:"absolute",onOpenChange:x,whileElementsMounted:Ua,middleware:[Ga(4),nA({elementContext:"reference",padding:10,apply(V){const ne=V.elements.reference.parentElement,W=ne==null?void 0:ne.getBoundingClientRect().width;Object.assign(V.elements.floating.style,{width:`${W}px`,maxWidth:`${W}px`,minWidth:"max-content",maxHeight:`${Math.min(480,V.availableHeight)}px`})}})]}),O=BA(U,d_),{getReferenceProps:$,getFloatingProps:Z,getItemProps:te}=Yo([qo(U,{role:"listbox"}),Uo(U),Fb(U,{activeIndex:I,allowEscape:!0,cols:0,focusItemOnOpen:"auto",listRef:N,loop:!0,openOnArrowKeyDown:!0,scrollItemIntoView:!0,selectedIndex:I,virtual:!0,onNavigate:V=>C(Y=>V??Y)})]);b.useEffect(()=>{const V=H.reference.current;if(V)return Oa(V)},[]);const Q=(V,Y)=>{var W,Ee;E(V.value),(W=H.reference.current)==null||W.setAttribute("data-value",V.value),P(V.label??"");const ne=Tc(v.current,V.value);ne&&((Ee=f.onChange)==null||Ee.call(f,ne)),x(!1),T(""),C(Y)},G=V=>{var ne;const Y=V.target.value;return T(Y),!g&&Y===""?x(!0):(V.target.name=f.name||"",Y?x(!0):(ne=f.onChange)==null?void 0:ne.call(f,V))},j=()=>{x(!0),T("")},B=()=>{var V;T(""),E(""),(V=H.reference.current)==null||V.setAttribute("data-value",""),P(""),Tc(H.reference.current),x(!1)},z=f.id||f.name;return w.jsxs(Ka,{...f,container:a,error:d,feedback:n,form:f.form,hideLeft:l,id:f.name||f.id,interactive:o,labelClassName:r,left:u,name:f.name,optionalText:i,placeholder:f.placeholder,required:h,rightLabel:s,title:f.title,right:w.jsxs("span",{className:"flex items-center gap-0.5",children:[w.jsxs("button",{type:"button",className:"transition-colors link:text-primary",children:[w.jsx(yv,{size:20}),w.jsx("span",{className:"sr-only",children:m.inputCaretDown})]}),S?w.jsx("button",{type:"button",onClick:B,className:"transition-colors link:text-danger",children:w.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}):null]}),children:[w.jsx("input",{...$({...f,onChange:G,onFocus:j,pattern:R,ref:H.setReference,name:`${z}-shadow`,id:`${z}-shadow`,onClick:V=>V.currentTarget.focus(),onKeyDown(V){if(V.key==="Escape")return V.currentTarget.blur(),x(!1);if(V.key==="Enter"){if(I!==null&&F[I])return V.preventDefault(),Q(F[I],I);if(F.length===1)return V.preventDefault(),Q(F[0],0)}}}),"data-value":S,"data-error":!!d,"data-name":z,"data-target":z,required:h,value:g?y:k||S,"aria-autocomplete":"list",autoComplete:"off",className:He("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary",f.className)}),w.jsx("input",{id:z,name:z,type:"hidden","data-origin":z,ref:p,required:h,defaultValue:f.value||S||void 0}),w.jsx(Ho,{preserveTabOrder:!0,children:g?w.jsx(ri,{guards:!0,returnFocus:!1,context:U,initialFocus:-1,visuallyHiddenDismiss:!0,children:w.jsx("ul",{...Z({ref:H.setFloating,style:{position:L,left:(A??0)+16,top:D??0,...O.styles}}),"data-floating":"true",className:"z-floating m-0 origin-[top_center] list-none overflow-auto overflow-y-auto rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:F.map((V,Y)=>b.createElement(Wb,{...te({onClick:()=>Q(V,Y),ref:ne=>void(N.current[Y]=ne),selected:I===Y,active:S===V.value}),key:`${V.value}-option`,option:V,selected:I===Y,active:S===V.value}))})}):null})]})}),zb=b.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:s,container:i,...a},l)=>w.jsxs("label",{"data-task":t,"data-disabled":a.disabled,"aria-disabled":a.disabled,className:He("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",i),children:[w.jsx("input",{...a,ref:l,type:"checkbox","data-task":t,className:He("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",o)}),e,w.jsx("span",{"data-name":"checkbox-label",className:He("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),oi=b.forwardRef(({type:e="text",feedback:t=null,info:n,labelClassName:r,next:o,interactive:s,rightLabel:i,optionalText:a,container:l,hideLeft:c=!1,right:u,left:d,error:h,...f},p)=>{const m=f.id??f.name,v=b.useRef(null);return b.useEffect(()=>{if(v.current===null)return;const g=v.current,x=Oa(v.current),y=T=>{const S=T;if(S.key==="Enter"&&g.enterKeyHint==="next"){const E=g.getAttribute("data-next");if(E){const k=document.getElementById(E);if(k)return k.focus(),void S.preventDefault()}}};return g.addEventListener("keydown",y),()=>{x(),g.removeEventListener("keydown",y)}},[]),w.jsx(Ka,{info:n,container:l,error:h,feedback:t,hideLeft:c,left:d,optionalText:a,right:u,rightLabel:i,interactive:s,form:f.form,id:f.name||f.id,name:f.name,labelClassName:r,title:f.title,placeholder:f.placeholder,required:f.required,children:w.jsx(Hv,{...f,type:e,"data-next":o,ref:Du(p,v),id:m,name:m,className:He("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary",f.className)})})}),Jp=new Date(1970,11,31),Kl={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},em={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},m_={literal:(e,t)=>t,year:e=>e.getFullYear(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},Zl=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},g_=b.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=b.useId(),l=zt(),c=b.useMemo(()=>new Intl.DateTimeFormat(t),[t]),[u,d]=b.useState(e||void 0),[h,f]=b.useState(!1),p=Zl(c,Jp).flatMap(E=>bn.keyof(Kl,E.type)?Kl[E.type](E.value):[]),m=Zl(c,Jp).reduce((E,k)=>E+(bn.keyof(em,k.type)?em[k.type](k.value):""),""),[v,g]=b.useState(u?Zl(c,u).reduce((E,k)=>E+(bn.keyof(Kl,k.type)?m_[k.type](u,k.value):""),""):""),x=E=>{const k=E.target.value;if(g(k),p.length===k.length&&p.every((I,C)=>{const N=k.charAt(C);return typeof I=="string"?N===I:I.test(N)})){const I=So(Jk(k,m,new Date));return d(I),r==null?void 0:r(I)}return d(void 0),r==null?void 0:r(void 0)},y=E=>(d(E),r==null||r(E),g(E?ek(E,m):"")),T=Pv(u),S=T?u.toISOString():void 0;return w.jsx(oi,{...s,mask:p,value:v,"data-value":S,"data-target":s.name,className:"uppercase",formNoValidate:!h,placeholder:m,onChange:x,required:s.required??!0,error:h?void 0:s.error,name:void 0,id:void 0,right:w.jsxs(b.Fragment,{children:[w.jsx("input",{"data-origin":s.name,defaultValue:S,form:s.form,hidden:!0,id:s.name,name:s.name,ref:i,type:"date"}),w.jsx(Ko,{open:h,onChange:f,trigger:w.jsxs("span",{"aria-labelledby":a,children:[w.jsx("span",{id:a,className:"sr-only",children:l.datePickerCalendarButtonLabel}),w.jsx(FP,{})]}),buttonProps:{"aria-describedby":a},children:w.jsx(eb,{...s,locale:t,changeOnlyOnClick:!0,markToday:o,onChange:y,disabledDate:n,date:T?u:void 0})})]})})}),y_=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],v_=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],b_=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],x_=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],tm=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function nm(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?x_:b_:t.binary?v_:y_,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,s=o?"-":t.signed?"+":"";o&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){const u=tm(e,t.locale,i);return s+u+r+n[0]}const a=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**a,i||(e=e.toPrecision(3));const l=tm(Number(e),t.locale,i),c=n[a];return s+l+r+c}var tu={exports:{}},Si={exports:{}},je={};/** @license React v16.13.1
|
|
177
|
+
*/var lO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],na=lO.join(","),fb=typeof Element>"u",Eo=fb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ra=!fb&&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},oa=function e(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&&e(t.parentNode);return i},cO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},uO=function(t,n,r){if(oa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(na));return n&&Eo.call(t,na)&&o.unshift(t),o=o.filter(r),o},dO=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!oa(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Eo.call(i,na);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),h=!oa(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&h){var f=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},hb=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},pb=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||cO(t))&&!hb(t)?0:t.tabIndex},fO=function(t,n){var r=pb(t);return r<0&&n&&!hb(t)?0:r},hO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},mb=function(t){return t.tagName==="INPUT"},pO=function(t){return mb(t)&&t.type==="hidden"},mO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},gO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},yO=function(t){if(!t.name)return!0;var n=t.form||ra(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=gO(o,t.form);return!s||s===t},vO=function(t){return mb(t)&&t.type==="radio"},bO=function(t){return vO(t)&&!yO(t)},xO=function(t){var n,r=t&&ra(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=ra(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},Ep=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},wO=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Eo.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Eo.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=ra(t);if(l&&!l.shadowRoot&&o(l)===!0)return Ep(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(xO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ep(t);return!1},SO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Eo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},TO=function(t,n){return!(n.disabled||oa(n)||pO(n)||wO(n,t)||mO(n)||SO(n))},Xc=function(t,n){return!(bO(n)||pb(n)<0||!TO(t,n))},EO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},CO=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=fO(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(hO).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ds=function(t,n){n=n||{};var r;return n.getShadowRoot?r=dO([t],n.includeContainer,{filter:Xc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:EO}):r=uO(t,n.includeContainer,Xc.bind(null,n)),CO(r)},PO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Eo.call(t,na)===!1?!1:Xc(n,t)};function Cp(e,t,n){let{reference:r,floating:o}=e;const s=Mr(t),i=Rd(t),a=Pd(i),l=rr(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Bo(t)){case"start":f[i]-=h*(n&&c?-1:1);break;case"end":f[i]+=h*(n&&c?-1:1);break}return f}const RO=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Cp(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:v,fn:g}=a[m],{x,y,data:T,reset:S}=await g({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});u=x??u,d=y??d,f={...f,[v]:{...f[v],...T}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:d}=Cp(c,h,l)),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}};async function kd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=$o(t,e),p=db(f),v=a[h?d==="floating"?"reference":"floating":d],g=ta(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),T=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},S=ta(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:y,strategy:l}):x);return{top:(g.top-S.top+p.top)/T.y,bottom:(S.bottom-g.bottom+p.bottom)/T.y,left:(g.left-S.left+p.left)/T.x,right:(S.right-g.right+p.right)/T.x}}const kO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=$o(e,t)||{};if(c==null)return{};const d=db(u),h={x:n,y:r},f=Rd(o),p=Pd(f),m=await i.getDimensions(c),v=f==="y",g=v?"top":"left",x=v?"bottom":"right",y=v?"clientHeight":"clientWidth",T=s.reference[p]+s.reference[f]-h[f]-s.floating[p],S=h[f]-s.reference[f],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let k=E?E[y]:0;(!k||!await(i.isElement==null?void 0:i.isElement(E)))&&(k=a.floating[y]||s.floating[p]);const P=T/2-S/2,I=k/2-m[p]/2-1,C=yn(d[g],I),N=yn(d[x],I),M=C,F=k-m[p]-N,R=k/2-m[p]/2+P,A=Kc(M,R,F),D=!l.arrow&&Bo(o)!=null&&R!==A&&s.reference[p]/2-(R<M?C:N)-m[p]/2<0,L=D?R<M?R-M:R-F:0;return{[f]:h[f]+L,data:{[f]:A,centerOffset:R-A-L,...D&&{alignmentOffset:L}},reset:D}}}),IO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=$o(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=rr(o),x=Mr(a),y=rr(a)===a,T=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=h||(y||!m?[ea(a)]:oO(a)),E=p!=="none";!h&&E&&S.push(...iO(a,m,p,T));const k=[a,...S],P=await kd(t,v),I=[];let C=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&I.push(P[g]),d){const R=rO(o,i,T);I.push(P[R[0]],P[R[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every(R=>R<=0)){var N,M;const R=(((N=s.flip)==null?void 0:N.index)||0)+1,A=k[R];if(A)return{data:{index:R,overflows:C},reset:{placement:A}};let D=(M=C.filter(L=>L.overflows[0]<=0).sort((L,H)=>L.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!D)switch(f){case"bestFit":{var F;const L=(F=C.filter(H=>{if(E){const U=Mr(H.placement);return U===x||U==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(U=>U>0).reduce((U,O)=>U+O,0)]).sort((H,U)=>H[1]-U[1])[0])==null?void 0:F[0];L&&(D=L);break}case"initialPlacement":D=a;break}if(o!==D)return{reset:{placement:D}}}return{}}}};async function OO(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=rr(n),a=Bo(n),l=Mr(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&l?-1:1,d=$o(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const AO=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,l=await OO(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},_O=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:v=>{let{x:g,y:x}=v;return{x:g,y:x}}},...l}=$o(e,t),c={x:n,y:r},u=await kd(t,l),d=Mr(rr(o)),h=ub(d);let f=c[h],p=c[d];if(s){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",x=f+u[v],y=f-u[g];f=Kc(x,f,y)}if(i){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",x=p+u[v],y=p-u[g];p=Kc(x,p,y)}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},MO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=$o(e,t),l=await kd(t,a),c=rr(n),u=Bo(n),d=Mr(n)==="y",{width:h,height:f}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const v=f-l.top-l.bottom,g=h-l.left-l.right,x=yn(f-l[p],v),y=yn(h-l[m],g),T=!t.middlewareData.shift;let S=x,E=y;if(d?E=u||T?yn(y,g):g:S=u||T?yn(x,v):v,T&&!u){const P=Ht(l.left,0),I=Ht(l.right,0),C=Ht(l.top,0),N=Ht(l.bottom,0);d?E=h-2*(P!==0||I!==0?P+I:Ht(l.left,l.right)):S=f-2*(C!==0||N!==0?C+N:Ht(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:S});const k=await o.getDimensions(s.floating);return h!==k.width||f!==k.height?{reset:{rects:!0}}:{}}}};function gb(e){const t=Zt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ut(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ji(n)!==s||Ji(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Id(e){return $e(e)?e:e.contextElement}function so(e){const t=Id(e);if(!ut(t))return nr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gb(t);let i=(s?Ji(n.width):n.width)/r,a=(s?Ji(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const DO=nr(0);function yb(e){const t=Nt(e);return!wd()||!t.visualViewport?DO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nt(e)?!1:t}function Dr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Id(e);let i=nr(1);t&&(r?$e(r)&&(i=so(r)):i=so(e));const a=jO(s,n,r)?yb(s):nr(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const h=Nt(s),f=r&&$e(r)?Nt(r):r;let p=h,m=Yc(p);for(;m&&r&&f!==p;){const v=so(m),g=m.getBoundingClientRect(),x=Zt(m),y=g.left+(m.clientLeft+parseFloat(x.paddingLeft))*v.x,T=g.top+(m.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=y,c+=T,p=Nt(m),m=Yc(p)}}return ta({width:u,height:d,x:l,y:c})}function NO(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=$n(r),a=t?za(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=nr(1);const u=nr(0),d=ut(r);if((d||!d&&!s)&&((cr(r)!=="body"||ti(i))&&(l=Ha(r)),ut(r))){const h=Dr(r);c=so(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function FO(e){return Array.from(e.getClientRects())}function vb(e){return Dr($n(e)).left+Ha(e).scrollLeft}function LO(e){const t=$n(e),n=Ha(e),r=e.ownerDocument.body,o=Ht(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ht(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+vb(e);const a=-n.scrollTop;return Zt(r).direction==="rtl"&&(i+=Ht(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function VO(e,t){const n=Nt(e),r=$n(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=wd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function $O(e,t){const n=Dr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ut(e)?so(e):nr(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Pp(e,t,n){let r;if(t==="viewport")r=VO(e,n);else if(t==="document")r=LO($n(e));else if($e(t))r=$O(t,n);else{const o=yb(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ta(r)}function bb(e,t){const n=Fn(e);return n===t||!$e(n)||tr(n)?!1:Zt(n).position==="fixed"||bb(n,t)}function BO(e,t){const n=t.get(e);if(n)return n;let r=Xn(e,[],!1).filter(a=>$e(a)&&cr(a)!=="body"),o=null;const s=Zt(e).position==="fixed";let i=s?Fn(e):e;for(;$e(i)&&!tr(i);){const a=Zt(i),l=xd(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ti(i)&&!l&&bb(e,i))?r=r.filter(u=>u!==i):o=a,i=Fn(i)}return t.set(e,r),r}function WO(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?za(t)?[]:BO(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=Pp(t,u,o);return c.top=Ht(d.top,c.top),c.right=yn(d.right,c.right),c.bottom=yn(d.bottom,c.bottom),c.left=Ht(d.left,c.left),c},Pp(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function zO(e){const{width:t,height:n}=gb(e);return{width:t,height:n}}function HO(e,t,n){const r=ut(t),o=$n(t),s=n==="fixed",i=Dr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=nr(0);if(r||!r&&!s)if((cr(t)!=="body"||ti(o))&&(a=Ha(t)),r){const d=Dr(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=vb(o));const c=i.left+a.scrollLeft-l.x,u=i.top+a.scrollTop-l.y;return{x:c,y:u,width:i.width,height:i.height}}function Vl(e){return Zt(e).position==="static"}function Rp(e,t){return!ut(e)||Zt(e).position==="fixed"?null:t?t(e):e.offsetParent}function xb(e,t){const n=Nt(e);if(za(e))return n;if(!ut(e)){let o=Fn(e);for(;o&&!tr(o);){if($e(o)&&!Vl(o))return o;o=Fn(o)}return n}let r=Rp(e,t);for(;r&&KI(r)&&Vl(r);)r=Rp(r,t);return r&&tr(r)&&Vl(r)&&!xd(r)?n:r||ZI(e)||n}const UO=async function(e){const t=this.getOffsetParent||xb,n=this.getDimensions,r=await n(e.floating);return{reference:HO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GO(e){return Zt(e).direction==="rtl"}const YO={convertOffsetParentRelativeRectToViewportRelativeRect:NO,getDocumentElement:$n,getClippingRect:WO,getOffsetParent:xb,getElementRects:UO,getClientRects:FO,getDimensions:zO,getScale:so,isElement:$e,isRTL:GO};function qO(e,t){let n=null,r;const o=$n(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=no(u),p=no(o.clientWidth-(c+d)),m=no(o.clientHeight-(u+h)),v=no(c),x={rootMargin:-f+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Ht(0,yn(1,l))||1};let y=!0;function T(S){const E=S[0].intersectionRatio;if(E!==l){if(!y)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(T,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,x)}n.observe(e)}return i(!0),s}function Ua(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:l=!1}=r,c=Id(e),u=o||s?[...c?Xn(c):[],...Xn(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=c&&a?qO(c,n):null;let h=-1,f=null;i&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,m=l?Dr(e):null;l&&v();function v(){const g=Dr(e);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(v)}return n(),()=>{var g;u.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),d==null||d(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const KO=AO,ZO=_O,XO=IO,QO=MO,kp=kO,JO=(e,t,n)=>{const r=new Map,o={platform:YO,...n},s={...o.platform,_c:r};return RO(e,t,{...o,platform:s})};var _i=typeof document<"u"?b.useLayoutEffect:b.useEffect;function sa(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(!sa(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)&&!sa(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function wb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ip(e,t){const n=wb(e);return Math.round(t*n)/n}function Op(e){const t=_.useRef(e);return _i(()=>{t.current=e}),t}function eA(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:l,open:c}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=_.useState(r);sa(h,r)||f(r);const[p,m]=_.useState(null),[v,g]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,m(L))},[]),y=_.useCallback(L=>{L!==k.current&&(k.current=L,g(L))},[]),T=s||p,S=i||v,E=_.useRef(null),k=_.useRef(null),P=_.useRef(u),I=l!=null,C=Op(l),N=Op(o),M=_.useCallback(()=>{if(!E.current||!k.current)return;const L={placement:t,strategy:n,middleware:h};N.current&&(L.platform=N.current),JO(E.current,k.current,L).then(H=>{const U={...H,isPositioned:!0};F.current&&!sa(P.current,U)&&(P.current=U,ig.flushSync(()=>{d(U)}))})},[h,t,n,N]);_i(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const F=_.useRef(!1);_i(()=>(F.current=!0,()=>{F.current=!1}),[]),_i(()=>{if(T&&(E.current=T),S&&(k.current=S),T&&S){if(C.current)return C.current(T,S,M);M()}},[T,S,M,C,I]);const R=_.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:y}),[x,y]),A=_.useMemo(()=>({reference:T,floating:S}),[T,S]),D=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!A.floating)return L;const H=Ip(A.floating,u.x),U=Ip(A.floating,u.y);return a?{...L,transform:"translate("+H+"px, "+U+"px)",...wb(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,A.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:M,refs:R,elements:A,floatingStyles:D}),[u,M,R,A,D])}const tA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?kp({element:r.current,padding:o}).fn(n):{}:r?kp({element:r,padding:o}).fn(n):{}}}},Ga=(e,t)=>({...KO(e),options:[e,t]}),Od=(e,t)=>({...ZO(e),options:[e,t]}),Ad=(e,t)=>({...XO(e),options:[e,t]}),nA=(e,t)=>({...QO(e),options:[e,t]}),Sb=(e,t)=>({...tA(e),options:[e,t]});function Qc(e){return _.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Tb={..._},rA=Tb.useInsertionEffect,oA=rA||(e=>e());function yt(e){const t=_.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return oA(()=>{t.current=e}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const _d="ArrowUp",ni="ArrowDown",Co="ArrowLeft",Wo="ArrowRight";function bi(e,t,n){return Math.floor(e/t)!==n}function Ss(e,t){return t<0||t>=e.current.length}function $l(e,t){return Ot(e,{disabledIndices:t})}function Ap(e,t){return Ot(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ot(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=t===void 0?{}:t;const i=e.current;let a=n;do a+=r?-s:s;while(a>=0&&a<=i.length-1&&Mi(i,a,o));return a}function sA(e,t){let{event:n,orientation:r,loop:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===_d){if(u&&Et(n),c===-1)d=l;else if(d=Ot(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||d<0)){const h=c%s,f=l%s,p=l-(f-h);f===h?d=l:d=f>h?p:p-s}Ss(e,d)&&(d=c)}if(n.key===ni&&(u&&Et(n),c===-1?d=a:(d=Ot(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>l&&(d=Ot(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),Ss(e,d)&&(d=c)),r==="both"){const h=no(c/s);n.key===Wo&&(u&&Et(n),c%s!==s-1?(d=Ot(e,{startingIndex:c,disabledIndices:i}),o&&bi(d,s,h)&&(d=Ot(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(d=Ot(e,{startingIndex:c-c%s-1,disabledIndices:i})),bi(d,s,h)&&(d=c)),n.key===Co&&(u&&Et(n),c%s!==0?(d=Ot(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&bi(d,s,h)&&(d=Ot(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(d=Ot(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),bi(d,s,h)&&(d=c));const f=no(l/s)===h;Ss(e,d)&&(o&&f?d=n.key===Co?l:Ot(e,{startingIndex:c-c%s-1,disabledIndices:i}):d=c)}return d}function iA(e,t,n){const r=[];let o=0;return e.forEach((s,i)=>{let{width:a,height:l}=s;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const u=[];for(let d=0;d<a;d++)for(let h=0;h<l;h++)u.push(o+d+h*t);o%t+a<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=i}),c=!0):o++}}),[...r]}function aA(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)}}function lA(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Mi(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}let _p=0;function Yn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(_p);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():_p=requestAnimationFrame(s)}var ke=typeof document<"u"?b.useLayoutEffect:b.useEffect;function cA(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 uA(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const Eb=_.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function dA(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,s]=_.useState(()=>new Map),i=_.useCallback(l=>{s(c=>new Map(c).set(l,null))},[]),a=_.useCallback(l=>{s(c=>{const u=new Map(c);return u.delete(l),u})},[]);return ke(()=>{const l=new Map(o);Array.from(l.keys()).sort(cA).forEach((u,d)=>{l.set(u,d)}),uA(o,l)||s(l)},[o]),_.createElement(Eb.Provider,{value:_.useMemo(()=>({register:i,unregister:a,map:o,elementsRef:n,labelsRef:r}),[i,a,o,n,r])},t)}function Cb(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:s,labelsRef:i}=_.useContext(Eb),[a,l]=_.useState(null),c=_.useRef(null),u=_.useCallback(d=>{if(c.current=d,a!==null&&(s.current[a]=d,i)){var h;const f=t!==void 0;i.current[a]=f?t:(h=d==null?void 0:d.textContent)!=null?h:null}},[a,s,i,t]);return ke(()=>{const d=c.current;if(d)return n(d),()=>{r(d)}},[n,r]),ke(()=>{const d=c.current?o.get(c.current):null;d!=null&&l(d)},[o]),_.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}let Mp=!1,fA=0;const Dp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fA++;function hA(){const[e,t]=_.useState(()=>Mp?Dp():void 0);return ke(()=>{e==null&&t(Dp())},[]),_.useEffect(()=>{Mp=!0},[]),e}const pA=Tb.useId,zo=pA||hA;let js;process.env.NODE_ENV!=="production"&&(js=new Set);function Di(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=js)!=null&&e.has(o))){var s;(s=js)==null||s.add(o),console.warn(o)}}function mA(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=js)!=null&&e.has(o))){var s;(s=js)==null||s.add(o),console.error(o)}}const Pb=_.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:h,style:{transform:f,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||Di("The `ref` prop is required for `FloatingArrow`."));const v=zo(),[g,x]=_.useState(!1);if(ke(()=>{if(!o)return;Zt(o).direction==="rtl"&&x(!0)},[o]),!o)return null;const y=c*2,T=y/2,S=i/2*(l/-8+1),E=a/2*l/4,[k,P]=r.split("-"),I=!!h,C=k==="top"||k==="bottom",N=u&&P==="end"?"bottom":"top";let M=u&&P==="end"?"right":"left";u&&g&&(M=P==="end"?"left":"right");const F=(s==null?void 0:s.x)!=null?u||s.x:"",R=(s==null?void 0:s.y)!=null?u||s.y:"",A=h||"M0,0"+(" H"+i)+(" L"+(i-S)+","+(a-E))+(" Q"+i/2+","+a+" "+S+","+(a-E))+" Z",D={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[k];return _.createElement("svg",Po({},m,{"aria-hidden":!0,ref:n,width:I?i:i+y,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[M]:F,[N]:R,[k]:C||I?"100%":"calc(100% - "+y/2+"px)",transform:""+D+(f??""),...p}}),y>0&&_.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:d,strokeWidth:y+(h?0:1),d:A}),_.createElement("path",{stroke:y&&!h?m.fill:"none",d:A}),_.createElement("clipPath",{id:v},_.createElement("rect",{x:-T,y:T*(I?-1:1),width:i+y,height:i})))});function Rb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const kb=_.createContext(null),Ib=_.createContext(null),ur=()=>{var e;return((e=_.useContext(kb))==null?void 0:e.id)||null},dr=()=>_.useContext(Ib);function gA(e){const t=zo(),n=dr(),o=ur();return ke(()=>{const s={id:t,parentId:o};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,o]),t}function yA(e){const{children:t,id:n}=e,r=ur();return _.createElement(kb.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function vA(e){const{children:t}=e,n=_.useRef([]),r=_.useCallback(i=>{n.current=[...n.current,i]},[]),o=_.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),s=_.useState(()=>Rb())[0];return _.createElement(Ib.Provider,{value:_.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s])},t)}function or(e){return"data-floating-ui-"+e}function Pt(e){const t=b.useRef(e);return ke(()=>{t.current=e}),t}const jp=or("safe-polygon");function Bl(e,t,n){return n&&!To(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function Ob(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:h=!0}=t,f=dr(),p=ur(),m=Pt(c),v=Pt(l),g=Pt(n),x=_.useRef(),y=_.useRef(-1),T=_.useRef(),S=_.useRef(-1),E=_.useRef(!0),k=_.useRef(!1),P=_.useRef(()=>{}),I=_.useCallback(()=>{var A;const D=(A=o.current.openEvent)==null?void 0:A.type;return(D==null?void 0:D.includes("mouse"))&&D!=="mousedown"},[o]);_.useEffect(()=>{if(!a)return;function A(D){let{open:L}=D;L||(clearTimeout(y.current),clearTimeout(S.current),E.current=!0)}return s.on("openchange",A),()=>{s.off("openchange",A)}},[a,s]),_.useEffect(()=>{if(!a||!m.current||!n)return;function A(L){I()&&r(!1,L,"hover")}const D=xt(i.floating).documentElement;return D.addEventListener("mouseleave",A),()=>{D.removeEventListener("mouseleave",A)}},[i.floating,n,r,a,m,I]);const C=_.useCallback(function(A,D,L){D===void 0&&(D=!0),L===void 0&&(L="hover");const H=Bl(v.current,"close",x.current);H&&!T.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,A,L),H)):D&&(clearTimeout(y.current),r(!1,A,L))},[v,r]),N=yt(()=>{P.current(),T.current=void 0}),M=yt(()=>{if(k.current){const A=xt(i.floating).body;A.style.pointerEvents="",A.removeAttribute(jp),k.current=!1}});_.useEffect(()=>{if(!a)return;function A(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function D(O){if(clearTimeout(y.current),E.current=!1,u&&!To(x.current)||d>0&&!Bl(v.current,"open"))return;const $=Bl(v.current,"open",x.current);$?y.current=window.setTimeout(()=>{g.current||r(!0,O,"hover")},$):r(!0,O,"hover")}function L(O){if(A())return;P.current();const $=xt(i.floating);if(clearTimeout(S.current),m.current&&o.current.floatingContext){n||clearTimeout(y.current),T.current=m.current({...o.current.floatingContext,tree:f,x:O.clientX,y:O.clientY,onClose(){M(),N(),C(O,!0,"safe-polygon")}});const te=T.current;$.addEventListener("mousemove",te),P.current=()=>{$.removeEventListener("mousemove",te)};return}(x.current==="touch"?!nt(i.floating,O.relatedTarget):!0)&&C(O)}function H(O){A()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:f,x:O.clientX,y:O.clientY,onClose(){M(),N(),C(O)}})(O))}if($e(i.domReference)){var U;const O=i.domReference;return n&&O.addEventListener("mouseleave",H),(U=i.floating)==null||U.addEventListener("mouseleave",H),h&&O.addEventListener("mousemove",D,{once:!0}),O.addEventListener("mouseenter",D),O.addEventListener("mouseleave",L),()=>{var $;n&&O.removeEventListener("mouseleave",H),($=i.floating)==null||$.removeEventListener("mouseleave",H),h&&O.removeEventListener("mousemove",D),O.removeEventListener("mouseenter",D),O.removeEventListener("mouseleave",L)}}},[i,a,e,u,d,h,C,N,M,r,n,g,f,v,m,o]),ke(()=>{var A;if(a&&n&&(A=m.current)!=null&&A.__options.blockPointerEvents&&I()){const L=xt(i.floating).body;L.setAttribute(jp,""),L.style.pointerEvents="none",k.current=!0;const H=i.floating;if($e(i.domReference)&&H){var D;const U=i.domReference,O=f==null||(D=f.nodesRef.current.find($=>$.id===p))==null||(D=D.context)==null?void 0:D.elements.floating;return O&&(O.style.pointerEvents=""),U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,i,f,m,I]),ke(()=>{n||(x.current=void 0,N(),M())},[n,N,M]),_.useEffect(()=>()=>{N(),clearTimeout(y.current),clearTimeout(S.current),M()},[a,i.domReference,N,M]);const F=_.useMemo(()=>{function A(D){x.current=D.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(D){const{nativeEvent:L}=D;function H(){!E.current&&!g.current&&r(!0,L,"hover")}u&&!To(x.current)||n||d===0||(clearTimeout(S.current),x.current==="touch"?H():S.current=window.setTimeout(H,d))}}},[u,r,n,g,d]),R=_.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(A){C(A.nativeEvent,!1)}}),[C]);return _.useMemo(()=>a?{reference:F,floating:R}:{},[a,F,R])}function bA(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function _r(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var a;return o.parentId===i.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function xA(e,t){let n,r=-1;function o(s,i){i>r&&(n=s,r=i),_r(e,s).forEach(l=>{o(l.id,i+1)})}return o(t,0),e.find(s=>s.id===n)}let qr=new WeakMap,xi=new WeakSet,wi={},Wl=0;const wA=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ab=e=>e&&(e.host||Ab(e.parentNode)),SA=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ab(n);return e.contains(r)?r:null}).filter(n=>n!=null);function TA(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=SA(t,e),a=new Set,l=new Set(i),c=[];wi[o]||(wi[o]=new WeakMap);const u=wi[o];i.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||[].forEach.call(f.children,p=>{if(cr(p)!=="script")if(a.has(p))h(p);else{const m=s?p.getAttribute(s):null,v=m!==null&&m!=="false",g=(qr.get(p)||0)+1,x=(u.get(p)||0)+1;qr.set(p,g),u.set(p,x),c.push(p),g===1&&v&&xi.add(p),x===1&&p.setAttribute(o,""),!v&&s&&p.setAttribute(s,"true")}})}return Wl++,()=>{c.forEach(f=>{const p=(qr.get(f)||0)-1,m=(u.get(f)||0)-1;qr.set(f,p),u.set(f,m),p||(!xi.has(f)&&s&&f.removeAttribute(s),xi.delete(f)),m||f.removeAttribute(o)}),Wl--,Wl||(qr=new WeakMap,qr=new WeakMap,xi=new WeakSet,wi={})}}function Np(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=xt(e[0]).body;return TA(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ro=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _b(e,t){const n=Ds(e,Ro());t==="prev"&&n.reverse();const r=n.indexOf(tn(xt(e)));return n.slice(r+1)[0]}function Mb(){return _b(document.body,"next")}function Db(){return _b(document.body,"prev")}function Ts(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!nt(n,r)}function EA(e){Ds(e,Ro()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function CA(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 PA(e,t,n){const r=e.indexOf(t);function o(i){const a=or("focus-guard");let l=r+(i?1:0),c=e[l];for(;c&&(!c.isConnected||c.hasAttribute(a)||nt(n,c));)i?l++:l--,c=e[l];return c}const s=o(!0);return s||o(!1)}const Md={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let RA;function Fp(e){e.key==="Tab"&&(e.target,clearTimeout(RA))}const ia=_.forwardRef(function(t,n){const[r,o]=_.useState();ke(()=>(Ed()&&o("button"),document.addEventListener("keydown",Fp),()=>{document.removeEventListener("keydown",Fp)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[or("focus-guard")]:"",style:Md};return _.createElement("span",Po({},t,s))}),jb=_.createContext(null),Lp=or("portal");function kA(e){e===void 0&&(e={});const{id:t,root:n}=e,r=zo(),o=Nb(),[s,i]=_.useState(null),a=_.useRef(null);return ke(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),ke(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Lp,""),l.appendChild(c),a.current=c,i(c)},[t,r]),ke(()=>{if(!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!$e(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Lp,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Ho(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,s=kA({id:n,root:r}),[i,a]=_.useState(null),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return _.useEffect(()=>{if(!s||!o||i!=null&&i.modal)return;function f(p){s&&Ts(p)&&(p.type==="focusin"?CA:EA)(s)}return s.addEventListener("focusin",f,!0),s.addEventListener("focusout",f,!0),()=>{s.removeEventListener("focusin",f,!0),s.removeEventListener("focusout",f,!0)}},[s,o,i==null?void 0:i.modal]),_.createElement(jb.Provider,{value:_.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s])},h&&s&&_.createElement(ia,{"data-type":"outside",ref:l,onFocus:f=>{if(Ts(f,s)){var p;(p=u.current)==null||p.focus()}else{const m=Db()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus()}}}),h&&s&&_.createElement("span",{"aria-owns":s.id,style:Md}),s&&ig.createPortal(t,s),h&&s&&_.createElement(ia,{"data-type":"outside",ref:c,onFocus:f=>{if(Ts(f,s)){var p;(p=d.current)==null||p.focus()}else{const m=Mb()||(i==null?void 0:i.refs.domReference.current);m==null||m.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,f.nativeEvent))}}}))}const Nb=()=>_.useContext(jb),Vp=20;let Sr=[];function zl(e){Sr=Sr.filter(n=>n.isConnected);let t=e;if(!(!t||cr(t)==="body")){if(!PO(t,Ro())){const n=Ds(t,Ro())[0];n&&(t=n)}Sr.push(t),Sr.length>Vp&&(Sr=Sr.slice(-Vp))}}function $p(){return Sr.slice().reverse().find(e=>e.isConnected)}const IA=_.forwardRef(function(t,n){return _.createElement("button",Po({},t,{type:"button",ref:n,tabIndex:-1,style:Md}))});function ri(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:h,refs:f,nodeId:p,onOpenChange:m,events:v,dataRef:g,floatingId:x,elements:{domReference:y,floating:T}}=t,S=typeof i=="number"&&i<0,E=cb(y)&&S,k=wA()?s:!0,P=Pt(o),I=Pt(i),C=Pt(a),N=dr(),M=Nb(),F=_.useRef(null),R=_.useRef(null),A=_.useRef(!1),D=_.useRef(!1),L=_.useRef(-1),H=M!=null,U=T==null?void 0:T.firstElementChild,O=(U==null?void 0:U.id)===x?U:T,$=yt(function(G){return G===void 0&&(G=O),G?Ds(G,Ro()):[]}),Z=yt(G=>{const j=$(G);return P.current.map(B=>y&&B==="reference"?y:O&&B==="floating"?O:j).filter(Boolean).flat()});_.useEffect(()=>{if(r||!c)return;function G(B){if(B.key==="Tab"){nt(O,tn(xt(O)))&&$().length===0&&!E&&Et(B);const z=Z(),V=gn(B);P.current[0]==="reference"&&V===y&&(Et(B),B.shiftKey?Yn(z[z.length-1]):Yn(z[1])),P.current[1]==="floating"&&V===O&&B.shiftKey&&(Et(B),Yn(z[0]))}}const j=xt(O);return j.addEventListener("keydown",G),()=>{j.removeEventListener("keydown",G)}},[r,y,O,c,P,E,$,Z]),_.useEffect(()=>{if(r||!T)return;function G(j){const B=gn(j),V=$().indexOf(B);V!==-1&&(L.current=V)}return T.addEventListener("focusin",G),()=>{T.removeEventListener("focusin",G)}},[r,T,$]),_.useEffect(()=>{if(r||!d)return;function G(){D.current=!0,setTimeout(()=>{D.current=!1})}function j(B){const z=B.relatedTarget;queueMicrotask(()=>{const V=!(nt(y,z)||nt(T,z)||nt(z,T)||nt(M==null?void 0:M.portalNode,z)||z!=null&&z.hasAttribute(or("focus-guard"))||N&&(_r(N.nodesRef.current,p).find(Y=>{var ne,W;return nt((ne=Y.context)==null?void 0:ne.elements.floating,z)||nt((W=Y.context)==null?void 0:W.elements.domReference,z)})||bA(N.nodesRef.current,p).find(Y=>{var ne,W;return((ne=Y.context)==null?void 0:ne.elements.floating)===z||((W=Y.context)==null?void 0:W.elements.domReference)===z})));if(l&&V&&tn(xt(O))===xt(O).body){ut(O)&&(O==null||O.focus());const Y=L.current,ne=$(),W=ne[Y]||ne[ne.length-1]||O;ut(W)&&W.focus()}(E||!c)&&z&&V&&!D.current&&z!==$p()&&(A.current=!0,m(!1,B))})}if(T&&ut(y))return y.addEventListener("focusout",j),y.addEventListener("pointerdown",G),T.addEventListener("focusout",j),()=>{y.removeEventListener("focusout",j),y.removeEventListener("pointerdown",G),T.removeEventListener("focusout",j)}},[r,y,T,O,c,p,N,M,m,d,l,$,E]),_.useEffect(()=>{var G;if(r)return;const j=Array.from((M==null||(G=M.portalNode)==null?void 0:G.querySelectorAll("["+or("portal")+"]"))||[]);if(T){const B=[T,...j,F.current,R.current,P.current.includes("reference")||E?y:null].filter(V=>V!=null),z=c||E?Np(B,k,!k):Np(B);return()=>{z()}}},[r,y,T,c,P,M,E,k]),ke(()=>{if(r||!ut(O))return;const G=xt(O),j=tn(G);queueMicrotask(()=>{const B=Z(O),z=I.current,V=(typeof z=="number"?B[z]:z.current)||O,Y=nt(O,j);!S&&!Y&&h&&Yn(V,{preventScroll:V===O})})},[r,h,O,S,Z,I]),ke(()=>{if(r||!O)return;let G=!1;const j=xt(O),B=tn(j);let V=g.current.openEvent;const Y=f.domReference.current;zl(B);function ne(W){let{open:Ee,reason:et,event:ze,nested:tt}=W;Ee&&(V=ze),et==="escape-key"&&f.domReference.current&&zl(f.domReference.current),et==="hover"&&ze.type==="mouseleave"&&(A.current=!0),et==="outside-press"&&(tt?(A.current=!1,G=!0):A.current=!(ab(ze)||Td(ze)))}return v.on("openchange",ne),()=>{v.off("openchange",ne);const W=tn(j),Ee=nt(T,W)||N&&_r(N.nodesRef.current,p).some(ce=>{var Te;return nt((Te=ce.context)==null?void 0:Te.elements.floating,W)});(Ee||V&&["click","mousedown"].includes(V.type))&&f.domReference.current&&zl(f.domReference.current);const ze=Y||B,tt=Ds(xt(ze).body,Ro());queueMicrotask(()=>{let ce=$p();!ce&&ut(ze)&&T&&(ce=PA(tt,ze,T)),C.current&&!A.current&&ut(ce)&&(!(ce!==W&&W!==j.body)||Ee)&&ce.focus({preventScroll:G})})}},[r,T,O,C,g,f,v,N,p]),ke(()=>{if(!r&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:d,open:h,onOpenChange:m,refs:f}),()=>{M.setFocusManagerState(null)}},[r,M,c,h,m,f,d]),ke(()=>{if(r||!O||typeof MutationObserver!="function"||S)return;const G=()=>{const B=O.getAttribute("tabindex"),z=$(),V=tn(xt(T)),Y=z.indexOf(V);Y!==-1&&(L.current=Y),P.current.includes("floating")||V!==f.domReference.current&&z.length===0?B!=="0"&&O.setAttribute("tabindex","0"):B!=="-1"&&O.setAttribute("tabindex","-1")};G();const j=new MutationObserver(G);return j.observe(O,{childList:!0,subtree:!0,attributes:!0}),()=>{j.disconnect()}},[r,T,O,f,P,$,S]);function te(G){return r||!u||!c?null:_.createElement(IA,{ref:G==="start"?F:R,onClick:j=>m(!1,j.nativeEvent)},typeof u=="string"?u:"Dismiss")}const Q=!r&&k&&(c?!E:!0)&&(H||c);return _.createElement(_.Fragment,null,Q&&_.createElement(ia,{"data-type":"inside",ref:M==null?void 0:M.beforeInsideRef,onFocus:G=>{if(c){const B=Z();Yn(o[0]==="reference"?B[0]:B[B.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(A.current=!1,Ts(G,M.portalNode)){const B=Mb()||y;B==null||B.focus()}else{var j;(j=M.beforeOutsideRef.current)==null||j.focus()}}}),!E&&te("start"),n,te("end"),Q&&_.createElement(ia,{"data-type":"inside",ref:M==null?void 0:M.afterInsideRef,onFocus:G=>{if(c)Yn(Z()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(d&&(A.current=!0),Ts(G,M.portalNode)){const B=Db()||y;B==null||B.focus()}else{var j;(j=M.afterOutsideRef.current)==null||j.focus()}}}))}const Hl=new Set,OA=_.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,s=zo();return ke(()=>{if(!r)return;Hl.add(s);const i=/iP(hone|ad|od)|iOS/.test(Sd()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,d=a.left?parseFloat(a.left):window.scrollX,h=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[c]=u+"px"),i){var f,p;const m=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,v=((p=window.visualViewport)==null?void 0:p.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(h-Math.floor(v))+"px",left:-(d-Math.floor(m))+"px",right:"0"})}return()=>{Hl.delete(s),Hl.size===0&&(Object.assign(a,{overflow:"",[c]:""}),i&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(d,h)))}},[s,r]),_.createElement("div",Po({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function Bp(e){return ut(e.target)&&e.target.tagName==="BUTTON"}function Wp(e){return Cd(e)}function Ya(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=_.useRef(),h=_.useRef(!1),f=_.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(To(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}To(m,!0)&&c||(n&&l&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||Bp(p))&&(p.key===" "&&!Wp(s)&&(p.preventDefault(),h.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Bp(p)||Wp(s)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,l]);return _.useMemo(()=>i?{reference:f}:{},[i,f])}function AA(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var s;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(((s=t.dataRef.current.openEvent)==null?void 0:s.type)||"")&&t.pointerType!=="touch";let u=i.width,d=i.height,h=i.x,f=i.y;return n==null&&t.x&&a&&(n=i.x-t.x),r==null&&t.y&&l&&(r=i.y-t.y),h-=n||0,f-=r||0,u=0,d=0,!o||c?(u=t.axis==="y"?i.width:0,d=t.axis==="x"?i.height:0,h=a&&t.x!=null?t.x:h,f=l&&t.y!=null?t.y:f):o&&!c&&(d=t.axis==="x"?i.height:d,u=t.axis==="y"?i.width:u),o=!0,{width:u,height:d,x:h,y:f,top:f,right:h+u,bottom:f+d,left:h}}}}function zp(e){return e!=null&&e.clientX!=null}function _A(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:s},refs:i}=e,{enabled:a=!0,axis:l="both",x:c=null,y:u=null}=t,d=_.useRef(!1),h=_.useRef(null),[f,p]=_.useState(),[m,v]=_.useState([]),g=yt((E,k)=>{d.current||r.current.openEvent&&!zp(r.current.openEvent)||i.setPositionReference(AA(s,{x:E,y:k,axis:l,dataRef:r,pointerType:f}))}),x=yt(E=>{c!=null||u!=null||(n?h.current||v([]):g(E.clientX,E.clientY))}),y=To(f)?o:n,T=_.useCallback(()=>{if(!y||!a||c!=null||u!=null)return;const E=Nt(o);function k(P){const I=gn(P);nt(o,I)?(E.removeEventListener("mousemove",k),h.current=null):g(P.clientX,P.clientY)}if(!r.current.openEvent||zp(r.current.openEvent)){E.addEventListener("mousemove",k);const P=()=>{E.removeEventListener("mousemove",k),h.current=null};return h.current=P,P}i.setPositionReference(s)},[y,a,c,u,o,r,i,s,g]);_.useEffect(()=>T(),[T,m]),_.useEffect(()=>{a&&!o&&(d.current=!1)},[a,o]),_.useEffect(()=>{!a&&n&&(d.current=!0)},[a,n]),ke(()=>{a&&(c!=null||u!=null)&&(d.current=!1,g(c,u))},[a,c,u,g]);const S=_.useMemo(()=>{function E(k){let{pointerType:P}=k;p(P)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:x,onMouseEnter:x}},[x]);return _.useMemo(()=>a?{reference:S}:{},[a,S])}const MA={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},DA={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Hp=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Uo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:p}=t,m=dr(),v=yt(typeof l=="function"?l:()=>!1),g=typeof l=="function"?v:l,x=_.useRef(!1),y=_.useRef(!1),{escapeKey:T,outsidePress:S}=Hp(f),{escapeKey:E,outsidePress:k}=Hp(p),P=yt(R=>{var A;if(!n||!i||!a||R.key!=="Escape")return;const D=(A=s.current.floatingContext)==null?void 0:A.nodeId,L=m?_r(m.nodesRef.current,D):[];if(!T&&(R.stopPropagation(),L.length>0)){let H=!0;if(L.forEach(U=>{var O;if((O=U.context)!=null&&O.open&&!U.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,QI(R)?R.nativeEvent:R,"escape-key")}),I=yt(R=>{var A;const D=()=>{var L;P(R),(L=gn(R))==null||L.removeEventListener("keydown",D)};(A=gn(R))==null||A.addEventListener("keydown",D)}),C=yt(R=>{var A;const D=x.current;x.current=!1;const L=y.current;if(y.current=!1,c==="click"&&L||D||typeof g=="function"&&!g(R))return;const H=gn(R),U="["+or("inert")+"]",O=xt(o.floating).querySelectorAll(U);let $=$e(H)?H:null;for(;$&&!tr($);){const G=Fn($);if(tr(G)||!$e(G))break;$=G}if(O.length&&$e(H)&&!JI(H)&&!nt(H,o.floating)&&Array.from(O).every(G=>!nt($,G)))return;if(ut(H)&&F){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,j=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let B=j&&R.offsetX>H.clientWidth;if(j&&Zt(H).direction==="rtl"&&(B=R.offsetX<=H.offsetWidth-H.clientWidth),B||G&&R.offsetY>H.clientHeight)return}const Z=(A=s.current.floatingContext)==null?void 0:A.nodeId,te=m&&_r(m.nodesRef.current,Z).some(G=>{var j;return Ll(R,(j=G.context)==null?void 0:j.elements.floating)});if(Ll(R,o.floating)||Ll(R,o.domReference)||te)return;const Q=m?_r(m.nodesRef.current,Z):[];if(Q.length>0){let G=!0;if(Q.forEach(j=>{var B;if((B=j.context)!=null&&B.open&&!j.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,R,"outside-press")}),N=yt(R=>{var A;const D=()=>{var L;C(R),(L=gn(R))==null||L.removeEventListener(c,D)};(A=gn(R))==null||A.addEventListener(c,D)});_.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=S;function R(L){r(!1,L,"ancestor-scroll")}const A=xt(o.floating);a&&A.addEventListener("keydown",E?I:P,E),g&&A.addEventListener(c,k?N:C,k);let D=[];return h&&($e(o.domReference)&&(D=Xn(o.domReference)),$e(o.floating)&&(D=D.concat(Xn(o.floating))),!$e(o.reference)&&o.reference&&o.reference.contextElement&&(D=D.concat(Xn(o.reference.contextElement)))),D=D.filter(L=>{var H;return L!==((H=A.defaultView)==null?void 0:H.visualViewport)}),D.forEach(L=>{L.addEventListener("scroll",R,{passive:!0})}),()=>{a&&A.removeEventListener("keydown",E?I:P,E),g&&A.removeEventListener(c,k?N:C,k),D.forEach(L=>{L.removeEventListener("scroll",R)})}},[s,o,a,g,c,n,r,h,i,T,S,P,E,I,C,k,N]),_.useEffect(()=>{x.current=!1},[g,c]);const M=_.useMemo(()=>({onKeyDown:P,[MA[d]]:R=>{u&&r(!1,R.nativeEvent,"reference-press")}}),[P,r,u,d]),F=_.useMemo(()=>({onKeyDown:P,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[DA[c]]:()=>{x.current=!0}}),[P,c]);return _.useMemo(()=>i?{reference:M,floating:F}:{},[i,M,F])}function jA(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=zo(),s=_.useRef({}),[i]=_.useState(()=>Rb()),a=ur()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!$e(f)&&mA("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=_.useState(r.reference),u=yt((f,p,m)=>{s.current.openEvent=f?p:void 0,i.emit("openchange",{open:f,event:p,reason:m,nested:a}),n==null||n(f,p,m)}),d=_.useMemo(()=>({setPositionReference:c}),[]),h=_.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return _.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:h,events:i,floatingId:o,refs:d}),[t,u,h,i,o,d])}function Go(e){e===void 0&&(e={});const{nodeId:t}=e,n=jA({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=_.useState(null),[a,l]=_.useState(null),u=(o==null?void 0:o.reference)||s,d=_.useRef(null),h=dr();ke(()=>{u&&(d.current=u)},[u]);const f=eA({...e,elements:{...o,...a&&{reference:a}}}),p=_.useCallback(y=>{const T=$e(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;l(T),f.refs.setReference(T)},[f.refs]),m=_.useCallback(y=>{($e(y)||y===null)&&(d.current=y,i(y)),($e(f.refs.reference.current)||f.refs.reference.current===null||y!==null&&!$e(y))&&f.refs.setReference(y)},[f.refs]),v=_.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:d}),[f.refs,m,p]),g=_.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),x=_.useMemo(()=>({...f,...r,refs:v,elements:g,nodeId:t}),[f,v,g,t,r]);return ke(()=>{r.dataRef.current.floatingContext=x;const y=h==null?void 0:h.nodesRef.current.find(T=>T.id===t);y&&(y.context=x)}),_.useMemo(()=>({...f,context:x,refs:v,elements:g}),[f,v,g,x])}function NA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=_.useRef(!1),u=_.useRef(),d=_.useRef(!0);_.useEffect(()=>{if(!a)return;const f=Nt(i.domReference);function p(){!n&&ut(i.domReference)&&i.domReference===tn(xt(i.domReference))&&(c.current=!0)}function m(){d.current=!0}return f.addEventListener("blur",p),f.addEventListener("keydown",m,!0),()=>{f.removeEventListener("blur",p),f.removeEventListener("keydown",m,!0)}},[i.domReference,n,a]),_.useEffect(()=>{if(!a)return;function f(p){let{reason:m}=p;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,a]),_.useEffect(()=>()=>{clearTimeout(u.current)},[]);const h=_.useMemo(()=>({onPointerDown(f){Td(f.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(f){if(c.current)return;const p=gn(f.nativeEvent);if(l&&$e(p))try{if(Ed()&&lb())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!d.current&&!Cd(p))return}r(!0,f.nativeEvent,"focus")},onBlur(f){c.current=!1;const p=f.relatedTarget,m=f.nativeEvent,v=$e(p)&&p.hasAttribute(or("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var g;const x=tn(i.domReference?i.domReference.ownerDocument:document);!p&&x===i.domReference||nt((g=s.current.floatingContext)==null?void 0:g.refs.floating.current,x)||nt(i.domReference,x)||v||r(!1,m,"focus")})}}),[s,i.domReference,r,l]);return _.useMemo(()=>a?{reference:h}:{},[a,h])}const Up="active",Gp="selected";function Ul(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Up]:i,[Gp]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[Up,Gp].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var h,f=arguments.length,p=new Array(f),m=0;m<f;m++)p[m]=arguments[m];return(h=r.get(c))==null?void 0:h.map(v=>v(...p)).find(v=>v!==void 0)}}}else i[c]=u}),i),{})}}function Yo(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=_.useCallback(a=>Ul(a,e,"reference"),t),s=_.useCallback(a=>Ul(a,e,"floating"),n),i=_.useCallback(a=>Ul(a,e,"item"),r);return _.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let Yp=!1;function qa(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qp(e,t){return qa(t,e===_d||e===ni,e===Co||e===Wo)}function Gl(e,t,n){return qa(t,e===ni,n?e===Co:e===Wo)||e==="Enter"||e===" "||e===""}function FA(e,t,n){return qa(t,n?e===Co:e===Wo,e===ni)}function Kp(e,t,n){return qa(t,n?e===Wo:e===Co,e===_d)}function Fb(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:h=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:g=!0,disabledIndices:x=void 0,orientation:y="vertical",cols:T=1,scrollItemIntoView:S=!0,virtualItemRef:E,itemSizes:k,dense:P=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||Di("`useListNavigation` looping must be enabled to allow escaping."),p||Di("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&T>1&&Di("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const I=ur(),C=dr(),N=yt(a),M=_.useRef(m),F=_.useRef(c??-1),R=_.useRef(null),A=_.useRef(!0),D=_.useRef(N),L=_.useRef(!!o.floating),H=_.useRef(n),U=_.useRef(!1),O=_.useRef(!1),$=Pt(x),Z=Pt(n),te=Pt(S),Q=Pt(o.floating),G=Pt(c),[j,B]=_.useState(),[z,V]=_.useState(),Y=yt(function(ce,Te,le){le===void 0&&(le=!1);function Pe(Re){p?(B(Re.id),C==null||C.events.emit("virtualfocus",Re),E&&(E.current=Re)):Yn(Re,{preventScroll:!0,sync:lb()&&Ed()?Yp||U.current:!1})}const at=ce.current[Te.current];at&&Pe(at),requestAnimationFrame(()=>{const Re=ce.current[Te.current]||at;if(!Re)return;at||Pe(Re);const pt=te.current;pt&&W&&(le||!A.current)&&(Re.scrollIntoView==null||Re.scrollIntoView(typeof pt=="boolean"?{block:"nearest",inline:"nearest"}:pt))})});ke(()=>{document.createElement("div").focus({get preventScroll(){return Yp=!0,!1}})},[]),ke(()=>{l&&(n&&o.floating?M.current&&c!=null&&(O.current=!0,F.current=c,N(c)):L.current&&(F.current=-1,D.current(null)))},[l,n,o.floating,c,N]),ke(()=>{if(l&&n&&o.floating)if(i==null){if(U.current=!1,G.current!=null)return;if(L.current&&(F.current=-1,Y(s,F)),(!H.current||!L.current)&&M.current&&(R.current!=null||M.current===!0&&R.current==null)){let ce=0;const Te=()=>{s.current[0]==null?(ce<2&&(ce?requestAnimationFrame:queueMicrotask)(Te),ce++):(F.current=R.current==null||Gl(R.current,y,f)||h?$l(s,$.current):Ap(s,$.current),R.current=null,N(F.current))};Te()}}else Ss(s,i)||(F.current=i,Y(s,F,O.current),O.current=!1)},[l,n,o.floating,i,G,h,s,y,f,N,Y,$]),ke(()=>{var ce;if(!l||o.floating||!C||p||!L.current)return;const Te=C.nodesRef.current,le=(ce=Te.find(Re=>Re.id===I))==null||(ce=ce.context)==null?void 0:ce.elements.floating,Pe=tn(xt(o.floating)),at=Te.some(Re=>Re.context&&nt(Re.context.elements.floating,Pe));le&&!at&&A.current&&le.focus({preventScroll:!0})},[l,o.floating,C,I,p]),ke(()=>{if(!l||!C||!p||I)return;function ce(Te){V(Te.id),E&&(E.current=Te)}return C.events.on("virtualfocus",ce),()=>{C.events.off("virtualfocus",ce)}},[l,C,p,I,E]),ke(()=>{D.current=N,L.current=!!o.floating}),ke(()=>{n||(R.current=null)},[n]),ke(()=>{H.current=n},[n]);const ne=i!=null,W=_.useMemo(()=>{function ce(le){if(!n)return;const Pe=s.current.indexOf(le);Pe!==-1&&N(Pe)}return{onFocus(le){let{currentTarget:Pe}=le;ce(Pe)},onClick:le=>{let{currentTarget:Pe}=le;return Pe.focus({preventScroll:!0})},...v&&{onMouseMove(le){let{currentTarget:Pe}=le;ce(Pe)},onPointerLeave(le){let{pointerType:Pe}=le;!A.current||Pe==="touch"||(F.current=-1,Y(s,F),N(null),p||Yn(Q.current,{preventScroll:!0}))}}}},[n,Q,Y,v,s,N,p]),Ee=yt(ce=>{if(A.current=!1,U.current=!0,!Z.current&&ce.currentTarget===Q.current)return;if(h&&Kp(ce.key,y,f)){Et(ce),r(!1,ce.nativeEvent,"list-navigation"),ut(o.domReference)&&!p&&o.domReference.focus();return}const Te=F.current,le=$l(s,x),Pe=Ap(s,x);if(ce.key==="Home"&&(Et(ce),F.current=le,N(F.current)),ce.key==="End"&&(Et(ce),F.current=Pe,N(F.current)),T>1){const at=k||Array.from({length:s.current.length},()=>({width:1,height:1})),Re=iA(at,T,P),pt=Re.findIndex(ie=>ie!=null&&!Mi(s.current,ie,x)),J=Re.reduce((ie,Oe,Ue)=>Oe!=null&&!Mi(s.current,Oe,x)?Ue:ie,-1);if(F.current=Re[sA({current:Re.map(ie=>ie!=null?s.current[ie]:null)},{event:ce,orientation:y,loop:d,cols:T,disabledIndices:lA([...x||s.current.map((ie,Oe)=>Mi(s.current,Oe)?Oe:void 0),void 0],Re),minIndex:pt,maxIndex:J,prevIndex:aA(F.current>Pe?le:F.current,at,Re,T,ce.key===ni?"bl":ce.key===Wo?"tr":"tl"),stopEvent:!0})],N(F.current),y==="both")return}if(qp(ce.key,y)){if(Et(ce),n&&!p&&tn(ce.currentTarget.ownerDocument)===ce.currentTarget){F.current=Gl(ce.key,y,f)?le:Pe,N(F.current);return}Gl(ce.key,y,f)?d?F.current=Te>=Pe?u&&Te!==s.current.length?-1:le:Ot(s,{startingIndex:Te,disabledIndices:x}):F.current=Math.min(Pe,Ot(s,{startingIndex:Te,disabledIndices:x})):d?F.current=Te<=le?u&&Te!==-1?s.current.length:Pe:Ot(s,{startingIndex:Te,decrement:!0,disabledIndices:x}):F.current=Math.max(le,Ot(s,{startingIndex:Te,decrement:!0,disabledIndices:x})),Ss(s,F.current)?N(null):N(F.current)}}),et=_.useMemo(()=>p&&n&&ne&&{"aria-activedescendant":z||j},[p,n,ne,z,j]),ze=_.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!cb(o.domReference)&&et,onKeyDown:Ee,onPointerMove(){A.current=!0}}),[et,Ee,o.domReference,y]),tt=_.useMemo(()=>{function ce(le){m==="auto"&&ab(le.nativeEvent)&&(M.current=!0)}function Te(le){M.current=m,m==="auto"&&Td(le.nativeEvent)&&(M.current=!0)}return{...et,onKeyDown(le){A.current=!1;const Pe=le.key.indexOf("Arrow")===0,at=FA(le.key,y,f),Re=Kp(le.key,y,f),pt=qp(le.key,y),J=(h?at:pt)||le.key==="Enter"||le.key.trim()==="";if(p&&n){const St=C==null?void 0:C.nodesRef.current.find(jt=>jt.parentId==null),kt=C&&St?xA(C.nodesRef.current,St.id):null;if(Pe&&kt&&E){const jt=new KeyboardEvent("keydown",{key:le.key,bubbles:!0});if(at||Re){var ie,Oe;const mr=((ie=kt.context)==null?void 0:ie.elements.domReference)===le.currentTarget,Wr=Re&&!mr?(Oe=kt.context)==null?void 0:Oe.elements.domReference:at?s.current.find(zr=>(zr==null?void 0:zr.id)===j):null;Wr&&(Et(le),Wr.dispatchEvent(jt),V(void 0))}if(pt&&kt.context&&kt.context.open&&kt.parentId&&le.currentTarget!==kt.context.elements.domReference){var Ue;Et(le),(Ue=kt.context.elements.domReference)==null||Ue.dispatchEvent(jt);return}}return Ee(le)}if(!(!n&&!g&&Pe)){if(J&&(R.current=h&&pt?null:le.key),h){at&&(Et(le),n?(F.current=$l(s,$.current),N(F.current)):r(!0,le.nativeEvent,"list-navigation"));return}pt&&(c!=null&&(F.current=c),Et(le),!n&&g?r(!0,le.nativeEvent,"list-navigation"):Ee(le),n&&N(F.current))}},onFocus(){n&&!p&&N(null)},onPointerDown:Te,onMouseDown:ce,onClick:ce}},[j,et,Ee,$,m,s,h,N,r,n,g,y,f,c,C,p,E]);return _.useMemo(()=>l?{reference:tt,floating:ze,item:W}:{},[l,tt,ze,W])}const LA=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function qo(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=(n=LA.get(i))!=null?n:i,l=zo(),u=ur()!=null,d=_.useMemo(()=>a==="tooltip"||i==="label"?{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":a==="alertdialog"?"dialog":a,"aria-controls":r?o:void 0,...a==="listbox"&&{role:"combobox"},...a==="menu"&&{id:l},...a==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,l,i]),h=_.useMemo(()=>{const p={id:o,...a&&{role:a}};return a==="tooltip"||i==="label"?p:{...p,...a==="menu"&&{"aria-labelledby":l}}},[a,o,l,i]),f=_.useCallback(p=>{let{active:m,selected:v}=p;const g={role:"option",...m&&{id:o+"-option"}};switch(i){case"select":return{...g,"aria-selected":m&&v};case"combobox":return{...g,...m&&{"aria-selected":!0}}}return{}},[o,i]);return _.useMemo(()=>s?{reference:d,floating:h,item:f}:{},[s,d,h,f])}const Zp=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Kr(e,t){return typeof e=="function"?e(t):e}function VA(e,t){const[n,r]=_.useState(e);return e&&!n&&r(!0),_.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function $A(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=(typeof o=="number"?o:o.close)||0,[a,l]=_.useState("unmounted"),c=VA(n,i);return!c&&a==="close"&&l("unmounted"),ke(()=>{if(r){if(n){l("initial");const u=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(u)}}l("close")}},[n,r]),{isMounted:c,status:a}}function BA(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=_.useMemo(()=>({side:l,placement:a}),[l,a]),u=typeof i=="number",d=(u?i:i.open)||0,h=(u?i:i.close)||0,[f,p]=_.useState(()=>({...Kr(s,c),...Kr(n,c)})),{isMounted:m,status:v}=$A(e,{duration:i}),g=Pt(n),x=Pt(r),y=Pt(o),T=Pt(s);return ke(()=>{const S=Kr(g.current,c),E=Kr(y.current,c),k=Kr(T.current,c),P=Kr(x.current,c)||Object.keys(S).reduce((I,C)=>(I[C]="",I),{});if(v==="initial"&&p(I=>({transitionProperty:I.transitionProperty,...k,...S})),v==="open"&&p({transitionProperty:Object.keys(P).map(Zp).join(","),transitionDuration:d+"ms",...k,...P}),v==="close"){const I=E||S;p({transitionProperty:Object.keys(I).map(Zp).join(","),transitionDuration:h+"ms",...k,...I})}},[h,y,g,x,T,d,v,c]),{isMounted:m,styles:f}}function WA(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=_.useRef(),m=_.useRef(""),v=_.useRef((n=f??i)!=null?n:-1),g=_.useRef(null),x=yt(a),y=yt(l),T=Pt(u),S=Pt(h);ke(()=>{r&&(clearTimeout(p.current),g.current=null,m.current="")},[r]),ke(()=>{if(r&&m.current===""){var C;v.current=(C=f??i)!=null?C:-1}},[r,f,i]);const E=yt(C=>{C?o.current.typing||(o.current.typing=C,y(C)):o.current.typing&&(o.current.typing=C,y(C))}),k=yt(C=>{function N(D,L,H){const U=T.current?T.current(L,H):L.find(O=>(O==null?void 0:O.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return U?D.indexOf(U):-1}const M=s.current;if(m.current.length>0&&m.current[0]!==" "&&(N(M,M,m.current)===-1?E(!1):C.key===" "&&Et(C)),M==null||S.current.includes(C.key)||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;r&&C.key!==" "&&(Et(C),E(!0)),M.every(D=>{var L,H;return D?((L=D[0])==null?void 0:L.toLocaleLowerCase())!==((H=D[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===C.key&&(m.current="",v.current=g.current),m.current+=C.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",v.current=g.current,E(!1)},d);const R=v.current,A=N(M,[...M.slice((R||0)+1),...M.slice(0,(R||0)+1)],m.current);A!==-1?(x(A),g.current=A):C.key!==" "&&(m.current="",E(!1))}),P=_.useMemo(()=>({onKeyDown:k}),[k]),I=_.useMemo(()=>({onKeyDown:k,onKeyUp(C){C.key===" "&&E(!1)}}),[k,E]);return _.useMemo(()=>c?{reference:P,floating:I}:{},[c,P,I])}function Xp(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function zA(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){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();function c(d,h){const f=performance.now(),p=f-l;if(i===null||a===null||p===0)return i=d,a=h,l=f,null;const m=d-i,v=h-a,x=Math.sqrt(m*m+v*v)/p;return i=d,a=h,l=f,x}const u=d=>{let{x:h,y:f,placement:p,elements:m,onClose:v,nodeId:g,tree:x}=d;return function(T){function S(){clearTimeout(o),v()}if(clearTimeout(o),!m.domReference||!m.floating||p==null||h==null||f==null)return;const{clientX:E,clientY:k}=T,P=[E,k],I=gn(T),C=T.type==="mouseleave",N=nt(m.floating,I),M=nt(m.domReference,I),F=m.domReference.getBoundingClientRect(),R=m.floating.getBoundingClientRect(),A=p.split("-")[0],D=h>R.right-R.width/2,L=f>R.bottom-R.height/2,H=zA(P,F),U=R.width>F.width,O=R.height>F.height,$=(U?F:R).left,Z=(U?F:R).right,te=(O?F:R).top,Q=(O?F:R).bottom;if(N&&(s=!0,!C))return;if(M&&(s=!1),M&&!C){s=!0;return}if(C&&$e(T.relatedTarget)&&nt(m.floating,T.relatedTarget)||x&&_r(x.nodesRef.current,g).some(B=>{let{context:z}=B;return z==null?void 0:z.open}))return;if(A==="top"&&f>=F.bottom-1||A==="bottom"&&f<=F.top+1||A==="left"&&h>=F.right-1||A==="right"&&h<=F.left+1)return S();let G=[];switch(A){case"top":G=[[$,F.top+1],[$,R.bottom-1],[Z,R.bottom-1],[Z,F.top+1]];break;case"bottom":G=[[$,R.top+1],[$,F.bottom-1],[Z,F.bottom-1],[Z,R.top+1]];break;case"left":G=[[R.right-1,Q],[R.right-1,te],[F.left+1,te],[F.left+1,Q]];break;case"right":G=[[F.right-1,Q],[F.right-1,te],[R.left+1,te],[R.left+1,Q]];break}function j(B){let[z,V]=B;switch(A){case"top":{const Y=[U?z+t/2:D?z+t*4:z-t*4,V+t+1],ne=[U?z-t/2:D?z+t*4:z-t*4,V+t+1],W=[[R.left,D||U?R.bottom-t:R.top],[R.right,D?U?R.bottom-t:R.top:R.bottom-t]];return[Y,ne,...W]}case"bottom":{const Y=[U?z+t/2:D?z+t*4:z-t*4,V-t],ne=[U?z-t/2:D?z+t*4:z-t*4,V-t],W=[[R.left,D||U?R.top+t:R.bottom],[R.right,D?U?R.top+t:R.bottom:R.top+t]];return[Y,ne,...W]}case"left":{const Y=[z+t+1,O?V+t/2:L?V+t*4:V-t*4],ne=[z+t+1,O?V-t/2:L?V+t*4:V-t*4];return[...[[L||O?R.right-t:R.left,R.top],[L?O?R.right-t:R.left:R.right-t,R.bottom]],Y,ne]}case"right":{const Y=[z-t,O?V+t/2:L?V+t*4:V-t*4],ne=[z-t,O?V-t/2:L?V+t*4:V-t*4],W=[[L||O?R.left+t:R.right,R.top],[L?O?R.left+t:R.right:R.left+t,R.bottom]];return[Y,ne,...W]}}}if(!Xp([E,k],G)){if(s&&!H)return S();if(!C&&r){const B=c(T.clientX,T.clientY);if(B!==null&&B<.1)return S()}Xp([E,k],j([h,f]))?!s&&r&&(o=window.setTimeout(S,40)):S()}}};return u.__options={blockPointerEvents:n},u}const Ko=e=>{const t=b.useId(),[n,r]=b.useState(e.open),o=b.useRef(null),s=b.useMemo(()=>[Ga(10),Ad({fallbackAxisSideDirection:"end"}),Od(),Sb({padding:5,element:o})],[e.arrow]),{refs:i,floatingStyles:a,context:l}=Go({open:n,middleware:s,transform:!0,whileElementsMounted:Ua,onOpenChange:(p,m)=>{var g;const v=m==null?void 0:m.relatedTarget;v&&v.dataset.floating==="true"&&!p||(r(p),(g=e.onChange)==null||g.call(e,p))}}),c=Ya(l),u=Uo(l),d=qo(l),{getReferenceProps:h,getFloatingProps:f}=Yo([c,u,d]);return w.jsxs(b.Fragment,{children:[w.jsx("button",{ref:i.setReference,...h(e.buttonProps),type:"button",children:e.trigger}),n&&w.jsx(Ho,{preserveTabOrder:!0,id:`${t}-portal`,children:w.jsx(ri,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:w.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:i.setFloating,style:a,"aria-labelledby":t,...f(),children:[w.jsx(Pb,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),w.jsx("header",{className:"mb-2",children:w.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},UA=e=>{const t=b.useRef(null),n=b.useId(),r=`${n}:wrapper`,o=`${n}:title`,[s,i]=b.useState(!1),{context:a,refs:l}=Go({transform:!0,open:s!==null,nodeId:n,onOpenChange:i,strategy:"absolute"}),c=Ya(a),u=qo(a),d=Uo(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:h,getReferenceProps:f}=Yo([c,u,d]);return w.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[w.jsx(ho,{...f(e),as:Ct.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>i(!0),children:w.jsx(Ct.span,{layoutId:o,children:e.trigger})}),w.jsx(ei,{children:s?w.jsx(Ho,{root:t,children:w.jsx(ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:w.jsx(Ct.div,{...h(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})};function GA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function YA(...e){return t=>e.forEach(n=>GA(n,t))}var Dd=_.forwardRef((e,t)=>{const{children:n,...r}=e,o=_.Children.toArray(n),s=o.find(KA);if(s){const i=s.props.children,a=o.map(l=>l===s?_.Children.count(i)>1?_.Children.only(null):_.isValidElement(i)?i.props.children:null:l);return w.jsx(Jc,{...r,ref:t,children:_.isValidElement(i)?_.cloneElement(i,void 0,a):null})}return w.jsx(Jc,{...r,ref:t,children:n})});Dd.displayName="Slot";var Jc=_.forwardRef((e,t)=>{const{children:n,...r}=e;if(_.isValidElement(n)){const o=XA(n);return _.cloneElement(n,{...ZA(r,n.props),ref:t?YA(t,o):o})}return _.Children.count(n)>1?_.Children.only(null):null});Jc.displayName="SlotClone";var qA=({children:e})=>w.jsx(w.Fragment,{children:e});function KA(e){return _.isValidElement(e)&&e.type===qA}function ZA(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function XA(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Lb=300,QA=500,Vb=(e="")=>He("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary data-[open]:bg-primary focus:bg-primary aria-expanded:opacity-80","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),eu=b.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),Qp=b.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:s,...i},a)=>{const l=ur(),c=l!==null,[u,d]=b.useState(!1),[h,f]=b.useState(!1),[p,m]=b.useState(null),v=b.useRef([]),g=b.useRef([]),x=b.useContext(eu),y=dr(),T=gA(),S=Cb(),{floatingStyles:E,refs:k,context:P}=Go({nodeId:T,open:u,transform:!0,onOpenChange:d,whileElementsMounted:Ua,placement:c?"right":"bottom-start",strategy:"absolute",middleware:[Ga({mainAxis:c?0:4,alignmentAxis:c?-4:0}),Ad(),Od()]}),I=qo(P,{role:"menu",enabled:!0}),C=Uo(P,{bubbles:!0}),N=Ob(P,{enabled:n,delay:{open:Lb},handleClose:HA({blockPointerEvents:!0})}),M=Ya(P,{event:"mousedown",toggle:!c,ignoreMouse:c,keyboardHandlers:!0}),F=Fb(P,{loop:!0,activeIndex:p,virtual:!0,nested:c,allowEscape:!0,listRef:v,scrollItemIntoView:!0,onNavigate:m}),R=WA(P,{activeIndex:p,listRef:g,resetMs:QA,onMatch:u?m:void 0}),{getReferenceProps:A,getFloatingProps:D,getItemProps:L}=Yo([N,M,I,C,F,R]);b.useEffect(()=>{if(!y)return;const U=()=>d(!1),O=$=>{$.nodeId!==T&&$.parentId===l&&d(!1)};return y.events.on("click",U),y.events.on("menuopen",O),()=>{y.events.off("click",U),y.events.off("menuopen",O)}},[y,T,l]),b.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:l,nodeId:T})},[y,u,T,l]);const H=r?i.className:He(Vb(i.className));return w.jsxs(yA,{id:T,children:[w.jsx(b.Fragment,{children:i.asChild?w.jsx(Dd,{children:s,ref:Qc([k.setReference,S.ref,a]),tabIndex:c?x.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...A(x.getItemProps({...i,onFocus(U){var O;(O=i.onFocus)==null||O.call(i,U),f(!1),x.setHasFocusInside(!0)}}))}):w.jsxs("button",{type:"button",ref:Qc([k.setReference,S.ref,a]),tabIndex:c?x.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":c?"":void 0,role:c?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...A(x.getItemProps({...i,onFocus(U){var O;(O=i.onFocus)==null||O.call(i,U),f(!1),x.setHasFocusInside(!0)}})),children:[s,c&&w.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[w.jsx("span",{className:"sr-only",children:"Next menu"}),w.jsx(ud,{size:14})]})]})}),w.jsx(eu.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:L,setHasFocusInside:f,isOpen:u},children:w.jsx(dA,{elementsRef:v,labelsRef:g,children:u&&w.jsx(Ho,{preserveTabOrder:!0,children:w.jsx(ri,{context:P,modal:!1,initialFocus:c?-1:0,returnFocus:!c,children:w.jsx(t,{...D(),ref:k.setFloating,style:{...i.style,...E},className:He("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none",o),children:e})})})})})]})}),JA=b.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},s)=>{const i=b.useContext(eu),a=Cb({label:r?null:typeof e=="string"?e:t}),l=dr(),c=a.index===i.activeIndex;return w.jsxs("button",{...o,ref:Qc([a.ref,s]),"data-active":c,type:"button",role:"menuitem",disabled:r,tabIndex:c?0:-1,className:Vb(o.className),...i.getItemProps({onClick(u){var d;(d=o.onClick)==null||d.call(o,u),l==null||l.events.emit("click")},onFocus(u){var d;(d=o.onFocus)==null||d.call(o,u),i.setHasFocusInside(!0)}}),children:[e,n?w.jsx(n,{size:16}):null]})}),e_=b.forwardRef((e,t)=>ur()!==null?w.jsx(Qp,{...e,isParent:!1,ref:t}):w.jsx(vA,{children:w.jsx(Qp,{...e,isParent:!0,ref:t})})),t_=(e,t)=>Qi()?t:window.matchMedia(e).matches,n_=(e,t=!0)=>{const[n,r]=b.useState(t);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),s=()=>r(t_(e,t));return s(),o.addListener?(o.addListener(s),()=>o.removeListener?o.removeListener(s):void 0):(o.addEventListener("change",s),()=>o.removeEventListener("change",s))},[e]),n},nn="600ms",r_={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:nn},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:nn},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:nn}},o_={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:nn},exit:{translateX:["0%","30%"],opacity:0,animationDuration:nn}},Yl={drawer:e=>e==="left"?r_:o_,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:nn,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:nn,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:nn,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:nn},enter:{opacity:1,scale:[1.05,1],animationDuration:nn},exit:{opacity:0,scale:.97,animationDuration:nn}}},s_=Gs("isolate z-floating border border-card-border ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background",{variants:{type:{drawer:"max-h-screen max-w-[90%] absolute w-fit h-screen min-h-0",dialog:"max-h-[calc(100lvh-10%)] relative container h-min rounded-lg py-4",sheet:"w-screen absolute bottom-0 h-[85vh] max-h-[85vh] max-h-[85svh] pt-6 pb-4 rounded-t-lg"},position:{none:"",right:"py-4 absolute right-0 top-0 rounded-l-lg",left:"py-4 absolute left-0 top-0 rounded-r-lg"}},defaultVariants:{position:"right",type:"dialog"}}),i_={top:0,left:0,right:0,bottom:-1},a_=e=>e*.62,l_=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const c=e.parent.current,u=e.value.get()||c.getBoundingClientRect().width,d=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+d))}const s=e.parent.current.getBoundingClientRect(),i=e.value.get()||s.height,a=Math.abs(i-r.delta.y),l=a_(window.outerHeight);return a<l?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return w.jsx(Ct.div,{draggable:!0,dragMomentum:!0,dragListener:!0,dragPropagation:!0,onDrag:t,animate:!1,initial:!1,dragElastic:0,dragDirectionLock:!0,dragSnapToOrigin:!0,drag:e.sheet?"y":"x",dragConstraints:i_,whileDrag:{cursor:"grabbing"},className:He("absolute rounded-lg",e.sheet?"cursor-row-resize":"cursor-col-resize bg-floating-border",e.sheet?"top-1 flex h-3 w-full justify-center py-2":e.position==="left"?"right-5 top-1/2 h-10 w-2":"left-2 top-1/2 h-10 w-2"),children:e.sheet?w.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},ql={drawer:"right",sheet:"none",dialog:"none"},c_=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...s})=>{const i=b.useId(),a=b.useId(),l=n_("(min-width: 64rem)"),c=e!=="dialog",u=l?e==="drawer"?s.position:ql[e]:r?ql[e]:ql.sheet,d=l||r?Yl[e]:Yl.sheet,h=typeof d=="function"?d(u):d,f=l||r?e:"sheet",{refs:p,context:m}=Go({open:s.open,onOpenChange:s.onChange}),v=Ya(m),g=qo(m),x=Uo(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:T}=Yo([v,g,x]),S=s.trigger,E=bo(void 0),k=()=>s.onChange(!1);return w.jsxs(b.Fragment,{children:[s.trigger?w.jsx(b.Fragment,{children:s.asChild?w.jsx(Dd,{ref:p.setReference,...y({layoutId:s.layoutId}),children:S}):w.jsx(Ct.button,{ref:p.setReference,...y(),layoutId:s.layoutId,type:"button",children:S})}):null,w.jsx(Ho,{children:w.jsx(ei,{presenceAffectsLayout:!0,children:s.open?w.jsx(OA,{lockScroll:!0,className:`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${f==="drawer"?"":"grid items-end justify-center lg:items-center"}`,children:w.jsx(ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:m,children:w.jsxs(Ct.div,{animate:"enter","aria-describedby":a,"aria-labelledby":i,className:s_({position:u,type:f}),exit:"exit",layoutId:s.layoutId,initial:"initial",ref:p.setFloating,style:f==="drawer"?{width:E}:{height:E},variants:h,...T(),children:[s.title?w.jsx("header",{className:"relative w-full",children:s.title?w.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:s.title}):null}):null,w.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:s.children}),s.footer?w.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:s.footer}):null,o?w.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:w.jsx("button",{type:"button",onClick:k,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:w.jsx(xv,{})})}):null,c&&t?w.jsx(l_,{onChange:s.onChange,parent:p.floating,position:u,sheet:f==="sheet",value:E}):null]})})}):null})})]})},u_=e=>w.jsx(Ct.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),$b=({children:e,followCursor:t=!1,placement:n,enabled:r,as:o,title:s,...i})=>{const[a,l]=b.useState(!1),c=b.useRef(null),u=o||"span",{refs:d,floatingStyles:h,context:f}=Go({open:a,placement:n,transform:!0,onOpenChange:l,whileElementsMounted:Ua,middleware:[Ga(5),Ad({fallbackAxisSideDirection:"start"}),Od(),Sb({element:c,padding:5})]}),p=Ob(f,{move:!0,enabled:r,delay:{open:Lb}}),m=NA(f,{enabled:r}),v=Uo(f,{enabled:r}),g=qo(f,{role:"tooltip",enabled:r}),x=_A(f,{enabled:!!r&&!!t}),{getReferenceProps:y,getFloatingProps:T}=Yo([p,m,v,g,x]);return w.jsxs(b.Fragment,{children:[w.jsx(u,{ref:d.setReference,...y(i),children:s}),w.jsx(Ho,{children:a&&w.jsxs(No,{...T(),ref:d.setFloating,style:h,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[w.jsx(Pb,{ref:c,context:f,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),e]})})]})};class aa{static getDescendantProperty(t,n,r=[]){let o,s,i,a,l,c;if(n){if(i=n.indexOf("."),i===-1?o=n:(o=n.slice(0,i),s=n.slice(i+1)),a=t[o],a!==null&&typeof a<"u")if(!s&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(l=0,c=a.length;l<c;l++)aa.getDescendantProperty(a[l],s,r);else s&&aa.getDescendantProperty(a,s,r)}else r.push(t);return r}}class ro{constructor(t=[],n=[],r={}){Array.isArray(n)||(r=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},r)}search(t=""){if(t==="")return this.haystack;const n=[];for(let r=0;r<this.haystack.length;r++){const o=this.haystack[r];if(this.keys.length===0){const s=ro.isMatch(o,t,this.options.caseSensitive);s&&n.push({item:o,score:s})}else for(let s=0;s<this.keys.length;s++){const i=aa.getDescendantProperty(o,this.keys[s]);let a=!1;for(let l=0;l<i.length;l++){const c=ro.isMatch(i[l],t,this.options.caseSensitive);if(c){a=!0,n.push({item:o,score:c});break}}if(a)break}}return this.options.sort&&n.sort((r,o)=>r.score-o.score),n.map(r=>r.item)}static isMatch(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());const o=ro.nearestIndexesFor(t,n);return o?t===n?1:o.length>1?2+(o[o.length-1]-o[0]):2+o[0]:!1}static nearestIndexesFor(t,n){const r=n.split("");let o=[];return ro.indexesOfFirstLetter(t,n).forEach((i,a)=>{let l=i+1;o[a]=[i];for(let c=1;c<r.length;c++){const u=r[c];if(l=t.indexOf(u,l),l===-1){o[a]=!1;break}o[a].push(l),l++}}),o=o.filter(i=>i!==!1),o.length?o.sort((i,a)=>i.length===1?i[0]-a[0]:(i=i[i.length-1]-i[0],a=a[a.length-1]-a[0],i-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,s)=>o!==r?!1:s).filter(o=>o!==!1)}}const Bb=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:s})=>w.jsxs("div",{className:He("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:w.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-error:text-danger",children:[s,e||r?w.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?w.jsx($b,{title:w.jsxs("span",{className:"cursor-help",children:[w.jsx("span",{className:"sr-only",children:r}),w.jsx(bv,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:r}):null,e?w.jsxs(b.Fragment,{children:[w.jsx(vv,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0}),w.jsx(BP,{className:"hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}):null]}):null]}),o]}),Ka=({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:s,right:i,info:a,children:l,error:c,form:u,id:d,labelClassName:h="",name:f,title:p,placeholder:m,hideLeft:v,required:g})=>{const x=d??f,y=zt(),T=e??y.inputOptionalLabel;return w.jsxs("fieldset",{form:u,"data-error":!!c,"data-interactive":!!s,className:He("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[w.jsxs("label",{form:u,htmlFor:x,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-error:text-danger",children:[!v&&!n?w.jsx(Bb,{info:a,hideLeft:v,reportStatus:!0,title:p,placeholder:m,children:T||n?w.jsxs(b.Fragment,{children:[g?null:w.jsx("span",{className:"text-opacity-70",children:T}),n?w.jsx(b.Fragment,{children:n}):null]}):null}):null,w.jsxs("div",{className:`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-error:border-danger ${h}`,children:[t?w.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap",children:t}):null,l,i?w.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap",children:i}):null]})]}),w.jsx("p",{className:"mt-input-gap hidden flex-shrink-0 flex-grow-0 whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:inline-block group-error:inline-block group-error:text-danger",children:c}),w.jsx("p",{className:"mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden",children:o})]})},Wb=b.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},s)=>w.jsx("li",{...o,ref:s,role:"option","aria-selected":t,className:"w-full border-b border-tooltip-border last:border-transparent",children:w.jsxs("button",{type:"button","data-value":r.value,onClick:n,"aria-selected":t,"aria-checked":t,"aria-current":t,className:`flex w-full cursor-pointer justify-between p-2 text-left ${t?"bg-primary text-primary-foreground":""} ${e?"bg-primary/70 text-primary-foreground":""}`,children:[r.label??r.value,t?w.jsx("span",{children:w.jsx(LP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})),d_={duration:300,initial:{transform:"scaleY(0)",opacity:.4},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},f_={caseSensitive:!1,sort:!1},h_=[],p_=b.forwardRef(({options:e,dynamicOption:t=!1,feedback:n=null,labelClassName:r,interactive:o,rightLabel:s,optionalText:i,container:a,hideLeft:l=!1,right:c,left:u,error:d,required:h=!1,...f},p)=>{const m=zt(),v=b.useRef(null),[g,x]=b.useState(!1),[y,T]=b.useState(""),[S,E]=b.useState(f.value??f.defaultValue??""),[k,P]=b.useState(f.value??f.defaultValue??""),[I,C]=b.useState(null),N=b.useRef(h_),M=t&&y!==""?[{value:y,label:y,"data-dynamic":"true"},...e]:e,F=new ro(M,["value","label"],f_).search(y),R=t?void 0:`^(${e.map(V=>`${Uc(V.value)}${V.label?"|"+Uc(V.label):""}`).join("|")})$`;b.useEffect(()=>{if(f.value){const V=e.find(Y=>Y.value===f.value);E((V==null?void 0:V.label)??f.value)}},[f.value]);const{x:A,y:D,strategy:L,refs:H,context:U}=Go({open:g,transform:!0,strategy:"absolute",onOpenChange:x,whileElementsMounted:Ua,middleware:[Ga(4),nA({elementContext:"reference",padding:10,apply(V){const ne=V.elements.reference.parentElement,W=ne==null?void 0:ne.getBoundingClientRect().width;Object.assign(V.elements.floating.style,{width:`${W}px`,maxWidth:`${W}px`,minWidth:"max-content",maxHeight:`${Math.min(480,V.availableHeight)}px`})}})]}),O=BA(U,d_),{getReferenceProps:$,getFloatingProps:Z,getItemProps:te}=Yo([qo(U,{role:"listbox"}),Uo(U),Fb(U,{activeIndex:I,allowEscape:!0,cols:0,focusItemOnOpen:"auto",listRef:N,loop:!0,openOnArrowKeyDown:!0,scrollItemIntoView:!0,selectedIndex:I,virtual:!0,onNavigate:V=>C(Y=>V??Y)})]);b.useEffect(()=>{const V=H.reference.current;if(V)return Oa(V)},[]);const Q=(V,Y)=>{var W,Ee;E(V.value),(W=H.reference.current)==null||W.setAttribute("data-value",V.value),P(V.label??"");const ne=Tc(v.current,V.value);ne&&((Ee=f.onChange)==null||Ee.call(f,ne)),x(!1),T(""),C(Y)},G=V=>{var ne;const Y=V.target.value;return T(Y),!g&&Y===""?x(!0):(V.target.name=f.name||"",Y?x(!0):(ne=f.onChange)==null?void 0:ne.call(f,V))},j=()=>{x(!0),T("")},B=()=>{var V;T(""),E(""),(V=H.reference.current)==null||V.setAttribute("data-value",""),P(""),Tc(H.reference.current),x(!1)},z=f.id||f.name;return w.jsxs(Ka,{...f,container:a,error:d,feedback:n,form:f.form,hideLeft:l,id:f.name||f.id,interactive:o,labelClassName:r,left:u,name:f.name,optionalText:i,placeholder:f.placeholder,required:h,rightLabel:s,title:f.title,right:w.jsxs("span",{className:"flex items-center gap-0.5",children:[w.jsxs("button",{type:"button",className:"transition-colors link:text-primary",children:[w.jsx(yv,{size:20}),w.jsx("span",{className:"sr-only",children:m.inputCaretDown})]}),S?w.jsx("button",{type:"button",onClick:B,className:"transition-colors link:text-danger",children:w.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}):null]}),children:[w.jsx("input",{...$({...f,onChange:G,onFocus:j,pattern:R,ref:H.setReference,name:`${z}-shadow`,id:`${z}-shadow`,onClick:V=>V.currentTarget.focus(),onKeyDown(V){if(V.key==="Escape")return V.currentTarget.blur(),x(!1);if(V.key==="Enter"){if(I!==null&&F[I])return V.preventDefault(),Q(F[I],I);if(F.length===1)return V.preventDefault(),Q(F[0],0)}}}),"data-value":S,"data-error":!!d,"data-name":z,"data-target":z,required:h,value:g?y:k||S,"aria-autocomplete":"list",autoComplete:"off",className:He("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary",f.className)}),w.jsx("input",{id:z,name:z,type:"hidden","data-origin":z,ref:p,required:h,defaultValue:f.value||S||void 0}),w.jsx(Ho,{preserveTabOrder:!0,children:g?w.jsx(ri,{guards:!0,returnFocus:!1,context:U,initialFocus:-1,visuallyHiddenDismiss:!0,children:w.jsx("ul",{...Z({ref:H.setFloating,style:{position:L,left:(A??0)+16,top:D??0,...O.styles}}),"data-floating":"true",className:"z-floating m-0 origin-[top_center] list-none overflow-auto overflow-y-auto rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating",children:F.map((V,Y)=>b.createElement(Wb,{...te({onClick:()=>Q(V,Y),ref:ne=>void(N.current[Y]=ne),selected:I===Y,active:S===V.value}),key:`${V.value}-option`,option:V,selected:I===Y,active:S===V.value}))})}):null})]})}),zb=b.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:s,container:i,...a},l)=>w.jsxs("label",{"data-task":t,"data-disabled":a.disabled,"aria-disabled":a.disabled,className:He("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",i),children:[w.jsx("input",{...a,ref:l,type:"checkbox","data-task":t,className:He("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",o)}),e,w.jsx("span",{"data-name":"checkbox-label",className:He("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),oi=b.forwardRef(({type:e="text",feedback:t=null,info:n,labelClassName:r,next:o,interactive:s,rightLabel:i,optionalText:a,container:l,hideLeft:c=!1,right:u,left:d,error:h,...f},p)=>{const m=f.id??f.name,v=b.useRef(null);return b.useEffect(()=>{if(v.current===null)return;const g=v.current,x=Oa(v.current),y=T=>{const S=T;if(S.key==="Enter"&&g.enterKeyHint==="next"){const E=g.getAttribute("data-next");if(E){const k=document.getElementById(E);if(k)return k.focus(),void S.preventDefault()}}};return g.addEventListener("keydown",y),()=>{x(),g.removeEventListener("keydown",y)}},[]),w.jsx(Ka,{info:n,container:l,error:h,feedback:t,hideLeft:c,left:d,optionalText:a,right:u,rightLabel:i,interactive:s,form:f.form,id:f.name||f.id,name:f.name,labelClassName:r,title:f.title,placeholder:f.placeholder,required:f.required,children:w.jsx(Hv,{...f,type:e,"data-next":o,ref:Du(p,v),id:m,name:m,className:He("input placeholder-input-mask group h-input-height w-full flex-1","rounded-md bg-transparent px-input-x py-input-y text-foreground","outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary","group-error:text-danger group-error:placeholder-input-mask-error","group-focus-within:border-primary group-hover:border-primary",f.className)})})}),Jp=new Date(1970,11,31),Kl={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},em={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},m_={literal:(e,t)=>t,year:e=>e.getFullYear(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},Zl=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},g_=b.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...s},i)=>{const a=b.useId(),l=zt(),c=b.useMemo(()=>new Intl.DateTimeFormat(t),[t]),[u,d]=b.useState(e||void 0),[h,f]=b.useState(!1),p=Zl(c,Jp).flatMap(E=>bn.keyof(Kl,E.type)?Kl[E.type](E.value):[]),m=Zl(c,Jp).reduce((E,k)=>E+(bn.keyof(em,k.type)?em[k.type](k.value):""),""),[v,g]=b.useState(u?Zl(c,u).reduce((E,k)=>E+(bn.keyof(Kl,k.type)?m_[k.type](u,k.value):""),""):""),x=E=>{const k=E.target.value;if(g(k),p.length===k.length&&p.every((I,C)=>{const N=k.charAt(C);return typeof I=="string"?N===I:I.test(N)})){const I=So(Jk(k,m,new Date));return d(I),r==null?void 0:r(I)}return d(void 0),r==null?void 0:r(void 0)},y=E=>(d(E),r==null||r(E),g(E?ek(E,m):"")),T=Pv(u),S=T?u.toISOString():void 0;return w.jsx(oi,{...s,mask:p,value:v,"data-value":S,"data-target":s.name,className:"uppercase",formNoValidate:!h,placeholder:m,onChange:x,required:s.required??!0,error:h?void 0:s.error,name:void 0,id:void 0,right:w.jsxs(b.Fragment,{children:[w.jsx("input",{"data-origin":s.name,defaultValue:S,form:s.form,hidden:!0,id:s.name,name:s.name,ref:i,type:"date"}),w.jsx(Ko,{open:h,onChange:f,trigger:w.jsxs("span",{"aria-labelledby":a,children:[w.jsx("span",{id:a,className:"sr-only",children:l.datePickerCalendarButtonLabel}),w.jsx(FP,{})]}),buttonProps:{"aria-describedby":a},children:w.jsx(eb,{...s,locale:t,changeOnlyOnClick:!0,markToday:o,onChange:y,disabledDate:n,date:T?u:void 0})})]})})}),y_=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],v_=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],b_=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],x_=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],tm=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function nm(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};const n=t.bits?t.binary?x_:b_:t.binary?v_:y_,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,s=o?"-":t.signed?"+":"";o&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){const u=tm(e,t.locale,i);return s+u+r+n[0]}const a=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**a,i||(e=e.toPrecision(3));const l=tm(Number(e),t.locale,i),c=n[a];return s+l+r+c}var tu={exports:{}},Si={exports:{}},je={};/** @license React v16.13.1
|
|
178
178
|
* react-is.production.min.js
|
|
179
179
|
*
|
|
180
180
|
* Copyright (c) Facebook, Inc. and its affiliates.
|