@g4rcez/components 0.0.50 → 0.0.51

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.js CHANGED
@@ -174,7 +174,7 @@
174
174
  */var Ah;function nA(){return Ah||(Ah=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=rv();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;function l(u,f,h,d,p){var m=i(null),g;m.current===null?(g={hasValue:!1,value:null},m.current=g):g=m.current;var v=a(function(){var S=!1,E,R,A=function(D){if(!S){S=!0,E=D;var N=d(D);if(p!==void 0&&g.hasValue){var P=g.value;if(p(P,N))return R=P,P}return R=N,N}var O=E,F=R;if(r(O,D))return F;var _=d(D);return p!==void 0&&p(F,_)?F:(E=D,R=_,_)},k=h===void 0?null:h,I=function(){return A(f())},j=k===null?void 0:function(){return A(k())};return[I,j]},[f,h,d,p]),w=v[0],y=v[1],T=o(u,w,y);return s(function(){g.hasValue=!0,g.value=T},[T]),c(T),T}Ih.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ih}process.env.NODE_ENV==="production"?tA():nA();const Pr=e=>{const t=b.useRef(e??{});return b.useEffect(()=>void(t.current=e),[e]),t},rA=e=>{const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current},oA=e=>Object.entries(e),ov=e=>e instanceof Promise,iv=(e,t,n,r)=>t===e?n.reduce((o,i)=>i(o,t,r),e):e.constructor.name===Object.name?n.reduce((o,i)=>i(o,t,r),{...t,...e}):n.reduce((o,i)=>i(o,t,r),e),iA=(e,t,n,r,o,i)=>(...s)=>{const a=performance.now(),c=t(...s),l=(u,f)=>n(h=>iv(u,h,i,f));return ov(c)?c.then(u=>{o.current={method:e,props:r(),time:performance.now()-a},l(u,o.current)}):(o.current={method:e,props:r(),time:performance.now()-a},void l(c,o.current))},sA=(e,t,n,r,o,i)=>(...s)=>{o.current={method:e,time:0,props:r()};const a=t(...s),c=l=>n(u=>iv(l,u,i,o.current));return ov(a)?a.then(l=>c(l)):c(a)},Pu=(e,t,n)=>{const[r,o]=b.useState(()=>e),i=Pr(r),s=Pr((n==null?void 0:n.props)??{}),a=Pr(t),c=Pr((n==null?void 0:n.postMiddleware)??[]),l=Pr((n==null?void 0:n.interceptor)??[]),u=b.useRef(e),f=rA(r),h=Pr(f),d=b.useRef(null);b.useEffect(()=>{if(d.current===null)return;const m=d.current;c.current.forEach(g=>{g(r,f,m)})},[r,c,f]);const[p]=b.useState(()=>{const m=()=>s.current,g=a.current({props:m,state:()=>i.current,initialState:u.current,previousState:()=>h.current});return oA(g).reduce((v,[w,y])=>({...v,[w]:n!=null&&n.debug?iA(w,y,o,m,d,l.current):sA(w,y,o,m,d,l.current)}),{})});return[r,p,s.current]},aA=(e,t=0)=>{let n;return function(...o){clearTimeout(n),n=setTimeout(()=>e(...o),t)}};function lA(e,t){return b.useRef(aA(e,t)).current}const Ru={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>)`},Xo=(e,t,n="",r="")=>Object.entries(e).reduce((o,[i,s])=>{const a=r===""?`${n}${i}`:`${r}-${i}`;if(typeof s=="string"){const c=r===""?`${n}${i}`:i;return o.concat(t(s,c,a))}return o.concat(Xo(s,t,n,a))},[]),sv=(e,t,n="",r="")=>Object.entries(e).reduce((o,[i,s])=>{const a=r===""?`${n}${i}`:`${r}-${i}`;if(typeof s=="string"){const c=r===""?`${n}${i}`:i;return{...o,[c]:t(s,i,a)}}return{...o,[i]:sv(s,t,n,a)}},{}),Oh={default:e=>`:root { ${e} }`,dark:e=>`html.dark {${e}}`},rc=(e,t)=>{const n=t.value||((o,i)=>i),r=e.map(o=>`${o.key}: ${n(o.key,o.value)}`).join(";");return t.result(r)},cA={default:e=>rc(e,{result:Oh.default}),dark:e=>rc(e,{result:Oh.dark})},uA=(e,t)=>{const n=(s,a,c)=>({key:`--${c}`,value:`${s}`}),r=Xo(e.colors,n),o=Xo(e.spacing,n),i=Xo(e.rounded,n);return rc(r.concat(o,i),{result:s=>`html${t?`.${t}`:""} {${s}}`,value:(s,a)=>a.replace("hsla(","").replace(")","")})},av={button:"0.4rem",pill:"2rem",card:"0.75rem",full:"9999px"},lv={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"},fA={name:"dark",rounded:av,spacing:lv,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%)"}},alert:{primary:{text:"hsla(210,100%,72%)",border:"hsla(212,69%,16%)",bg:"hsla(215,42%,9%)"},warn:{bg:"hsla(28,33%,9%)",border:"hsla(29,65%,12%)",text:"hsla(27,100%,78%)"},info:{text:"hsla(253,100%,83%)",bg:"hsla(263,28%,11%)",border:"hsla(252,34%,51%)"},success:{text:"hsla(144,79%,79%)",bg:"hsla(153,20%,9%)",border:"hsla(144,70%,14%)"},danger:{text:"hsla(350,100%,91%)",bg:"hsla(355,25%,15%)",border:"hsla(355,25%,10%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(220,9%,94%)",bg:"hsla(220,6%,10%)",border:"hsla(214,7%,19%)"}}}},dA={name:"light",rounded:av,spacing:lv,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%)"}},alert:{primary:{text:"hsla(206,70%,50%)",border:"hsla(206,90%,89%)",bg:"hsla(205,92%,95%)"},warn:{bg:"hsla(23,100%,96%)",text:"hsla(23,93%,53%)",border:"hsla(33,100%,85%)"},info:{text:"hsla(252,56%,57%)",bg:"hsla(256,100%,95%)",border:"hsla(252,76%,84%)"},success:{text:"hsla(152,56%,39%)",bg:"hsla(139,47%,93%)",border:"hsla(152,58%,78%)"},danger:{text:"hsla(358,69%,55%)",bg:"hsla(357,90%,96%)",border:"hsla(359,100%,90%)"},neutral:{text:"hsla(200,98%,60%)",bg:"hsla(200,28%,19%)",border:"hsla(200,90%,89%)"},secondary:{text:"hsla(216,10%,10%)",bg:"hsla(214,7%,92%)",border:"hsla(216,22%,78%)"}}}},hA=fA,pA=dA,Iu={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=>x.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"},Au=b.createContext({colorTokenParser:Ru.hsla,translations:Iu,locale:void 0}),mA=e=>{const t=b.useMemo(()=>({locale:e.locale,translations:{...Iu,...e.map},colorTokenParser:e.parser||Ru.hsla}),[e]);return x.jsx(Au.Provider,{value:t,children:e.children})},gA=()=>{const e=b.useContext(Au);if(e)return e.locale},Dt=()=>{const e=b.useContext(Au);return e?e.translations:Iu},ta=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)}),Dh=(e,t,n)=>e.split(t).filter(Boolean).reduce((r,o)=>r!=null?r[o]:r,n),Mh={basic:/[,[\]]+?/,extend:/[,[\].]+?/},Ou=(e,t)=>{const n=Dh(t,Mh.basic,e)||Dh(t,Mh.extend,e);return n===void 0||n===e?void 0:n},Es=()=>typeof window>"u",oc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),cv=(e,t)=>{const n=[];for(let r=0;r<t;r++){const o=r*t,i=e.slice(o,o+t);i.length>0&&n.push(i)}return n},yA={type:"spring",bounce:.3,duration:.6},kh=e=>(t=1)=>({x:`${100*e*t}%`,opacity:.25}),Fh={middle:{x:"0%",opacity:1},enter:kh(1),exit:kh(-1)},jh={exit:{visibility:"hidden"}},vA=e=>{const t=fn($y(e));return Vy({start:t,end:yo(t,41)})},uv=(e,t)=>e.toLocaleDateString(t,{month:"long"}),bA=(e,t)=>Array.from({length:12}).map((n,r)=>{const o=$y(new Date(e).setMonth(r)),i=uv(o,t);return x.jsx("option",{value:i,"data-index":r,children:i},i)}),Qa={ArrowLeft:(e,t)=>t==="days"?kI(e,1):Qy(e,1),ArrowRight:(e,t)=>t==="days"?yo(e,1):ea(e,1),ArrowUp:(e,t)=>t==="days"?FI(e,1):jI(e,1),ArrowDown:(e,t)=>t==="days"?Ny(e,1):Ly(e,1)},Nh=(e,t,n,r=0)=>{const o=n.toISOString(),i=()=>{var s;if(e!=null&&e.dataset.focustrap){const a=(s=t.current)==null?void 0:s.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&&i(),setTimeout(i,r)},Jn=e=>e.getFullYear().toString().padStart(4,"0"),xA=(e,t,n)=>e===void 0||n===void 0?!1:FR(t,e)&&jR(t,n),fv=({RenderOnDay:e,changeOnlyOnClick:t=!1,labelRange:n,disabledDate:r,locale:o,markToday:i=!0,onChangeMonth:s,onChangeYear:a,rangeMode:c=!1,onChange:l,styles:u,markRange:f=!0,...h})=>{const d=Dt(),p=b.useRef(null),{date:m,range:g}=h,v=m||new Date,w=b.useRef(null),[y,T]=Pu({date:v,isAnimating:!1,year:Jn(v),direction:void 0,range:{from:g==null?void 0:g.from,to:g==null?void 0:g.to},months:bA(v,o),selectMode:c?"from":void 0,week:Vy({start:fn(v),end:VP(v)})},I=>({onChangeYear:j=>({year:j}),setToday:()=>({date:Zr(new Date)}),onExitComplete:()=>(Nh(w.current||null,p,I.state().date,200),w.current=null,{isAnimating:!1}),date:j=>{const D=j(I.state().date);return{date:D,year:Jn(D)}},nextMonth:j=>{w.current=j.currentTarget;const D=I.state();if(D.isAnimating)return D;const N=ea(D.date,1);return{date:N,isAnimating:!0,direction:1,year:Jn(N)}},previousMonth:j=>{w.current=j.currentTarget;const D=I.state();if(D.isAnimating)return D;const N=Qy(D.date,1);return{date:N,isAnimating:!0,direction:-1,year:Jn(N)}},onSelectDate:j=>{const D=I.state(),N=j.currentTarget.dataset.range==="true",P=j.currentTarget.dataset.date||"",O=new Date(P);return{date:O,year:Jn(O),selectMode:D.selectMode===void 0?void 0:D.selectMode==="from"?"to":"from",range:N?{from:D.selectMode==="from"?O:D.range.from,to:D.selectMode==="to"?O:D.range.to}:D.range}},onChangeMonth:j=>{const D=j.target.value,P=Array.from(j.target.options).find(F=>F.value===D),O=I.state();if(P){const F=P.dataset.index||"",_=new Date(I.state().date);return _.setMonth(+F),{...O,date:_,year:Jn(_)}}return O},onKeyDown:j=>{const D=j.key,N=I.state();if(D in Qa){(D==="ArrowUp"||D==="ArrowDown")&&j.preventDefault();const P=I.state().date,O=vn.keyof(Qa,D)?Qa[D](P,j.shiftKey?"month":"days"):null;if(O!==null)return Nh(j.target,p,O),{...N,date:O,year:Jn(O)}}return I.state()}}),{props:{onChangeMonth:s,onChangeYear:a},postMiddleware:[(I,j,D)=>{var P,O;return(D.method==="onChangeMonth"||D.method==="previousMonth"||D.method==="nextMonth")&&((O=(P=D.props).onChangeMonth)==null||O.call(P,I.date)),I},(I,j,D)=>{var P,O;return D.method==="onChangeYear"&&((O=(P=D.props).onChangeYear)==null||O.call(P,I.date)),I},(I,j,D)=>{const N=D.method==="onSelectDate"||D.method==="setToday"||D.method==="onKeyDown";return c&&N&&t?(l==null||l(I.range),I):(N&&t&&(l==null||l(I.date)),I)}]}),S=cv(vA(y.date),7),E=y.date.toISOString(),R=uv(y.date,o);b.useEffect(()=>{t||l==null||l(y.date)},[E]);const A=lA(I=>{T.date(j=>{const D=new Date(j);return D.setFullYear(+I),D})},1200),k=I=>{const j=I.currentTarget.value;T.onChangeYear(j),a==null||a(new Date(j)),A(j)};return x.jsx(TC,{transition:yA,children:x.jsxs("div",{ref:p,className:ke("relative overflow-hidden",u==null?void 0:u.calendar),children:[x.jsx("div",{className:"flex flex-col justify-center rounded text-center",children:x.jsx(go,{initial:!1,mode:"popLayout",custom:y.direction,onExitComplete:T.onExitComplete,children:x.jsxs(ft.div,{initial:"enter",animate:"middle",exit:"exit",children:[x.jsxs("header",{className:"relative flex justify-between",children:[x.jsx(ft.button,{layout:!0,"data-focustrap":"prev",variants:jh,onClick:T.previousMonth,className:"z-calendar rounded-full p-1.5 hover:bg-primary",children:x.jsx(mP,{className:"h-4 w-4"})}),x.jsx(ft.span,{layout:!0,variants:Fh,custom:y.direction,className:"absolute inset-0 isolate z-normal flex items-center justify-center font-semibold",children:x.jsxs("span",{className:"flex w-fit items-center justify-center gap-0.5 py-1",children:[x.jsx("select",{style:{width:`${R.length}ch`},value:R,onChange:T.onChangeMonth,className:"w-fit cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary",children:y.months}),x.jsx(nv,{mask:"int",value:y.year,maxLength:4,placeholder:"YYYY",onChange:k,style:{width:`${y.year.length}ch`},className:"w-16 cursor-pointer appearance-none bg-transparent hover:text-primary"})]})}),x.jsx(ft.button,{layout:!0,"data-focustrap":"next",variants:jh,className:"z-calendar rounded-full p-1.5 hover:bg-primary",onClick:T.nextMonth,children:x.jsx(bu,{className:"h-4 w-4"})}),x.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%)"}})]}),x.jsxs(ft.table,{className:"mt-2 table min-w-full table-auto border-0",children:[x.jsx("thead",{children:x.jsx("tr",{children:y.week.map(I=>x.jsx("th",{className:ke("py-2 text-sm font-medium capitalize",u==null?void 0:u.weekDay),children:I.toLocaleDateString(o,{weekday:"short"})},I.toString()))})}),x.jsx(ft.tbody,{layout:!0,variants:Fh,custom:y.direction,onKeyDown:T.onKeyDown,className:ke(u==null?void 0:u.week),children:S.map((I,j)=>x.jsx("tr",{className:u==null?void 0:u.week,children:I.map(D=>{var U,M,$,q;const N=D.toISOString(),P=c?N===((U=g==null?void 0:g.to)==null?void 0:U.toISOString())||N===((M=g==null?void 0:g.from)==null?void 0:M.toISOString()):N===(m==null?void 0:m.toISOString()),O=MI(D)&&i,F=(r==null?void 0:r(D))||!1,_=!DI(D,y.date)||F,H=c?xA(g==null?void 0:g.from,D,g==null?void 0:g.to):!1;return x.jsxs("td",{align:"center",className:ke("relative",u==null?void 0:u.dayFrame),children:[x.jsxs("button",{type:"button","data-date":N,disabled:F,"data-range":c,onClick:T.onSelectDate,"data-view":y.date.getMonth().toString(),className:ke(`flex size-10 items-center justify-center rounded-full font-semibold proportional-nums disabled:cursor-not-allowed ${O?"text-primary":""} ${_?"text-disabled":""} ${P?"bg-primary text-primary-foreground":""}`,u==null?void 0:u.day,H&&f?"size-10 border border-dashed border-card-border":""),children:[D.getDate(),P&&(($=y.range.from)==null?void 0:$.toISOString())===N?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:(n==null?void 0:n.from)??d.calendarFromDate})}):null,P&&((q=y.range.to)==null?void 0:q.toISOString())===N?x.jsx("span",{className:"absolute -top-2 left-0 h-full w-full",children:x.jsx("span",{className:"text-xs text-foreground",children:(n==null?void 0:n.to)??d.calendarToDate})}):null]}),e?x.jsx(e,{date:D}):null]},N)})},`week-${I.length}-${j}`))})]})]},R)})}),x.jsx("footer",{className:"mt-2 text-center text-primary",children:x.jsx("button",{className:"transition-transform duration-300 hover:scale-105",type:"button",onClick:T.setToday,children:"Today"})})]})})},dv=({children:e,title:t,as:n="div",container:r="",header:o=null,className:i="",...s})=>x.jsxs(ho,{...s,as:n,className:ke("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow",r),children:[t?x.jsx("header",{className:"mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium",children:t}):o,x.jsx("div",{className:ke("min-w-full px-8",i),children:e})]});function kt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function wA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function hv(...e){return t=>e.forEach(n=>wA(n,t))}function pr(...e){return C.useCallback(hv(...e),e)}function pv(e,t=[]){let n=[];function r(i,s){const a=C.createContext(s),c=n.length;n=[...n,s];function l(f){const{scope:h,children:d,...p}=f,m=(h==null?void 0:h[e][c])||a,g=C.useMemo(()=>p,Object.values(p));return x.jsx(m.Provider,{value:g,children:d})}function u(f,h){const d=(h==null?void 0:h[e][c])||a,p=C.useContext(d);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,u]}const o=()=>{const i=n.map(s=>C.createContext(s));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,TA(o,...t)]}function TA(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:c,scopeName:l})=>{const f=c(i)[`__scope${l}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Jr=C.forwardRef((e,t)=>{const{children:n,...r}=e,o=C.Children.toArray(n),i=o.find(EA);if(i){const s=i.props.children,a=o.map(c=>c===i?C.Children.count(s)>1?C.Children.only(null):C.isValidElement(s)?s.props.children:null:c);return x.jsx(ic,{...r,ref:t,children:C.isValidElement(s)?C.cloneElement(s,void 0,a):null})}return x.jsx(ic,{...r,ref:t,children:n})});Jr.displayName="Slot";var ic=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const o=PA(n);return C.cloneElement(n,{...CA(r,n.props),ref:t?hv(t,o):o})}return C.Children.count(n)>1?C.Children.only(null):null});ic.displayName="SlotClone";var SA=({children:e})=>x.jsx(x.Fragment,{children:e});function EA(e){return C.isValidElement(e)&&e.type===SA}function CA(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function PA(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)}function RA(e){const t=e+"CollectionProvider",[n,r]=pv(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=d=>{const{scope:p,children:m}=d,g=b.useRef(null),v=b.useRef(new Map).current;return x.jsx(o,{scope:p,itemMap:v,collectionRef:g,children:m})};s.displayName=t;const a=e+"CollectionSlot",c=b.forwardRef((d,p)=>{const{scope:m,children:g}=d,v=i(a,m),w=pr(p,v.collectionRef);return x.jsx(Jr,{ref:w,children:g})});c.displayName=a;const l=e+"CollectionItemSlot",u="data-radix-collection-item",f=b.forwardRef((d,p)=>{const{scope:m,children:g,...v}=d,w=b.useRef(null),y=pr(p,w),T=i(l,m);return b.useEffect(()=>(T.itemMap.set(w,{ref:w,...v}),()=>void T.itemMap.delete(w))),x.jsx(Jr,{[u]:"",ref:y,children:g})});f.displayName=l;function h(d){const p=i(e+"CollectionConsumer",d);return b.useCallback(()=>{const g=p.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((T,S)=>v.indexOf(T.ref.current)-v.indexOf(S.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},h,r]}var IA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],pn=IA.reduce((e,t)=>{const n=C.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Jr:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function mv(e,t){e&&yi.flushSync(()=>e.dispatchEvent(t))}function wn(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function AA(e,t=globalThis==null?void 0:globalThis.document){const n=wn(e);C.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var OA="DismissableLayer",sc="dismissableLayer.update",DA="dismissableLayer.pointerDownOutside",MA="dismissableLayer.focusOutside",Lh,gv=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...c}=e,l=C.useContext(gv),[u,f]=C.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=C.useState({}),p=pr(t,R=>f(R)),m=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),w=u?m.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,T=w>=v,S=FA(R=>{const A=R.target,k=[...l.branches].some(I=>I.contains(A));!T||k||(o==null||o(R),s==null||s(R),R.defaultPrevented||a==null||a())},h),E=jA(R=>{const A=R.target;[...l.branches].some(I=>I.contains(A))||(i==null||i(R),s==null||s(R),R.defaultPrevented||a==null||a())},h);return AA(R=>{w===l.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),C.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Lh=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),_h(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Lh)}},[u,h,n,l]),C.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),_h())},[u,l]),C.useEffect(()=>{const R=()=>d({});return document.addEventListener(sc,R),()=>document.removeEventListener(sc,R)},[]),x.jsx(pn.div,{...c,ref:p,style:{pointerEvents:y?T?"auto":"none":void 0,...e.style},onFocusCapture:kt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:kt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:kt(e.onPointerDownCapture,S.onPointerDownCapture)})});yv.displayName=OA;var kA="DismissableLayerBranch",vv=C.forwardRef((e,t)=>{const n=C.useContext(gv),r=C.useRef(null),o=pr(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(pn.div,{...e,ref:o})});vv.displayName=kA;function FA(e,t=globalThis==null?void 0:globalThis.document){const n=wn(e),r=C.useRef(!1),o=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){bv(DA,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function jA(e,t=globalThis==null?void 0:globalThis.document){const n=wn(e),r=C.useRef(!1);return C.useEffect(()=>{const o=i=>{i.target&&!r.current&&bv(MA,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _h(){const e=new CustomEvent(sc);document.dispatchEvent(e)}function bv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mv(o,i):o.dispatchEvent(i)}var NA=yv,LA=vv,Cs=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},_A="Portal",xv=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=C.useState(!1);Cs(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?jc.createPortal(x.jsx(pn.div,{...r,ref:t}),s):null});xv.displayName=_A;function VA(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var wv=e=>{const{present:t,children:n}=e,r=$A(t),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=pr(r.ref,BA(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:i}):null};wv.displayName="Presence";function $A(e){const[t,n]=C.useState(),r=C.useRef({}),o=C.useRef(e),i=C.useRef("none"),s=e?"mounted":"unmounted",[a,c]=VA(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const l=Hi(r.current);i.current=a==="mounted"?l:"none"},[a]),Cs(()=>{const l=r.current,u=o.current;if(u!==e){const h=i.current,d=Hi(l);e?c("MOUNT"):d==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&h!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Cs(()=>{if(t){const l=f=>{const d=Hi(r.current).includes(f.animationName);f.target===t&&d&&yi.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=Hi(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Hi(e){return(e==null?void 0:e.animationName)||"none"}function BA(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)}function WA({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=HA({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=wn(n),c=C.useCallback(l=>{if(i){const f=typeof l=="function"?l(e):l;f!==e&&a(f)}else o(l)},[i,e,o,a]);return[s,c]}function HA({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,o=C.useRef(r),i=wn(t);return C.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var zA="VisuallyHidden",Du=C.forwardRef((e,t)=>x.jsx(pn.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Du.displayName=zA;var Mu="ToastProvider",[ku,UA,GA]=RA("Toast"),[Tv,AL]=pv("Toast",[GA]),[YA,na]=Tv(Mu),Sv=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,c]=C.useState(null),[l,u]=C.useState(0),f=C.useRef(!1),h=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Mu}\`. Expected non-empty \`string\`.`),x.jsx(ku.Provider,{scope:t,children:x.jsx(YA,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:C.useCallback(()=>u(d=>d+1),[]),onToastRemove:C.useCallback(()=>u(d=>d-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:s})})};Sv.displayName=Mu;var Ev="ToastViewport",KA=["F8"],ac="toast.viewportPause",lc="toast.viewportResume",Cv=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=KA,label:o="Notifications ({hotkey})",...i}=e,s=na(Ev,n),a=UA(n),c=C.useRef(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),h=pr(t,f,s.onViewportChange),d=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=s.toastCount>0;C.useEffect(()=>{const g=v=>{var y;r.every(T=>v[T]||v.code===T)&&((y=f.current)==null||y.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),C.useEffect(()=>{const g=c.current,v=f.current;if(p&&g&&v){const w=()=>{if(!s.isClosePausedRef.current){const E=new CustomEvent(ac);v.dispatchEvent(E),s.isClosePausedRef.current=!0}},y=()=>{if(s.isClosePausedRef.current){const E=new CustomEvent(lc);v.dispatchEvent(E),s.isClosePausedRef.current=!1}},T=E=>{!g.contains(E.relatedTarget)&&y()},S=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",T),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",S),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",T),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",S),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[p,s.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:g})=>{const w=a().map(y=>{const T=y.ref.current,S=[T,...lO(T)];return g==="forwards"?S:S.reverse()});return(g==="forwards"?w.reverse():w).flat()},[a]);return C.useEffect(()=>{const g=f.current;if(g){const v=w=>{var S,E,R;const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const A=document.activeElement,k=w.shiftKey;if(w.target===g&&k){(S=l.current)==null||S.focus();return}const D=m({tabbingDirection:k?"backwards":"forwards"}),N=D.findIndex(P=>P===A);Za(D.slice(N+1))?w.preventDefault():k?(E=l.current)==null||E.focus():(R=u.current)==null||R.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[a,m]),x.jsxs(LA,{ref:c,role:"region","aria-label":o.replace("{hotkey}",d),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&x.jsx(cc,{ref:l,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});Za(g)}}),x.jsx(ku.Slot,{scope:n,children:x.jsx(pn.ol,{tabIndex:-1,...i,ref:h})}),p&&x.jsx(cc,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});Za(g)}})]})});Cv.displayName=Ev;var Pv="ToastFocusProxy",cc=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=na(Pv,n);return x.jsx(Du,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var l;const a=s.relatedTarget;!((l=i.viewport)!=null&&l.contains(a))&&r()}})});cc.displayName=Pv;var ra="Toast",qA="toast.swipeStart",XA="toast.swipeMove",QA="toast.swipeCancel",ZA="toast.swipeEnd",Rv=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a=!0,c]=WA({prop:r,defaultProp:o,onChange:i});return x.jsx(wv,{present:n||a,children:x.jsx(tO,{open:a,...s,ref:t,onClose:()=>c(!1),onPause:wn(e.onPause),onResume:wn(e.onResume),onSwipeStart:kt(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:kt(e.onSwipeMove,l=>{const{x:u,y:f}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:kt(e.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:kt(e.onSwipeEnd,l=>{const{x:u,y:f}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});Rv.displayName=ra;var[JA,eO]=Tv(ra,{onClose(){}}),tO=C.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:d,...p}=e,m=na(ra,n),[g,v]=C.useState(null),w=pr(t,P=>v(P)),y=C.useRef(null),T=C.useRef(null),S=o||m.duration,E=C.useRef(0),R=C.useRef(S),A=C.useRef(0),{onToastAdd:k,onToastRemove:I}=m,j=wn(()=>{var O;(g==null?void 0:g.contains(document.activeElement))&&((O=m.viewport)==null||O.focus()),s()}),D=C.useCallback(P=>{!P||P===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(j,P))},[j]);C.useEffect(()=>{const P=m.viewport;if(P){const O=()=>{D(R.current),l==null||l()},F=()=>{const _=new Date().getTime()-E.current;R.current=R.current-_,window.clearTimeout(A.current),c==null||c()};return P.addEventListener(ac,F),P.addEventListener(lc,O),()=>{P.removeEventListener(ac,F),P.removeEventListener(lc,O)}}},[m.viewport,S,c,l,D]),C.useEffect(()=>{i&&!m.isClosePausedRef.current&&D(S)},[i,S,m.isClosePausedRef,D]),C.useEffect(()=>(k(),()=>I()),[k,I]);const N=C.useMemo(()=>g?kv(g):null,[g]);return m.viewport?x.jsxs(x.Fragment,{children:[N&&x.jsx(nO,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:N}),x.jsx(JA,{scope:n,onClose:j,children:yi.createPortal(x.jsx(ku.ItemSlot,{scope:n,children:x.jsx(NA,{asChild:!0,onEscapeKeyDown:kt(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||j(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(pn.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:kt(e.onKeyDown,P=>{P.key==="Escape"&&(a==null||a(P.nativeEvent),P.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:kt(e.onPointerDown,P=>{P.button===0&&(y.current={x:P.clientX,y:P.clientY})}),onPointerMove:kt(e.onPointerMove,P=>{if(!y.current)return;const O=P.clientX-y.current.x,F=P.clientY-y.current.y,_=!!T.current,H=["left","right"].includes(m.swipeDirection),U=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,M=H?U(0,O):0,$=H?0:U(0,F),q=P.pointerType==="touch"?10:2,J={x:M,y:$},X={originalEvent:P,delta:J};_?(T.current=J,zi(XA,f,X,{discrete:!1})):Vh(J,m.swipeDirection,q)?(T.current=J,zi(qA,u,X,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(O)>q||Math.abs(F)>q)&&(y.current=null)}),onPointerUp:kt(e.onPointerUp,P=>{const O=T.current,F=P.target;if(F.hasPointerCapture(P.pointerId)&&F.releasePointerCapture(P.pointerId),T.current=null,y.current=null,O){const _=P.currentTarget,H={originalEvent:P,delta:O};Vh(O,m.swipeDirection,m.swipeThreshold)?zi(ZA,d,H,{discrete:!0}):zi(QA,h,H,{discrete:!0}),_.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),nO=e=>{const{__scopeToast:t,children:n,...r}=e,o=na(ra,t),[i,s]=C.useState(!1),[a,c]=C.useState(!1);return sO(()=>s(!0)),C.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:x.jsx(xv,{asChild:!0,children:x.jsx(Du,{...r,children:i&&x.jsxs(x.Fragment,{children:[o.label," ",n]})})})},rO="ToastTitle",Iv=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(pn.div,{...r,ref:t})});Iv.displayName=rO;var oO="ToastDescription",Av=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.jsx(pn.div,{...r,ref:t})});Av.displayName=oO;var Ov="ToastAction",iO=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?x.jsx(Mv,{altText:n,asChild:!0,children:x.jsx(Fu,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ov}\`. Expected non-empty \`string\`.`),null)});iO.displayName=Ov;var Dv="ToastClose",Fu=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=eO(Dv,n);return x.jsx(Mv,{asChild:!0,children:x.jsx(pn.button,{type:"button",...r,ref:t,onClick:kt(e.onClick,o.onClose)})})});Fu.displayName=Dv;var Mv=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return x.jsx(pn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function kv(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),aO(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...kv(r))}}),t}function zi(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mv(o,i):o.dispatchEvent(i)}var Vh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function sO(e=()=>{}){const t=wn(e);Cs(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function aO(e){return e.nodeType===e.ELEMENT_NODE}function lO(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Za(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var cO=Sv,uO=Cv,fO=Rv,dO=Iv,hO=Av,pO=Fu;const mO=e=>{const[t,n]=b.useState(!1),r=()=>n(!0),o=()=>n(!1);return b.useEffect(()=>{const i=e.current;if(i)return i.addEventListener("mouseenter",r),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mouseenter",r),i.removeEventListener("mouseleave",o)}},[]),t},gO=lo("relative isolate z-tooltip flex justify-between overflow-hidden whitespace-nowrap rounded-lg border text-sm shadow-sm supports-[backdrop-filter]:backdrop-blur-xl",{variants:{theme:{warn:"bg-warn-notification/90 text-warn-hover border-warn/50",info:"bg-info-notification supports-[backdrop-filter]:bg-info-notification/50 supports-[backdrop-filter]:bg-info/20 text-info border-info/50",danger:"bg-danger-notification supports-[backdrop-filter]:bg-danger-notification/60 text-danger border-danger/50",success:"bg-success-notification supports-[backdrop-filter]:bg-success-notification/50 text-success border-success/50",default:"border-card-border bg-card-background text-foreground"}},defaultVariants:{theme:"default"}}),Fv=b.createContext(()=>{throw new Error("Not implemented")}),yO=()=>b.useContext(Fv),$h={0:{opacity:1,y:[10,15],scale:[1,.98]},1:{opacity:1,y:[15,20],scale:[1,.97]},2:{opacity:1,y:[20,25],scale:[1,.96]},default:{opacity:1,y:[25,30],scale:[1,.95]}},vO=b.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,i=t.hover?"hover":t.isLast?"isLast":"other",s=gO({theme:t.theme||"default"});return x.jsx(fO,{ref:n,asChild:!0,forceMount:!0,onOpenChange:t.onClose,duration:o,children:x.jsx(ft.li,{layout:!0,layoutScroll:!0,animate:i,"data-index":t.index,initial:{y:-100,zIndex:-1},className:"text-select pointer-events-auto absolute right-0 top-0 w-80",variants:{isLast:{y:10,scale:1,animationDuration:"300ms",opacity:1},hover:{y:0,position:"static",scale:1,opacity:1},other:$h[t.reversedIndex]||$h.default},transition:{type:"spring",mass:1.2,damping:30,stiffness:200},exit:{opacity:[.9,0],transition:{opacity:{bounce:.25,duration:.3}}},children:x.jsxs("div",{className:s,children:[x.jsxs("div",{className:"flex flex-col p-4",children:[t.title?x.jsx(dO,{className:"select-text truncate text-lg font-medium leading-relaxed",children:"Title"}):null,x.jsx(hO,{className:"select-text truncate",children:t.text})]}),r?x.jsx(pO,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:x.jsx(wu,{className:"h-5 w-5"})}):null]})})})});function bO({children:e,max:t=5,duration:n=5e3}){const r=b.useRef(null),o=mO(r),[i,s]=b.useState([]),a=b.useCallback(()=>s([]),[]);b.useEffect(()=>()=>a(),[a]);const c=b.useCallback((l,u)=>{const f=window.crypto.randomUUID();return s(d=>{const p=[...d,{...u,id:f,text:l}];return p.length>t?p.slice(p.length-t,p.length+1):p}),{clear:a,close:()=>s(d=>d.filter(p=>p.id!==f))}},[t]);return x.jsxs(cO,{duration:n,swipeThreshold:150,children:[x.jsx(Fv.Provider,{value:c,children:e}),x.jsx(go,{presenceAffectsLayout:!0,mode:"popLayout",children:i.map((l,u,f)=>{const h=()=>s(d=>d.filter(p=>p.id!==l.id));return b.createElement(vO,{...l,key:l.id,hover:o,index:u,onClose:h,isLast:f.length-1===u,reversedIndex:f.length-(u+1)})})}),x.jsx(uO,{ref:r,"data-items":i.length,style:{justifyContent:"start",height:`${(o?i.length:Math.min(1,i.length))*7}rem`},className:"fixed right-4 top-10 flex w-80 list-none flex-col-reverse items-end gap-4 overflow-y-clip overflow-x-visible data-[items=true]:pb-8 max-sm:top-20"})]})}const xO=e=>x.jsxs("div",{className:"divide-y divide-card-border bg-card-background shadow border border-card-border rounded-card",children:[x.jsxs("header",{className:"p-6 items-start flex gap-4",children:[x.jsx("div",{className:ke("size-10 p-8 rounded-card flex items-center justify-center aspect-square bg-primary",e.iconContainer),children:x.jsx("div",{children:x.jsx(e.Icon,{className:"size-10 aspect-square text-primary-foreground"})})}),x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("header",{children:x.jsx("h3",{className:"text-base leading-none",children:e.title})}),x.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?x.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),jv=(e,t)=>{const[n,r]=b.useState(()=>t||e);return b.useEffect(()=>{r(e)},[e]),[n,r]},Nv=b.createContext(""),wO=e=>{const[t,n]=jv(e.active),r=qr(0),o=qr(0),i=b.useRef(null),s=e.useHash?"a":"button";b.useLayoutEffect(()=>{const u=i.current;if(u===null)return;const f=m=>{if(!m)return;const g=m.getBoundingClientRect();o.set(g.width),r.set(m.offsetLeft)},h=()=>{const m=u.querySelector("li[data-active=true]");return void f(m)};window.addEventListener("resize",h);let d=u.querySelector("li[data-active=true]");const p=window.location.hash.replace(/^#/,"");if(e.active===""&&p!==""&&(d=u.querySelector(`li[data-id="${p}"]`),n(p)),d===null){d=u.querySelector("li[data-id]");const m=d.getAttribute("data-id")||"";n(m)}return f(d),()=>window.removeEventListener("resize",h)},[]);const a=Bm(e.onChange);b.useEffect(()=>{a.current&&a.current(t)},[a,t]);const c=b.Children.toArray(e.children),l=u=>{const f=u.currentTarget,h=f.getBoundingClientRect();o.set(h.width),r.set(f.offsetLeft),n(f.dataset.id||"")};return x.jsx(Nv.Provider,{value:t,children:x.jsx(dv,{className:e.className,container:"pt-0 max-w-full w-full min-w-0",header:x.jsx("header",{ref:i,className:"relative mb-2 overflow-x-auto border-b border-card-border",children:x.jsx("nav",{className:"min-w-0",children:x.jsx("ul",{className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:c.map(u=>{const f=u.props;return x.jsx("li",{"data-id":f.id,"data-active":t===f.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:x.jsx(s,{"data-id":f.id,onClick:l,"aria-current":"page",href:e.useHash?`#${f.id}`:void 0,className:"block w-full whitespace-nowrap px-10 py-4",children:f.title})},`tab-header-${f.id}`)})})})}),children:e.children})})},TO=()=>b.useContext(Nv),SO=e=>{const t=TO();return x.jsx(b.Fragment,{children:e.id===t?e.children:null})};function Un(e){return Lv(e)?(e.nodeName||"").toLowerCase():"#document"}function Pt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sn(e){var t;return(t=(Lv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lv(e){return e instanceof Node||e instanceof Pt(e).Node}function De(e){return e instanceof Element||e instanceof Pt(e).Element}function et(e){return e instanceof HTMLElement||e instanceof Pt(e).HTMLElement}function uc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pt(e).ShadowRoot}function Ci(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function EO(e){return["table","td","th"].includes(Un(e))}function oa(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ju(e){const t=Nu(),n=De(e)?Vt(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 CO(e){let t=Tn(e);for(;et(t)&&!_n(t);){if(ju(t))return t;if(oa(t))return null;t=Tn(t)}return null}function Nu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _n(e){return["html","body","#document"].includes(Un(e))}function Vt(e){return Pt(e).getComputedStyle(e)}function ia(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tn(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||uc(e)&&e.host||Sn(e);return uc(t)?t.host:t}function _v(e){const t=Tn(e);return _n(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&Ci(t)?t:_v(t)}function Fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=_v(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Pt(o);if(i){const a=fc(s);return t.concat(s,s.visualViewport||[],Ci(o)?o:[],a&&n?Fn(a):[])}return t.concat(o,Fn(o,[],n))}function fc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ht(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 Ye(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&uc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Lu(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Vv(){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 $v(e){return e.mozInputSource===0&&e.isTrusted?!0:dc()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function _u(e){return PO()?!1:!dc()&&e.width===0&&e.height===0||dc()&&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 Vu(){return/apple/i.test(navigator.vendor)}function dc(){const e=/android/i;return e.test(Lu())||e.test(Vv())}function Bv(){return Lu().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function PO(){return Vv().includes("jsdom/")}function eo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function RO(e){return"nativeEvent"in e}function IO(e){return e.matches("html,body")}function ut(e){return(e==null?void 0:e.ownerDocument)||document}function Ja(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 nn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const AO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function $u(e){return et(e)&&e.matches(AO)}function mt(e){e.preventDefault(),e.stopPropagation()}function Wv(e){return e?e.getAttribute("role")==="combobox"&&$u(e):!1}const rn=Math.min,Mt=Math.max,Ps=Math.round,Fr=Math.floor,Vn=e=>({x:e,y:e}),OO={left:"right",right:"left",bottom:"top",top:"bottom"},DO={start:"end",end:"start"};function hc(e,t,n){return Mt(e,rn(t,n))}function vo(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function bo(e){return e.split("-")[1]}function Hv(e){return e==="x"?"y":"x"}function Bu(e){return e==="y"?"height":"width"}function mr(e){return["top","bottom"].includes($n(e))?"y":"x"}function Wu(e){return Hv(mr(e))}function MO(e,t,n){n===void 0&&(n=!1);const r=bo(e),o=Wu(e),i=Bu(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Rs(s)),[s,Rs(s)]}function kO(e){const t=Rs(e);return[pc(e),t,pc(t)]}function pc(e){return e.replace(/start|end/g,t=>DO[t])}function FO(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function jO(e,t,n,r){const o=bo(e);let i=FO($n(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(pc)))),i}function Rs(e){return e.replace(/left|right|bottom|top/g,t=>OO[t])}function NO(e){return{top:0,right:0,bottom:0,left:0,...e}}function zv(e){return typeof e!="number"?NO(e):{top:e,right:e,bottom:e,left:e}}function Is(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])"],As=LO.join(","),Uv=typeof Element>"u",to=Uv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Os=!Uv&&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},Ds=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"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},_O=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},VO=function(t,n,r){if(Ds(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(As));return n&&to.call(t,As)&&o.unshift(t),o=o.filter(r),o},$O=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Ds(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,l=e(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{var u=to.call(s,As);u&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!Ds(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&h){var d=e(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},Gv=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Yv=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||_O(t))&&!Gv(t)?0:t.tabIndex},BO=function(t,n){var r=Yv(t);return r<0&&n&&!Gv(t)?0:r},WO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Kv=function(t){return t.tagName==="INPUT"},HO=function(t){return Kv(t)&&t.type==="hidden"},zO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},UO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},GO=function(t){if(!t.name)return!0;var n=t.form||Os(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(s){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",s.message),!1}var i=UO(o,t.form);return!i||i===t},YO=function(t){return Kv(t)&&t.type==="radio"},KO=function(t){return YO(t)&&!GO(t)},qO=function(t){var n,r=t&&Os(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,c;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var l,u,f;r=Os(o),o=(l=r)===null||l===void 0?void 0:l.host,i=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Bh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},XO=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=to.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(to.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,l=Os(t);if(c&&!c.shadowRoot&&o(c)===!0)return Bh(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=a}if(qO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Bh(t);return!1},QO=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 to.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ZO=function(t,n){return!(n.disabled||Ds(n)||HO(n)||XO(n,t)||zO(n)||QO(n))},mc=function(t,n){return!(KO(n)||Yv(n)<0||!ZO(t,n))},JO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},eD=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=BO(a,s),l=s?e(o.candidates):a;c===0?s?n.push.apply(n,l):n.push(a):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:l})}),r.sort(WO).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},li=function(t,n){n=n||{};var r;return n.getShadowRoot?r=$O([t],n.includeContainer,{filter:mc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:JO}):r=VO(t,n.includeContainer,mc.bind(null,n)),eD(r)},tD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return to.call(t,As)===!1?!1:mc(n,t)};function Wh(e,t,n){let{reference:r,floating:o}=e;const i=mr(t),s=Wu(t),a=Bu(s),c=$n(t),l=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let d;switch(c){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(bo(t)){case"start":d[s]-=h*(n&&l?-1:1);break;case"end":d[s]+=h*(n&&l?-1:1);break}return d}const nD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Wh(l,r,c),h=r,d={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:w,y,data:T,reset:S}=await v({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:d,rects:l,platform:s,elements:{reference:e,floating:t}});u=w??u,f=y??f,d={...d,[g]:{...d[g],...T}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:f}=Wh(l,h,c)),m=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}};async function Hu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=vo(t,e),p=zv(d),g=a[h?f==="floating"?"reference":"floating":f],v=Is(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),T=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},S=Is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:c}):w);return{top:(v.top-S.top+p.top)/T.y,bottom:(S.bottom-v.bottom+p.bottom)/T.y,left:(v.left-S.left+p.left)/T.x,right:(S.right-v.right+p.right)/T.x}}const rD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=vo(e,t)||{};if(l==null)return{};const f=zv(u),h={x:n,y:r},d=Wu(o),p=Bu(d),m=await s.getDimensions(l),g=d==="y",v=g?"top":"left",w=g?"bottom":"right",y=g?"clientHeight":"clientWidth",T=i.reference[p]+i.reference[d]-h[d]-i.floating[p],S=h[d]-i.reference[d],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let R=E?E[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(E)))&&(R=a.floating[y]||i.floating[p]);const A=T/2-S/2,k=R/2-m[p]/2-1,I=rn(f[v],k),j=rn(f[w],k),D=I,N=R-m[p]-j,P=R/2-m[p]/2+A,O=hc(D,P,N),F=!c.arrow&&bo(o)!=null&&P!==O&&i.reference[p]/2-(P<D?I:j)-m[p]/2<0,_=F?P<D?P-D:P-N:0;return{[d]:h[d]+_,data:{[d]:O,centerOffset:P-O-_,...F&&{alignmentOffset:_}},reset:F}}}),oD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=vo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=$n(o),w=mr(a),y=$n(a)===a,T=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=h||(y||!m?[Rs(a)]:kO(a)),E=p!=="none";!h&&E&&S.push(...jO(a,m,p,T));const R=[a,...S],A=await Hu(t,g),k=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(A[v]),f){const P=MO(o,s,T);k.push(A[P[0]],A[P[1]])}if(I=[...I,{placement:o,overflows:k}],!k.every(P=>P<=0)){var j,D;const P=(((j=i.flip)==null?void 0:j.index)||0)+1,O=R[P];if(O)return{data:{index:P,overflows:I},reset:{placement:O}};let F=(D=I.filter(_=>_.overflows[0]<=0).sort((_,H)=>_.overflows[1]-H.overflows[1])[0])==null?void 0:D.placement;if(!F)switch(d){case"bestFit":{var N;const _=(N=I.filter(H=>{if(E){const U=mr(H.placement);return U===w||U==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(U=>U>0).reduce((U,M)=>U+M,0)]).sort((H,U)=>H[1]-U[1])[0])==null?void 0:N[0];_&&(F=_);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function iD(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=$n(n),a=bo(n),c=mr(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,f=vo(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(d=a==="end"?p*-1:p),c?{x:d*u,y:h*l}:{x:h*l,y:d*u}}const sD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await iD(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},aD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...c}=vo(e,t),l={x:n,y:r},u=await Hu(t,c),f=mr($n(o)),h=Hv(f);let d=l[h],p=l[f];if(i){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",w=d+u[g],y=d-u[v];d=hc(w,d,y)}if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=p+u[g],y=p-u[v];p=hc(w,p,y)}const m=a.fn({...t,[h]:d,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},lD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=vo(e,t),c=await Hu(t,a),l=$n(n),u=bo(n),f=mr(n)==="y",{width:h,height:d}=r.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const g=d-c.top-c.bottom,v=h-c.left-c.right,w=rn(d-c[p],g),y=rn(h-c[m],v),T=!t.middlewareData.shift;let S=w,E=y;if(f?E=u||T?rn(y,v):v:S=u||T?rn(w,g):g,T&&!u){const A=Mt(c.left,0),k=Mt(c.right,0),I=Mt(c.top,0),j=Mt(c.bottom,0);f?E=h-2*(A!==0||k!==0?A+k:Mt(c.left,c.right)):S=d-2*(I!==0||j!==0?I+j:Mt(c.top,c.bottom))}await s({...t,availableWidth:E,availableHeight:S});const R=await o.getDimensions(i.floating);return h!==R.width||d!==R.height?{reset:{rects:!0}}:{}}}};function qv(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ps(n)!==i||Ps(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zu(e){return De(e)?e:e.contextElement}function Lr(e){const t=zu(e);if(!et(t))return Vn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qv(t);let s=(i?Ps(n.width):n.width)/r,a=(i?Ps(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cD=Vn(0);function Xv(e){const t=Pt(e);return!Nu()||!t.visualViewport?cD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function gr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zu(e);let s=Vn(1);t&&(r?De(r)&&(s=Lr(r)):s=Lr(e));const a=uD(i,n,r)?Xv(i):Vn(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=Pt(i),d=r&&De(r)?Pt(r):r;let p=h,m=fc(p);for(;m&&r&&d!==p;){const g=Lr(m),v=m.getBoundingClientRect(),w=Vt(m),y=v.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,T=v.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;c*=g.x,l*=g.y,u*=g.x,f*=g.y,c+=y,l+=T,p=Pt(m),m=fc(p)}}return Is({width:u,height:f,x:c,y:l})}function fD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Sn(r),a=t?oa(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Vn(1);const u=Vn(0),f=et(r);if((f||!f&&!i)&&((Un(r)!=="body"||Ci(s))&&(c=ia(r)),et(r))){const h=gr(r);l=Lr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function dD(e){return Array.from(e.getClientRects())}function Qv(e){return gr(Sn(e)).left+ia(e).scrollLeft}function hD(e){const t=Sn(e),n=ia(e),r=e.ownerDocument.body,o=Mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Qv(e);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(s+=Mt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function pD(e,t){const n=Pt(e),r=Sn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=Nu();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function mD(e,t){const n=gr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=et(e)?Lr(e):Vn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Hh(e,t,n){let r;if(t==="viewport")r=pD(e,n);else if(t==="document")r=hD(Sn(e));else if(De(t))r=mD(t,n);else{const o=Xv(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Is(r)}function Zv(e,t){const n=Tn(e);return n===t||!De(n)||_n(n)?!1:Vt(n).position==="fixed"||Zv(n,t)}function gD(e,t){const n=t.get(e);if(n)return n;let r=Fn(e,[],!1).filter(a=>De(a)&&Un(a)!=="body"),o=null;const i=Vt(e).position==="fixed";let s=i?Tn(e):e;for(;De(s)&&!_n(s);){const a=Vt(s),c=ju(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ci(s)&&!c&&Zv(e,s))?r=r.filter(u=>u!==s):o=a,s=Tn(s)}return t.set(e,r),r}function yD(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oa(t)?[]:gD(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const f=Hh(t,u,o);return l.top=Mt(f.top,l.top),l.right=rn(f.right,l.right),l.bottom=rn(f.bottom,l.bottom),l.left=Mt(f.left,l.left),l},Hh(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vD(e){const{width:t,height:n}=qv(e);return{width:t,height:n}}function bD(e,t,n){const r=et(t),o=Sn(t),i=n==="fixed",s=gr(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Vn(0);if(r||!r&&!i)if((Un(t)!=="body"||Ci(o))&&(a=ia(t)),r){const f=gr(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=Qv(o));const l=s.left+a.scrollLeft-c.x,u=s.top+a.scrollTop-c.y;return{x:l,y:u,width:s.width,height:s.height}}function el(e){return Vt(e).position==="static"}function zh(e,t){return!et(e)||Vt(e).position==="fixed"?null:t?t(e):e.offsetParent}function Jv(e,t){const n=Pt(e);if(oa(e))return n;if(!et(e)){let o=Tn(e);for(;o&&!_n(o);){if(De(o)&&!el(o))return o;o=Tn(o)}return n}let r=zh(e,t);for(;r&&EO(r)&&el(r);)r=zh(r,t);return r&&_n(r)&&el(r)&&!ju(r)?n:r||CO(e)||n}const xD=async function(e){const t=this.getOffsetParent||Jv,n=this.getDimensions,r=await n(e.floating);return{reference:bD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wD(e){return Vt(e).direction==="rtl"}const TD={convertOffsetParentRelativeRectToViewportRelativeRect:fD,getDocumentElement:Sn,getClippingRect:yD,getOffsetParent:Jv,getElementRects:xD,getClientRects:dD,getDimensions:vD,getScale:Lr,isElement:De,isRTL:wD};function SD(e,t){let n=null,r;const o=Sn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:l,top:u,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const d=Fr(u),p=Fr(o.clientWidth-(l+f)),m=Fr(o.clientHeight-(u+h)),g=Fr(l),w={rootMargin:-d+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Mt(0,rn(1,c))||1};let y=!0;function T(S){const E=S[0].intersectionRatio;if(E!==c){if(!y)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(T,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(e)}return s(!0),i}function sa(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=zu(e),u=o||i?[...l?Fn(l):[],...Fn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=l&&a?SD(l,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(t)})),n()}),l&&!c&&d.observe(l),d.observe(t));let p,m=c?gr(e):null;c&&g();function g(){const v=gr(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(g)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(v=d)==null||v.disconnect(),d=null,c&&cancelAnimationFrame(p)}}const ED=sD,CD=aD,PD=oD,RD=lD,Uh=rD,ID=(e,t,n)=>{const r=new Map,o={platform:TD,...n},i={...o.platform,_c:r};return nD(e,t,{...o,platform:i})};var os=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Ms(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(!Ms(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ms(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function eb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gh(e,t){const n=eb(e);return Math.round(t*n)/n}function Yh(e){const t=C.useRef(e);return os(()=>{t.current=e}),t}function AD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);Ms(h,r)||d(r);const[p,m]=C.useState(null),[g,v]=C.useState(null),w=C.useCallback(_=>{_!==E.current&&(E.current=_,m(_))},[]),y=C.useCallback(_=>{_!==R.current&&(R.current=_,v(_))},[]),T=i||p,S=s||g,E=C.useRef(null),R=C.useRef(null),A=C.useRef(u),k=c!=null,I=Yh(c),j=Yh(o),D=C.useCallback(()=>{if(!E.current||!R.current)return;const _={placement:t,strategy:n,middleware:h};j.current&&(_.platform=j.current),ID(E.current,R.current,_).then(H=>{const U={...H,isPositioned:!0};N.current&&!Ms(A.current,U)&&(A.current=U,yi.flushSync(()=>{f(U)}))})},[h,t,n,j]);os(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[l]);const N=C.useRef(!1);os(()=>(N.current=!0,()=>{N.current=!1}),[]),os(()=>{if(T&&(E.current=T),S&&(R.current=S),T&&S){if(I.current)return I.current(T,S,D);D()}},[T,S,D,I,k]);const P=C.useMemo(()=>({reference:E,floating:R,setReference:w,setFloating:y}),[w,y]),O=C.useMemo(()=>({reference:T,floating:S}),[T,S]),F=C.useMemo(()=>{const _={position:n,left:0,top:0};if(!O.floating)return _;const H=Gh(O.floating,u.x),U=Gh(O.floating,u.y);return a?{..._,transform:"translate("+H+"px, "+U+"px)",...eb(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,O.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:D,refs:P,elements:O,floatingStyles:F}),[u,D,P,O,F])}const OD=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?Uh({element:r.current,padding:o}).fn(n):{}:r?Uh({element:r,padding:o}).fn(n):{}}}},aa=(e,t)=>({...ED(e),options:[e,t]}),Uu=(e,t)=>({...CD(e),options:[e,t]}),Gu=(e,t)=>({...PD(e),options:[e,t]}),DD=(e,t)=>({...RD(e),options:[e,t]}),tb=(e,t)=>({...OD(e),options:[e,t]});function gc(e){return C.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const nb={...C},MD=nb.useInsertionEffect,kD=MD||(e=>e());function at(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return kD(()=>{t.current=e}),C.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 Yu="ArrowUp",Pi="ArrowDown",no="ArrowLeft",xo="ArrowRight";function Ui(e,t,n){return Math.floor(e/t)!==n}function Qo(e,t){return t<0||t>=e.current.length}function tl(e,t){return xt(e,{disabledIndices:t})}function Kh(e,t){return xt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=t===void 0?{}:t;const s=e.current;let a=n;do a+=r?-i:i;while(a>=0&&a<=s.length-1&&is(s,a,o));return a}function FD(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:c,prevIndex:l,stopEvent:u=!1}=t,f=l;if(n.key===Yu){if(u&&mt(n),l===-1)f=c;else if(f=xt(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),o&&(l-i<a||f<0)){const h=l%i,d=c%i,p=c-(d-h);d===h?f=c:f=d>h?p:p-i}Qo(e,f)&&(f=l)}if(n.key===Pi&&(u&&mt(n),l===-1?f=a:(f=xt(e,{startingIndex:l,amount:i,disabledIndices:s}),o&&l+i>c&&(f=xt(e,{startingIndex:l%i-i,amount:i,disabledIndices:s}))),Qo(e,f)&&(f=l)),r==="both"){const h=Fr(l/i);n.key===xo&&(u&&mt(n),l%i!==i-1?(f=xt(e,{startingIndex:l,disabledIndices:s}),o&&Ui(f,i,h)&&(f=xt(e,{startingIndex:l-l%i-1,disabledIndices:s}))):o&&(f=xt(e,{startingIndex:l-l%i-1,disabledIndices:s})),Ui(f,i,h)&&(f=l)),n.key===no&&(u&&mt(n),l%i!==0?(f=xt(e,{startingIndex:l,decrement:!0,disabledIndices:s}),o&&Ui(f,i,h)&&(f=xt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:s}))):o&&(f=xt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:s})),Ui(f,i,h)&&(f=l));const d=Fr(c/i)===h;Qo(e,f)&&(o&&d?f=n.key===no?c:xt(e,{startingIndex:l-l%i-1,disabledIndices:s}):f=l)}return f}function jD(e,t,n){const r=[];let o=0;return e.forEach((i,s)=>{let{width:a,height:c}=i;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let l=!1;for(n&&(o=0);!l;){const u=[];for(let f=0;f<a;f++)for(let h=0;h<c;h++)u.push(o+f+h*t);o%t+a<=t&&u.every(f=>r[f]==null)?(u.forEach(f=>{r[f]=s}),l=!0):o++}}),[...r]}function ND(e,t,n,r,o){if(e===-1)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function LD(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function is(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 qh=0;function On(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(qh);const i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():qh=requestAnimationFrame(i)}var be=typeof document<"u"?b.useLayoutEffect:b.useEffect;function _D(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 VD(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 rb=C.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function $D(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=C.useState(()=>new Map),s=C.useCallback(c=>{i(l=>new Map(l).set(c,null))},[]),a=C.useCallback(c=>{i(l=>{const u=new Map(l);return u.delete(c),u})},[]);return be(()=>{const c=new Map(o);Array.from(c.keys()).sort(_D).forEach((u,f)=>{c.set(u,f)}),VD(o,c)||i(c)},[o]),C.createElement(rb.Provider,{value:C.useMemo(()=>({register:s,unregister:a,map:o,elementsRef:n,labelsRef:r}),[s,a,o,n,r])},t)}function ob(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:s}=C.useContext(rb),[a,c]=C.useState(null),l=C.useRef(null),u=C.useCallback(f=>{if(l.current=f,a!==null&&(i.current[a]=f,s)){var h;const d=t!==void 0;s.current[a]=d?t:(h=f==null?void 0:f.textContent)!=null?h:null}},[a,i,s,t]);return be(()=>{const f=l.current;if(f)return n(f),()=>{r(f)}},[n,r]),be(()=>{const f=l.current?o.get(l.current):null;f!=null&&c(f)},[o]),C.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function ro(){return ro=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},ro.apply(this,arguments)}let Xh=!1,BD=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+BD++;function WD(){const[e,t]=C.useState(()=>Xh?Qh():void 0);return be(()=>{e==null&&t(Qh())},[]),C.useEffect(()=>{Xh=!0},[]),e}const HD=nb.useId,wo=HD||WD;let ci;process.env.NODE_ENV!=="production"&&(ci=new Set);function ss(){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=ci)!=null&&e.has(o))){var i;(i=ci)==null||i.add(o),console.warn(o)}}function zD(){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=ci)!=null&&e.has(o))){var i;(i=ci)==null||i.add(o),console.error(o)}}const ib=C.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:s=14,height:a=7,tipRadius:c=0,strokeWidth:l=0,staticOffset:u,stroke:f,d:h,style:{transform:d,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||ss("The `ref` prop is required for `FloatingArrow`."));const g=wo(),[v,w]=C.useState(!1);if(be(()=>{if(!o)return;Vt(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const y=l*2,T=y/2,S=s/2*(c/-8+1),E=a/2*c/4,[R,A]=r.split("-"),k=!!h,I=R==="top"||R==="bottom",j=u&&A==="end"?"bottom":"top";let D=u&&A==="end"?"right":"left";u&&v&&(D=A==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?u||i.x:"",P=(i==null?void 0:i.y)!=null?u||i.y:"",O=h||"M0,0"+(" H"+s)+(" L"+(s-S)+","+(a-E))+(" Q"+s/2+","+a+" "+S+","+(a-E))+" Z",F={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[R];return C.createElement("svg",ro({},m,{"aria-hidden":!0,ref:n,width:k?s:s+y,height:s,viewBox:"0 0 "+s+" "+(a>s?a:s),style:{position:"absolute",pointerEvents:"none",[D]:N,[j]:P,[R]:I||k?"100%":"calc(100% - "+y/2+"px)",transform:""+F+(d??""),...p}}),y>0&&C.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:f,strokeWidth:y+(h?0:1),d:O}),C.createElement("path",{stroke:y&&!h?m.fill:"none",d:O}),C.createElement("clipPath",{id:g},C.createElement("rect",{x:-T,y:T*(k?-1:1),width:s+y,height:s})))});function sb(){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 ab=C.createContext(null),lb=C.createContext(null),Gn=()=>{var e;return((e=C.useContext(ab))==null?void 0:e.id)||null},Yn=()=>C.useContext(lb);function UD(e){const t=wo(),n=Yn(),o=Gn();return be(()=>{const i={id:t,parentId:o};return n==null||n.addNode(i),()=>{n==null||n.removeNode(i)}},[n,t,o]),t}function GD(e){const{children:t,id:n}=e,r=Gn();return C.createElement(ab.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function YD(e){const{children:t}=e,n=C.useRef([]),r=C.useCallback(s=>{n.current=[...n.current,s]},[]),o=C.useCallback(s=>{n.current=n.current.filter(a=>a!==s)},[]),i=C.useState(()=>sb())[0];return C.createElement(lb.Provider,{value:C.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i])},t)}function Bn(e){return"data-floating-ui-"+e}function gt(e){const t=b.useRef(e);return be(()=>{t.current=e}),t}const Zh=Bn("safe-polygon");function nl(e,t,n){return n&&!eo(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function cb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:f=0,move:h=!0}=t,d=Yn(),p=Gn(),m=gt(l),g=gt(c),v=gt(n),w=C.useRef(),y=C.useRef(-1),T=C.useRef(),S=C.useRef(-1),E=C.useRef(!0),R=C.useRef(!1),A=C.useRef(()=>{}),k=C.useCallback(()=>{var O;const F=(O=o.current.openEvent)==null?void 0:O.type;return(F==null?void 0:F.includes("mouse"))&&F!=="mousedown"},[o]);C.useEffect(()=>{if(!a)return;function O(F){let{open:_}=F;_||(clearTimeout(y.current),clearTimeout(S.current),E.current=!0)}return i.on("openchange",O),()=>{i.off("openchange",O)}},[a,i]),C.useEffect(()=>{if(!a||!m.current||!n)return;function O(_){k()&&r(!1,_,"hover")}const F=ut(s.floating).documentElement;return F.addEventListener("mouseleave",O),()=>{F.removeEventListener("mouseleave",O)}},[s.floating,n,r,a,m,k]);const I=C.useCallback(function(O,F,_){F===void 0&&(F=!0),_===void 0&&(_="hover");const H=nl(g.current,"close",w.current);H&&!T.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,O,_),H)):F&&(clearTimeout(y.current),r(!1,O,_))},[g,r]),j=at(()=>{A.current(),T.current=void 0}),D=at(()=>{if(R.current){const O=ut(s.floating).body;O.style.pointerEvents="",O.removeAttribute(Zh),R.current=!1}});C.useEffect(()=>{if(!a)return;function O(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function F(M){if(clearTimeout(y.current),E.current=!1,u&&!eo(w.current)||f>0&&!nl(g.current,"open"))return;const $=nl(g.current,"open",w.current);$?y.current=window.setTimeout(()=>{v.current||r(!0,M,"hover")},$):r(!0,M,"hover")}function _(M){if(O())return;A.current();const $=ut(s.floating);if(clearTimeout(S.current),m.current&&o.current.floatingContext){n||clearTimeout(y.current),T.current=m.current({...o.current.floatingContext,tree:d,x:M.clientX,y:M.clientY,onClose(){D(),j(),I(M,!0,"safe-polygon")}});const J=T.current;$.addEventListener("mousemove",J),A.current=()=>{$.removeEventListener("mousemove",J)};return}(w.current==="touch"?!Ye(s.floating,M.relatedTarget):!0)&&I(M)}function H(M){O()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:M.clientX,y:M.clientY,onClose(){D(),j(),I(M)}})(M))}if(De(s.domReference)){var U;const M=s.domReference;return n&&M.addEventListener("mouseleave",H),(U=s.floating)==null||U.addEventListener("mouseleave",H),h&&M.addEventListener("mousemove",F,{once:!0}),M.addEventListener("mouseenter",F),M.addEventListener("mouseleave",_),()=>{var $;n&&M.removeEventListener("mouseleave",H),($=s.floating)==null||$.removeEventListener("mouseleave",H),h&&M.removeEventListener("mousemove",F),M.removeEventListener("mouseenter",F),M.removeEventListener("mouseleave",_)}}},[s,a,e,u,f,h,I,j,D,r,n,v,d,g,m,o]),be(()=>{var O;if(a&&n&&(O=m.current)!=null&&O.__options.blockPointerEvents&&k()){const _=ut(s.floating).body;_.setAttribute(Zh,""),_.style.pointerEvents="none",R.current=!0;const H=s.floating;if(De(s.domReference)&&H){var F;const U=s.domReference,M=d==null||(F=d.nodesRef.current.find($=>$.id===p))==null||(F=F.context)==null?void 0:F.elements.floating;return M&&(M.style.pointerEvents=""),U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,s,d,m,k]),be(()=>{n||(w.current=void 0,j(),D())},[n,j,D]),C.useEffect(()=>()=>{j(),clearTimeout(y.current),clearTimeout(S.current),D()},[a,s.domReference,j,D]);const N=C.useMemo(()=>{function O(F){w.current=F.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(F){const{nativeEvent:_}=F;function H(){!E.current&&!v.current&&r(!0,_,"hover")}u&&!eo(w.current)||n||f===0||(clearTimeout(S.current),w.current==="touch"?H():S.current=window.setTimeout(H,f))}}},[u,r,n,v,f]),P=C.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(O){I(O.nativeEvent,!1)}}),[I]);return C.useMemo(()=>a?{reference:N,floating:P}:{},[a,N,P])}function KD(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){const i=e.find(s=>s.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function hr(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function qD(e,t){let n,r=-1;function o(i,s){s>r&&(n=i,r=s),hr(e,i).forEach(c=>{o(c.id,s+1)})}return o(t,0),e.find(i=>i.id===n)}let Rr=new WeakMap,Gi=new WeakSet,Yi={},rl=0;const XD=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ub=e=>e&&(e.host||ub(e.parentNode)),QD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ub(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ZD(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=QD(t,e),a=new Set,c=new Set(s),l=[];Yi[o]||(Yi[o]=new WeakMap);const u=Yi[o];s.forEach(f),h(t),a.clear();function f(d){!d||a.has(d)||(a.add(d),d.parentNode&&f(d.parentNode))}function h(d){!d||c.has(d)||[].forEach.call(d.children,p=>{if(Un(p)!=="script")if(a.has(p))h(p);else{const m=i?p.getAttribute(i):null,g=m!==null&&m!=="false",v=(Rr.get(p)||0)+1,w=(u.get(p)||0)+1;Rr.set(p,v),u.set(p,w),l.push(p),v===1&&g&&Gi.add(p),w===1&&p.setAttribute(o,""),!g&&i&&p.setAttribute(i,"true")}})}return rl++,()=>{l.forEach(d=>{const p=(Rr.get(d)||0)-1,m=(u.get(d)||0)-1;Rr.set(d,p),u.set(d,m),p||(!Gi.has(d)&&i&&d.removeAttribute(i),Gi.delete(d)),m||d.removeAttribute(o)}),rl--,rl||(Rr=new WeakMap,Rr=new WeakMap,Gi=new WeakSet,Yi={})}}function Jh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ut(e[0]).body;return ZD(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const oo=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fb(e,t){const n=li(e,oo());t==="prev"&&n.reverse();const r=n.indexOf(Ht(ut(e)));return n.slice(r+1)[0]}function db(){return fb(document.body,"next")}function hb(){return fb(document.body,"prev")}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ye(n,r)}function JD(e){li(e,oo()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function eM(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 tM(e,t,n){const r=e.indexOf(t);function o(s){const a=Bn("focus-guard");let c=r+(s?1:0),l=e[c];for(;l&&(!l.isConnected||l.hasAttribute(a)||Ye(n,l));)s?c++:c--,l=e[c];return l}const i=o(!0);return i||o(!1)}const Ku={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 nM;function ep(e){e.key==="Tab"&&(e.target,clearTimeout(nM))}const ks=C.forwardRef(function(t,n){const[r,o]=C.useState();be(()=>(Vu()&&o("button"),document.addEventListener("keydown",ep),()=>{document.removeEventListener("keydown",ep)}),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Bn("focus-guard")]:"",style:Ku};return C.createElement("span",ro({},t,i))}),pb=C.createContext(null),tp=Bn("portal");function rM(e){e===void 0&&(e={});const{id:t,root:n}=e,r=wo(),o=mb(),[i,s]=C.useState(null),a=C.useRef(null);return be(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),be(()=>{if(!r||a.current)return;const c=t?document.getElementById(t):null;if(!c)return;const l=document.createElement("div");l.id=r,l.setAttribute(tp,""),c.appendChild(l),a.current=l,s(l)},[t,r]),be(()=>{if(!r||a.current)return;let c=n||(o==null?void 0:o.portalNode);c&&!De(c)&&(c=c.current),c=c||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,c.appendChild(l));const u=document.createElement("div");u.id=r,u.setAttribute(tp,""),c=l||c,c.appendChild(u),a.current=u,s(u)},[t,n,r,o]),i}function To(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,i=rM({id:n,root:r}),[s,a]=C.useState(null),c=C.useRef(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),h=!!s&&!s.modal&&s.open&&o&&!!(r||i);return C.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function d(p){i&&Zo(p)&&(p.type==="focusin"?eM:JD)(i)}return i.addEventListener("focusin",d,!0),i.addEventListener("focusout",d,!0),()=>{i.removeEventListener("focusin",d,!0),i.removeEventListener("focusout",d,!0)}},[i,o,s==null?void 0:s.modal]),C.createElement(pb.Provider,{value:C.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i])},h&&i&&C.createElement(ks,{"data-type":"outside",ref:c,onFocus:d=>{if(Zo(d,i)){var p;(p=u.current)==null||p.focus()}else{const m=hb()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),h&&i&&C.createElement("span",{"aria-owns":i.id,style:Ku}),i&&yi.createPortal(t,i),h&&i&&C.createElement(ks,{"data-type":"outside",ref:l,onFocus:d=>{if(Zo(d,i)){var p;(p=f.current)==null||p.focus()}else{const m=db()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const mb=()=>C.useContext(pb),np=20;let or=[];function ol(e){or=or.filter(n=>n.isConnected);let t=e;if(!(!t||Un(t)==="body")){if(!tD(t,oo())){const n=li(t,oo())[0];n&&(t=n)}or.push(t),or.length>np&&(or=or.slice(-np))}}function rp(){return or.slice().reverse().find(e=>e.isConnected)}const oM=C.forwardRef(function(t,n){return C.createElement("button",ro({},t,{type:"button",ref:n,tabIndex:-1,style:Ku}))});function Ri(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:d,nodeId:p,onOpenChange:m,events:g,dataRef:v,floatingId:w,elements:{domReference:y,floating:T}}=t,S=typeof s=="number"&&s<0,E=Wv(y)&&S,R=XD()?i:!0,A=gt(o),k=gt(s),I=gt(a),j=Yn(),D=mb(),N=C.useRef(null),P=C.useRef(null),O=C.useRef(!1),F=C.useRef(!1),_=C.useRef(-1),H=D!=null,U=T==null?void 0:T.firstElementChild,M=(U==null?void 0:U.id)===w?U:T,$=at(function(G){return G===void 0&&(G=M),G?li(G,oo()):[]}),q=at(G=>{const L=$(G);return A.current.map(B=>y&&B==="reference"?y:M&&B==="floating"?M:L).filter(Boolean).flat()});C.useEffect(()=>{if(r||!l)return;function G(B){if(B.key==="Tab"){Ye(M,Ht(ut(M)))&&$().length===0&&!E&&mt(B);const z=q(),V=nn(B);A.current[0]==="reference"&&V===y&&(mt(B),B.shiftKey?On(z[z.length-1]):On(z[1])),A.current[1]==="floating"&&V===M&&B.shiftKey&&(mt(B),On(z[0]))}}const L=ut(M);return L.addEventListener("keydown",G),()=>{L.removeEventListener("keydown",G)}},[r,y,M,l,A,E,$,q]),C.useEffect(()=>{if(r||!T)return;function G(L){const B=nn(L),V=$().indexOf(B);V!==-1&&(_.current=V)}return T.addEventListener("focusin",G),()=>{T.removeEventListener("focusin",G)}},[r,T,$]),C.useEffect(()=>{if(r||!f)return;function G(){F.current=!0,setTimeout(()=>{F.current=!1})}function L(B){const z=B.relatedTarget;queueMicrotask(()=>{const V=!(Ye(y,z)||Ye(T,z)||Ye(z,T)||Ye(D==null?void 0:D.portalNode,z)||z!=null&&z.hasAttribute(Bn("focus-guard"))||j&&(hr(j.nodesRef.current,p).find(Y=>{var ee,W;return Ye((ee=Y.context)==null?void 0:ee.elements.floating,z)||Ye((W=Y.context)==null?void 0:W.elements.domReference,z)})||KD(j.nodesRef.current,p).find(Y=>{var ee,W;return((ee=Y.context)==null?void 0:ee.elements.floating)===z||((W=Y.context)==null?void 0:W.elements.domReference)===z})));if(c&&V&&Ht(ut(M))===ut(M).body){et(M)&&(M==null||M.focus());const Y=_.current,ee=$(),W=ee[Y]||ee[ee.length-1]||M;et(W)&&W.focus()}(E||!l)&&z&&V&&!F.current&&z!==rp()&&(O.current=!0,m(!1,B))})}if(T&&et(y))return y.addEventListener("focusout",L),y.addEventListener("pointerdown",G),T.addEventListener("focusout",L),()=>{y.removeEventListener("focusout",L),y.removeEventListener("pointerdown",G),T.removeEventListener("focusout",L)}},[r,y,T,M,l,p,j,D,m,f,c,$,E]),C.useEffect(()=>{var G;if(r)return;const L=Array.from((D==null||(G=D.portalNode)==null?void 0:G.querySelectorAll("["+Bn("portal")+"]"))||[]);if(T){const B=[T,...L,N.current,P.current,A.current.includes("reference")||E?y:null].filter(V=>V!=null),z=l||E?Jh(B,R,!R):Jh(B);return()=>{z()}}},[r,y,T,l,A,D,E,R]),be(()=>{if(r||!et(M))return;const G=ut(M),L=Ht(G);queueMicrotask(()=>{const B=q(M),z=k.current,V=(typeof z=="number"?B[z]:z.current)||M,Y=Ye(M,L);!S&&!Y&&h&&On(V,{preventScroll:V===M})})},[r,h,M,S,q,k]),be(()=>{if(r||!M)return;let G=!1;const L=ut(M),B=Ht(L);let V=v.current.openEvent;const Y=d.domReference.current;ol(B);function ee(W){let{open:we,reason:Ue,event:je,nested:Ge}=W;we&&(V=je),Ue==="escape-key"&&d.domReference.current&&ol(d.domReference.current),Ue==="hover"&&je.type==="mouseleave"&&(O.current=!0),Ue==="outside-press"&&(Ge?(O.current=!1,G=!0):O.current=!($v(je)||_u(je)))}return g.on("openchange",ee),()=>{g.off("openchange",ee);const W=Ht(L),we=Ye(T,W)||j&&hr(j.nodesRef.current,p).some(ie=>{var me;return Ye((me=ie.context)==null?void 0:me.elements.floating,W)});(we||V&&["click","mousedown"].includes(V.type))&&d.domReference.current&&ol(d.domReference.current);const je=Y||B,Ge=li(ut(je).body,oo());queueMicrotask(()=>{let ie=rp();!ie&&et(je)&&T&&(ie=tM(Ge,je,T)),I.current&&!O.current&&et(ie)&&(!(ie!==W&&W!==L.body)||we)&&ie.focus({preventScroll:G})})}},[r,T,M,I,v,d,g,j,p]),be(()=>{if(!r&&D)return D.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:m,refs:d}),()=>{D.setFocusManagerState(null)}},[r,D,l,h,m,d,f]),be(()=>{if(r||!M||typeof MutationObserver!="function"||S)return;const G=()=>{const B=M.getAttribute("tabindex"),z=$(),V=Ht(ut(T)),Y=z.indexOf(V);Y!==-1&&(_.current=Y),A.current.includes("floating")||V!==d.domReference.current&&z.length===0?B!=="0"&&M.setAttribute("tabindex","0"):B!=="-1"&&M.setAttribute("tabindex","-1")};G();const L=new MutationObserver(G);return L.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{L.disconnect()}},[r,T,M,d,A,$,S]);function J(G){return r||!u||!l?null:C.createElement(oM,{ref:G==="start"?N:P,onClick:L=>m(!1,L.nativeEvent)},typeof u=="string"?u:"Dismiss")}const X=!r&&R&&(l?!E:!0)&&(H||l);return C.createElement(C.Fragment,null,X&&C.createElement(ks,{"data-type":"inside",ref:D==null?void 0:D.beforeInsideRef,onFocus:G=>{if(l){const B=q();On(o[0]==="reference"?B[0]:B[B.length-1])}else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(O.current=!1,Zo(G,D.portalNode)){const B=db()||y;B==null||B.focus()}else{var L;(L=D.beforeOutsideRef.current)==null||L.focus()}}}),!E&&J("start"),n,J("end"),X&&C.createElement(ks,{"data-type":"inside",ref:D==null?void 0:D.afterInsideRef,onFocus:G=>{if(l)On(q()[0]);else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(f&&(O.current=!0),Zo(G,D.portalNode)){const B=hb()||y;B==null||B.focus()}else{var L;(L=D.afterOutsideRef.current)==null||L.focus()}}}))}const il=new Set,iM=C.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,i=wo();return be(()=>{if(!r)return;il.add(i);const s=/iP(hone|ad|od)|iOS/.test(Lu()),a=document.body.style,l=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,f=a.left?parseFloat(a.left):window.scrollX,h=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[l]=u+"px"),s){var d,p;const m=((d=window.visualViewport)==null?void 0:d.offsetLeft)||0,g=((p=window.visualViewport)==null?void 0:p.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(h-Math.floor(g))+"px",left:-(f-Math.floor(m))+"px",right:"0"})}return()=>{il.delete(i),il.size===0&&(Object.assign(a,{overflow:"",[l]:""}),s&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(f,h)))}},[i,r]),C.createElement("div",ro({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function op(e){return et(e.target)&&e.target.tagName==="BUTTON"}function ip(e){return $u(e)}function la(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0}=t,f=C.useRef(),h=C.useRef(!1),d=C.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const m=f.current;p.button===0&&a!=="click"&&(eo(m,!0)&&l||(n&&c&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=f.current;if(a==="mousedown"&&f.current){f.current=void 0;return}eo(m,!0)&&l||(n&&c&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!u||op(p))&&(p.key===" "&&!ip(i)&&(p.preventDefault(),h.current=!0),p.key==="Enter"&&r(!(n&&c),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||op(p)||ip(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&c),p.nativeEvent,"click"))}}),[o,i,a,l,u,r,n,c]);return C.useMemo(()=>s?{reference:d}:{},[s,d])}function sM(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const s=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(((i=t.dataRef.current.openEvent)==null?void 0:i.type)||"")&&t.pointerType!=="touch";let u=s.width,f=s.height,h=s.x,d=s.y;return n==null&&t.x&&a&&(n=s.x-t.x),r==null&&t.y&&c&&(r=s.y-t.y),h-=n||0,d-=r||0,u=0,f=0,!o||l?(u=t.axis==="y"?s.width:0,f=t.axis==="x"?s.height:0,h=a&&t.x!=null?t.x:h,d=c&&t.y!=null?t.y:d):o&&!l&&(f=t.axis==="x"?s.height:f,u=t.axis==="y"?s.width:u),o=!0,{width:u,height:f,x:h,y:d,top:d,right:h+u,bottom:d+f,left:h}}}}function sp(e){return e!=null&&e.clientX!=null}function aM(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:s}=e,{enabled:a=!0,axis:c="both",x:l=null,y:u=null}=t,f=C.useRef(!1),h=C.useRef(null),[d,p]=C.useState(),[m,g]=C.useState([]),v=at((E,R)=>{f.current||r.current.openEvent&&!sp(r.current.openEvent)||s.setPositionReference(sM(i,{x:E,y:R,axis:c,dataRef:r,pointerType:d}))}),w=at(E=>{l!=null||u!=null||(n?h.current||g([]):v(E.clientX,E.clientY))}),y=eo(d)?o:n,T=C.useCallback(()=>{if(!y||!a||l!=null||u!=null)return;const E=Pt(o);function R(A){const k=nn(A);Ye(o,k)?(E.removeEventListener("mousemove",R),h.current=null):v(A.clientX,A.clientY)}if(!r.current.openEvent||sp(r.current.openEvent)){E.addEventListener("mousemove",R);const A=()=>{E.removeEventListener("mousemove",R),h.current=null};return h.current=A,A}s.setPositionReference(i)},[y,a,l,u,o,r,s,i,v]);C.useEffect(()=>T(),[T,m]),C.useEffect(()=>{a&&!o&&(f.current=!1)},[a,o]),C.useEffect(()=>{!a&&n&&(f.current=!0)},[a,n]),be(()=>{a&&(l!=null||u!=null)&&(f.current=!1,v(l,u))},[a,l,u,v]);const S=C.useMemo(()=>{function E(R){let{pointerType:A}=R;p(A)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:w,onMouseEnter:w}},[w]);return C.useMemo(()=>a?{reference:S}:{},[a,S])}const lM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ap=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 So(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:p}=t,m=Yn(),g=at(typeof c=="function"?c:()=>!1),v=typeof c=="function"?g:c,w=C.useRef(!1),y=C.useRef(!1),{escapeKey:T,outsidePress:S}=ap(d),{escapeKey:E,outsidePress:R}=ap(p),A=at(P=>{var O;if(!n||!s||!a||P.key!=="Escape")return;const F=(O=i.current.floatingContext)==null?void 0:O.nodeId,_=m?hr(m.nodesRef.current,F):[];if(!T&&(P.stopPropagation(),_.length>0)){let H=!0;if(_.forEach(U=>{var M;if((M=U.context)!=null&&M.open&&!U.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,RO(P)?P.nativeEvent:P,"escape-key")}),k=at(P=>{var O;const F=()=>{var _;A(P),(_=nn(P))==null||_.removeEventListener("keydown",F)};(O=nn(P))==null||O.addEventListener("keydown",F)}),I=at(P=>{var O;const F=w.current;w.current=!1;const _=y.current;if(y.current=!1,l==="click"&&_||F||typeof v=="function"&&!v(P))return;const H=nn(P),U="["+Bn("inert")+"]",M=ut(o.floating).querySelectorAll(U);let $=De(H)?H:null;for(;$&&!_n($);){const G=Tn($);if(_n(G)||!De(G))break;$=G}if(M.length&&De(H)&&!IO(H)&&!Ye(H,o.floating)&&Array.from(M).every(G=>!Ye($,G)))return;if(et(H)&&N){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,L=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let B=L&&P.offsetX>H.clientWidth;if(L&&Vt(H).direction==="rtl"&&(B=P.offsetX<=H.offsetWidth-H.clientWidth),B||G&&P.offsetY>H.clientHeight)return}const q=(O=i.current.floatingContext)==null?void 0:O.nodeId,J=m&&hr(m.nodesRef.current,q).some(G=>{var L;return Ja(P,(L=G.context)==null?void 0:L.elements.floating)});if(Ja(P,o.floating)||Ja(P,o.domReference)||J)return;const X=m?hr(m.nodesRef.current,q):[];if(X.length>0){let G=!0;if(X.forEach(L=>{var B;if((B=L.context)!=null&&B.open&&!L.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,P,"outside-press")}),j=at(P=>{var O;const F=()=>{var _;I(P),(_=nn(P))==null||_.removeEventListener(l,F)};(O=nn(P))==null||O.addEventListener(l,F)});C.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=T,i.current.__outsidePressBubbles=S;function P(_){r(!1,_,"ancestor-scroll")}const O=ut(o.floating);a&&O.addEventListener("keydown",E?k:A,E),v&&O.addEventListener(l,R?j:I,R);let F=[];return h&&(De(o.domReference)&&(F=Fn(o.domReference)),De(o.floating)&&(F=F.concat(Fn(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(Fn(o.reference.contextElement)))),F=F.filter(_=>{var H;return _!==((H=O.defaultView)==null?void 0:H.visualViewport)}),F.forEach(_=>{_.addEventListener("scroll",P,{passive:!0})}),()=>{a&&O.removeEventListener("keydown",E?k:A,E),v&&O.removeEventListener(l,R?j:I,R),F.forEach(_=>{_.removeEventListener("scroll",P)})}},[i,o,a,v,l,n,r,h,s,T,S,A,E,k,I,R,j]),C.useEffect(()=>{w.current=!1},[v,l]);const D=C.useMemo(()=>({onKeyDown:A,[lM[f]]:P=>{u&&r(!1,P.nativeEvent,"reference-press")}}),[A,r,u,f]),N=C.useMemo(()=>({onKeyDown:A,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[cM[l]]:()=>{w.current=!0}}),[A,l]);return C.useMemo(()=>s?{reference:D,floating:N}:{},[s,D,N])}function uM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=wo(),i=C.useRef({}),[s]=C.useState(()=>sb()),a=Gn()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!De(d)&&zD("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=C.useState(r.reference),u=at((d,p,m)=>{i.current.openEvent=d?p:void 0,s.emit("openchange",{open:d,event:p,reason:m,nested:a}),n==null||n(d,p,m)}),f=C.useMemo(()=>({setPositionReference:l}),[]),h=C.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return C.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:f}),[t,u,h,s,o,f])}function Eo(e){e===void 0&&(e={});const{nodeId:t}=e,n=uM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=C.useState(null),[a,c]=C.useState(null),u=(o==null?void 0:o.reference)||i,f=C.useRef(null),h=Yn();be(()=>{u&&(f.current=u)},[u]);const d=AD({...e,elements:{...o,...a&&{reference:a}}}),p=C.useCallback(y=>{const T=De(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;c(T),d.refs.setReference(T)},[d.refs]),m=C.useCallback(y=>{(De(y)||y===null)&&(f.current=y,s(y)),(De(d.refs.reference.current)||d.refs.reference.current===null||y!==null&&!De(y))&&d.refs.setReference(y)},[d.refs]),g=C.useMemo(()=>({...d.refs,setReference:m,setPositionReference:p,domReference:f}),[d.refs,m,p]),v=C.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),w=C.useMemo(()=>({...d,...r,refs:g,elements:v,nodeId:t}),[d,g,v,t,r]);return be(()=>{r.dataRef.current.floatingContext=w;const y=h==null?void 0:h.nodesRef.current.find(T=>T.id===t);y&&(y.context=w)}),C.useMemo(()=>({...d,context:w,refs:g,elements:v}),[d,g,v,w])}function fM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:c=!0}=t,l=C.useRef(!1),u=C.useRef(),f=C.useRef(!0);C.useEffect(()=>{if(!a)return;const d=Pt(s.domReference);function p(){!n&&et(s.domReference)&&s.domReference===Ht(ut(s.domReference))&&(l.current=!0)}function m(){f.current=!0}return d.addEventListener("blur",p),d.addEventListener("keydown",m,!0),()=>{d.removeEventListener("blur",p),d.removeEventListener("keydown",m,!0)}},[s.domReference,n,a]),C.useEffect(()=>{if(!a)return;function d(p){let{reason:m}=p;(m==="reference-press"||m==="escape-key")&&(l.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,a]),C.useEffect(()=>()=>{clearTimeout(u.current)},[]);const h=C.useMemo(()=>({onPointerDown(d){_u(d.nativeEvent)||(f.current=!1)},onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const p=nn(d.nativeEvent);if(c&&De(p))try{if(Vu()&&Bv())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!f.current&&!$u(p))return}r(!0,d.nativeEvent,"focus")},onBlur(d){l.current=!1;const p=d.relatedTarget,m=d.nativeEvent,g=De(p)&&p.hasAttribute(Bn("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const w=Ht(s.domReference?s.domReference.ownerDocument:document);!p&&w===s.domReference||Ye((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,w)||Ye(s.domReference,w)||g||r(!1,m,"focus")})}}),[i,s.domReference,r,c]);return C.useMemo(()=>a?{reference:h}:{},[a,h])}const lp="active",cp="selected";function sl(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[lp]:s,[cp]:a,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(c=>{let[l,u]=c;if(!(o&&[lp,cp].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),s[l]=function(){for(var h,d=arguments.length,p=new Array(d),m=0;m<d;m++)p[m]=arguments[m];return(h=r.get(l))==null?void 0:h.map(g=>g(...p)).find(g=>g!==void 0)}}}else s[l]=u}),s),{})}}function Co(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=C.useCallback(a=>sl(a,e,"reference"),t),i=C.useCallback(a=>sl(a,e,"floating"),n),s=C.useCallback(a=>sl(a,e,"item"),r);return C.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}let up=!1;function ca(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function fp(e,t){return ca(t,e===Yu||e===Pi,e===no||e===xo)}function al(e,t,n){return ca(t,e===Pi,n?e===no:e===xo)||e==="Enter"||e===" "||e===""}function dM(e,t,n){return ca(t,n?e===no:e===xo,e===Pi)}function dp(e,t,n){return ca(t,n?e===xo:e===no,e===Yu)}function gb(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:s,onNavigate:a=()=>{},enabled:c=!0,selectedIndex:l=null,allowEscape:u=!1,loop:f=!1,nested:h=!1,rtl:d=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:w=void 0,orientation:y="vertical",cols:T=1,scrollItemIntoView:S=!0,virtualItemRef:E,itemSizes:R,dense:A=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(f||ss("`useListNavigation` looping must be enabled to allow escaping."),p||ss("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&T>1&&ss("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const k=Gn(),I=Yn(),j=at(a),D=C.useRef(m),N=C.useRef(l??-1),P=C.useRef(null),O=C.useRef(!0),F=C.useRef(j),_=C.useRef(!!o.floating),H=C.useRef(n),U=C.useRef(!1),M=C.useRef(!1),$=gt(w),q=gt(n),J=gt(S),X=gt(o.floating),G=gt(l),[L,B]=C.useState(),[z,V]=C.useState(),Y=at(function(ie,me,oe){oe===void 0&&(oe=!1);function ye(ve){p?(B(ve.id),I==null||I.events.emit("virtualfocus",ve),E&&(E.current=ve)):On(ve,{preventScroll:!0,sync:Bv()&&Vu()?up||U.current:!1})}const Qe=ie.current[me.current];Qe&&ye(Qe),requestAnimationFrame(()=>{const ve=ie.current[me.current]||Qe;if(!ve)return;Qe||ye(ve);const ot=J.current;ot&&W&&(oe||!O.current)&&(ve.scrollIntoView==null||ve.scrollIntoView(typeof ot=="boolean"?{block:"nearest",inline:"nearest"}:ot))})});be(()=>{document.createElement("div").focus({get preventScroll(){return up=!0,!1}})},[]),be(()=>{c&&(n&&o.floating?D.current&&l!=null&&(M.current=!0,N.current=l,j(l)):_.current&&(N.current=-1,F.current(null)))},[c,n,o.floating,l,j]),be(()=>{if(c&&n&&o.floating)if(s==null){if(U.current=!1,G.current!=null)return;if(_.current&&(N.current=-1,Y(i,N)),(!H.current||!_.current)&&D.current&&(P.current!=null||D.current===!0&&P.current==null)){let ie=0;const me=()=>{i.current[0]==null?(ie<2&&(ie?requestAnimationFrame:queueMicrotask)(me),ie++):(N.current=P.current==null||al(P.current,y,d)||h?tl(i,$.current):Kh(i,$.current),P.current=null,j(N.current))};me()}}else Qo(i,s)||(N.current=s,Y(i,N,M.current),M.current=!1)},[c,n,o.floating,s,G,h,i,y,d,j,Y,$]),be(()=>{var ie;if(!c||o.floating||!I||p||!_.current)return;const me=I.nodesRef.current,oe=(ie=me.find(ve=>ve.id===k))==null||(ie=ie.context)==null?void 0:ie.elements.floating,ye=Ht(ut(o.floating)),Qe=me.some(ve=>ve.context&&Ye(ve.context.elements.floating,ye));oe&&!Qe&&O.current&&oe.focus({preventScroll:!0})},[c,o.floating,I,k,p]),be(()=>{if(!c||!I||!p||k)return;function ie(me){V(me.id),E&&(E.current=me)}return I.events.on("virtualfocus",ie),()=>{I.events.off("virtualfocus",ie)}},[c,I,p,k,E]),be(()=>{F.current=j,_.current=!!o.floating}),be(()=>{n||(P.current=null)},[n]),be(()=>{H.current=n},[n]);const ee=s!=null,W=C.useMemo(()=>{function ie(oe){if(!n)return;const ye=i.current.indexOf(oe);ye!==-1&&j(ye)}return{onFocus(oe){let{currentTarget:ye}=oe;ie(ye)},onClick:oe=>{let{currentTarget:ye}=oe;return ye.focus({preventScroll:!0})},...g&&{onMouseMove(oe){let{currentTarget:ye}=oe;ie(ye)},onPointerLeave(oe){let{pointerType:ye}=oe;!O.current||ye==="touch"||(N.current=-1,Y(i,N),j(null),p||On(X.current,{preventScroll:!0}))}}}},[n,X,Y,g,i,j,p]),we=at(ie=>{if(O.current=!1,U.current=!0,!q.current&&ie.currentTarget===X.current)return;if(h&&dp(ie.key,y,d)){mt(ie),r(!1,ie.nativeEvent,"list-navigation"),et(o.domReference)&&!p&&o.domReference.focus();return}const me=N.current,oe=tl(i,w),ye=Kh(i,w);if(ie.key==="Home"&&(mt(ie),N.current=oe,j(N.current)),ie.key==="End"&&(mt(ie),N.current=ye,j(N.current)),T>1){const Qe=R||Array.from({length:i.current.length},()=>({width:1,height:1})),ve=jD(Qe,T,A),ot=ve.findIndex(re=>re!=null&&!is(i.current,re,w)),Z=ve.reduce((re,xe,Ne)=>xe!=null&&!is(i.current,xe,w)?Ne:re,-1);if(N.current=ve[FD({current:ve.map(re=>re!=null?i.current[re]:null)},{event:ie,orientation:y,loop:f,cols:T,disabledIndices:LD([...w||i.current.map((re,xe)=>is(i.current,xe)?xe:void 0),void 0],ve),minIndex:ot,maxIndex:Z,prevIndex:ND(N.current>ye?oe:N.current,Qe,ve,T,ie.key===Pi?"bl":ie.key===xo?"tr":"tl"),stopEvent:!0})],j(N.current),y==="both")return}if(fp(ie.key,y)){if(mt(ie),n&&!p&&Ht(ie.currentTarget.ownerDocument)===ie.currentTarget){N.current=al(ie.key,y,d)?oe:ye,j(N.current);return}al(ie.key,y,d)?f?N.current=me>=ye?u&&me!==i.current.length?-1:oe:xt(i,{startingIndex:me,disabledIndices:w}):N.current=Math.min(ye,xt(i,{startingIndex:me,disabledIndices:w})):f?N.current=me<=oe?u&&me!==-1?i.current.length:ye:xt(i,{startingIndex:me,decrement:!0,disabledIndices:w}):N.current=Math.max(oe,xt(i,{startingIndex:me,decrement:!0,disabledIndices:w})),Qo(i,N.current)?j(null):j(N.current)}}),Ue=C.useMemo(()=>p&&n&&ee&&{"aria-activedescendant":z||L},[p,n,ee,z,L]),je=C.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!Wv(o.domReference)&&Ue,onKeyDown:we,onPointerMove(){O.current=!0}}),[Ue,we,o.domReference,y]),Ge=C.useMemo(()=>{function ie(oe){m==="auto"&&$v(oe.nativeEvent)&&(D.current=!0)}function me(oe){D.current=m,m==="auto"&&_u(oe.nativeEvent)&&(D.current=!0)}return{...Ue,onKeyDown(oe){O.current=!1;const ye=oe.key.indexOf("Arrow")===0,Qe=dM(oe.key,y,d),ve=dp(oe.key,y,d),ot=fp(oe.key,y),Z=(h?Qe:ot)||oe.key==="Enter"||oe.key.trim()==="";if(p&&n){const ht=I==null?void 0:I.nodesRef.current.find(Ct=>Ct.parentId==null),vt=I&&ht?qD(I.nodesRef.current,ht.id):null;if(ye&&vt&&E){const Ct=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(Qe||ve){var re,xe;const Qn=((re=vt.context)==null?void 0:re.elements.domReference)===oe.currentTarget,wr=ve&&!Qn?(xe=vt.context)==null?void 0:xe.elements.domReference:Qe?i.current.find(Tr=>(Tr==null?void 0:Tr.id)===L):null;wr&&(mt(oe),wr.dispatchEvent(Ct),V(void 0))}if(ot&&vt.context&&vt.context.open&&vt.parentId&&oe.currentTarget!==vt.context.elements.domReference){var Ne;mt(oe),(Ne=vt.context.elements.domReference)==null||Ne.dispatchEvent(Ct);return}}return we(oe)}if(!(!n&&!v&&ye)){if(Z&&(P.current=h&&ot?null:oe.key),h){Qe&&(mt(oe),n?(N.current=tl(i,$.current),j(N.current)):r(!0,oe.nativeEvent,"list-navigation"));return}ot&&(l!=null&&(N.current=l),mt(oe),!n&&v?r(!0,oe.nativeEvent,"list-navigation"):we(oe),n&&j(N.current))}},onFocus(){n&&!p&&j(null)},onPointerDown:me,onMouseDown:ie,onClick:ie}},[L,Ue,we,$,m,i,h,j,r,n,v,y,d,l,I,p,E]);return C.useMemo(()=>c?{reference:Ge,floating:je,item:W}:{},[c,Ge,je,W])}const hM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Po(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,a=(n=hM.get(s))!=null?n:s,c=wo(),u=Gn()!=null,f=C.useMemo(()=>a==="tooltip"||s==="label"?{["aria-"+(s==="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:c},...a==="menu"&&u&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,c,s]),h=C.useMemo(()=>{const p={id:o,...a&&{role:a}};return a==="tooltip"||s==="label"?p:{...p,...a==="menu"&&{"aria-labelledby":c}}},[a,o,c,s]),d=C.useCallback(p=>{let{active:m,selected:g}=p;const v={role:"option",...m&&{id:o+"-option"}};switch(s){case"select":return{...v,"aria-selected":m&&g};case"combobox":return{...v,...m&&{"aria-selected":!0}}}return{}},[o,s]);return C.useMemo(()=>i?{reference:f,floating:h,item:d}:{},[i,f,h,d])}const hp=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Ir(e,t){return typeof e=="function"?e(t):e}function pM(e,t){const[n,r]=C.useState(e);return e&&!n&&r(!0),C.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function mM(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,s=(typeof o=="number"?o:o.close)||0,[a,c]=C.useState("unmounted"),l=pM(n,s);return!l&&a==="close"&&c("unmounted"),be(()=>{if(r){if(n){c("initial");const u=requestAnimationFrame(()=>{c("open")});return()=>{cancelAnimationFrame(u)}}c("close")}},[n,r]),{isMounted:l,status:a}}function gM(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:s=250}=t,a=e.placement,c=a.split("-")[0],l=C.useMemo(()=>({side:c,placement:a}),[c,a]),u=typeof s=="number",f=(u?s:s.open)||0,h=(u?s:s.close)||0,[d,p]=C.useState(()=>({...Ir(i,l),...Ir(n,l)})),{isMounted:m,status:g}=mM(e,{duration:s}),v=gt(n),w=gt(r),y=gt(o),T=gt(i);return be(()=>{const S=Ir(v.current,l),E=Ir(y.current,l),R=Ir(T.current,l),A=Ir(w.current,l)||Object.keys(S).reduce((k,I)=>(k[I]="",k),{});if(g==="initial"&&p(k=>({transitionProperty:k.transitionProperty,...R,...S})),g==="open"&&p({transitionProperty:Object.keys(A).map(hp).join(","),transitionDuration:f+"ms",...R,...A}),g==="close"){const k=E||S;p({transitionProperty:Object.keys(k).map(hp).join(","),transitionDuration:h+"ms",...R,...k})}},[h,y,v,w,T,f,g,l]),{isMounted:m,styles:d}}function yM(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:f=750,ignoreKeys:h=[],selectedIndex:d=null}=t,p=C.useRef(),m=C.useRef(""),g=C.useRef((n=d??s)!=null?n:-1),v=C.useRef(null),w=at(a),y=at(c),T=gt(u),S=gt(h);be(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),be(()=>{if(r&&m.current===""){var I;g.current=(I=d??s)!=null?I:-1}},[r,d,s]);const E=at(I=>{I?o.current.typing||(o.current.typing=I,y(I)):o.current.typing&&(o.current.typing=I,y(I))}),R=at(I=>{function j(F,_,H){const U=T.current?T.current(_,H):_.find(M=>(M==null?void 0:M.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return U?F.indexOf(U):-1}const D=i.current;if(m.current.length>0&&m.current[0]!==" "&&(j(D,D,m.current)===-1?E(!1):I.key===" "&&mt(I)),D==null||S.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;r&&I.key!==" "&&(mt(I),E(!0)),D.every(F=>{var _,H;return F?((_=F[0])==null?void 0:_.toLocaleLowerCase())!==((H=F[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===I.key&&(m.current="",g.current=v.current),m.current+=I.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},f);const P=g.current,O=j(D,[...D.slice((P||0)+1),...D.slice(0,(P||0)+1)],m.current);O!==-1?(w(O),v.current=O):I.key!==" "&&(m.current="",E(!1))}),A=C.useMemo(()=>({onKeyDown:R}),[R]),k=C.useMemo(()=>({onKeyDown:R,onKeyUp(I){I.key===" "&&E(!1)}}),[R,E]);return C.useMemo(()=>l?{reference:A,floating:k}:{},[l,A,k])}function pp(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[c,l]=t[s]||[0,0],[u,f]=t[a]||[0,0];l>=r!=f>=r&&n<=(u-c)*(r-l)/(f-l)+c&&(o=!o)}return o}function vM(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function bM(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,c=performance.now();function l(f,h){const d=performance.now(),p=d-c;if(s===null||a===null||p===0)return s=f,a=h,c=d,null;const m=f-s,g=h-a,w=Math.sqrt(m*m+g*g)/p;return s=f,a=h,c=d,w}const u=f=>{let{x:h,y:d,placement:p,elements:m,onClose:g,nodeId:v,tree:w}=f;return function(T){function S(){clearTimeout(o),g()}if(clearTimeout(o),!m.domReference||!m.floating||p==null||h==null||d==null)return;const{clientX:E,clientY:R}=T,A=[E,R],k=nn(T),I=T.type==="mouseleave",j=Ye(m.floating,k),D=Ye(m.domReference,k),N=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),O=p.split("-")[0],F=h>P.right-P.width/2,_=d>P.bottom-P.height/2,H=vM(A,N),U=P.width>N.width,M=P.height>N.height,$=(U?N:P).left,q=(U?N:P).right,J=(M?N:P).top,X=(M?N:P).bottom;if(j&&(i=!0,!I))return;if(D&&(i=!1),D&&!I){i=!0;return}if(I&&De(T.relatedTarget)&&Ye(m.floating,T.relatedTarget)||w&&hr(w.nodesRef.current,v).some(B=>{let{context:z}=B;return z==null?void 0:z.open}))return;if(O==="top"&&d>=N.bottom-1||O==="bottom"&&d<=N.top+1||O==="left"&&h>=N.right-1||O==="right"&&h<=N.left+1)return S();let G=[];switch(O){case"top":G=[[$,N.top+1],[$,P.bottom-1],[q,P.bottom-1],[q,N.top+1]];break;case"bottom":G=[[$,P.top+1],[$,N.bottom-1],[q,N.bottom-1],[q,P.top+1]];break;case"left":G=[[P.right-1,X],[P.right-1,J],[N.left+1,J],[N.left+1,X]];break;case"right":G=[[N.right-1,X],[N.right-1,J],[P.left+1,J],[P.left+1,X]];break}function L(B){let[z,V]=B;switch(O){case"top":{const Y=[U?z+t/2:F?z+t*4:z-t*4,V+t+1],ee=[U?z-t/2:F?z+t*4:z-t*4,V+t+1],W=[[P.left,F||U?P.bottom-t:P.top],[P.right,F?U?P.bottom-t:P.top:P.bottom-t]];return[Y,ee,...W]}case"bottom":{const Y=[U?z+t/2:F?z+t*4:z-t*4,V-t],ee=[U?z-t/2:F?z+t*4:z-t*4,V-t],W=[[P.left,F||U?P.top+t:P.bottom],[P.right,F?U?P.top+t:P.bottom:P.top+t]];return[Y,ee,...W]}case"left":{const Y=[z+t+1,M?V+t/2:_?V+t*4:V-t*4],ee=[z+t+1,M?V-t/2:_?V+t*4:V-t*4];return[...[[_||M?P.right-t:P.left,P.top],[_?M?P.right-t:P.left:P.right-t,P.bottom]],Y,ee]}case"right":{const Y=[z-t,M?V+t/2:_?V+t*4:V-t*4],ee=[z-t,M?V-t/2:_?V+t*4:V-t*4],W=[[_||M?P.left+t:P.right,P.top],[_?M?P.left+t:P.right:P.left+t,P.bottom]];return[Y,ee,...W]}}}if(!pp([E,R],G)){if(i&&!H)return S();if(!I&&r){const B=l(T.clientX,T.clientY);if(B!==null&&B<.1)return S()}pp([E,R],L([h,d]))?!i&&r&&(o=window.setTimeout(S,40)):S()}}};return u.__options={blockPointerEvents:n},u}const Ro=e=>{const t=b.useId(),[n,r]=b.useState(e.open),o=b.useRef(null),i=b.useMemo(()=>[aa(10),Gu({fallbackAxisSideDirection:"end"}),Uu(),tb({padding:5,element:o})],[e.arrow]),{refs:s,floatingStyles:a,context:c}=Eo({open:n,middleware:i,transform:!0,whileElementsMounted:sa,onOpenChange:(p,m)=>{var v;const g=m==null?void 0:m.relatedTarget;g&&g.dataset.floating==="true"&&!p||(r(p),(v=e.onChange)==null||v.call(e,p))}}),l=la(c),u=So(c),f=Po(c),{getReferenceProps:h,getFloatingProps:d}=Co([l,u,f]);return x.jsxs(b.Fragment,{children:[x.jsx("button",{ref:s.setReference,...h(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(To,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(Ri,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:c,modal:!1,children:x.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:s.setFloating,style:a,"aria-labelledby":t,...d(),children:[x.jsx(ib,{ref:o,context:c,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),x.jsx("header",{className:"mb-2",children:x.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},xM=e=>{const t=b.useRef(null),n=b.useId(),r=`${n}:wrapper`,o=`${n}:title`,[i,s]=b.useState(!1),{context:a,refs:c}=Eo({transform:!0,open:i!==null,nodeId:n,onOpenChange:s,strategy:"absolute"}),l=la(a),u=Po(a),f=So(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:h,getReferenceProps:d}=Co([l,u,f]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(Hr,{...d(e),as:ft.button,layoutId:r,ref:c.setReference,size:"small",onClick:()=>s(!0),children:x.jsx(ft.span,{layoutId:o,children:e.trigger})}),x.jsx(go,{children:i?x.jsx(To,{root:t,children:x.jsx(Ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:x.jsx(ft.div,{...h(),ref:c.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},yb=300,wM=500,vb=(e="")=>ke("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),yc=b.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),mp=b.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:i,...s},a)=>{const c=Gn(),l=c!==null,[u,f]=b.useState(!1),[h,d]=b.useState(!1),[p,m]=b.useState(null),g=b.useRef([]),v=b.useRef([]),w=b.useContext(yc),y=Yn(),T=UD(),S=ob(),{floatingStyles:E,refs:R,context:A}=Eo({nodeId:T,open:u,transform:!0,onOpenChange:f,whileElementsMounted:sa,placement:l?"right":"bottom-start",strategy:"absolute",middleware:[aa({mainAxis:l?0:4,alignmentAxis:l?-4:0}),Gu(),Uu()]}),k=Po(A,{role:"menu",enabled:!0}),I=So(A,{bubbles:!0}),j=cb(A,{enabled:n,delay:{open:yb},handleClose:bM({blockPointerEvents:!0})}),D=la(A,{event:"mousedown",toggle:!l,ignoreMouse:l,keyboardHandlers:!0}),N=gb(A,{loop:!0,activeIndex:p,virtual:!0,nested:l,allowEscape:!0,listRef:g,scrollItemIntoView:!0,onNavigate:m}),P=yM(A,{activeIndex:p,listRef:v,resetMs:wM,onMatch:u?m:void 0}),{getReferenceProps:O,getFloatingProps:F,getItemProps:_}=Co([j,D,k,I,N,P]);b.useEffect(()=>{if(!y)return;const U=()=>f(!1),M=$=>{$.nodeId!==T&&$.parentId===c&&f(!1)};return y.events.on("click",U),y.events.on("menuopen",M),()=>{y.events.off("click",U),y.events.off("menuopen",M)}},[y,T,c]),b.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:c,nodeId:T})},[y,u,T,c]);const H=r?s.className:ke(vb(s.className));return x.jsxs(GD,{id:T,children:[x.jsx(b.Fragment,{children:s.asChild?x.jsx(Jr,{children:i,ref:gc([R.setReference,S.ref,a]),tabIndex:l?w.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":l?"":void 0,role:l?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...O(w.getItemProps({...s,onFocus(U){var M;(M=s.onFocus)==null||M.call(s,U),d(!1),w.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",ref:gc([R.setReference,S.ref,a]),tabIndex:l?w.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":l?"":void 0,role:l?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...O(w.getItemProps({...s,onFocus(U){var M;(M=s.onFocus)==null||M.call(s,U),d(!1),w.setHasFocusInside(!0)}})),children:[i,l&&x.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[x.jsx("span",{className:"sr-only",children:"Next menu"}),x.jsx(bu,{size:14})]})]})}),x.jsx(yc.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:_,setHasFocusInside:d,isOpen:u},children:x.jsx($D,{elementsRef:g,labelsRef:v,children:u&&x.jsx(To,{preserveTabOrder:!0,children:x.jsx(Ri,{context:A,modal:!1,initialFocus:l?-1:0,returnFocus:!l,children:x.jsx(t,{...F(),ref:R.setFloating,style:{...s.style,...E},className:ke("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})})})})})]})}),TM=b.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},i)=>{const s=b.useContext(yc),a=ob({label:r?null:typeof e=="string"?e:t}),c=Yn(),l=a.index===s.activeIndex;return x.jsxs("button",{...o,ref:gc([a.ref,i]),"data-active":l,type:"button",role:"menuitem",disabled:r,tabIndex:l?0:-1,className:vb(o.className),...s.getItemProps({onClick(u){var f;(f=o.onClick)==null||f.call(o,u),c==null||c.events.emit("click")},onFocus(u){var f;(f=o.onFocus)==null||f.call(o,u),s.setHasFocusInside(!0)}}),children:[e,n?x.jsx(n,{size:16}):null]})}),SM=b.forwardRef((e,t)=>Gn()!==null?x.jsx(mp,{...e,isParent:!1,ref:t}):x.jsx(YD,{children:x.jsx(mp,{...e,isParent:!0,ref:t})})),EM=(e,t)=>Es()?t:window.matchMedia(e).matches,CM=(e,t=!0)=>{const[n,r]=b.useState(t);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),i=()=>r(EM(e,t));return i(),o.addListener?(o.addListener(i),()=>o.removeListener?o.removeListener(i):void 0):(o.addEventListener("change",i),()=>o.removeEventListener("change",i))},[e]),n},zt="600ms",PM={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:zt},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:zt},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:zt}},RM={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:zt},exit:{translateX:["0%","30%"],opacity:0,animationDuration:zt}},ll={drawer:e=>e==="left"?PM:RM,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:zt,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:zt,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:zt,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:zt},enter:{opacity:1,scale:[1.05,1],animationDuration:zt},exit:{opacity:0,scale:.97,animationDuration:zt}}},IM=lo("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"}}),AM={top:0,left:0,right:0,bottom:-1},OM=e=>e*.62,DM=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const l=e.parent.current,u=e.value.get()||l.getBoundingClientRect().width,f=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+f))}const i=e.parent.current.getBoundingClientRect(),s=e.value.get()||i.height,a=Math.abs(s-r.delta.y),c=OM(window.outerHeight);return a<c?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return x.jsx(ft.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:AM,whileDrag:{cursor:"grabbing"},className:ke("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?x.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},cl={drawer:"right",sheet:"none",dialog:"none"},MM=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...i})=>{const s=b.useId(),a=b.useId(),c=CM("(min-width: 64rem)"),l=e!=="dialog",u=c?e==="drawer"?i.position:cl[e]:r?cl[e]:cl.sheet,f=c||r?ll[e]:ll.sheet,h=typeof f=="function"?f(u):f,d=c||r?e:"sheet",{refs:p,context:m}=Eo({open:i.open,onOpenChange:i.onChange}),g=la(m),v=Po(m),w=So(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:T}=Co([g,v,w]),S=i.trigger,E=qr(void 0),R=()=>i.onChange(!1);return x.jsxs(b.Fragment,{children:[i.trigger?x.jsx(b.Fragment,{children:i.asChild?x.jsx(Jr,{ref:p.setReference,...y({layoutId:i.layoutId}),children:S}):x.jsx(ft.button,{ref:p.setReference,...y(),layoutId:i.layoutId,type:"button",children:S})}):null,x.jsx(To,{children:x.jsx(go,{presenceAffectsLayout:!0,children:i.open?x.jsx(iM,{lockScroll:!0,className:`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${d==="drawer"?"":"grid items-end justify-center lg:items-center"}`,children:x.jsx(Ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:m,children:x.jsxs(ft.div,{animate:"enter","aria-describedby":a,"aria-labelledby":s,className:IM({position:u,type:d}),exit:"exit",layoutId:i.layoutId,initial:"initial",ref:p.setFloating,style:d==="drawer"?{width:E}:{height:E},variants:h,...T(),children:[i.title?x.jsx("header",{className:"relative w-full",children:i.title?x.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:i.title}):null}):null,x.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:i.children}),i.footer?x.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:i.footer}):null,o?x.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:x.jsx("button",{type:"button",onClick:R,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(wu,{})})}):null,l&&t?x.jsx(DM,{onChange:i.onChange,parent:p.floating,position:u,sheet:d==="sheet",value:E}):null]})})}):null})})]})},kM=e=>x.jsx(ft.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),bb=({children:e,followCursor:t=!1,placement:n,enabled:r,as:o,title:i,...s})=>{const[a,c]=b.useState(!1),l=b.useRef(null),u=o||"span",{refs:f,floatingStyles:h,context:d}=Eo({open:a,placement:n,transform:!0,onOpenChange:c,whileElementsMounted:sa,middleware:[aa(5),Gu({fallbackAxisSideDirection:"start"}),Uu(),tb({element:l,padding:5})]}),p=cb(d,{move:!0,enabled:r,delay:{open:yb}}),m=fM(d,{enabled:r}),g=So(d,{enabled:r}),v=Po(d,{role:"tooltip",enabled:r}),w=aM(d,{enabled:!!r&&!!t}),{getReferenceProps:y,getFloatingProps:T}=Co([p,m,g,v,w]);return x.jsxs(b.Fragment,{children:[x.jsx(u,{ref:f.setReference,...y(s),children:i}),x.jsx(To,{children:a&&x.jsxs(ho,{...T(),ref:f.setFloating,style:h,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[x.jsx(ib,{ref:l,context:d,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),e]})})]})};class Fs{static getDescendantProperty(t,n,r=[]){let o,i,s,a,c,l;if(n){if(s=n.indexOf("."),s===-1?o=n:(o=n.slice(0,s),i=n.slice(s+1)),a=t[o],a!==null&&typeof a<"u")if(!i&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(c=0,l=a.length;c<l;c++)Fs.getDescendantProperty(a[c],i,r);else i&&Fs.getDescendantProperty(a,i,r)}else r.push(t);return r}}class jr{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 i=jr.isMatch(o,t,this.options.caseSensitive);i&&n.push({item:o,score:i})}else for(let i=0;i<this.keys.length;i++){const s=Fs.getDescendantProperty(o,this.keys[i]);let a=!1;for(let c=0;c<s.length;c++){const l=jr.isMatch(s[c],t,this.options.caseSensitive);if(l){a=!0,n.push({item:o,score:l});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=jr.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 jr.indexesOfFirstLetter(t,n).forEach((s,a)=>{let c=s+1;o[a]=[s];for(let l=1;l<r.length;l++){const u=r[l];if(c=t.indexOf(u,c),c===-1){o[a]=!1;break}o[a].push(c),c++}}),o=o.filter(s=>s!==!1),o.length?o.sort((s,a)=>s.length===1?s[0]-a[0]:(s=s[s.length-1]-s[0],a=a[a.length-1]-a[0],s-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,i)=>o!==r?!1:i).filter(o=>o!==!1)}}const xb=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:i})=>x.jsxs("div",{className:ke("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:x.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-error:text-danger",children:[i,e||r?x.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?x.jsx(bb,{title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(My,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:r}):null,e?x.jsxs(b.Fragment,{children:[x.jsx(Dy,{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}),x.jsx(gP,{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]}),ua=({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:i,right:s,info:a,children:c,error:l,form:u,id:f,labelClassName:h="",name:d,title:p,placeholder:m,hideLeft:g,required:v})=>{const w=f??d,y=Dt(),T=e??y.inputOptionalLabel;return x.jsxs("fieldset",{form:u,"data-error":!!l,"data-interactive":!!i,className:ke("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[x.jsxs("label",{form:u,htmlFor:w,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-error:text-danger",children:[!g&&!n?x.jsx(xb,{info:a,hideLeft:g,reportStatus:!0,title:p,placeholder:m,children:T||n?x.jsxs(b.Fragment,{children:[v?null:x.jsx("span",{className:"text-opacity-70",children:T}),n?x.jsx(b.Fragment,{children:n}):null]}):null}):null,x.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?x.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,c,s?x.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-2",children:s}):null]})]}),x.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:l}),x.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})]})},FM=e=>x.jsx(b.Fragment,{children:e.children}),wb=b.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},i)=>{const s=r.Render??FM,a=r.label??r.value;return x.jsx("li",{...o,ref:i,role:"option","aria-selected":t,className:"w-full border-b border-tooltip-border last:border-transparent",children:x.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-hover text-primary-foreground":""} ${e?"bg-primary text-primary-foreground":""}`,children:[x.jsx(s,{...o,label:r.label,value:r.value,children:a}),t?x.jsx("span",{children:x.jsx(pP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})}),jM={duration:300,initial:{transform:"scaleY(0)",opacity:.4},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},NM={caseSensitive:!1,sort:!1},LM=[],_M=b.forwardRef(({options:e,dynamicOption:t=!1,feedback:n=null,labelClassName:r,interactive:o,rightLabel:i,optionalText:s,container:a,hideLeft:c=!1,right:l,left:u,error:f,required:h=!1,...d},p)=>{const m=d.value??d.defaultValue??"",g=Dt(),[v,w]=b.useState(!1),[y,T]=b.useState(""),[S,E]=b.useState(m),[R,A]=b.useState(()=>{var V;return((V=e.find(Y=>Y.value===m))==null?void 0:V.label)??m}),[k,I]=b.useState(null),j=b.useRef(LM),D=t&&y!==""?[{value:y,label:y,"data-dynamic":"true"},...e]:e,N=new jr(D,["value","label"],NM).search(y),P=t?void 0:`^(${e.map(V=>`${oc(V.value)}${V.label?"|"+oc(V.label):""}`).join("|")})$`;b.useEffect(()=>{if(d.value){const V=e.find(Y=>Y.value===d.value);E((V==null?void 0:V.label)??d.value)}},[d.value]);const{x:O,y:F,strategy:_,refs:H,context:U}=Eo({open:v,transform:!0,strategy:"absolute",onOpenChange:w,whileElementsMounted:sa,middleware:[aa(4),DD({elementContext:"reference",padding:10,apply(V){const ee=V.elements.reference.parentElement,W=ee==null?void 0:ee.getBoundingClientRect().width;Object.assign(V.elements.floating.style,{width:`${W}px`,maxWidth:`${W}px`,minWidth:"max-content",maxHeight:`${Math.min(480,V.availableHeight)}px`})}})]}),M=gM(U,jM),{getReferenceProps:$,getFloatingProps:q,getItemProps:J}=Co([Po(U,{role:"listbox"}),So(U),gb(U,{activeIndex:k,allowEscape:!0,cols:0,focusItemOnOpen:"auto",listRef:j,loop:!0,openOnArrowKeyDown:!0,scrollItemIntoView:!0,selectedIndex:k,virtual:!0,onNavigate:V=>I(Y=>V??Y)})]);b.useEffect(()=>{const V=H.reference.current;if(V)return Hs(V)},[]);const X=(V,Y)=>{E(V.value);const ee=H.reference.current;if(!ee)return;ee==null||ee.setAttribute("data-value",V.value),ee.value=V.value;const W=new Event("change",{bubbles:!1,cancelable:!0});ee.dispatchEvent(W),d.onChange&&d.onChange(W),A(V.label??""),w(!1),T(""),I(Y)},G=V=>{var ee;const Y=V.target.value;return T(Y),!v&&Y===""?w(!0):(V.target.name=d.name||"",Y?w(!0):(ee=d.onChange)==null?void 0:ee.call(d,V))},L=()=>{w(!0),T("")},B=()=>{var V;T(""),E(""),(V=H.reference.current)==null||V.setAttribute("data-value",""),A(""),$m(H.reference.current),w(!1)},z=d.id||d.name;return x.jsxs(ua,{...d,container:a,error:f,feedback:n,form:d.form,hideLeft:c,id:d.name||d.id,interactive:o,labelClassName:r,left:u,name:d.name,optionalText:s,placeholder:d.placeholder,required:h,rightLabel:i,title:d.title,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{type:"button",className:"transition-colors link:text-primary",children:[x.jsx(Oy,{size:20}),x.jsx("span",{className:"sr-only",children:g.inputCaretDown})]}),S?x.jsx("button",{type:"button",onClick:B,className:"transition-colors link:text-danger",children:x.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x.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:[x.jsx("input",{...$({...d,onChange:G,onFocus:L,pattern:P,ref:H.setReference,name:`${z}-shadow`,id:`${z}-shadow`,onClick:V=>V.currentTarget.focus(),onKeyDown(V){if(V.key==="Escape")return V.currentTarget.blur(),w(!1);if(V.key==="Enter"){if(k!==null&&N[k])return V.preventDefault(),X(N[k],k);if(N.length===1)return V.preventDefault(),X(N[0],0)}}}),"data-value":S,"data-error":!!f,"data-name":z,"data-target":z,required:h,value:v?y:R||S,"aria-autocomplete":"list",autoComplete:"off",className:ke("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",d.className)}),x.jsx("input",{id:z,name:z,type:"hidden","data-origin":z,ref:p,required:h,defaultValue:d.value||S||void 0}),x.jsx(To,{preserveTabOrder:!0,children:v?x.jsx(Ri,{guards:!0,returnFocus:!1,context:U,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsx("ul",{...q({ref:H.setFloating,style:{position:_,left:(O??0)+(S?26:16),top:F??0,...M.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:N.map((V,Y)=>{const ee=S===V.value||S===V.label;return x.jsx(wb,{...J({onClick:()=>X(V,Y),ref:W=>void(j.current[Y]=W),selected:k===Y}),option:V,active:ee,selected:k===Y},`${V.value}-option`)})})}):null})]})}),Tb=b.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:i,container:s,...a},c)=>x.jsxs("label",{"data-task":t,"data-disabled":a.disabled,"aria-disabled":a.disabled,className:ke("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",s),children:[x.jsx("input",{...a,ref:c,type:"checkbox","data-task":t,className:ke("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,x.jsx("span",{"data-name":"checkbox-label",className:ke("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),Ii=b.forwardRef(({type:e="text",feedback:t=null,info:n,labelClassName:r,next:o,interactive:i,rightLabel:s,optionalText:a,container:c,hideLeft:l=!1,right:u,left:f,error:h,...d},p)=>{const m=d.id??d.name,g=b.useRef(null);return b.useEffect(()=>{if(g.current===null)return;const v=g.current,w=Hs(g.current),y=T=>{const S=T;if(S.key==="Enter"&&v.enterKeyHint==="next"){const E=v.getAttribute("data-next");if(E){const R=document.getElementById(E);if(R)return R.focus(),void S.preventDefault()}}};return v.addEventListener("keydown",y),()=>{w(),v.removeEventListener("keydown",y)}},[]),x.jsx(ua,{info:n,container:c,error:h,feedback:t,hideLeft:l,left:f,optionalText:a,right:u,rightLabel:s,interactive:i,form:d.form,id:d.name||d.id,name:d.name,labelClassName:r,title:d.title,placeholder:d.placeholder,required:d.required,children:x.jsx(nv,{...d,type:e,"data-next":o,ref:Hc(p,g),id:m,name:m,className:ke("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",d.className)})})}),gp=new Date(1970,11,31),ul={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},yp={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},VM={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")},fl=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},$M=b.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...i},s)=>{const a=t||gA(),c=b.useId(),l=Dt(),u=b.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[f,h]=b.useState(e||void 0),[d,p]=b.useState(!1),m=fl(u,gp).flatMap(R=>vn.keyof(ul,R.type)?ul[R.type](R.value):[]),g=fl(u,gp).reduce((R,A)=>R+(vn.keyof(yp,A.type)?yp[A.type](A.value):""),"");console.log({locale:a,datetimeFormat:u,placeholder:g});const[v,w]=b.useState(f?fl(u,f).reduce((R,A)=>R+(vn.keyof(ul,A.type)?VM[A.type](f,A.value):""),""):""),y=R=>{const A=R.target.value;if(w(A),m.length===A.length&&m.every((I,j)=>{const D=A.charAt(j);return typeof I=="string"?D===I:I.test(D)})){const I=Zr(AI(A,g,new Date));return h(I),r==null?void 0:r(I)}return h(void 0),r==null?void 0:r(void 0)},T=R=>(h(R),r==null||r(R),w(R?OR(R,g):"")),S=_y(f),E=S?f.toISOString():void 0;return x.jsx(Ii,{...i,mask:m,value:v,"data-value":E,"data-target":i.name,className:"uppercase",formNoValidate:!d,placeholder:g,onChange:y,required:i.required??!0,error:d?void 0:i.error,name:void 0,id:void 0,right:x.jsxs(b.Fragment,{children:[x.jsx("input",{"data-origin":i.name,defaultValue:E,form:i.form,hidden:!0,id:i.name,name:i.name,ref:s,type:"date"}),x.jsx(Ro,{open:d,onChange:p,trigger:x.jsxs("span",{"aria-labelledby":c,children:[x.jsx("span",{id:c,className:"sr-only",children:l.datePickerCalendarButtonLabel}),x.jsx(hP,{})]}),buttonProps:{"aria-describedby":c},children:x.jsx(fv,{...i,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:T,disabledDate:n,date:S?f:void 0})})]})})}),BM=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],WM=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],HM=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],zM=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vp=(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 bp(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?zM:HM:t.binary?WM:BM,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,i=o?"-":t.signed?"+":"";o&&(e=-e);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),e<1){const u=vp(e,t.locale,s);return i+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,s||(e=e.toPrecision(3));const c=vp(Number(e),t.locale,s),l=n[a];return i+c+r+l}var vc={exports:{}},Ki={exports:{}},Pe={};/** @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])"],As=LO.join(","),Uv=typeof Element>"u",to=Uv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Os=!Uv&&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},Ds=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"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},_O=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},VO=function(t,n,r){if(Ds(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(As));return n&&to.call(t,As)&&o.unshift(t),o=o.filter(r),o},$O=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Ds(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,l=e(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{var u=to.call(s,As);u&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!Ds(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&h){var d=e(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},Gv=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Yv=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||_O(t))&&!Gv(t)?0:t.tabIndex},BO=function(t,n){var r=Yv(t);return r<0&&n&&!Gv(t)?0:r},WO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Kv=function(t){return t.tagName==="INPUT"},HO=function(t){return Kv(t)&&t.type==="hidden"},zO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},UO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},GO=function(t){if(!t.name)return!0;var n=t.form||Os(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(s){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",s.message),!1}var i=UO(o,t.form);return!i||i===t},YO=function(t){return Kv(t)&&t.type==="radio"},KO=function(t){return YO(t)&&!GO(t)},qO=function(t){var n,r=t&&Os(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,c;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var l,u,f;r=Os(o),o=(l=r)===null||l===void 0?void 0:l.host,i=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Bh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},XO=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=to.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(to.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,l=Os(t);if(c&&!c.shadowRoot&&o(c)===!0)return Bh(t);t.assignedSlot?t=t.assignedSlot:!c&&l!==t.ownerDocument?t=l.host:t=c}t=a}if(qO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Bh(t);return!1},QO=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 to.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ZO=function(t,n){return!(n.disabled||Ds(n)||HO(n)||XO(n,t)||zO(n)||QO(n))},mc=function(t,n){return!(KO(n)||Yv(n)<0||!ZO(t,n))},JO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},eD=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=BO(a,s),l=s?e(o.candidates):a;c===0?s?n.push.apply(n,l):n.push(a):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:l})}),r.sort(WO).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},li=function(t,n){n=n||{};var r;return n.getShadowRoot?r=$O([t],n.includeContainer,{filter:mc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:JO}):r=VO(t,n.includeContainer,mc.bind(null,n)),eD(r)},tD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return to.call(t,As)===!1?!1:mc(n,t)};function Wh(e,t,n){let{reference:r,floating:o}=e;const i=mr(t),s=Wu(t),a=Bu(s),c=$n(t),l=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let d;switch(c){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(bo(t)){case"start":d[s]-=h*(n&&l?-1:1);break;case"end":d[s]+=h*(n&&l?-1:1);break}return d}const nD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Wh(l,r,c),h=r,d={},p=0;for(let m=0;m<a.length;m++){const{name:g,fn:v}=a[m],{x:w,y,data:T,reset:S}=await v({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:d,rects:l,platform:s,elements:{reference:e,floating:t}});u=w??u,f=y??f,d={...d,[g]:{...d[g],...T}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:u,y:f}=Wh(l,h,c)),m=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}};async function Hu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=vo(t,e),p=zv(d),g=a[h?f==="floating"?"reference":"floating":f],v=Is(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),T=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},S=Is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:c}):w);return{top:(v.top-S.top+p.top)/T.y,bottom:(S.bottom-v.bottom+p.bottom)/T.y,left:(v.left-S.left+p.left)/T.x,right:(S.right-v.right+p.right)/T.x}}const rD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=vo(e,t)||{};if(l==null)return{};const f=zv(u),h={x:n,y:r},d=Wu(o),p=Bu(d),m=await s.getDimensions(l),g=d==="y",v=g?"top":"left",w=g?"bottom":"right",y=g?"clientHeight":"clientWidth",T=i.reference[p]+i.reference[d]-h[d]-i.floating[p],S=h[d]-i.reference[d],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let R=E?E[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(E)))&&(R=a.floating[y]||i.floating[p]);const A=T/2-S/2,k=R/2-m[p]/2-1,I=rn(f[v],k),j=rn(f[w],k),D=I,N=R-m[p]-j,P=R/2-m[p]/2+A,O=hc(D,P,N),F=!c.arrow&&bo(o)!=null&&P!==O&&i.reference[p]/2-(P<D?I:j)-m[p]/2<0,_=F?P<D?P-D:P-N:0;return{[d]:h[d]+_,data:{[d]:O,centerOffset:P-O-_,...F&&{alignmentOffset:_}},reset:F}}}),oD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=vo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=$n(o),w=mr(a),y=$n(a)===a,T=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=h||(y||!m?[Rs(a)]:kO(a)),E=p!=="none";!h&&E&&S.push(...jO(a,m,p,T));const R=[a,...S],A=await Hu(t,g),k=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(A[v]),f){const P=MO(o,s,T);k.push(A[P[0]],A[P[1]])}if(I=[...I,{placement:o,overflows:k}],!k.every(P=>P<=0)){var j,D;const P=(((j=i.flip)==null?void 0:j.index)||0)+1,O=R[P];if(O)return{data:{index:P,overflows:I},reset:{placement:O}};let F=(D=I.filter(_=>_.overflows[0]<=0).sort((_,H)=>_.overflows[1]-H.overflows[1])[0])==null?void 0:D.placement;if(!F)switch(d){case"bestFit":{var N;const _=(N=I.filter(H=>{if(E){const U=mr(H.placement);return U===w||U==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(U=>U>0).reduce((U,M)=>U+M,0)]).sort((H,U)=>H[1]-U[1])[0])==null?void 0:N[0];_&&(F=_);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function iD(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=$n(n),a=bo(n),c=mr(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,f=vo(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(d=a==="end"?p*-1:p),c?{x:d*u,y:h*l}:{x:h*l,y:d*u}}const sD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,c=await iD(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},aD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:v,y:w}=g;return{x:v,y:w}}},...c}=vo(e,t),l={x:n,y:r},u=await Hu(t,c),f=mr($n(o)),h=Hv(f);let d=l[h],p=l[f];if(i){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",w=d+u[g],y=d-u[v];d=hc(w,d,y)}if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=p+u[g],y=p-u[v];p=hc(w,p,y)}const m=a.fn({...t,[h]:d,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},lD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=vo(e,t),c=await Hu(t,a),l=$n(n),u=bo(n),f=mr(n)==="y",{width:h,height:d}=r.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const g=d-c.top-c.bottom,v=h-c.left-c.right,w=rn(d-c[p],g),y=rn(h-c[m],v),T=!t.middlewareData.shift;let S=w,E=y;if(f?E=u||T?rn(y,v):v:S=u||T?rn(w,g):g,T&&!u){const A=Mt(c.left,0),k=Mt(c.right,0),I=Mt(c.top,0),j=Mt(c.bottom,0);f?E=h-2*(A!==0||k!==0?A+k:Mt(c.left,c.right)):S=d-2*(I!==0||j!==0?I+j:Mt(c.top,c.bottom))}await s({...t,availableWidth:E,availableHeight:S});const R=await o.getDimensions(i.floating);return h!==R.width||d!==R.height?{reset:{rects:!0}}:{}}}};function qv(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ps(n)!==i||Ps(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zu(e){return De(e)?e:e.contextElement}function Lr(e){const t=zu(e);if(!et(t))return Vn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qv(t);let s=(i?Ps(n.width):n.width)/r,a=(i?Ps(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cD=Vn(0);function Xv(e){const t=Pt(e);return!Nu()||!t.visualViewport?cD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pt(e)?!1:t}function gr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zu(e);let s=Vn(1);t&&(r?De(r)&&(s=Lr(r)):s=Lr(e));const a=uD(i,n,r)?Xv(i):Vn(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=Pt(i),d=r&&De(r)?Pt(r):r;let p=h,m=fc(p);for(;m&&r&&d!==p;){const g=Lr(m),v=m.getBoundingClientRect(),w=Vt(m),y=v.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,T=v.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;c*=g.x,l*=g.y,u*=g.x,f*=g.y,c+=y,l+=T,p=Pt(m),m=fc(p)}}return Is({width:u,height:f,x:c,y:l})}function fD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Sn(r),a=t?oa(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Vn(1);const u=Vn(0),f=et(r);if((f||!f&&!i)&&((Un(r)!=="body"||Ci(s))&&(c=ia(r)),et(r))){const h=gr(r);l=Lr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}}function dD(e){return Array.from(e.getClientRects())}function Qv(e){return gr(Sn(e)).left+ia(e).scrollLeft}function hD(e){const t=Sn(e),n=ia(e),r=e.ownerDocument.body,o=Mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Qv(e);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(s+=Mt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function pD(e,t){const n=Pt(e),r=Sn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=Nu();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function mD(e,t){const n=gr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=et(e)?Lr(e):Vn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function Hh(e,t,n){let r;if(t==="viewport")r=pD(e,n);else if(t==="document")r=hD(Sn(e));else if(De(t))r=mD(t,n);else{const o=Xv(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Is(r)}function Zv(e,t){const n=Tn(e);return n===t||!De(n)||_n(n)?!1:Vt(n).position==="fixed"||Zv(n,t)}function gD(e,t){const n=t.get(e);if(n)return n;let r=Fn(e,[],!1).filter(a=>De(a)&&Un(a)!=="body"),o=null;const i=Vt(e).position==="fixed";let s=i?Tn(e):e;for(;De(s)&&!_n(s);){const a=Vt(s),c=ju(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ci(s)&&!c&&Zv(e,s))?r=r.filter(u=>u!==s):o=a,s=Tn(s)}return t.set(e,r),r}function yD(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oa(t)?[]:gD(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const f=Hh(t,u,o);return l.top=Mt(f.top,l.top),l.right=rn(f.right,l.right),l.bottom=rn(f.bottom,l.bottom),l.left=Mt(f.left,l.left),l},Hh(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function vD(e){const{width:t,height:n}=qv(e);return{width:t,height:n}}function bD(e,t,n){const r=et(t),o=Sn(t),i=n==="fixed",s=gr(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Vn(0);if(r||!r&&!i)if((Un(t)!=="body"||Ci(o))&&(a=ia(t)),r){const f=gr(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=Qv(o));const l=s.left+a.scrollLeft-c.x,u=s.top+a.scrollTop-c.y;return{x:l,y:u,width:s.width,height:s.height}}function el(e){return Vt(e).position==="static"}function zh(e,t){return!et(e)||Vt(e).position==="fixed"?null:t?t(e):e.offsetParent}function Jv(e,t){const n=Pt(e);if(oa(e))return n;if(!et(e)){let o=Tn(e);for(;o&&!_n(o);){if(De(o)&&!el(o))return o;o=Tn(o)}return n}let r=zh(e,t);for(;r&&EO(r)&&el(r);)r=zh(r,t);return r&&_n(r)&&el(r)&&!ju(r)?n:r||CO(e)||n}const xD=async function(e){const t=this.getOffsetParent||Jv,n=this.getDimensions,r=await n(e.floating);return{reference:bD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wD(e){return Vt(e).direction==="rtl"}const TD={convertOffsetParentRelativeRectToViewportRelativeRect:fD,getDocumentElement:Sn,getClippingRect:yD,getOffsetParent:Jv,getElementRects:xD,getClientRects:dD,getDimensions:vD,getScale:Lr,isElement:De,isRTL:wD};function SD(e,t){let n=null,r;const o=Sn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:l,top:u,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const d=Fr(u),p=Fr(o.clientWidth-(l+f)),m=Fr(o.clientHeight-(u+h)),g=Fr(l),w={rootMargin:-d+"px "+-p+"px "+-m+"px "+-g+"px",threshold:Mt(0,rn(1,c))||1};let y=!0;function T(S){const E=S[0].intersectionRatio;if(E!==c){if(!y)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(T,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(e)}return s(!0),i}function sa(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=zu(e),u=o||i?[...l?Fn(l):[],...Fn(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=l&&a?SD(l,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(t)})),n()}),l&&!c&&d.observe(l),d.observe(t));let p,m=c?gr(e):null;c&&g();function g(){const v=gr(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(g)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(v=d)==null||v.disconnect(),d=null,c&&cancelAnimationFrame(p)}}const ED=sD,CD=aD,PD=oD,RD=lD,Uh=rD,ID=(e,t,n)=>{const r=new Map,o={platform:TD,...n},i={...o.platform,_c:r};return nD(e,t,{...o,platform:i})};var os=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Ms(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(!Ms(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ms(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function eb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gh(e,t){const n=eb(e);return Math.round(t*n)/n}function Yh(e){const t=C.useRef(e);return os(()=>{t.current=e}),t}function AD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);Ms(h,r)||d(r);const[p,m]=C.useState(null),[g,v]=C.useState(null),w=C.useCallback(_=>{_!==E.current&&(E.current=_,m(_))},[]),y=C.useCallback(_=>{_!==R.current&&(R.current=_,v(_))},[]),T=i||p,S=s||g,E=C.useRef(null),R=C.useRef(null),A=C.useRef(u),k=c!=null,I=Yh(c),j=Yh(o),D=C.useCallback(()=>{if(!E.current||!R.current)return;const _={placement:t,strategy:n,middleware:h};j.current&&(_.platform=j.current),ID(E.current,R.current,_).then(H=>{const U={...H,isPositioned:!0};N.current&&!Ms(A.current,U)&&(A.current=U,yi.flushSync(()=>{f(U)}))})},[h,t,n,j]);os(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[l]);const N=C.useRef(!1);os(()=>(N.current=!0,()=>{N.current=!1}),[]),os(()=>{if(T&&(E.current=T),S&&(R.current=S),T&&S){if(I.current)return I.current(T,S,D);D()}},[T,S,D,I,k]);const P=C.useMemo(()=>({reference:E,floating:R,setReference:w,setFloating:y}),[w,y]),O=C.useMemo(()=>({reference:T,floating:S}),[T,S]),F=C.useMemo(()=>{const _={position:n,left:0,top:0};if(!O.floating)return _;const H=Gh(O.floating,u.x),U=Gh(O.floating,u.y);return a?{..._,transform:"translate("+H+"px, "+U+"px)",...eb(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,O.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:D,refs:P,elements:O,floatingStyles:F}),[u,D,P,O,F])}const OD=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?Uh({element:r.current,padding:o}).fn(n):{}:r?Uh({element:r,padding:o}).fn(n):{}}}},aa=(e,t)=>({...ED(e),options:[e,t]}),Uu=(e,t)=>({...CD(e),options:[e,t]}),Gu=(e,t)=>({...PD(e),options:[e,t]}),DD=(e,t)=>({...RD(e),options:[e,t]}),tb=(e,t)=>({...OD(e),options:[e,t]});function gc(e){return C.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const nb={...C},MD=nb.useInsertionEffect,kD=MD||(e=>e());function at(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return kD(()=>{t.current=e}),C.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 Yu="ArrowUp",Pi="ArrowDown",no="ArrowLeft",xo="ArrowRight";function Ui(e,t,n){return Math.floor(e/t)!==n}function Qo(e,t){return t<0||t>=e.current.length}function tl(e,t){return xt(e,{disabledIndices:t})}function Kh(e,t){return xt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=t===void 0?{}:t;const s=e.current;let a=n;do a+=r?-i:i;while(a>=0&&a<=s.length-1&&is(s,a,o));return a}function FD(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:c,prevIndex:l,stopEvent:u=!1}=t,f=l;if(n.key===Yu){if(u&&mt(n),l===-1)f=c;else if(f=xt(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),o&&(l-i<a||f<0)){const h=l%i,d=c%i,p=c-(d-h);d===h?f=c:f=d>h?p:p-i}Qo(e,f)&&(f=l)}if(n.key===Pi&&(u&&mt(n),l===-1?f=a:(f=xt(e,{startingIndex:l,amount:i,disabledIndices:s}),o&&l+i>c&&(f=xt(e,{startingIndex:l%i-i,amount:i,disabledIndices:s}))),Qo(e,f)&&(f=l)),r==="both"){const h=Fr(l/i);n.key===xo&&(u&&mt(n),l%i!==i-1?(f=xt(e,{startingIndex:l,disabledIndices:s}),o&&Ui(f,i,h)&&(f=xt(e,{startingIndex:l-l%i-1,disabledIndices:s}))):o&&(f=xt(e,{startingIndex:l-l%i-1,disabledIndices:s})),Ui(f,i,h)&&(f=l)),n.key===no&&(u&&mt(n),l%i!==0?(f=xt(e,{startingIndex:l,decrement:!0,disabledIndices:s}),o&&Ui(f,i,h)&&(f=xt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:s}))):o&&(f=xt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:s})),Ui(f,i,h)&&(f=l));const d=Fr(c/i)===h;Qo(e,f)&&(o&&d?f=n.key===no?c:xt(e,{startingIndex:l-l%i-1,disabledIndices:s}):f=l)}return f}function jD(e,t,n){const r=[];let o=0;return e.forEach((i,s)=>{let{width:a,height:c}=i;if(a>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let l=!1;for(n&&(o=0);!l;){const u=[];for(let f=0;f<a;f++)for(let h=0;h<c;h++)u.push(o+f+h*t);o%t+a<=t&&u.every(f=>r[f]==null)?(u.forEach(f=>{r[f]=s}),l=!0):o++}}),[...r]}function ND(e,t,n,r,o){if(e===-1)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function LD(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function is(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 qh=0;function On(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(qh);const i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():qh=requestAnimationFrame(i)}var be=typeof document<"u"?b.useLayoutEffect:b.useEffect;function _D(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 VD(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 rb=C.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function $D(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=C.useState(()=>new Map),s=C.useCallback(c=>{i(l=>new Map(l).set(c,null))},[]),a=C.useCallback(c=>{i(l=>{const u=new Map(l);return u.delete(c),u})},[]);return be(()=>{const c=new Map(o);Array.from(c.keys()).sort(_D).forEach((u,f)=>{c.set(u,f)}),VD(o,c)||i(c)},[o]),C.createElement(rb.Provider,{value:C.useMemo(()=>({register:s,unregister:a,map:o,elementsRef:n,labelsRef:r}),[s,a,o,n,r])},t)}function ob(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:s}=C.useContext(rb),[a,c]=C.useState(null),l=C.useRef(null),u=C.useCallback(f=>{if(l.current=f,a!==null&&(i.current[a]=f,s)){var h;const d=t!==void 0;s.current[a]=d?t:(h=f==null?void 0:f.textContent)!=null?h:null}},[a,i,s,t]);return be(()=>{const f=l.current;if(f)return n(f),()=>{r(f)}},[n,r]),be(()=>{const f=l.current?o.get(l.current):null;f!=null&&c(f)},[o]),C.useMemo(()=>({ref:u,index:a??-1}),[a,u])}function ro(){return ro=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},ro.apply(this,arguments)}let Xh=!1,BD=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+BD++;function WD(){const[e,t]=C.useState(()=>Xh?Qh():void 0);return be(()=>{e==null&&t(Qh())},[]),C.useEffect(()=>{Xh=!0},[]),e}const HD=nb.useId,wo=HD||WD;let ci;process.env.NODE_ENV!=="production"&&(ci=new Set);function ss(){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=ci)!=null&&e.has(o))){var i;(i=ci)==null||i.add(o),console.warn(o)}}function zD(){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=ci)!=null&&e.has(o))){var i;(i=ci)==null||i.add(o),console.error(o)}}const ib=C.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:s=14,height:a=7,tipRadius:c=0,strokeWidth:l=0,staticOffset:u,stroke:f,d:h,style:{transform:d,...p}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||ss("The `ref` prop is required for `FloatingArrow`."));const g=wo(),[v,w]=C.useState(!1);if(be(()=>{if(!o)return;Vt(o).direction==="rtl"&&w(!0)},[o]),!o)return null;const y=l*2,T=y/2,S=s/2*(c/-8+1),E=a/2*c/4,[R,A]=r.split("-"),k=!!h,I=R==="top"||R==="bottom",j=u&&A==="end"?"bottom":"top";let D=u&&A==="end"?"right":"left";u&&v&&(D=A==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?u||i.x:"",P=(i==null?void 0:i.y)!=null?u||i.y:"",O=h||"M0,0"+(" H"+s)+(" L"+(s-S)+","+(a-E))+(" Q"+s/2+","+a+" "+S+","+(a-E))+" Z",F={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[R];return C.createElement("svg",ro({},m,{"aria-hidden":!0,ref:n,width:k?s:s+y,height:s,viewBox:"0 0 "+s+" "+(a>s?a:s),style:{position:"absolute",pointerEvents:"none",[D]:N,[j]:P,[R]:I||k?"100%":"calc(100% - "+y/2+"px)",transform:""+F+(d??""),...p}}),y>0&&C.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:f,strokeWidth:y+(h?0:1),d:O}),C.createElement("path",{stroke:y&&!h?m.fill:"none",d:O}),C.createElement("clipPath",{id:g},C.createElement("rect",{x:-T,y:T*(k?-1:1),width:s+y,height:s})))});function sb(){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 ab=C.createContext(null),lb=C.createContext(null),Gn=()=>{var e;return((e=C.useContext(ab))==null?void 0:e.id)||null},Yn=()=>C.useContext(lb);function UD(e){const t=wo(),n=Yn(),o=Gn();return be(()=>{const i={id:t,parentId:o};return n==null||n.addNode(i),()=>{n==null||n.removeNode(i)}},[n,t,o]),t}function GD(e){const{children:t,id:n}=e,r=Gn();return C.createElement(ab.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r])},t)}function YD(e){const{children:t}=e,n=C.useRef([]),r=C.useCallback(s=>{n.current=[...n.current,s]},[]),o=C.useCallback(s=>{n.current=n.current.filter(a=>a!==s)},[]),i=C.useState(()=>sb())[0];return C.createElement(lb.Provider,{value:C.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i])},t)}function Bn(e){return"data-floating-ui-"+e}function gt(e){const t=b.useRef(e);return be(()=>{t.current=e}),t}const Zh=Bn("safe-polygon");function nl(e,t,n){return n&&!eo(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function cb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:f=0,move:h=!0}=t,d=Yn(),p=Gn(),m=gt(l),g=gt(c),v=gt(n),w=C.useRef(),y=C.useRef(-1),T=C.useRef(),S=C.useRef(-1),E=C.useRef(!0),R=C.useRef(!1),A=C.useRef(()=>{}),k=C.useCallback(()=>{var O;const F=(O=o.current.openEvent)==null?void 0:O.type;return(F==null?void 0:F.includes("mouse"))&&F!=="mousedown"},[o]);C.useEffect(()=>{if(!a)return;function O(F){let{open:_}=F;_||(clearTimeout(y.current),clearTimeout(S.current),E.current=!0)}return i.on("openchange",O),()=>{i.off("openchange",O)}},[a,i]),C.useEffect(()=>{if(!a||!m.current||!n)return;function O(_){k()&&r(!1,_,"hover")}const F=ut(s.floating).documentElement;return F.addEventListener("mouseleave",O),()=>{F.removeEventListener("mouseleave",O)}},[s.floating,n,r,a,m,k]);const I=C.useCallback(function(O,F,_){F===void 0&&(F=!0),_===void 0&&(_="hover");const H=nl(g.current,"close",w.current);H&&!T.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,O,_),H)):F&&(clearTimeout(y.current),r(!1,O,_))},[g,r]),j=at(()=>{A.current(),T.current=void 0}),D=at(()=>{if(R.current){const O=ut(s.floating).body;O.style.pointerEvents="",O.removeAttribute(Zh),R.current=!1}});C.useEffect(()=>{if(!a)return;function O(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function F(M){if(clearTimeout(y.current),E.current=!1,u&&!eo(w.current)||f>0&&!nl(g.current,"open"))return;const $=nl(g.current,"open",w.current);$?y.current=window.setTimeout(()=>{v.current||r(!0,M,"hover")},$):r(!0,M,"hover")}function _(M){if(O())return;A.current();const $=ut(s.floating);if(clearTimeout(S.current),m.current&&o.current.floatingContext){n||clearTimeout(y.current),T.current=m.current({...o.current.floatingContext,tree:d,x:M.clientX,y:M.clientY,onClose(){D(),j(),I(M,!0,"safe-polygon")}});const J=T.current;$.addEventListener("mousemove",J),A.current=()=>{$.removeEventListener("mousemove",J)};return}(w.current==="touch"?!Ye(s.floating,M.relatedTarget):!0)&&I(M)}function H(M){O()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:M.clientX,y:M.clientY,onClose(){D(),j(),I(M)}})(M))}if(De(s.domReference)){var U;const M=s.domReference;return n&&M.addEventListener("mouseleave",H),(U=s.floating)==null||U.addEventListener("mouseleave",H),h&&M.addEventListener("mousemove",F,{once:!0}),M.addEventListener("mouseenter",F),M.addEventListener("mouseleave",_),()=>{var $;n&&M.removeEventListener("mouseleave",H),($=s.floating)==null||$.removeEventListener("mouseleave",H),h&&M.removeEventListener("mousemove",F),M.removeEventListener("mouseenter",F),M.removeEventListener("mouseleave",_)}}},[s,a,e,u,f,h,I,j,D,r,n,v,d,g,m,o]),be(()=>{var O;if(a&&n&&(O=m.current)!=null&&O.__options.blockPointerEvents&&k()){const _=ut(s.floating).body;_.setAttribute(Zh,""),_.style.pointerEvents="none",R.current=!0;const H=s.floating;if(De(s.domReference)&&H){var F;const U=s.domReference,M=d==null||(F=d.nodesRef.current.find($=>$.id===p))==null||(F=F.context)==null?void 0:F.elements.floating;return M&&(M.style.pointerEvents=""),U.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,p,s,d,m,k]),be(()=>{n||(w.current=void 0,j(),D())},[n,j,D]),C.useEffect(()=>()=>{j(),clearTimeout(y.current),clearTimeout(S.current),D()},[a,s.domReference,j,D]);const N=C.useMemo(()=>{function O(F){w.current=F.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(F){const{nativeEvent:_}=F;function H(){!E.current&&!v.current&&r(!0,_,"hover")}u&&!eo(w.current)||n||f===0||(clearTimeout(S.current),w.current==="touch"?H():S.current=window.setTimeout(H,f))}}},[u,r,n,v,f]),P=C.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(O){I(O.nativeEvent,!1)}}),[I]);return C.useMemo(()=>a?{reference:N,floating:P}:{},[a,N,P])}function KD(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){const i=e.find(s=>s.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function hr(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function qD(e,t){let n,r=-1;function o(i,s){s>r&&(n=i,r=s),hr(e,i).forEach(c=>{o(c.id,s+1)})}return o(t,0),e.find(i=>i.id===n)}let Rr=new WeakMap,Gi=new WeakSet,Yi={},rl=0;const XD=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ub=e=>e&&(e.host||ub(e.parentNode)),QD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ub(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ZD(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=QD(t,e),a=new Set,c=new Set(s),l=[];Yi[o]||(Yi[o]=new WeakMap);const u=Yi[o];s.forEach(f),h(t),a.clear();function f(d){!d||a.has(d)||(a.add(d),d.parentNode&&f(d.parentNode))}function h(d){!d||c.has(d)||[].forEach.call(d.children,p=>{if(Un(p)!=="script")if(a.has(p))h(p);else{const m=i?p.getAttribute(i):null,g=m!==null&&m!=="false",v=(Rr.get(p)||0)+1,w=(u.get(p)||0)+1;Rr.set(p,v),u.set(p,w),l.push(p),v===1&&g&&Gi.add(p),w===1&&p.setAttribute(o,""),!g&&i&&p.setAttribute(i,"true")}})}return rl++,()=>{l.forEach(d=>{const p=(Rr.get(d)||0)-1,m=(u.get(d)||0)-1;Rr.set(d,p),u.set(d,m),p||(!Gi.has(d)&&i&&d.removeAttribute(i),Gi.delete(d)),m||d.removeAttribute(o)}),rl--,rl||(Rr=new WeakMap,Rr=new WeakMap,Gi=new WeakSet,Yi={})}}function Jh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=ut(e[0]).body;return ZD(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const oo=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fb(e,t){const n=li(e,oo());t==="prev"&&n.reverse();const r=n.indexOf(Ht(ut(e)));return n.slice(r+1)[0]}function db(){return fb(document.body,"next")}function hb(){return fb(document.body,"prev")}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ye(n,r)}function JD(e){li(e,oo()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function eM(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 tM(e,t,n){const r=e.indexOf(t);function o(s){const a=Bn("focus-guard");let c=r+(s?1:0),l=e[c];for(;l&&(!l.isConnected||l.hasAttribute(a)||Ye(n,l));)s?c++:c--,l=e[c];return l}const i=o(!0);return i||o(!1)}const Ku={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 nM;function ep(e){e.key==="Tab"&&(e.target,clearTimeout(nM))}const ks=C.forwardRef(function(t,n){const[r,o]=C.useState();be(()=>(Vu()&&o("button"),document.addEventListener("keydown",ep),()=>{document.removeEventListener("keydown",ep)}),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Bn("focus-guard")]:"",style:Ku};return C.createElement("span",ro({},t,i))}),pb=C.createContext(null),tp=Bn("portal");function rM(e){e===void 0&&(e={});const{id:t,root:n}=e,r=wo(),o=mb(),[i,s]=C.useState(null),a=C.useRef(null);return be(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),be(()=>{if(!r||a.current)return;const c=t?document.getElementById(t):null;if(!c)return;const l=document.createElement("div");l.id=r,l.setAttribute(tp,""),c.appendChild(l),a.current=l,s(l)},[t,r]),be(()=>{if(!r||a.current)return;let c=n||(o==null?void 0:o.portalNode);c&&!De(c)&&(c=c.current),c=c||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,c.appendChild(l));const u=document.createElement("div");u.id=r,u.setAttribute(tp,""),c=l||c,c.appendChild(u),a.current=u,s(u)},[t,n,r,o]),i}function To(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,i=rM({id:n,root:r}),[s,a]=C.useState(null),c=C.useRef(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),h=!!s&&!s.modal&&s.open&&o&&!!(r||i);return C.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function d(p){i&&Zo(p)&&(p.type==="focusin"?eM:JD)(i)}return i.addEventListener("focusin",d,!0),i.addEventListener("focusout",d,!0),()=>{i.removeEventListener("focusin",d,!0),i.removeEventListener("focusout",d,!0)}},[i,o,s==null?void 0:s.modal]),C.createElement(pb.Provider,{value:C.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i])},h&&i&&C.createElement(ks,{"data-type":"outside",ref:c,onFocus:d=>{if(Zo(d,i)){var p;(p=u.current)==null||p.focus()}else{const m=hb()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus()}}}),h&&i&&C.createElement("span",{"aria-owns":i.id,style:Ku}),i&&yi.createPortal(t,i),h&&i&&C.createElement(ks,{"data-type":"outside",ref:l,onFocus:d=>{if(Zo(d,i)){var p;(p=f.current)==null||p.focus()}else{const m=db()||(s==null?void 0:s.refs.domReference.current);m==null||m.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const mb=()=>C.useContext(pb),np=20;let or=[];function ol(e){or=or.filter(n=>n.isConnected);let t=e;if(!(!t||Un(t)==="body")){if(!tD(t,oo())){const n=li(t,oo())[0];n&&(t=n)}or.push(t),or.length>np&&(or=or.slice(-np))}}function rp(){return or.slice().reverse().find(e=>e.isConnected)}const oM=C.forwardRef(function(t,n){return C.createElement("button",ro({},t,{type:"button",ref:n,tabIndex:-1,style:Ku}))});function Ri(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:d,nodeId:p,onOpenChange:m,events:g,dataRef:v,floatingId:w,elements:{domReference:y,floating:T}}=t,S=typeof s=="number"&&s<0,E=Wv(y)&&S,R=XD()?i:!0,A=gt(o),k=gt(s),I=gt(a),j=Yn(),D=mb(),N=C.useRef(null),P=C.useRef(null),O=C.useRef(!1),F=C.useRef(!1),_=C.useRef(-1),H=D!=null,U=T==null?void 0:T.firstElementChild,M=(U==null?void 0:U.id)===w?U:T,$=at(function(G){return G===void 0&&(G=M),G?li(G,oo()):[]}),q=at(G=>{const L=$(G);return A.current.map(B=>y&&B==="reference"?y:M&&B==="floating"?M:L).filter(Boolean).flat()});C.useEffect(()=>{if(r||!l)return;function G(B){if(B.key==="Tab"){Ye(M,Ht(ut(M)))&&$().length===0&&!E&&mt(B);const z=q(),V=nn(B);A.current[0]==="reference"&&V===y&&(mt(B),B.shiftKey?On(z[z.length-1]):On(z[1])),A.current[1]==="floating"&&V===M&&B.shiftKey&&(mt(B),On(z[0]))}}const L=ut(M);return L.addEventListener("keydown",G),()=>{L.removeEventListener("keydown",G)}},[r,y,M,l,A,E,$,q]),C.useEffect(()=>{if(r||!T)return;function G(L){const B=nn(L),V=$().indexOf(B);V!==-1&&(_.current=V)}return T.addEventListener("focusin",G),()=>{T.removeEventListener("focusin",G)}},[r,T,$]),C.useEffect(()=>{if(r||!f)return;function G(){F.current=!0,setTimeout(()=>{F.current=!1})}function L(B){const z=B.relatedTarget;queueMicrotask(()=>{const V=!(Ye(y,z)||Ye(T,z)||Ye(z,T)||Ye(D==null?void 0:D.portalNode,z)||z!=null&&z.hasAttribute(Bn("focus-guard"))||j&&(hr(j.nodesRef.current,p).find(Y=>{var ee,W;return Ye((ee=Y.context)==null?void 0:ee.elements.floating,z)||Ye((W=Y.context)==null?void 0:W.elements.domReference,z)})||KD(j.nodesRef.current,p).find(Y=>{var ee,W;return((ee=Y.context)==null?void 0:ee.elements.floating)===z||((W=Y.context)==null?void 0:W.elements.domReference)===z})));if(c&&V&&Ht(ut(M))===ut(M).body){et(M)&&(M==null||M.focus());const Y=_.current,ee=$(),W=ee[Y]||ee[ee.length-1]||M;et(W)&&W.focus()}(E||!l)&&z&&V&&!F.current&&z!==rp()&&(O.current=!0,m(!1,B))})}if(T&&et(y))return y.addEventListener("focusout",L),y.addEventListener("pointerdown",G),T.addEventListener("focusout",L),()=>{y.removeEventListener("focusout",L),y.removeEventListener("pointerdown",G),T.removeEventListener("focusout",L)}},[r,y,T,M,l,p,j,D,m,f,c,$,E]),C.useEffect(()=>{var G;if(r)return;const L=Array.from((D==null||(G=D.portalNode)==null?void 0:G.querySelectorAll("["+Bn("portal")+"]"))||[]);if(T){const B=[T,...L,N.current,P.current,A.current.includes("reference")||E?y:null].filter(V=>V!=null),z=l||E?Jh(B,R,!R):Jh(B);return()=>{z()}}},[r,y,T,l,A,D,E,R]),be(()=>{if(r||!et(M))return;const G=ut(M),L=Ht(G);queueMicrotask(()=>{const B=q(M),z=k.current,V=(typeof z=="number"?B[z]:z.current)||M,Y=Ye(M,L);!S&&!Y&&h&&On(V,{preventScroll:V===M})})},[r,h,M,S,q,k]),be(()=>{if(r||!M)return;let G=!1;const L=ut(M),B=Ht(L);let V=v.current.openEvent;const Y=d.domReference.current;ol(B);function ee(W){let{open:we,reason:Ue,event:je,nested:Ge}=W;we&&(V=je),Ue==="escape-key"&&d.domReference.current&&ol(d.domReference.current),Ue==="hover"&&je.type==="mouseleave"&&(O.current=!0),Ue==="outside-press"&&(Ge?(O.current=!1,G=!0):O.current=!($v(je)||_u(je)))}return g.on("openchange",ee),()=>{g.off("openchange",ee);const W=Ht(L),we=Ye(T,W)||j&&hr(j.nodesRef.current,p).some(ie=>{var me;return Ye((me=ie.context)==null?void 0:me.elements.floating,W)});(we||V&&["click","mousedown"].includes(V.type))&&d.domReference.current&&ol(d.domReference.current);const je=Y||B,Ge=li(ut(je).body,oo());queueMicrotask(()=>{let ie=rp();!ie&&et(je)&&T&&(ie=tM(Ge,je,T)),I.current&&!O.current&&et(ie)&&(!(ie!==W&&W!==L.body)||we)&&ie.focus({preventScroll:G})})}},[r,T,M,I,v,d,g,j,p]),be(()=>{if(!r&&D)return D.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:m,refs:d}),()=>{D.setFocusManagerState(null)}},[r,D,l,h,m,d,f]),be(()=>{if(r||!M||typeof MutationObserver!="function"||S)return;const G=()=>{const B=M.getAttribute("tabindex"),z=$(),V=Ht(ut(T)),Y=z.indexOf(V);Y!==-1&&(_.current=Y),A.current.includes("floating")||V!==d.domReference.current&&z.length===0?B!=="0"&&M.setAttribute("tabindex","0"):B!=="-1"&&M.setAttribute("tabindex","-1")};G();const L=new MutationObserver(G);return L.observe(M,{childList:!0,subtree:!0,attributes:!0}),()=>{L.disconnect()}},[r,T,M,d,A,$,S]);function J(G){return r||!u||!l?null:C.createElement(oM,{ref:G==="start"?N:P,onClick:L=>m(!1,L.nativeEvent)},typeof u=="string"?u:"Dismiss")}const X=!r&&R&&(l?!E:!0)&&(H||l);return C.createElement(C.Fragment,null,X&&C.createElement(ks,{"data-type":"inside",ref:D==null?void 0:D.beforeInsideRef,onFocus:G=>{if(l){const B=q();On(o[0]==="reference"?B[0]:B[B.length-1])}else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(O.current=!1,Zo(G,D.portalNode)){const B=db()||y;B==null||B.focus()}else{var L;(L=D.beforeOutsideRef.current)==null||L.focus()}}}),!E&&J("start"),n,J("end"),X&&C.createElement(ks,{"data-type":"inside",ref:D==null?void 0:D.afterInsideRef,onFocus:G=>{if(l)On(q()[0]);else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(f&&(O.current=!0),Zo(G,D.portalNode)){const B=hb()||y;B==null||B.focus()}else{var L;(L=D.afterOutsideRef.current)==null||L.focus()}}}))}const il=new Set,iM=C.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t,i=wo();return be(()=>{if(!r)return;il.add(i);const s=/iP(hone|ad|od)|iOS/.test(Lu()),a=document.body.style,l=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,f=a.left?parseFloat(a.left):window.scrollX,h=a.top?parseFloat(a.top):window.scrollY;if(a.overflow="hidden",u&&(a[l]=u+"px"),s){var d,p;const m=((d=window.visualViewport)==null?void 0:d.offsetLeft)||0,g=((p=window.visualViewport)==null?void 0:p.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(h-Math.floor(g))+"px",left:-(f-Math.floor(m))+"px",right:"0"})}return()=>{il.delete(i),il.size===0&&(Object.assign(a,{overflow:"",[l]:""}),s&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(f,h)))}},[i,r]),C.createElement("div",ro({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))});function op(e){return et(e.target)&&e.target.tagName==="BUTTON"}function ip(e){return $u(e)}function la(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0}=t,f=C.useRef(),h=C.useRef(!1),d=C.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const m=f.current;p.button===0&&a!=="click"&&(eo(m,!0)&&l||(n&&c&&(!o.current.openEvent||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=f.current;if(a==="mousedown"&&f.current){f.current=void 0;return}eo(m,!0)&&l||(n&&c&&(!o.current.openEvent||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!u||op(p))&&(p.key===" "&&!ip(i)&&(p.preventDefault(),h.current=!0),p.key==="Enter"&&r(!(n&&c),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||op(p)||ip(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&c),p.nativeEvent,"click"))}}),[o,i,a,l,u,r,n,c]);return C.useMemo(()=>s?{reference:d}:{},[s,d])}function sM(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const s=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(((i=t.dataRef.current.openEvent)==null?void 0:i.type)||"")&&t.pointerType!=="touch";let u=s.width,f=s.height,h=s.x,d=s.y;return n==null&&t.x&&a&&(n=s.x-t.x),r==null&&t.y&&c&&(r=s.y-t.y),h-=n||0,d-=r||0,u=0,f=0,!o||l?(u=t.axis==="y"?s.width:0,f=t.axis==="x"?s.height:0,h=a&&t.x!=null?t.x:h,d=c&&t.y!=null?t.y:d):o&&!l&&(f=t.axis==="x"?s.height:f,u=t.axis==="y"?s.width:u),o=!0,{width:u,height:f,x:h,y:d,top:d,right:h+u,bottom:d+f,left:h}}}}function sp(e){return e!=null&&e.clientX!=null}function aM(e,t){t===void 0&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:s}=e,{enabled:a=!0,axis:c="both",x:l=null,y:u=null}=t,f=C.useRef(!1),h=C.useRef(null),[d,p]=C.useState(),[m,g]=C.useState([]),v=at((E,R)=>{f.current||r.current.openEvent&&!sp(r.current.openEvent)||s.setPositionReference(sM(i,{x:E,y:R,axis:c,dataRef:r,pointerType:d}))}),w=at(E=>{l!=null||u!=null||(n?h.current||g([]):v(E.clientX,E.clientY))}),y=eo(d)?o:n,T=C.useCallback(()=>{if(!y||!a||l!=null||u!=null)return;const E=Pt(o);function R(A){const k=nn(A);Ye(o,k)?(E.removeEventListener("mousemove",R),h.current=null):v(A.clientX,A.clientY)}if(!r.current.openEvent||sp(r.current.openEvent)){E.addEventListener("mousemove",R);const A=()=>{E.removeEventListener("mousemove",R),h.current=null};return h.current=A,A}s.setPositionReference(i)},[y,a,l,u,o,r,s,i,v]);C.useEffect(()=>T(),[T,m]),C.useEffect(()=>{a&&!o&&(f.current=!1)},[a,o]),C.useEffect(()=>{!a&&n&&(f.current=!0)},[a,n]),be(()=>{a&&(l!=null||u!=null)&&(f.current=!1,v(l,u))},[a,l,u,v]);const S=C.useMemo(()=>{function E(R){let{pointerType:A}=R;p(A)}return{onPointerDown:E,onPointerEnter:E,onMouseMove:w,onMouseEnter:w}},[w]);return C.useMemo(()=>a?{reference:S}:{},[a,S])}const lM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ap=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 So(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:p}=t,m=Yn(),g=at(typeof c=="function"?c:()=>!1),v=typeof c=="function"?g:c,w=C.useRef(!1),y=C.useRef(!1),{escapeKey:T,outsidePress:S}=ap(d),{escapeKey:E,outsidePress:R}=ap(p),A=at(P=>{var O;if(!n||!s||!a||P.key!=="Escape")return;const F=(O=i.current.floatingContext)==null?void 0:O.nodeId,_=m?hr(m.nodesRef.current,F):[];if(!T&&(P.stopPropagation(),_.length>0)){let H=!0;if(_.forEach(U=>{var M;if((M=U.context)!=null&&M.open&&!U.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}r(!1,RO(P)?P.nativeEvent:P,"escape-key")}),k=at(P=>{var O;const F=()=>{var _;A(P),(_=nn(P))==null||_.removeEventListener("keydown",F)};(O=nn(P))==null||O.addEventListener("keydown",F)}),I=at(P=>{var O;const F=w.current;w.current=!1;const _=y.current;if(y.current=!1,l==="click"&&_||F||typeof v=="function"&&!v(P))return;const H=nn(P),U="["+Bn("inert")+"]",M=ut(o.floating).querySelectorAll(U);let $=De(H)?H:null;for(;$&&!_n($);){const G=Tn($);if(_n(G)||!De(G))break;$=G}if(M.length&&De(H)&&!IO(H)&&!Ye(H,o.floating)&&Array.from(M).every(G=>!Ye($,G)))return;if(et(H)&&N){const G=H.clientWidth>0&&H.scrollWidth>H.clientWidth,L=H.clientHeight>0&&H.scrollHeight>H.clientHeight;let B=L&&P.offsetX>H.clientWidth;if(L&&Vt(H).direction==="rtl"&&(B=P.offsetX<=H.offsetWidth-H.clientWidth),B||G&&P.offsetY>H.clientHeight)return}const q=(O=i.current.floatingContext)==null?void 0:O.nodeId,J=m&&hr(m.nodesRef.current,q).some(G=>{var L;return Ja(P,(L=G.context)==null?void 0:L.elements.floating)});if(Ja(P,o.floating)||Ja(P,o.domReference)||J)return;const X=m?hr(m.nodesRef.current,q):[];if(X.length>0){let G=!0;if(X.forEach(L=>{var B;if((B=L.context)!=null&&B.open&&!L.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,P,"outside-press")}),j=at(P=>{var O;const F=()=>{var _;I(P),(_=nn(P))==null||_.removeEventListener(l,F)};(O=nn(P))==null||O.addEventListener(l,F)});C.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=T,i.current.__outsidePressBubbles=S;function P(_){r(!1,_,"ancestor-scroll")}const O=ut(o.floating);a&&O.addEventListener("keydown",E?k:A,E),v&&O.addEventListener(l,R?j:I,R);let F=[];return h&&(De(o.domReference)&&(F=Fn(o.domReference)),De(o.floating)&&(F=F.concat(Fn(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(Fn(o.reference.contextElement)))),F=F.filter(_=>{var H;return _!==((H=O.defaultView)==null?void 0:H.visualViewport)}),F.forEach(_=>{_.addEventListener("scroll",P,{passive:!0})}),()=>{a&&O.removeEventListener("keydown",E?k:A,E),v&&O.removeEventListener(l,R?j:I,R),F.forEach(_=>{_.removeEventListener("scroll",P)})}},[i,o,a,v,l,n,r,h,s,T,S,A,E,k,I,R,j]),C.useEffect(()=>{w.current=!1},[v,l]);const D=C.useMemo(()=>({onKeyDown:A,[lM[f]]:P=>{u&&r(!1,P.nativeEvent,"reference-press")}}),[A,r,u,f]),N=C.useMemo(()=>({onKeyDown:A,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[cM[l]]:()=>{w.current=!0}}),[A,l]);return C.useMemo(()=>s?{reference:D,floating:N}:{},[s,D,N])}function uM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=wo(),i=C.useRef({}),[s]=C.useState(()=>sb()),a=Gn()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!De(d)&&zD("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=C.useState(r.reference),u=at((d,p,m)=>{i.current.openEvent=d?p:void 0,s.emit("openchange",{open:d,event:p,reason:m,nested:a}),n==null||n(d,p,m)}),f=C.useMemo(()=>({setPositionReference:l}),[]),h=C.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return C.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:h,events:s,floatingId:o,refs:f}),[t,u,h,s,o,f])}function Eo(e){e===void 0&&(e={});const{nodeId:t}=e,n=uM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=C.useState(null),[a,c]=C.useState(null),u=(o==null?void 0:o.reference)||i,f=C.useRef(null),h=Yn();be(()=>{u&&(f.current=u)},[u]);const d=AD({...e,elements:{...o,...a&&{reference:a}}}),p=C.useCallback(y=>{const T=De(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;c(T),d.refs.setReference(T)},[d.refs]),m=C.useCallback(y=>{(De(y)||y===null)&&(f.current=y,s(y)),(De(d.refs.reference.current)||d.refs.reference.current===null||y!==null&&!De(y))&&d.refs.setReference(y)},[d.refs]),g=C.useMemo(()=>({...d.refs,setReference:m,setPositionReference:p,domReference:f}),[d.refs,m,p]),v=C.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),w=C.useMemo(()=>({...d,...r,refs:g,elements:v,nodeId:t}),[d,g,v,t,r]);return be(()=>{r.dataRef.current.floatingContext=w;const y=h==null?void 0:h.nodesRef.current.find(T=>T.id===t);y&&(y.context=w)}),C.useMemo(()=>({...d,context:w,refs:g,elements:v}),[d,g,v,w])}function fM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:c=!0}=t,l=C.useRef(!1),u=C.useRef(),f=C.useRef(!0);C.useEffect(()=>{if(!a)return;const d=Pt(s.domReference);function p(){!n&&et(s.domReference)&&s.domReference===Ht(ut(s.domReference))&&(l.current=!0)}function m(){f.current=!0}return d.addEventListener("blur",p),d.addEventListener("keydown",m,!0),()=>{d.removeEventListener("blur",p),d.removeEventListener("keydown",m,!0)}},[s.domReference,n,a]),C.useEffect(()=>{if(!a)return;function d(p){let{reason:m}=p;(m==="reference-press"||m==="escape-key")&&(l.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,a]),C.useEffect(()=>()=>{clearTimeout(u.current)},[]);const h=C.useMemo(()=>({onPointerDown(d){_u(d.nativeEvent)||(f.current=!1)},onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const p=nn(d.nativeEvent);if(c&&De(p))try{if(Vu()&&Bv())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!f.current&&!$u(p))return}r(!0,d.nativeEvent,"focus")},onBlur(d){l.current=!1;const p=d.relatedTarget,m=d.nativeEvent,g=De(p)&&p.hasAttribute(Bn("focus-guard"))&&p.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const w=Ht(s.domReference?s.domReference.ownerDocument:document);!p&&w===s.domReference||Ye((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,w)||Ye(s.domReference,w)||g||r(!1,m,"focus")})}}),[i,s.domReference,r,c]);return C.useMemo(()=>a?{reference:h}:{},[a,h])}const lp="active",cp="selected";function sl(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[lp]:s,[cp]:a,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(c=>{let[l,u]=c;if(!(o&&[lp,cp].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),s[l]=function(){for(var h,d=arguments.length,p=new Array(d),m=0;m<d;m++)p[m]=arguments[m];return(h=r.get(l))==null?void 0:h.map(g=>g(...p)).find(g=>g!==void 0)}}}else s[l]=u}),s),{})}}function Co(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=C.useCallback(a=>sl(a,e,"reference"),t),i=C.useCallback(a=>sl(a,e,"floating"),n),s=C.useCallback(a=>sl(a,e,"item"),r);return C.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}let up=!1;function ca(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function fp(e,t){return ca(t,e===Yu||e===Pi,e===no||e===xo)}function al(e,t,n){return ca(t,e===Pi,n?e===no:e===xo)||e==="Enter"||e===" "||e===""}function dM(e,t,n){return ca(t,n?e===no:e===xo,e===Pi)}function dp(e,t,n){return ca(t,n?e===xo:e===no,e===Yu)}function gb(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:s,onNavigate:a=()=>{},enabled:c=!0,selectedIndex:l=null,allowEscape:u=!1,loop:f=!1,nested:h=!1,rtl:d=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:w=void 0,orientation:y="vertical",cols:T=1,scrollItemIntoView:S=!0,virtualItemRef:E,itemSizes:R,dense:A=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(f||ss("`useListNavigation` looping must be enabled to allow escaping."),p||ss("`useListNavigation` must be virtual to allow escaping.")),y==="vertical"&&T>1&&ss("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const k=Gn(),I=Yn(),j=at(a),D=C.useRef(m),N=C.useRef(l??-1),P=C.useRef(null),O=C.useRef(!0),F=C.useRef(j),_=C.useRef(!!o.floating),H=C.useRef(n),U=C.useRef(!1),M=C.useRef(!1),$=gt(w),q=gt(n),J=gt(S),X=gt(o.floating),G=gt(l),[L,B]=C.useState(),[z,V]=C.useState(),Y=at(function(ie,me,oe){oe===void 0&&(oe=!1);function ye(ve){p?(B(ve.id),I==null||I.events.emit("virtualfocus",ve),E&&(E.current=ve)):On(ve,{preventScroll:!0,sync:Bv()&&Vu()?up||U.current:!1})}const Qe=ie.current[me.current];Qe&&ye(Qe),requestAnimationFrame(()=>{const ve=ie.current[me.current]||Qe;if(!ve)return;Qe||ye(ve);const ot=J.current;ot&&W&&(oe||!O.current)&&(ve.scrollIntoView==null||ve.scrollIntoView(typeof ot=="boolean"?{block:"nearest",inline:"nearest"}:ot))})});be(()=>{document.createElement("div").focus({get preventScroll(){return up=!0,!1}})},[]),be(()=>{c&&(n&&o.floating?D.current&&l!=null&&(M.current=!0,N.current=l,j(l)):_.current&&(N.current=-1,F.current(null)))},[c,n,o.floating,l,j]),be(()=>{if(c&&n&&o.floating)if(s==null){if(U.current=!1,G.current!=null)return;if(_.current&&(N.current=-1,Y(i,N)),(!H.current||!_.current)&&D.current&&(P.current!=null||D.current===!0&&P.current==null)){let ie=0;const me=()=>{i.current[0]==null?(ie<2&&(ie?requestAnimationFrame:queueMicrotask)(me),ie++):(N.current=P.current==null||al(P.current,y,d)||h?tl(i,$.current):Kh(i,$.current),P.current=null,j(N.current))};me()}}else Qo(i,s)||(N.current=s,Y(i,N,M.current),M.current=!1)},[c,n,o.floating,s,G,h,i,y,d,j,Y,$]),be(()=>{var ie;if(!c||o.floating||!I||p||!_.current)return;const me=I.nodesRef.current,oe=(ie=me.find(ve=>ve.id===k))==null||(ie=ie.context)==null?void 0:ie.elements.floating,ye=Ht(ut(o.floating)),Qe=me.some(ve=>ve.context&&Ye(ve.context.elements.floating,ye));oe&&!Qe&&O.current&&oe.focus({preventScroll:!0})},[c,o.floating,I,k,p]),be(()=>{if(!c||!I||!p||k)return;function ie(me){V(me.id),E&&(E.current=me)}return I.events.on("virtualfocus",ie),()=>{I.events.off("virtualfocus",ie)}},[c,I,p,k,E]),be(()=>{F.current=j,_.current=!!o.floating}),be(()=>{n||(P.current=null)},[n]),be(()=>{H.current=n},[n]);const ee=s!=null,W=C.useMemo(()=>{function ie(oe){if(!n)return;const ye=i.current.indexOf(oe);ye!==-1&&j(ye)}return{onFocus(oe){let{currentTarget:ye}=oe;ie(ye)},onClick:oe=>{let{currentTarget:ye}=oe;return ye.focus({preventScroll:!0})},...g&&{onMouseMove(oe){let{currentTarget:ye}=oe;ie(ye)},onPointerLeave(oe){let{pointerType:ye}=oe;!O.current||ye==="touch"||(N.current=-1,Y(i,N),j(null),p||On(X.current,{preventScroll:!0}))}}}},[n,X,Y,g,i,j,p]),we=at(ie=>{if(O.current=!1,U.current=!0,!q.current&&ie.currentTarget===X.current)return;if(h&&dp(ie.key,y,d)){mt(ie),r(!1,ie.nativeEvent,"list-navigation"),et(o.domReference)&&!p&&o.domReference.focus();return}const me=N.current,oe=tl(i,w),ye=Kh(i,w);if(ie.key==="Home"&&(mt(ie),N.current=oe,j(N.current)),ie.key==="End"&&(mt(ie),N.current=ye,j(N.current)),T>1){const Qe=R||Array.from({length:i.current.length},()=>({width:1,height:1})),ve=jD(Qe,T,A),ot=ve.findIndex(re=>re!=null&&!is(i.current,re,w)),Z=ve.reduce((re,xe,Ne)=>xe!=null&&!is(i.current,xe,w)?Ne:re,-1);if(N.current=ve[FD({current:ve.map(re=>re!=null?i.current[re]:null)},{event:ie,orientation:y,loop:f,cols:T,disabledIndices:LD([...w||i.current.map((re,xe)=>is(i.current,xe)?xe:void 0),void 0],ve),minIndex:ot,maxIndex:Z,prevIndex:ND(N.current>ye?oe:N.current,Qe,ve,T,ie.key===Pi?"bl":ie.key===xo?"tr":"tl"),stopEvent:!0})],j(N.current),y==="both")return}if(fp(ie.key,y)){if(mt(ie),n&&!p&&Ht(ie.currentTarget.ownerDocument)===ie.currentTarget){N.current=al(ie.key,y,d)?oe:ye,j(N.current);return}al(ie.key,y,d)?f?N.current=me>=ye?u&&me!==i.current.length?-1:oe:xt(i,{startingIndex:me,disabledIndices:w}):N.current=Math.min(ye,xt(i,{startingIndex:me,disabledIndices:w})):f?N.current=me<=oe?u&&me!==-1?i.current.length:ye:xt(i,{startingIndex:me,decrement:!0,disabledIndices:w}):N.current=Math.max(oe,xt(i,{startingIndex:me,decrement:!0,disabledIndices:w})),Qo(i,N.current)?j(null):j(N.current)}}),Ue=C.useMemo(()=>p&&n&&ee&&{"aria-activedescendant":z||L},[p,n,ee,z,L]),je=C.useMemo(()=>({"aria-orientation":y==="both"?void 0:y,...!Wv(o.domReference)&&Ue,onKeyDown:we,onPointerMove(){O.current=!0}}),[Ue,we,o.domReference,y]),Ge=C.useMemo(()=>{function ie(oe){m==="auto"&&$v(oe.nativeEvent)&&(D.current=!0)}function me(oe){D.current=m,m==="auto"&&_u(oe.nativeEvent)&&(D.current=!0)}return{...Ue,onKeyDown(oe){O.current=!1;const ye=oe.key.indexOf("Arrow")===0,Qe=dM(oe.key,y,d),ve=dp(oe.key,y,d),ot=fp(oe.key,y),Z=(h?Qe:ot)||oe.key==="Enter"||oe.key.trim()==="";if(p&&n){const ht=I==null?void 0:I.nodesRef.current.find(Ct=>Ct.parentId==null),vt=I&&ht?qD(I.nodesRef.current,ht.id):null;if(ye&&vt&&E){const Ct=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(Qe||ve){var re,xe;const Qn=((re=vt.context)==null?void 0:re.elements.domReference)===oe.currentTarget,wr=ve&&!Qn?(xe=vt.context)==null?void 0:xe.elements.domReference:Qe?i.current.find(Tr=>(Tr==null?void 0:Tr.id)===L):null;wr&&(mt(oe),wr.dispatchEvent(Ct),V(void 0))}if(ot&&vt.context&&vt.context.open&&vt.parentId&&oe.currentTarget!==vt.context.elements.domReference){var Ne;mt(oe),(Ne=vt.context.elements.domReference)==null||Ne.dispatchEvent(Ct);return}}return we(oe)}if(!(!n&&!v&&ye)){if(Z&&(P.current=h&&ot?null:oe.key),h){Qe&&(mt(oe),n?(N.current=tl(i,$.current),j(N.current)):r(!0,oe.nativeEvent,"list-navigation"));return}ot&&(l!=null&&(N.current=l),mt(oe),!n&&v?r(!0,oe.nativeEvent,"list-navigation"):we(oe),n&&j(N.current))}},onFocus(){n&&!p&&j(null)},onPointerDown:me,onMouseDown:ie,onClick:ie}},[L,Ue,we,$,m,i,h,j,r,n,v,y,d,l,I,p,E]);return C.useMemo(()=>c?{reference:Ge,floating:je,item:W}:{},[c,Ge,je,W])}const hM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Po(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,a=(n=hM.get(s))!=null?n:s,c=wo(),u=Gn()!=null,f=C.useMemo(()=>a==="tooltip"||s==="label"?{["aria-"+(s==="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:c},...a==="menu"&&u&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},[a,o,u,r,c,s]),h=C.useMemo(()=>{const p={id:o,...a&&{role:a}};return a==="tooltip"||s==="label"?p:{...p,...a==="menu"&&{"aria-labelledby":c}}},[a,o,c,s]),d=C.useCallback(p=>{let{active:m,selected:g}=p;const v={role:"option",...m&&{id:o+"-option"}};switch(s){case"select":return{...v,"aria-selected":m&&g};case"combobox":return{...v,...m&&{"aria-selected":!0}}}return{}},[o,s]);return C.useMemo(()=>i?{reference:f,floating:h,item:d}:{},[i,f,h,d])}const hp=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Ir(e,t){return typeof e=="function"?e(t):e}function pM(e,t){const[n,r]=C.useState(e);return e&&!n&&r(!0),C.useEffect(()=>{if(!e&&n){const o=setTimeout(()=>r(!1),t);return()=>clearTimeout(o)}},[e,n,t]),n}function mM(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,s=(typeof o=="number"?o:o.close)||0,[a,c]=C.useState("unmounted"),l=pM(n,s);return!l&&a==="close"&&c("unmounted"),be(()=>{if(r){if(n){c("initial");const u=requestAnimationFrame(()=>{c("open")});return()=>{cancelAnimationFrame(u)}}c("close")}},[n,r]),{isMounted:l,status:a}}function gM(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:s=250}=t,a=e.placement,c=a.split("-")[0],l=C.useMemo(()=>({side:c,placement:a}),[c,a]),u=typeof s=="number",f=(u?s:s.open)||0,h=(u?s:s.close)||0,[d,p]=C.useState(()=>({...Ir(i,l),...Ir(n,l)})),{isMounted:m,status:g}=mM(e,{duration:s}),v=gt(n),w=gt(r),y=gt(o),T=gt(i);return be(()=>{const S=Ir(v.current,l),E=Ir(y.current,l),R=Ir(T.current,l),A=Ir(w.current,l)||Object.keys(S).reduce((k,I)=>(k[I]="",k),{});if(g==="initial"&&p(k=>({transitionProperty:k.transitionProperty,...R,...S})),g==="open"&&p({transitionProperty:Object.keys(A).map(hp).join(","),transitionDuration:f+"ms",...R,...A}),g==="close"){const k=E||S;p({transitionProperty:Object.keys(k).map(hp).join(","),transitionDuration:h+"ms",...R,...k})}},[h,y,v,w,T,f,g,l]),{isMounted:m,styles:d}}function yM(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:f=750,ignoreKeys:h=[],selectedIndex:d=null}=t,p=C.useRef(),m=C.useRef(""),g=C.useRef((n=d??s)!=null?n:-1),v=C.useRef(null),w=at(a),y=at(c),T=gt(u),S=gt(h);be(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),be(()=>{if(r&&m.current===""){var I;g.current=(I=d??s)!=null?I:-1}},[r,d,s]);const E=at(I=>{I?o.current.typing||(o.current.typing=I,y(I)):o.current.typing&&(o.current.typing=I,y(I))}),R=at(I=>{function j(F,_,H){const U=T.current?T.current(_,H):_.find(M=>(M==null?void 0:M.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return U?F.indexOf(U):-1}const D=i.current;if(m.current.length>0&&m.current[0]!==" "&&(j(D,D,m.current)===-1?E(!1):I.key===" "&&mt(I)),D==null||S.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;r&&I.key!==" "&&(mt(I),E(!0)),D.every(F=>{var _,H;return F?((_=F[0])==null?void 0:_.toLocaleLowerCase())!==((H=F[1])==null?void 0:H.toLocaleLowerCase()):!0})&&m.current===I.key&&(m.current="",g.current=v.current),m.current+=I.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=v.current,E(!1)},f);const P=g.current,O=j(D,[...D.slice((P||0)+1),...D.slice(0,(P||0)+1)],m.current);O!==-1?(w(O),v.current=O):I.key!==" "&&(m.current="",E(!1))}),A=C.useMemo(()=>({onKeyDown:R}),[R]),k=C.useMemo(()=>({onKeyDown:R,onKeyUp(I){I.key===" "&&E(!1)}}),[R,E]);return C.useMemo(()=>l?{reference:A,floating:k}:{},[l,A,k])}function pp(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[c,l]=t[s]||[0,0],[u,f]=t[a]||[0,0];l>=r!=f>=r&&n<=(u-c)*(r-l)/(f-l)+c&&(o=!o)}return o}function vM(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function bM(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,c=performance.now();function l(f,h){const d=performance.now(),p=d-c;if(s===null||a===null||p===0)return s=f,a=h,c=d,null;const m=f-s,g=h-a,w=Math.sqrt(m*m+g*g)/p;return s=f,a=h,c=d,w}const u=f=>{let{x:h,y:d,placement:p,elements:m,onClose:g,nodeId:v,tree:w}=f;return function(T){function S(){clearTimeout(o),g()}if(clearTimeout(o),!m.domReference||!m.floating||p==null||h==null||d==null)return;const{clientX:E,clientY:R}=T,A=[E,R],k=nn(T),I=T.type==="mouseleave",j=Ye(m.floating,k),D=Ye(m.domReference,k),N=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),O=p.split("-")[0],F=h>P.right-P.width/2,_=d>P.bottom-P.height/2,H=vM(A,N),U=P.width>N.width,M=P.height>N.height,$=(U?N:P).left,q=(U?N:P).right,J=(M?N:P).top,X=(M?N:P).bottom;if(j&&(i=!0,!I))return;if(D&&(i=!1),D&&!I){i=!0;return}if(I&&De(T.relatedTarget)&&Ye(m.floating,T.relatedTarget)||w&&hr(w.nodesRef.current,v).some(B=>{let{context:z}=B;return z==null?void 0:z.open}))return;if(O==="top"&&d>=N.bottom-1||O==="bottom"&&d<=N.top+1||O==="left"&&h>=N.right-1||O==="right"&&h<=N.left+1)return S();let G=[];switch(O){case"top":G=[[$,N.top+1],[$,P.bottom-1],[q,P.bottom-1],[q,N.top+1]];break;case"bottom":G=[[$,P.top+1],[$,N.bottom-1],[q,N.bottom-1],[q,P.top+1]];break;case"left":G=[[P.right-1,X],[P.right-1,J],[N.left+1,J],[N.left+1,X]];break;case"right":G=[[N.right-1,X],[N.right-1,J],[P.left+1,J],[P.left+1,X]];break}function L(B){let[z,V]=B;switch(O){case"top":{const Y=[U?z+t/2:F?z+t*4:z-t*4,V+t+1],ee=[U?z-t/2:F?z+t*4:z-t*4,V+t+1],W=[[P.left,F||U?P.bottom-t:P.top],[P.right,F?U?P.bottom-t:P.top:P.bottom-t]];return[Y,ee,...W]}case"bottom":{const Y=[U?z+t/2:F?z+t*4:z-t*4,V-t],ee=[U?z-t/2:F?z+t*4:z-t*4,V-t],W=[[P.left,F||U?P.top+t:P.bottom],[P.right,F?U?P.top+t:P.bottom:P.top+t]];return[Y,ee,...W]}case"left":{const Y=[z+t+1,M?V+t/2:_?V+t*4:V-t*4],ee=[z+t+1,M?V-t/2:_?V+t*4:V-t*4];return[...[[_||M?P.right-t:P.left,P.top],[_?M?P.right-t:P.left:P.right-t,P.bottom]],Y,ee]}case"right":{const Y=[z-t,M?V+t/2:_?V+t*4:V-t*4],ee=[z-t,M?V-t/2:_?V+t*4:V-t*4],W=[[_||M?P.left+t:P.right,P.top],[_?M?P.left+t:P.right:P.left+t,P.bottom]];return[Y,ee,...W]}}}if(!pp([E,R],G)){if(i&&!H)return S();if(!I&&r){const B=l(T.clientX,T.clientY);if(B!==null&&B<.1)return S()}pp([E,R],L([h,d]))?!i&&r&&(o=window.setTimeout(S,40)):S()}}};return u.__options={blockPointerEvents:n},u}const Ro=e=>{const t=b.useId(),[n,r]=b.useState(e.open),o=b.useRef(null),i=b.useMemo(()=>[aa(10),Gu({fallbackAxisSideDirection:"end"}),Uu(),tb({padding:5,element:o})],[e.arrow]),{refs:s,floatingStyles:a,context:c}=Eo({open:n,middleware:i,transform:!0,whileElementsMounted:sa,onOpenChange:(p,m)=>{var v;const g=m==null?void 0:m.relatedTarget;g&&g.dataset.floating==="true"&&!p||(r(p),(v=e.onChange)==null||v.call(e,p))}}),l=la(c),u=So(c),f=Po(c),{getReferenceProps:h,getFloatingProps:d}=Co([l,u,f]);return x.jsxs(b.Fragment,{children:[x.jsx("button",{ref:s.setReference,...h(e.buttonProps),type:"button",children:e.trigger}),n&&x.jsx(To,{preserveTabOrder:!0,id:`${t}-portal`,children:x.jsx(Ri,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:c,modal:!1,children:x.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-6 shadow-2xl",ref:s.setFloating,style:a,"aria-labelledby":t,...d(),children:[x.jsx(ib,{ref:o,context:c,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),x.jsx("header",{className:"mb-2",children:x.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},xM=e=>{const t=b.useRef(null),n=b.useId(),r=`${n}:wrapper`,o=`${n}:title`,[i,s]=b.useState(!1),{context:a,refs:c}=Eo({transform:!0,open:i!==null,nodeId:n,onOpenChange:s,strategy:"absolute"}),l=la(a),u=Po(a),f=So(a,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:h,getReferenceProps:d}=Co([l,u,f]);return x.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[x.jsx(Hr,{...d(e),as:ft.button,layoutId:r,ref:c.setReference,size:"small",onClick:()=>s(!0),children:x.jsx(ft.span,{layoutId:o,children:e.trigger})}),x.jsx(go,{children:i?x.jsx(To,{root:t,children:x.jsx(Ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:a,children:x.jsx(ft.div,{...h(),ref:c.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},yb=300,wM=500,vb=(e="")=>ke("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),yc=b.createContext({activeIndex:null,getItemProps:()=>({}),isOpen:!1,setActiveIndex:()=>{},setHasFocusInside:()=>{}}),mp=b.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,isParent:r,floatingClassName:o="",label:i,...s},a)=>{const c=Gn(),l=c!==null,[u,f]=b.useState(!1),[h,d]=b.useState(!1),[p,m]=b.useState(null),g=b.useRef([]),v=b.useRef([]),w=b.useContext(yc),y=Yn(),T=UD(),S=ob(),{floatingStyles:E,refs:R,context:A}=Eo({nodeId:T,open:u,transform:!0,onOpenChange:f,whileElementsMounted:sa,placement:l?"right":"bottom-start",strategy:"absolute",middleware:[aa({mainAxis:l?0:4,alignmentAxis:l?-4:0}),Gu(),Uu()]}),k=Po(A,{role:"menu",enabled:!0}),I=So(A,{bubbles:!0}),j=cb(A,{enabled:n,delay:{open:yb},handleClose:bM({blockPointerEvents:!0})}),D=la(A,{event:"mousedown",toggle:!l,ignoreMouse:l,keyboardHandlers:!0}),N=gb(A,{loop:!0,activeIndex:p,virtual:!0,nested:l,allowEscape:!0,listRef:g,scrollItemIntoView:!0,onNavigate:m}),P=yM(A,{activeIndex:p,listRef:v,resetMs:wM,onMatch:u?m:void 0}),{getReferenceProps:O,getFloatingProps:F,getItemProps:_}=Co([j,D,k,I,N,P]);b.useEffect(()=>{if(!y)return;const U=()=>f(!1),M=$=>{$.nodeId!==T&&$.parentId===c&&f(!1)};return y.events.on("click",U),y.events.on("menuopen",M),()=>{y.events.off("click",U),y.events.off("menuopen",M)}},[y,T,c]),b.useEffect(()=>{u&&y&&y.events.emit("menuopen",{parentId:c,nodeId:T})},[y,u,T,c]);const H=r?s.className:ke(vb(s.className));return x.jsxs(GD,{id:T,children:[x.jsx(b.Fragment,{children:s.asChild?x.jsx(Jr,{children:i,ref:gc([R.setReference,S.ref,a]),tabIndex:l?w.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":l?"":void 0,role:l?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...O(w.getItemProps({...s,onFocus(U){var M;(M=s.onFocus)==null||M.call(s,U),d(!1),w.setHasFocusInside(!0)}}))}):x.jsxs("button",{type:"button",ref:gc([R.setReference,S.ref,a]),tabIndex:l?w.activeIndex===S.index?0:-1:void 0,"data-open":u?"":void 0,"data-nested":l?"":void 0,role:l?"menuitem":void 0,"data-focus-inside":h?"":void 0,className:H,...O(w.getItemProps({...s,onFocus(U){var M;(M=s.onFocus)==null||M.call(s,U),d(!1),w.setHasFocusInside(!0)}})),children:[i,l&&x.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[x.jsx("span",{className:"sr-only",children:"Next menu"}),x.jsx(bu,{size:14})]})]})}),x.jsx(yc.Provider,{value:{activeIndex:p,setActiveIndex:m,getItemProps:_,setHasFocusInside:d,isOpen:u},children:x.jsx($D,{elementsRef:g,labelsRef:v,children:u&&x.jsx(To,{preserveTabOrder:!0,children:x.jsx(Ri,{context:A,modal:!1,initialFocus:l?-1:0,returnFocus:!l,children:x.jsx(t,{...F(),ref:R.setFloating,style:{...s.style,...E},className:ke("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})})})})})]})}),TM=b.forwardRef(({label:e,title:t,Right:n,disabled:r,...o},i)=>{const s=b.useContext(yc),a=ob({label:r?null:typeof e=="string"?e:t}),c=Yn(),l=a.index===s.activeIndex;return x.jsxs("button",{...o,ref:gc([a.ref,i]),"data-active":l,type:"button",role:"menuitem",disabled:r,tabIndex:l?0:-1,className:vb(o.className),...s.getItemProps({onClick(u){var f;(f=o.onClick)==null||f.call(o,u),c==null||c.events.emit("click")},onFocus(u){var f;(f=o.onFocus)==null||f.call(o,u),s.setHasFocusInside(!0)}}),children:[e,n?x.jsx(n,{size:16}):null]})}),SM=b.forwardRef((e,t)=>Gn()!==null?x.jsx(mp,{...e,isParent:!1,ref:t}):x.jsx(YD,{children:x.jsx(mp,{...e,isParent:!0,ref:t})})),EM=(e,t)=>Es()?t:window.matchMedia(e).matches,CM=(e,t=!0)=>{const[n,r]=b.useState(t);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),i=()=>r(EM(e,t));return i(),o.addListener?(o.addListener(i),()=>o.removeListener?o.removeListener(i):void 0):(o.addEventListener("change",i),()=>o.removeEventListener("change",i))},[e]),n},zt="600ms",PM={initial:{translateX:["-30%","0%"],opacity:.8,animationDuration:zt},enter:{translateX:["-30%","0%"],opacity:1,animationDuration:zt},exit:{translateX:["0%","-30%"],opacity:0,animationDuration:zt}},RM={initial:{translateX:["30%","0%"],opacity:.8},enter:{translateX:"0%",opacity:1,animationDuration:zt},exit:{translateX:["0%","30%"],opacity:0,animationDuration:zt}},ll={drawer:e=>e==="left"?PM:RM,sheet:{initial:{opacity:.5,translateY:"25%",animationDuration:zt,originY:"bottom"},enter:{opacity:1,translateY:"0%",animationDuration:zt,originY:"bottom"},exit:{opacity:.1,translateY:"50%",animationDuration:zt,originY:"bottom"}},dialog:{initial:{opacity:0,scale:.95,animationDuration:zt},enter:{opacity:1,scale:[1.05,1],animationDuration:zt},exit:{opacity:0,scale:.97,animationDuration:zt}}},IM=lo("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"}}),AM={top:0,left:0,right:0,bottom:-1},OM=e=>e*.62,DM=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const l=e.parent.current,u=e.value.get()||l.getBoundingClientRect().width,f=e.position==="right"?-r.delta.x:r.delta.x;return e.value.set(Math.abs(u+f))}const i=e.parent.current.getBoundingClientRect(),s=e.value.get()||i.height,a=Math.abs(s-r.delta.y),c=OM(window.outerHeight);return a<c?(e.onChange(!1),setTimeout(()=>e.value.set(window.outerHeight),350)):e.value.set(a)}};return x.jsx(ft.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:AM,whileDrag:{cursor:"grabbing"},className:ke("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?x.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},cl={drawer:"right",sheet:"none",dialog:"none"},MM=({type:e="dialog",resizer:t=!0,overlayClickClose:n=!1,forceType:r=!1,closable:o=!0,...i})=>{const s=b.useId(),a=b.useId(),c=CM("(min-width: 64rem)"),l=e!=="dialog",u=c?e==="drawer"?i.position:cl[e]:r?cl[e]:cl.sheet,f=c||r?ll[e]:ll.sheet,h=typeof f=="function"?f(u):f,d=c||r?e:"sheet",{refs:p,context:m}=Eo({open:i.open,onOpenChange:i.onChange}),g=la(m),v=Po(m),w=So(m,{escapeKey:!0,referencePress:!0,outsidePress:n}),{getReferenceProps:y,getFloatingProps:T}=Co([g,v,w]),S=i.trigger,E=qr(void 0),R=()=>i.onChange(!1);return x.jsxs(b.Fragment,{children:[i.trigger?x.jsx(b.Fragment,{children:i.asChild?x.jsx(Jr,{ref:p.setReference,...y({layoutId:i.layoutId}),children:S}):x.jsx(ft.button,{ref:p.setReference,...y(),layoutId:i.layoutId,type:"button",children:S})}):null,x.jsx(To,{children:x.jsx(go,{presenceAffectsLayout:!0,children:i.open?x.jsx(iM,{lockScroll:!0,className:`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${d==="drawer"?"":"grid items-end justify-center lg:items-center"}`,children:x.jsx(Ri,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:m,children:x.jsxs(ft.div,{animate:"enter","aria-describedby":a,"aria-labelledby":s,className:IM({position:u,type:d}),exit:"exit",layoutId:i.layoutId,initial:"initial",ref:p.setFloating,style:d==="drawer"?{width:E}:{height:E},variants:h,...T(),children:[i.title?x.jsx("header",{className:"relative w-full",children:i.title?x.jsx("h2",{className:"border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:i.title}):null}):null,x.jsx("section",{className:"flex-1 overflow-y-auto px-8 py-1",children:i.children}),i.footer?x.jsx("footer",{className:"w-full border-t border-floating-border px-8 pt-4",children:i.footer}):null,o?x.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:x.jsx("button",{type:"button",onClick:R,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:x.jsx(wu,{})})}):null,l&&t?x.jsx(DM,{onChange:i.onChange,parent:p.floating,position:u,sheet:d==="sheet",value:E}):null]})})}):null})})]})},kM=e=>x.jsx(ft.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),bb=({children:e,followCursor:t=!1,placement:n,enabled:r,as:o,title:i,...s})=>{const[a,c]=b.useState(!1),l=b.useRef(null),u=o||"span",{refs:f,floatingStyles:h,context:d}=Eo({open:a,placement:n,transform:!0,onOpenChange:c,whileElementsMounted:sa,middleware:[aa(5),Gu({fallbackAxisSideDirection:"start"}),Uu(),tb({element:l,padding:5})]}),p=cb(d,{move:!0,enabled:r,delay:{open:yb}}),m=fM(d,{enabled:r}),g=So(d,{enabled:r}),v=Po(d,{role:"tooltip",enabled:r}),w=aM(d,{enabled:!!r&&!!t}),{getReferenceProps:y,getFloatingProps:T}=Co([p,m,g,v,w]);return x.jsxs(b.Fragment,{children:[x.jsx(u,{ref:f.setReference,...y(s),children:i}),x.jsx(To,{children:a&&x.jsxs(ho,{...T(),ref:f.setFloating,style:h,className:"z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg",children:[x.jsx(ib,{ref:l,context:d,strokeWidth:.1,className:"fill-tooltip-background stroke-tooltip-border"}),e]})})]})};class Fs{static getDescendantProperty(t,n,r=[]){let o,i,s,a,c,l;if(n){if(s=n.indexOf("."),s===-1?o=n:(o=n.slice(0,s),i=n.slice(s+1)),a=t[o],a!==null&&typeof a<"u")if(!i&&(typeof a=="string"||typeof a=="number"))r.push(a);else if(Object.prototype.toString.call(a)==="[object Array]")for(c=0,l=a.length;c<l;c++)Fs.getDescendantProperty(a[c],i,r);else i&&Fs.getDescendantProperty(a,i,r)}else r.push(t);return r}}class jr{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 i=jr.isMatch(o,t,this.options.caseSensitive);i&&n.push({item:o,score:i})}else for(let i=0;i<this.keys.length;i++){const s=Fs.getDescendantProperty(o,this.keys[i]);let a=!1;for(let c=0;c<s.length;c++){const l=jr.isMatch(s[c],t,this.options.caseSensitive);if(l){a=!0,n.push({item:o,score:l});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=jr.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 jr.indexesOfFirstLetter(t,n).forEach((s,a)=>{let c=s+1;o[a]=[s];for(let l=1;l<r.length;l++){const u=r[l];if(c=t.indexOf(u,c),c===-1){o[a]=!1;break}o[a].push(c),c++}}),o=o.filter(s=>s!==!1),o.length?o.sort((s,a)=>s.length===1?s[0]-a[0]:(s=s[s.length-1]-s[0],a=a[a.length-1]-a[0],s-a))[0]:!1}static indexesOfFirstLetter(t,n){const r=n[0];return t.split("").map((o,i)=>o!==r?!1:i).filter(o=>o!==!1)}}const xb=({reportStatus:e,hideLeft:t=!1,className:n,info:r,children:o,title:i})=>x.jsxs("div",{className:ke("w-full justify-between",t&&o===null?"hidden":"flex",n),children:[t?null:x.jsxs("span",{className:"flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-error:text-danger",children:[i,e||r?x.jsxs("span",{className:"flex items-center justify-center gap-1",children:[r?x.jsx(bb,{title:x.jsxs("span",{className:"cursor-help",children:[x.jsx("span",{className:"sr-only",children:r}),x.jsx(My,{className:"aspect-square size-3","aria-hidden":"true",size:16,strokeWidth:1,absoluteStrokeWidth:!0})]}),children:r}):null,e?x.jsxs(b.Fragment,{children:[x.jsx(Dy,{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}),x.jsx(gP,{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]}),ua=({optionalText:e,left:t,rightLabel:n,container:r,feedback:o,interactive:i,right:s,info:a,children:c,error:l,form:u,id:f,labelClassName:h="",name:d,title:p,placeholder:m,hideLeft:g,required:v})=>{const w=f??d,y=Dt(),T=e??y.inputOptionalLabel;return x.jsxs("fieldset",{form:u,"data-error":!!l,"data-interactive":!!i,className:ke("group grid min-h-0 min-w-0 grid-cols-1 items-baseline",r),children:[x.jsxs("label",{form:u,htmlFor:w,className:"inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-error:text-danger",children:[!g&&!n?x.jsx(xb,{info:a,hideLeft:g,reportStatus:!0,title:p,placeholder:m,children:T||n?x.jsxs(b.Fragment,{children:[v?null:x.jsx("span",{className:"text-opacity-70",children:T}),n?x.jsx(b.Fragment,{children:n}):null]}):null}):null,x.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?x.jsx("span",{className:"flex flex-nowrap gap-1 whitespace-nowrap pl-2",children:t}):null,c,s?x.jsx("span",{className:"flex flex-nowrap gap-2 whitespace-nowrap pr-2",children:s}):null]})]}),x.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:l}),x.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})]})},FM=e=>x.jsx(b.Fragment,{children:e.children}),wb=b.forwardRef(({selected:e,active:t,onClick:n,option:r,...o},i)=>{const s=r.Render??FM,a=r.label??r.value;return o.hidden?null:x.jsx("li",{...o,ref:i,role:"option","aria-selected":t,className:"w-full border-b border-tooltip-border last:border-transparent",children:x.jsxs("button",{type:"button","aria-checked":t,"aria-current":t,"aria-selected":t,onClick:n,"data-value":r.value,className:`flex w-full cursor-pointer justify-between p-2 text-left ${t?"bg-primary-hover text-primary-foreground":""} ${e?"bg-primary text-primary-foreground":""}`,children:[x.jsx(s,{...o,label:r.label,value:r.value,children:a}),t?x.jsx("span",{children:x.jsx(pP,{"aria-hidden":!0,className:"text-current",absoluteStrokeWidth:!0,strokeWidth:2,size:22})}):null]})})}),jM={duration:300,initial:{transform:"scaleY(0)",opacity:.4},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},NM={caseSensitive:!1,sort:!1},LM=[],_M=b.forwardRef(({options:e,dynamicOption:t=!1,feedback:n=null,labelClassName:r,interactive:o,rightLabel:i,optionalText:s,container:a,hideLeft:c=!1,right:l,left:u,error:f,required:h=!1,...d},p)=>{const m=d.value??d.defaultValue??"",g=Dt(),[v,w]=b.useState(!1),[y,T]=b.useState(""),[S,E]=b.useState(m),[R,A]=b.useState(()=>{var V;return((V=e.find(Y=>Y.value===m))==null?void 0:V.label)??m}),[k,I]=b.useState(null),j=b.useRef(LM),D=t&&y!==""?[{value:y,label:y,"data-dynamic":"true"},...e]:e,N=new jr(D,["value","label"],NM).search(y),P=t?void 0:`^(${e.map(V=>`${oc(V.value)}${V.label?"|"+oc(V.label):""}`).join("|")})$`;b.useEffect(()=>{if(d.value){const V=e.find(Y=>Y.value===d.value);E((V==null?void 0:V.label)??d.value)}},[d.value]);const{x:O,y:F,strategy:_,refs:H,context:U}=Eo({open:v,transform:!0,strategy:"absolute",onOpenChange:w,whileElementsMounted:sa,middleware:[aa(4),DD({elementContext:"reference",padding:10,apply(V){const ee=V.elements.reference.parentElement,W=ee==null?void 0:ee.getBoundingClientRect().width;Object.assign(V.elements.floating.style,{width:`${W}px`,maxWidth:`${W}px`,minWidth:"max-content",maxHeight:`${Math.min(480,V.availableHeight)}px`})}})]}),M=gM(U,jM),{getReferenceProps:$,getFloatingProps:q,getItemProps:J}=Co([Po(U,{role:"listbox"}),So(U),gb(U,{cols:0,listRef:j,loop:!0,virtual:!0,allowEscape:!0,activeIndex:k,selectedIndex:k,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0,onNavigate:V=>I(Y=>V??Y)})]);b.useEffect(()=>{const V=H.reference.current;if(V)return Hs(V)},[]);const X=(V,Y)=>{E(V.value);const ee=H.reference.current;if(!ee)return;ee==null||ee.setAttribute("data-value",V.value),ee.value=V.value;const W=new Event("change",{bubbles:!1,cancelable:!0});ee.dispatchEvent(W),d.onChange&&d.onChange(W),A(V.label??""),w(!1),T(""),I(Y)},G=V=>{var ee;const Y=V.target.value;return T(Y),!v&&Y===""?w(!0):(V.target.name=d.name||"",Y?w(!0):(ee=d.onChange)==null?void 0:ee.call(d,V))},L=()=>{w(!0),T("")},B=()=>{var V;T(""),E(""),(V=H.reference.current)==null||V.setAttribute("data-value",""),A(""),$m(H.reference.current),w(!1)},z=d.id||d.name;return x.jsxs(ua,{...d,container:a,error:f,feedback:n,form:d.form,hideLeft:c,id:d.name||d.id,interactive:o,labelClassName:r,left:u,name:d.name,optionalText:s,placeholder:d.placeholder,required:h,rightLabel:i,title:d.title,right:x.jsxs("span",{className:"flex items-center gap-0.5",children:[x.jsxs("button",{type:"button",className:"transition-colors link:text-primary",children:[x.jsx(Oy,{size:20}),x.jsx("span",{className:"sr-only",children:g.inputCaretDown})]}),S?x.jsx("button",{type:"button",onClick:B,className:"transition-colors link:text-danger",children:x.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x.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:[x.jsx("input",{...$({...d,onChange:G,onFocus:L,pattern:P,ref:H.setReference,name:`${z}-shadow`,id:`${z}-shadow`,onClick:V=>V.currentTarget.focus(),onKeyDown(V){if(V.key==="Escape")return V.currentTarget.blur(),w(!1);if(V.key==="Enter"){if(k!==null&&N[k])return V.preventDefault(),X(N[k],k);if(N.length===1)return V.preventDefault(),X(N[0],0)}}}),"data-value":S,"data-error":!!f,"data-name":z,"data-target":z,required:h,value:v?y:R||S,"aria-autocomplete":"list",autoComplete:"off",className:ke("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",d.className)}),x.jsx("input",{id:z,name:z,type:"hidden","data-origin":z,ref:p,required:h,defaultValue:d.value||S||void 0}),x.jsx(To,{preserveTabOrder:!0,children:v?x.jsx(Ri,{guards:!0,returnFocus:!1,context:U,initialFocus:-1,visuallyHiddenDismiss:!0,children:x.jsx("ul",{...q({ref:H.setFloating,style:{position:_,left:(O??0)+(S?26:16),top:F??0,...M.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:N.map((V,Y)=>{const ee=S===V.value||S===V.label;return x.jsx(wb,{...J({onClick:()=>X(V,Y),ref:W=>void(j.current[Y]=W),selected:k===Y}),option:V,active:ee,selected:k===Y},`${V.value}-option`)})})}):null})]})}),Tb=b.forwardRef(({children:e,asTask:t=!1,labelClassName:n,error:r,className:o="",size:i,container:s,...a},c)=>x.jsxs("label",{"data-task":t,"data-disabled":a.disabled,"aria-disabled":a.disabled,className:ke("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed",t?"group-checkbox-checked:line-through":"",s),children:[x.jsx("input",{...a,ref:c,type:"checkbox","data-task":t,className:ke("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,x.jsx("span",{"data-name":"checkbox-label",className:ke("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:r})]})),Ii=b.forwardRef(({type:e="text",feedback:t=null,info:n,labelClassName:r,next:o,interactive:i,rightLabel:s,optionalText:a,container:c,hideLeft:l=!1,right:u,left:f,error:h,...d},p)=>{const m=d.id??d.name,g=b.useRef(null);return b.useEffect(()=>{if(g.current===null)return;const v=g.current,w=Hs(g.current),y=T=>{const S=T;if(S.key==="Enter"&&v.enterKeyHint==="next"){const E=v.getAttribute("data-next");if(E){const R=document.getElementById(E);if(R)return R.focus(),void S.preventDefault()}}};return v.addEventListener("keydown",y),()=>{w(),v.removeEventListener("keydown",y)}},[]),x.jsx(ua,{info:n,container:c,error:h,feedback:t,hideLeft:l,left:f,optionalText:a,right:u,rightLabel:s,interactive:i,form:d.form,id:d.name||d.id,name:d.name,labelClassName:r,title:d.title,placeholder:d.placeholder,required:d.required,children:x.jsx(nv,{...d,type:e,"data-next":o,ref:Hc(p,g),id:m,name:m,className:ke("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",d.className)})})}),gp=new Date(1970,11,31),ul={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],literal:e=>e.split("")},yp={year:()=>"yyyy",month:()=>"MM",day:()=>"dd",literal:e=>e},VM={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")},fl=(e,t)=>{try{return e.formatToParts(t)}catch{return[]}},$M=b.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,...i},s)=>{const a=t||gA(),c=b.useId(),l=Dt(),u=b.useMemo(()=>new Intl.DateTimeFormat(a),[a]),[f,h]=b.useState(e||void 0),[d,p]=b.useState(!1),m=fl(u,gp).flatMap(R=>vn.keyof(ul,R.type)?ul[R.type](R.value):[]),g=fl(u,gp).reduce((R,A)=>R+(vn.keyof(yp,A.type)?yp[A.type](A.value):""),"");console.log({locale:a,datetimeFormat:u,placeholder:g});const[v,w]=b.useState(f?fl(u,f).reduce((R,A)=>R+(vn.keyof(ul,A.type)?VM[A.type](f,A.value):""),""):""),y=R=>{const A=R.target.value;if(w(A),m.length===A.length&&m.every((I,j)=>{const D=A.charAt(j);return typeof I=="string"?D===I:I.test(D)})){const I=Zr(AI(A,g,new Date));return h(I),r==null?void 0:r(I)}return h(void 0),r==null?void 0:r(void 0)},T=R=>(h(R),r==null||r(R),w(R?OR(R,g):"")),S=_y(f),E=S?f.toISOString():void 0;return x.jsx(Ii,{...i,mask:m,value:v,"data-value":E,"data-target":i.name,className:"uppercase",formNoValidate:!d,placeholder:g,onChange:y,required:i.required??!0,error:d?void 0:i.error,name:void 0,id:void 0,right:x.jsxs(b.Fragment,{children:[x.jsx("input",{"data-origin":i.name,defaultValue:E,form:i.form,hidden:!0,id:i.name,name:i.name,ref:s,type:"date"}),x.jsx(Ro,{open:d,onChange:p,trigger:x.jsxs("span",{"aria-labelledby":c,children:[x.jsx("span",{id:c,className:"sr-only",children:l.datePickerCalendarButtonLabel}),x.jsx(hP,{})]}),buttonProps:{"aria-describedby":c},children:x.jsx(fv,{...i,locale:a,changeOnlyOnClick:!0,markToday:o,onChange:T,disabledDate:n,date:S?f:void 0})})]})})}),BM=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],WM=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],HM=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],zM=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vp=(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 bp(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?zM:HM:t.binary?WM:BM,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;const o=e<0,i=o?"-":t.signed?"+":"";o&&(e=-e);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),e<1){const u=vp(e,t.locale,s);return i+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,s||(e=e.toPrecision(3));const c=vp(Number(e),t.locale,s),l=n[a];return i+c+r+l}var vc={exports:{}},Ki={exports:{}},Pe={};/** @license React v16.13.1
178
178
  * react-is.production.min.js
179
179
  *
180
180
  * Copyright (c) Facebook, Inc. and its affiliates.