@g4rcez/components 2.0.9 → 2.0.10

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.umd.js CHANGED
@@ -219,7 +219,7 @@
219
219
  - less than the value passed to \`max\` (or ${Bd} if no \`max\` prop is set)
220
220
  - \`null\` or \`undefined\` if the progress is indeterminate.
221
221
 
222
- Defaulting to \`null\`.`}var O2=r0,M2=i0,c0=["PageUp","PageDown"],u0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],d0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Go="Slider",[Hd,D2,N2]=Ux(Go),[f0,TB]=Ls(Go,[N2]),[F2,js]=f0(Go),p0=P.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:b,...g}=e,p=P.useRef(new Set),v=P.useRef(0),x=a==="horizontal"?L2:V2,[T=[],w]=Kx({prop:u,defaultProp:c,onChange:V=>{[...p.current][v.current]?.focus(),d(V)}}),E=P.useRef(T);function k(V){const L=B2(T,V);_(V,L)}function C(V){_(V,v.current)}function O(){const V=E.current[v.current];T[v.current]!==V&&h(T)}function _(V,L,{commit:R}={commit:!1}){const I=U2(i),M=K2(Math.round((V-r)/i)*i+r,I),H=n0(M,[r,o]);w((D=[])=>{const A=z2(D,H,L);if(q2(A,l*i)){v.current=A.indexOf(H);const F=String(A)!==String(D);return F&&R&&h(A),F?A:D}else return D})}return m.jsx(F2,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:v,thumbs:p.current,values:T,orientation:a,form:b,children:m.jsx(Hd.Provider,{scope:e.__scopeSlider,children:m.jsx(Hd.Slot,{scope:e.__scopeSlider,children:m.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...g,ref:t,onPointerDown:It(g.onPointerDown,()=>{s||(E.current=T)}),min:r,max:o,inverted:f,onSlideStart:s?void 0:k,onSlideMove:s?void 0:C,onSlideEnd:s?void 0:O,onHomeKeyDown:()=>!s&&_(r,0,{commit:!0}),onEndKeyDown:()=>!s&&_(o,T.length-1,{commit:!0}),onStepKeyDown:({event:V,direction:L})=>{if(!s){const M=c0.includes(V.key)||V.shiftKey&&u0.includes(V.key)?10:1,H=v.current,D=T[H],A=i*M*L;_(D+A,H,{commit:!0})}}})})})})});p0.displayName=Go;var[h0,m0]=f0(Go,{startEdge:"left",endEdge:"right",size:"width",direction:1}),L2=P.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,h]=P.useState(null),f=rn(t,x=>h(x)),b=P.useRef(void 0),g=f2(o),p=g==="ltr",v=p&&!i||!p&&i;function y(x){const T=b.current||d.getBoundingClientRect(),w=[0,T.width],k=Ud(w,v?[n,r]:[r,n]);return b.current=T,k(x-T.left)}return m.jsx(h0,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:m.jsx(g0,{dir:g,"data-orientation":"horizontal",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const T=y(x.clientX);a?.(T)},onSlideMove:x=>{const T=y(x.clientX);s?.(T)},onSlideEnd:()=>{b.current=void 0,l?.()},onStepKeyDown:x=>{const w=d0[v?"from-left":"from-right"].includes(x.key);c?.({event:x,direction:w?-1:1})}})})}),V2=P.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=P.useRef(null),d=rn(t,u),h=P.useRef(void 0),f=!o;function b(g){const p=h.current||u.current.getBoundingClientRect(),v=[0,p.height],x=Ud(v,f?[r,n]:[n,r]);return h.current=p,x(g-p.top)}return m.jsx(h0,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:m.jsx(g0,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const p=b(g.clientY);i?.(p)},onSlideMove:g=>{const p=b(g.clientY);a?.(p)},onSlideEnd:()=>{h.current=void 0,s?.()},onStepKeyDown:g=>{const v=d0[f?"from-bottom":"from-top"].includes(g.key);l?.({event:g,direction:v?-1:1})}})})}),g0=P.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=js(Go,n);return m.jsx(Rt.span,{...c,ref:t,onKeyDown:It(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):c0.concat(u0).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:It(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(h)?h.focus():r(d)}),onPointerMove:It(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:It(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),i(d))})})}),v0="SliderTrack",y0=P.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=js(v0,n);return m.jsx(Rt.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});y0.displayName=v0;var Wd="SliderRange",b0=P.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=js(Wd,n),i=m0(Wd,n),a=P.useRef(null),s=rn(t,a),l=o.values.length,c=o.values.map(h=>S0(h,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return m.jsx(Rt.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});b0.displayName=Wd;var qd="SliderThumb",x0=P.forwardRef((e,t)=>{const n=D2(e.__scopeSlider),[r,o]=P.useState(null),i=rn(t,s=>o(s)),a=P.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return m.jsx($2,{...e,ref:i,index:a})}),$2=P.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=js(qd,n),s=m0(qd,n),[l,c]=P.useState(null),u=rn(t,y=>c(y)),d=l?a.form||!!l.closest("form"):!0,h=E2(l),f=a.values[r],b=f===void 0?0:S0(f,a.min,a.max),g=R2(r,a.values.length),p=h?.[s.size],v=p?H2(p,b,s.direction):0;return P.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),m.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${b}% + ${v}px)`},children:[m.jsx(Hd.ItemSlot,{scope:e.__scopeSlider,children:m.jsx(Rt.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":f,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:f===void 0?{display:"none"}:e.style,onFocus:It(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&m.jsx(w0,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:f},r)]})});x0.displayName=qd;var j2="RadioBubbleInput",w0=P.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=P.useRef(null),i=rn(o,r),a=T2(t);return P.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("input",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),m.jsx(Rt.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});w0.displayName=j2;function z2(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function S0(e,t,n){const i=100/(n-t)*(e-t);return n0(i,[0,100])}function R2(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function B2(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function H2(e,t,n){const r=e/2,i=Ud([0,50],[0,r]);return(r-i(t)*n)*n}function W2(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function q2(e,t){if(t>0){const n=W2(e);return Math.min(...n)>=t}return!0}function Ud(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function U2(e){return(String(e).split(".")[1]||"").length}function K2(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Y2=p0,G2=y0,Z2=b0,X2=x0,Kd="ToastProvider",[Yd,Q2,J2]=Ux("Toast"),[T0,EB]=Ls("Toast",[J2]),[eF,zs]=T0(Kd),E0=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=e,[s,l]=P.useState(null),[c,u]=P.useState(0),d=P.useRef(!1),h=P.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Kd}\`. Expected non-empty \`string\`.`),m.jsx(Yd.Provider,{scope:t,children:m.jsx(eF,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:P.useCallback(()=>u(f=>f+1),[]),onToastRemove:P.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:a})})};E0.displayName=Kd;var k0="ToastViewport",tF=["F8"],Gd="toast.viewportPause",Zd="toast.viewportResume",C0=P.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=tF,label:o="Notifications ({hotkey})",...i}=e,a=zs(k0,n),s=Q2(n),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),h=rn(t,d,a.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;P.useEffect(()=>{const p=v=>{r.length!==0&&r.every(x=>v[x]||v.code===x)&&d.current?.focus()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),P.useEffect(()=>{const p=l.current,v=d.current;if(b&&p&&v){const y=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(Gd);v.dispatchEvent(E),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(Zd);v.dispatchEvent(E),a.isClosePausedRef.current=!1}},T=E=>{!p.contains(E.relatedTarget)&&x()},w=()=>{p.contains(document.activeElement)||x()};return p.addEventListener("focusin",y),p.addEventListener("focusout",T),p.addEventListener("pointermove",y),p.addEventListener("pointerleave",w),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{p.removeEventListener("focusin",y),p.removeEventListener("focusout",T),p.removeEventListener("pointermove",y),p.removeEventListener("pointerleave",w),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,a.isClosePausedRef]);const g=P.useCallback(({tabbingDirection:p})=>{const y=s().map(x=>{const T=x.ref.current,w=[T,...mF(T)];return p==="forwards"?w:w.reverse()});return(p==="forwards"?y.reverse():y).flat()},[s]);return P.useEffect(()=>{const p=d.current;if(p){const v=y=>{const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const w=document.activeElement,E=y.shiftKey;if(y.target===p&&E){c.current?.focus();return}const O=g({tabbingDirection:E?"backwards":"forwards"}),_=O.findIndex(V=>V===w);Jd(O.slice(_+1))?y.preventDefault():E?c.current?.focus():u.current?.focus()}};return p.addEventListener("keydown",v),()=>p.removeEventListener("keydown",v)}},[s,g]),m.jsxs(w2,{ref:l,role:"region","aria-label":o.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&m.jsx(Xd,{ref:c,onFocusFromOutsideViewport:()=>{const p=g({tabbingDirection:"forwards"});Jd(p)}}),m.jsx(Yd.Slot,{scope:n,children:m.jsx(Rt.ol,{tabIndex:-1,...i,ref:h})}),b&&m.jsx(Xd,{ref:u,onFocusFromOutsideViewport:()=>{const p=g({tabbingDirection:"backwards"});Jd(p)}})]})});C0.displayName=k0;var A0="ToastFocusProxy",Xd=P.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=zs(A0,n);return m.jsx(jd,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:a=>{const s=a.relatedTarget;!i.viewport?.contains(s)&&r()}})});Xd.displayName=A0;var ra="Toast",nF="toast.swipeStart",rF="toast.swipeMove",oF="toast.swipeCancel",iF="toast.swipeEnd",P0=P.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=e,[s,l]=Kx({prop:r,defaultProp:o??!0,onChange:i,caller:ra});return m.jsx(Yx,{present:n||s,children:m.jsx(lF,{open:s,...a,ref:t,onClose:()=>l(!1),onPause:Qr(e.onPause),onResume:Qr(e.onResume),onSwipeStart:It(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:It(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:It(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:It(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});P0.displayName=ra;var[aF,sF]=T0(ra,{onClose(){}}),lF=P.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:f,...b}=e,g=zs(ra,n),[p,v]=P.useState(null),y=rn(t,I=>v(I)),x=P.useRef(null),T=P.useRef(null),w=o||g.duration,E=P.useRef(0),k=P.useRef(w),C=P.useRef(0),{onToastAdd:O,onToastRemove:_}=g,V=Qr(()=>{p?.contains(document.activeElement)&&g.viewport?.focus(),a()}),L=P.useCallback(I=>{!I||I===1/0||(window.clearTimeout(C.current),E.current=new Date().getTime(),C.current=window.setTimeout(V,I))},[V]);P.useEffect(()=>{const I=g.viewport;if(I){const M=()=>{L(k.current),c?.()},H=()=>{const D=new Date().getTime()-E.current;k.current=k.current-D,window.clearTimeout(C.current),l?.()};return I.addEventListener(Gd,H),I.addEventListener(Zd,M),()=>{I.removeEventListener(Gd,H),I.removeEventListener(Zd,M)}}},[g.viewport,w,l,c,L]),P.useEffect(()=>{i&&!g.isClosePausedRef.current&&L(w)},[i,w,g.isClosePausedRef,L]),P.useEffect(()=>(O(),()=>_()),[O,_]);const R=P.useMemo(()=>p?N0(p):null,[p]);return g.viewport?m.jsxs(m.Fragment,{children:[R&&m.jsx(cF,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),m.jsx(aF,{scope:n,onClose:V,children:gi.createPortal(m.jsx(Yd.ItemSlot,{scope:n,children:m.jsx(x2,{asChild:!0,onEscapeKeyDown:It(s,()=>{g.isFocusedToastEscapeKeyDownRef.current||V(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:m.jsx(Rt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:It(e.onKeyDown,I=>{I.key==="Escape"&&(s?.(I.nativeEvent),I.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:It(e.onPointerDown,I=>{I.button===0&&(x.current={x:I.clientX,y:I.clientY})}),onPointerMove:It(e.onPointerMove,I=>{if(!x.current)return;const M=I.clientX-x.current.x,H=I.clientY-x.current.y,D=!!T.current,A=["left","right"].includes(g.swipeDirection),F=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,N=A?F(0,M):0,W=A?0:F(0,H),j=I.pointerType==="touch"?10:2,Z={x:N,y:W},G={originalEvent:I,delta:Z};D?(T.current=Z,Rs(rF,d,G,{discrete:!1})):F0(Z,g.swipeDirection,j)?(T.current=Z,Rs(nF,u,G,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(M)>j||Math.abs(H)>j)&&(x.current=null)}),onPointerUp:It(e.onPointerUp,I=>{const M=T.current,H=I.target;if(H.hasPointerCapture(I.pointerId)&&H.releasePointerCapture(I.pointerId),T.current=null,x.current=null,M){const D=I.currentTarget,A={originalEvent:I,delta:M};F0(M,g.swipeDirection,g.swipeThreshold)?Rs(iF,f,A,{discrete:!0}):Rs(oF,h,A,{discrete:!0}),D.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),cF=e=>{const{__scopeToast:t,children:n,...r}=e,o=zs(ra,t),[i,a]=P.useState(!1),[s,l]=P.useState(!1);return pF(()=>a(!0)),P.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:m.jsx(t0,{asChild:!0,children:m.jsx(jd,{...r,children:i&&m.jsxs(m.Fragment,{children:[o.label," ",n]})})})},uF="ToastTitle",I0=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return m.jsx(Rt.div,{...r,ref:t})});I0.displayName=uF;var dF="ToastDescription",_0=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return m.jsx(Rt.div,{...r,ref:t})});_0.displayName=dF;var O0="ToastAction",fF=P.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?m.jsx(D0,{altText:n,asChild:!0,children:m.jsx(Qd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${O0}\`. Expected non-empty \`string\`.`),null)});fF.displayName=O0;var M0="ToastClose",Qd=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=sF(M0,n);return m.jsx(D0,{asChild:!0,children:m.jsx(Rt.button,{type:"button",...r,ref:t,onClick:It(e.onClick,o.onClose)})})});Qd.displayName=M0;var D0=P.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return m.jsx(Rt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function N0(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),hF(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...N0(r))}}),t}function Rs(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?qx(o,i):o.dispatchEvent(i)}var F0=(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 pF(e=()=>{}){const t=Qr(e);Yo(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function hF(e){return e.nodeType===e.ELEMENT_NODE}function mF(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 Jd(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var gF=E0,vF=C0,yF=P0,bF=I0,xF=_0,wF=Qd;const SF=e=>{const[t,n]=S.useState(!1),r=()=>n(!0),o=()=>n(!1);return S.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},TF=lo("relative isolate z-tooltip flex justify-between overflow-hidden whitespace-nowrap rounded-lg border text-sm shadow-shadow-notification",{variants:{theme:{default:"border-card-border bg-card-background text-foreground",info:"bg-alert-info-bg text-alert-info-text border-alert-info-border",warn:"bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",danger:"bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",success:"bg-alert-success-bg text-alert-success-text border-alert-success-border",secondary:"bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",muted:"bg-alert-muted-bg text-alert-muted-text border-alert-muted-border"}},defaultVariants:{theme:"default"}}),L0=S.createContext(()=>{throw new Error("Not implemented")}),EF=()=>S.useContext(L0),V0={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]}},kF=S.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,i=t.hover?"hover":t.isLast?"isLast":"other",a=TF({theme:t.theme||"default"});return m.jsx(yF,{ref:n,asChild:!0,forceMount:!0,onOpenChange:t.onClose,duration:o,children:m.jsx(et.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:V0[t.reversedIndex]||V0.default},transition:{type:"spring",mass:1.2,damping:30,stiffness:200},exit:{opacity:[.9,0],transition:{opacity:{bounce:.25,duration:.3}}},children:m.jsxs("div",{className:a,children:[m.jsxs("div",{className:"flex flex-col p-4",children:[t.title?m.jsx(bF,{className:"select-text truncate text-lg font-medium leading-relaxed",children:t.title}):null,m.jsx(xF,{className:"select-text truncate",children:t.text})]}),r?m.jsx(wF,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:m.jsx(Ao,{className:"size-5"})}):null]})})})});function CF({children:e,max:t=5,duration:n=5e3}){const r=S.useRef(null),o=SF(r),[i,a]=S.useState([]),s=S.useCallback(()=>a([]),[]);S.useEffect(()=>s,[s]);const l=S.useCallback((c,u)=>{const d=window.crypto.randomUUID();return a(f=>{const b=[...f,{...u,id:d,text:c}];return b.length>t?b.slice(b.length-t,b.length+1):b}),{clear:s,close:()=>a(f=>f.filter(b=>b.id!==d))}},[t]);return m.jsxs(gF,{duration:n,swipeThreshold:150,children:[m.jsx(L0.Provider,{value:l,children:e}),m.jsx(et.ol,{children:m.jsx(Xn,{presenceAffectsLayout:!0,mode:"popLayout",children:i.map((c,u,d)=>{const h=()=>a(f=>f.filter(b=>b.id!==c.id));return S.createElement(kF,{...c,hover:o,index:u,key:c.id,onClose:h,isLast:d.length-1===u,reversedIndex:d.length-(u+1)})})})}),m.jsx(vF,{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 AF=e=>m.jsxs(O2,{max:e.max,value:e.percent,style:{transform:"translateZ(0)"},className:ke("overflow-hidden relative w-full rounded-full h-6 bg-background",e.container),children:[m.jsx(M2,{style:{transform:$e.number(e.percent)?`translateX(-${100-e.percent}%)`:void 0},className:ke("bg-primary transition-transform ease-in-out size-full duration-500",e.className)}),$e.number(e.percent)?m.jsx("p",{className:ke("flex absolute inset-0 justify-center items-center w-full font-semibold tabular-nums text-primary-foreground",e.textClassName),children:e.label?e.label:`${e.percent} %`}):null]}),PF=e=>m.jsxs("div",{className:"divide-y divide-card-border rounded-card border border-card-border bg-card-background shadow-shadow-card",children:[m.jsxs("header",{className:"flex items-start gap-4 p-6",children:[m.jsx("div",{className:ke("flex aspect-square size-10 items-center justify-center rounded-card bg-primary p-8",e.iconContainer),children:m.jsx("div",{children:m.jsx(e.Icon,{className:"aspect-square size-10 text-primary-foreground"})})}),m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("header",{children:m.jsx("h3",{className:"text-base leading-none",children:e.title})}),m.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?m.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),$0=(e,t)=>{const[n,r]=S.useState(()=>t||e);return S.useEffect(()=>{r(e)},[e]),[n,r]},j0={ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight"},z0=S.createContext(""),IF=e=>e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true",ef=(e,t,n)=>{const r=n==="forward"?1:-1,o=t+r;for(let i=o;i>=0&&i<e.length;i+=r){const a=e[i];if(!IF(a))return a}return n==="backward"?ef(e,e.length-1,"backward"):ef(e,-1,"forward")},R0=(e,t)=>{const n=Array.from(e.querySelectorAll("li")),r=n.findIndex(i=>i.dataset.active==="true");if(r===-1)return null;const o=ef(n,r,t);return o===null?null:(o.querySelector("button")?.focus({preventScroll:!1}),o.getAttribute("data-id")||"")},B0={[j0.ArrowLeft]:(e,t)=>R0(t,"backward"),[j0.ArrowRight]:(e,t)=>R0(t,"forward")},_F=e=>{const[t,n]=$0(e.active),r=S.useRef(null),o=ir(e.onChange);S.useEffect(()=>{const l=r.current;if(l===null)return;let c=l.querySelector("li[data-active=true]");if(c===null){c=l.querySelector("li[data-id]");const u=c.getAttribute("data-id")||"";n(u)}},[e.active,n]),S.useEffect(()=>{o.current&&o.current(t)},[o,t]);const i=S.Children.toArray(e.children),a=l=>{const c=l.currentTarget;n(c.dataset.id||"")},s=l=>{if(r.current===null)return;const c=l.key;if($e.keyof(B0,c)){const u=B0[c],d=u(l,r.current);if(d===null)return;n(d)}};return m.jsx(z0.Provider,{value:t,children:m.jsx($d,{className:e.className,container:ke("pt-0 max-w-full w-full min-w-0",e.container),header:m.jsxs("header",{className:"relative mb-2 overflow-x-auto",children:[m.jsx("div",{className:"absolute bottom-0 h-[1px] w-full bg-card-border"}),m.jsx("nav",{className:"min-w-0",children:m.jsx("ul",{onKeyDown:s,ref:r,className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:i.map(l=>{const c=l.props,u=t===c.id;return m.jsx("li",{"data-id":c.id,"data-active":u,"aria-disabled":c.disabled,className:ke("relative w-fit border-b border-transparent transition-all",u?"border-primary font-medium text-primary":"",c.disabled?"aria-disabled:text-disabled":""),children:m.jsx(un,{as:"button",type:"button","data-id":c.id,"aria-current":"page",disabled:c.disabled,onClick:c.disabled?void 0:a,className:"block w-full whitespace-nowrap px-10 py-4 disabled:cursor-not-allowed",children:c.title})},`tab-header-${c.id}`)})})})]}),children:e.children})})},OF=()=>S.useContext(z0),MF=e=>{const t=OF();return m.jsx(S.Fragment,{children:e.id===t?e.children:null})},Bs=e=>m.jsxs("li",{"data-component":"timeline-item",className:"relative pb-12",role:"listitem",children:[m.jsx("span",{"aria-hidden":"true",className:"absolute left-6 top-8 -ml-px h-full w-0.5 bg-card-border"}),m.jsx("div",{className:"relative flex items-stretch justify-start space-x-3",children:e.children})]});Bs.Icon=function(t){return m.jsx("header",{...t,className:ke("flex size-12 items-center justify-center rounded-full bg-primary p-2 text-primary-foreground",t.className),children:t.children})},Bs.Body=function(t){return m.jsx(un,{...t,className:ke("min-w-0 flex-1",t.className),children:t.children})},Bs.Right=function(t){return m.jsx("footer",{className:"flex gap-6 self-stretch px-4 align-baseline",children:m.jsx(un,{...t,type:"button"})})};const DF=e=>m.jsx("ul",{"data-component":"timeline",role:"list",className:"flow-root [&>li:last-child>span[aria-hidden=true]]:hidden",children:e.children}),NF=({item:e,context:t,setter:n,get:r,refs:o})=>m.jsx(yr,{children:m.jsx(bg,{reducedMotion:"user",transition:{type:"tween",stiffness:25,duration:.3},children:m.jsxs(Xn,{presenceAffectsLayout:!0,children:[e?m.jsx(et.div,{exit:{opacity:0},animate:{opacity:1},initial:{opacity:0},className:"pointer-events-none fixed inset-0 top-0 z-overlay h-screen w-screen bg-floating-overlay/70"}):null,e?m.jsx(Md,{lockScroll:!0,className:"absolute inset-0 z-floating flex items-center justify-center",children:m.jsx(Zr,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:t,children:m.jsxs(et.div,{layout:!0,layoutId:`item-${e.id}`,className:"relative flex h-min w-min min-w-xs flex-col gap-4 rounded-card border border-card-border bg-card-background p-6 py-4 pb-8 shadow-shadow-card",ref:o.setFloating,...r(),children:[m.jsx("nav",{className:"absolute right-4 top-1 lg:right-2",children:m.jsx("button",{type:"button",onClick:n,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:m.jsx(Ao,{})})}),m.jsxs("header",{className:"flex w-full flex-wrap items-center justify-between gap-2",children:[m.jsx("h3",{className:"min-w-full text-balance text-2xl font-medium",children:e.title}),m.jsx("p",{className:"text-sm leading-snug text-secondary",children:e.description})]}),e.children]})})}):null]})})}),FF=e=>{const[t,n]=S.useState(null),r=S.useId(),{context:o,refs:i}=tr({open:t!==null,transform:!0,onOpenChange:h=>h?void 0:n(null)}),a=qo(o),s=xr(o,{role:"dialog"}),l=br(o,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:c}=nr([a,s,l]),u=S.useCallback(()=>{n(null)},[]),d=S.Children.toArray(e.children);return m.jsxs(S.Fragment,{children:[m.jsx(NF,{refs:i,context:o,get:c,item:t,setter:u}),m.jsx("ul",{role:"list",children:d.map((h,f)=>{const b=h.props,g=`${r}-${f}`,p=()=>n({...b,id:g}),v=b.leading;return m.jsx(et.li,{layout:!0,layoutId:`item-${g}`,className:"border-b border-card-border py-2 last:border-transparent",children:m.jsx(et.div,{layoutId:`toast-${g}`,className:"relative",children:m.jsx("div",{className:"relative flex items-start space-x-3",children:m.jsxs(S.Fragment,{children:[b.avatar?m.jsx("div",{children:m.jsx("div",{className:"relative px-1",children:m.jsx("button",{onClick:p,className:"flex size-10 items-center justify-center ring-primary",children:b.avatar})})}):null,m.jsx("div",{className:"min-w-0 flex-1 py-1 text-foreground",children:m.jsxs("div",{className:"flex flex-row flex-nowrap justify-between gap-4",children:[m.jsxs("button",{onClick:p,className:"cursor-pointer text-left transition-all ease-out hover:text-primary",children:[m.jsx("h3",{children:b.title}),m.jsx("p",{className:"text-sm leading-snug text-secondary",children:b.description})]}),v?m.jsx(v,{open:p}):null]})})]})})})},g)})})]})},LF=e=>m.jsx(S.Fragment,{children:e.children}),VF=/Mac|iPod|iPhone|iPad/,Hs=()=>VF.test(navigator.userAgent),$F=e=>e.split("+").map(t=>{const n=t.trim();return n==="Mod"?Hs()?"Meta":"Control":n==="Hyper"?Hs()?"Meta+Shift+Alt":"Control+Shift+Alt":n}),H0=e=>e.map(t=>t.trim()).join("+");class jF{constructor(t=[]){this.combinations=[],this.combinations=this.combinations.concat(t),this.combinations.forEach(n=>{this.add(n.key,n.fn)})}add(t,n){const r=H0($F(t));if(!this.combinations.find(o=>o.key===r))return this.combinations.push({fn:n,key:r}),this}register(){const t=new AbortController,n=r=>{const o=r.target;if((o.tagName==="INPUT"||o.tagName==="TEXTAREA")&&o.getAttribute("data-combikeysbypass")!=="true")return;const i=new Set;if(r.metaKey&&i.add("Meta"),r.ctrlKey&&i.add("Control"),r.altKey&&i.add("Alt"),r.key.charCodeAt(0)>127){const s=r.code.replace(/^Digit/,"").replace(/^Key/,"");i.add(r.shiftKey?s.toUpperCase():s.toLowerCase())}else i.add(r.shiftKey?r.key.toUpperCase():r.key);const a=H0(Array.from(i));this.combinations.forEach(s=>{if(s.key===a)return r.preventDefault(),void s.fn(r)})};return window.addEventListener("keydown",n,{signal:t.signal}),()=>t.abort()}}class wn extends Map{constructor(t){super(t),this.list=[],this.list=[],Array.isArray(t)&&(this.list=t),t instanceof wn&&(this.list=Array.from(t.entries()))}set(t,n){return super.set(t,n),this.list=(this.list??[]).concat([[t,n]]),this}remove(t){return super.delete(t),this.list=Array.from(this.entries())??[],this}map(t){return this.list.map((n,r)=>t(n[1],r))}clone(t){const n=new wn(this);return t?t(n):n}static from(t,n){return new wn(t.map(r=>[n(r),r]))}static unique(t,n){return Array.from(wn.from(t,n).values())}toArray(){return Array.from(this.values())}}const zF=(e,t)=>{e=String(e).toLocaleLowerCase(),t=String(t).toLocaleLowerCase();const n=t[0],r=e.split("").map((a,s)=>a===n?s:!1).filter(a=>a!==!1);if(r.length===0)return null;const o=[];if(r.forEach(a=>{let s=a+1;const l=[a];for(let c=1;c<t.length;c++){const u=t[c];if(s=e.indexOf(u,s),s===-1)return;l.push(s),s++}o.push(l)}),o.length===0)return null;const i=o.sort((a,s)=>{if(a.length===1)return a[0]-s[0];const l=a[a.length-1]-a[0],c=s[s.length-1]-s[0];return l-c})[0];return e===t?1:i.length>1?2+(i[i.length-1]-i[0]):2+i[0]},W0=(e,t,n)=>{const r=e.split(t).filter(Boolean);let o=n;for(const i of r){if(o==null)return o;o=o[i]}return o},q0={basic:/[,[\]]+?/,extend:/[,[\].]+?/},U0=(e,t)=>{const n=W0(t,q0.basic,e);return n!==void 0&&n!==e?n:W0(t,q0.extend,e)},K0=e=>e.replace(/[^0-9]/g,""),Ws=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),Y0=(e,t,n,r="FUZZY")=>r==="CONTAINS"?e.includes(t):r==="EQUAL"?e===t:r==="CONTAINS_NUMBERS"?K0(e).includes(K0(t)):r==="STARTS_WITH"?e.startsWith(t):r==="ENDS_WITH"?e.endsWith(t):r==="FUZZY"?zF(e,t)!==null:!1,RF=(e,t,n,r="FUZZY")=>Array.isArray(t)?t.some(o=>Y0(e,o,n,r)):Y0(e,t,n,r),tf=(e,t,n)=>{if(n.length===0)return e;const r=new Map,o=n.map(i=>({...i,value:$e.array(i.value)?i.value.map(Ws):Ws(`${i.value}`)}));return e.forEach(i=>{const a=U0(i,t);o.forEach(s=>{const l=U0(i,s.key);if(!l)return;const c=Ws(`${s.value}`.toLocaleLowerCase()).trim(),u=Ws(`${l}`.toLocaleLowerCase()).trim();if(RF(u,c,s.score,s.match))return void r.set(a,i);$e.function(s.ifNotMatch)&&s.ifNotMatch(c,u)&&r.set(a,i)})}),Array.from(r.values())},BF=e=>(e=e.trim(),e==="Alt"?Hs()?m.jsx(WI,{"aria-label":"Option",size:14}):"Alt":e==="Mod"?Hs()?m.jsx($I,{"aria-label":"Command",size:14}):"Ctrl":e),HF=e=>{const t=e.value.trim().split("+");return m.jsx("span",{className:"flex items-center gap-1",children:t.map((n,r)=>{const o=t.length-1===r;return m.jsxs(S.Fragment,{children:[m.jsx("kbd",{"aria-label":n,children:BF(n)}),o?null:m.jsx("span",{children:"+"})]},`${e.value}-${n}-key-${r}`)})})},nf=m.jsx("div",{className:"h-2 w-10/12 animate-pulse rounded bg-table-border"}),WF=(e,t)=>dr()?t:window.matchMedia(e).matches,qF=(e,t=!0)=>{const[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=window.matchMedia(e),i=()=>r(WF(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},G0=()=>window.matchMedia("@media (pointer: coarse)"),UF=()=>{const e=S.useRef(dr()?null:G0()),[t,n]=S.useState(dr()?!1:e.current?.matches??!1);return S.useEffect(()=>{(e.current===null?G0():e.current).addEventListener("change",o=>n(o.matches))},[]),t},rf=(e,t="overflow-hidden")=>{const n=S.useRef(null),r=UF(),o=S.useRef(dr()?"":document.documentElement.style.overflowY);return S.useEffect(()=>{if(!(n.current===null&&!e)&&t!=="block-only"&&t==="overflow-hidden")if(e){if(o.current=document.documentElement.style.overflowY,document.documentElement.style.overflowY="hidden",r||pb())return;document.documentElement.style.padding=Gh(document.documentElement)?"0 15px 0 0":""}else document.documentElement.style.padding="",document.documentElement.style.overflowY=o.current},[e,r,t]),S.useEffect(()=>{if(!e)return;const i=new AbortController,a=document.documentElement,s=l=>{const c=n.current;if(c&&c.contains(l.target)){const u=c.getBoundingClientRect(),d=c.style.height?Number(kT(c.style.height)):null,h=$e.number(d)?d:u.height,f=c.scrollHeight<=h;return h===c.scrollHeight?e?l.preventDefault():void 0:f?void 0:e?l.preventDefault():void 0}return l.currentTarget===document.documentElement,e?l.preventDefault():void 0};return a.addEventListener("wheel",s,{signal:i.signal,passive:!1}),a.addEventListener("scroll",s,{signal:i.signal,passive:!1}),()=>{i.abort()}},[e]),n},KF=Wx,Sn="500ms",YF={exit:{x:["0%","-30%"],opacity:0,animationDuration:Sn},enter:{x:["-30%","0%"],opacity:1,animationDuration:Sn},initial:{x:["-30%","0%"],opacity:.8,animationDuration:Sn}},GF={initial:{x:["30%","0%"],opacity:.8},enter:{x:"0%",opacity:1,animationDuration:Sn},exit:{x:["0%","30%"],opacity:0,animationDuration:Sn}},of={drawer:e=>e==="left"?YF:GF,sheet:{initial:{opacity:.5,y:"25%",animationDuration:Sn,transformOrigin:"bottom"},enter:{opacity:1,y:"0%",animationDuration:Sn,transformOrigin:"bottom"},exit:{opacity:.1,y:"50%",animationDuration:Sn,transformOrigin:"bottom"}},dialog:{exit:{opacity:0,scale:.95,animationDuration:Sn},initial:{opacity:.5,scale:.95,animationDuration:Sn,transition:{duration:.5,ease:"easeInOut"}},enter:{opacity:1,scale:[1.05,1],animationDuration:Sn}}},ZF=lo("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 max-h-[calc(100vh-15%)] max-h-[calc(100svh-5%)] h-screen 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"}}),Z0={top:0,left:0,right:0,bottom:0},X0=e=>e*.6,XF=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const u=e.parent.current,d=e.value.get()||u.getBoundingClientRect().width,h=e.position==="right"?-r.delta.x:r.delta.x,f=Math.abs(d+h);return e.value.set(f)}const i=e.parent.current.getBoundingClientRect(),a=e.value.get()||i.height,s=Math.abs(a-r.delta.y),l=window.outerHeight,c=X0(l);return s>=c?e.value.set(s):(document.activeElement instanceof HTMLElement&&document.activeElement?.blur(),e.onChange(!1),setTimeout(()=>e.value.set(void 0),350))}};return m.jsx(et.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:Z0,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?m.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},qs={drawer:"right",sheet:"none",dialog:"none"},QF=(e,t,n,r)=>{const o=n||"dialog";return e?n==="drawer"?r??qs.drawer:qs[o]:t?qs[o]:qs.sheet},JF=[],af=S.forwardRef(({open:e,title:t,footer:n,asChild:r,trigger:o,children:i,onChange:a,ariaTitle:s,className:l,bodyClassName:c,resizer:u=!0,animated:d=!0,closable:h=!0,forceType:f=!1,layoutId:b=void 0,overlayClassName:g="",type:p="dialog",position:v,overlayClickClose:y=!1,role:x="dialog",interactions:T=JF,...w},E)=>{const k=rf(e,"block-only"),C=S.useId(),O=S.useId(),_=qF("(min-width: 64rem)"),V=p!=="dialog",L=QF(_,f,p,v),R=_||f?of[p]:of.sheet,I=typeof R=="function"?R(L):R,M=_||f?p:"sheet",H=tr({open:e,onOpenChange:a}),D=qo(H.context,{}),A=xr(H.context,{role:x}),F=br(H.context,{escapeKey:!0,outsidePress:y}),N=nr([D,A,F].concat(T)),W=o,j=qa(void 0);S.useEffect(()=>{j.set(void 0)},[M]);const Z=()=>a(!1);S.useImperativeHandle(E,()=>({context:H.context,floating:k.current}),[H.context,k]);const G=(ee,B)=>{const U=H.refs.floating;if(U.current&&M==="sheet"){const Q=U.current.getBoundingClientRect(),z=j.get()||Q.height,ae=Math.abs(z-B.delta.y),le=X0(window.outerHeight);return ae<le?(Z(),setTimeout(()=>j.set(window.outerHeight),350)):j.set(ae)}},re={layoutId:b,layout:!0,exit:"exit",animate:"enter",initial:"initial",variants:I},te=d&&M==="sheet"?{...re,dragElastic:0,onDrag:G,dragConstraints:Z0,dragListener:!0,dragMomentum:!0,dragPropagation:!0,dragSnapToOrigin:!0,dragDirectionLock:!0,draggable:M==="sheet",drag:M==="sheet"?"y":"x"}:re;return m.jsxs(S.Fragment,{children:[o?m.jsx(S.Fragment,{children:r?m.jsx(KF,{ref:H.refs.setReference,...N.getReferenceProps({layoutId:b}),children:W}):m.jsx(et.button,{ref:H.refs.setReference,...N.getReferenceProps(),layoutId:b,type:"button",children:W})}):null,m.jsx(yr,{preserveTabOrder:!0,children:m.jsx(Xn,{propagate:!0,mode:"wait",initial:!1,children:e?m.jsx(Md,{lockScroll:!0,className:ke("inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70",M==="drawer"?"":"flex items-start justify-center p-10",g),children:m.jsx(Zr,{guards:!0,visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:H.context,children:m.jsxs(et.div,{...w,...te,...t?{"aria-labelledby":C,"aria-describedby":O}:{"aria-label":s},...N.getFloatingProps({"aria-modal":e,ref:Kn(H.refs.setFloating,k),className:ke(ZF({position:L,type:M}),l,"overscroll-contain")}),"data-component":"modal",style:M==="drawer"?{width:j}:{height:j},children:[t?m.jsx("header",{className:"relative w-full",children:t?m.jsx("h2",{id:C,className:"select-text border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:t}):null}):null,m.jsx("section",{"data-component":"modal-body",className:ke("flex-1 select-text overflow-y-auto px-8 py-1",c),children:i}),n?m.jsx("footer",{className:"w-full select-text border-t border-floating-border px-8 pt-4",children:n}):null,h?m.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:m.jsx("button",{type:"button",onClick:Z,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:m.jsx(Ao,{})})}):null,V&&u?m.jsx(XF,{onChange:a,value:j,sheet:M==="sheet",position:L,parent:H.refs.floating}):null]})})}):null},C)})]})}),eL=e=>m.jsx("span",{className:"flex h-full items-center text-left text-sm font-medium text-secondary",children:yc(e.item.title)?m.jsx(e.item.title,{text:e.text}):e.item.title}),tL=S.forwardRef((e,t)=>{const n=S.useId(),r=e.active,o=e.item;return o.type==="group"?m.jsx("div",{id:n,className:"h-10 px-2 pb-1 pt-2",children:m.jsx(eL,{text:e.text,item:o})}):o.type!=="shortcut"?m.jsx(S.Fragment,{}):m.jsxs("button",{...e,id:n,ref:t,role:"option",type:"button","aria-selected":r,"data-component":"command-palette-item",className:ke("flex h-10 items-center justify-between rounded-lg p-2 hover:bg-floating-hover",r?"bg-floating-hover":""),children:[m.jsxs("span",{className:"flex items-center gap-2",children:[o.Icon?o.Icon:null,m.jsx("span",{children:yc(o.title)?m.jsx(o.title,{text:e.text}):o.title})]}),o.shortcut?m.jsx(HF,{value:o.shortcut}):null]})}),nL=(e,t)=>{if(t.length===0)return e;const n=[{key:"title",value:t},{key:"shortcut",value:t},{key:"hint",value:t}],r=e.map(s=>({...s,title:$e.function(s.title)?s.title({text:t}):s.title})),o=r.reduce((s,l)=>{const c=$e.function(l.enabled)?l.enabled({text:t}):l.enabled??!0;return c&&s.push({...l,enabled:c}),s},[]),i=tf(o,"title",n),a=r.filter(s=>$e.function(s.enabled)?s.enabled({text:t}):!1);return wn.unique(i.concat(a),s=>s.title)},rL=[0,0,0,0,0],oL=e=>{const t=e.bind??"Mod + k",n=S.useRef([]),r=Et(),[o,i]=S.useState(""),a=ir(o),s=S.useId(),l=S.useRef(null),[c,u]=S.useState(null),d=tr({open:e.open,strategy:"absolute",onOpenChange:e.onChangeVisibility,whileElementsMounted:Ho}),h=Ns(d.context,{listRef:n,loop:!0,activeIndex:c,virtual:!0,allowEscape:!0,scrollItemIntoView:!0,onNavigate:y=>u(x=>$e.number(y)?y:e.open?x??0:null)}),{getItemProps:f}=nr([h]),b=e.commands.flatMap(y=>y.type==="group"?[y,...y.items]:[y]),g=nL(b,o),p=o===""?b:[{type:"group",title:"Results",items:[]},...g.filter(y=>y.type!=="group")];S.useEffect(()=>{const y=new jF;return y.add(t,()=>e.onChangeVisibility?.(!0)),b.forEach(x=>{x.type!=="group"&&x.type==="shortcut"&&x.shortcut!==void 0&&y.add(x.shortcut,T=>x.action({event:T,text:a.current,setOpen:e.onChangeVisibility}))}),y.register()},[t]);const v=e.Icon??hy;return m.jsx(S.Fragment,{children:m.jsxs(af,{ref:l,animated:!1,closable:!1,open:e.open,overlayClickClose:!0,interactions:[h],ariaTitle:"Command palette",bodyClassName:"px-0 py-0 pt-2","data-component":"command-palette",onChange:e.onChangeVisibility,className:"container relative py-0 md:max-w-screen-sm lg:max-w-screen-md",children:[m.jsxs("header",{className:"sticky top-0 isolate z-floating flex h-12 w-full items-center border-b border-floating-border bg-floating-background px-4",children:[m.jsx("div",{className:"flex size-10 items-center justify-center",children:m.jsx(v,{Default:hy,text:o,size:16})}),m.jsx("input",{autoFocus:!0,value:o,"data-combikeysbypass":"true",placeholder:"Search for...",onChange:y=>i(y.target.value),className:"h-12 w-full items-center bg-transparent px-2 py-2 pb-2 text-left text-lg outline-none",onKeyDown:y=>{if((y.key==="ArrowDown"||y.key==="ArrowUp")&&c!==null&&n.current[c]?.scrollIntoView({block:"start",inline:"start"}),y.key==="Enter"){if(c!==null&&p[c]){y.preventDefault();const x=p[c],T=y.currentTarget.value;if(x.type==="shortcut")return x.action({event:y,setOpen:e.onChangeVisibility,text:T})}if(p.length===1){y.preventDefault();const x=p[0],T=y.currentTarget.value;if(x.type==="shortcut")return x.action({event:y,setOpen:e.onChangeVisibility,text:T})}}}})]}),e.loading?m.jsxs("ul",{role:"listbox","data-component":"command-palette-list",className:"my-2 flex max-h-96 w-full origin-[top_center] flex-col gap-1 overflow-y-auto px-2",children:[m.jsx("div",{className:"h-10 px-2 pb-1 pt-2",children:r.commandPaletteLoading}),rL.map((y,x)=>m.jsx("li",{className:ke("flex h-10 items-center justify-between rounded-lg p-2 hover:bg-primary hover:text-primary-foreground"),children:nf},`${s}-${x}-skeleton-index`))]}):m.jsxs("div",{className:"flex min-w-full flex-row flex-nowrap","data-component":"command-palette-container",children:[m.jsxs("ul",{role:"listbox","data-component":"command-palette-list",className:"my-2 flex h-fit max-h-96 w-full origin-[top_center] flex-col gap-1 overflow-y-auto px-2",children:[p.map((y,x)=>S.createElement(tL,{...f({onMouseEnter:()=>u(x),ref(T){n.current[x]=T},onClick(T){T.preventDefault(),e.onChangeVisibility(!1),d.refs.domReference.current?.focus(),y.type==="shortcut"&&y.action({event:T,setOpen:e.onChangeVisibility,text:o})}}),item:y,text:o,active:c===x,key:`${s}-${y.type}-${x}`})),p.length===1?m.jsx("div",{className:ke("flex items-center justify-between rounded-lg p-2 text-secondary"),children:r.commandPaletteEmpty??e.emptyMessage}):null]}),e.Preview&&$e.number(c)?m.jsx(e.Preview,{command:p[c],text:o}):null]}),e.footer?m.jsx("footer",{className:"flex h-8 items-center rounded-b-lg bg-background p-2",children:e.footer}):null]})})},Zo=e=>{const t=S.useId(),[n,r]=S.useState(e.open);S.useEffect(()=>r(e.open),[e.open]);const o=S.useRef(null),i=S.useMemo(()=>[Xi(10),Ad({fallbackAxisSideDirection:"end"}),Cd(),Zb({padding:5,element:o})],[e.arrow]),{refs:a,floatingStyles:s,context:l}=tr({open:n,middleware:i,transform:!0,whileElementsMounted:Ho,onOpenChange:(b,g)=>{const p=g?.relatedTarget;p&&p.dataset.floating==="true"&&!b||(r(b),e.onChange?.(b))}}),c=qo(l),u=br(l),d=xr(l,{role:"tooltip"}),{getReferenceProps:h,getFloatingProps:f}=nr([c,u,d]);return m.jsxs(S.Fragment,{children:[m.jsx("button",{ref:a.setReference,...h(e.buttonProps),type:"button",children:e.trigger}),n&&m.jsx(yr,{preserveTabOrder:!0,id:`${t}-portal`,children:m.jsx(Zr,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:m.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-4 shadow-shadow-floating",ref:a.setFloating,style:s,"aria-labelledby":t,...f(),children:[m.jsx(ox,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),m.jsx("header",{className:"mb-2",children:m.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},iL=e=>{const t=S.useRef(null),n=S.useId(),r=`${n}:wrapper`,o=`${n}:title`,[i,a]=S.useState(e.open??!1);S.useEffect(()=>{a(e.open??!1)},[e.open]);const{context:s,refs:l}=tr({transform:!0,open:i!==null,nodeId:n,onOpenChange:a,strategy:"absolute"}),c=qo(s,{enabled:e.disabled??!0}),u=xr(s,{role:"tooltip"}),d=br(s,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:h,getReferenceProps:f}=nr([c,u,d]);return m.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[m.jsx(ka,{...f(e),as:et.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>a(!0),children:m.jsx(et.span,{layoutId:o,children:e.trigger})}),m.jsx(Xn,{children:i?m.jsx(yr,{root:t,children:m.jsx(Zr,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:s,children:m.jsx(et.div,{...h(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},Q0=(e="")=>ke("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary focus:bg-primary aria-expanded:opacity-80","focus:text-primary-foreground hover:text-primary-foreground","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),sf=S.createContext({isOpen:!1,activeIndex:null,getItemProps:()=>({}),setActiveIndex:()=>{},setHasFocusInside:()=>{}}),J0=S.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,open:r,isParent:o=!1,restoreFocus:i=!1,floatingClassName:a="",label:s,...l},c)=>{const[u,d]=S.useState(r??!1),[h,f]=S.useState(!1),[b,g]=S.useState(null),p=S.useRef([]),v=S.useRef([]),y=S.useContext(sf),x=gr(),T=vr(),w=hN(),E=Qb(),k=x!==null,{floatingStyles:C,refs:O,context:_}=tr({nodeId:w,open:u,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:Ho,placement:k?"right":"bottom-start",middleware:[Xi({mainAxis:k?0:4,alignmentAxis:k?-4:0}),Ad(),Cd()]}),V=xr(_,{role:"menu"}),L=br(_,{bubbles:!0}),R=cx(_,{move:!1,enabled:n,delay:{open:Mx},handleClose:Ox({blockPointerEvents:!0,requireIntent:!1})}),I=qo(_,{toggle:!k,event:"mousedown",ignoreMouse:k,keyboardHandlers:!0}),M=Ns(_,{loop:!0,activeIndex:b,nested:k,listRef:p,onNavigate:g}),H=jN(_,{activeIndex:b,listRef:v,resetMs:BN,onMatch:u?g:void 0}),{getReferenceProps:D,getFloatingProps:A,getItemProps:F}=nr([R,I,V,L,M,H]);S.useEffect(()=>{if(!T)return;const W=()=>d(!1),j=Z=>{Z.nodeId!==w&&Z.parentId===x&&d(!1)};return T.events.on("click",W),T.events.on("menuopen",j),()=>{T.events.off("click",W),T.events.off("menuopen",j)}},[T,w,x]),S.useEffect(()=>{u&&T&&T.events.emit("menuopen",{parentId:x,nodeId:w})},[T,u,w,x]);const N=o?l.className:ke(Q0(l.className));return m.jsxs(mN,{id:w,children:[m.jsx(S.Fragment,{children:l.asChild?m.jsx(Wx,{...D(y.getItemProps({...l,onFocus(W){l.onFocus?.(W),f(!1),y.setHasFocusInside(!0)}})),children:s,className:N,"data-open":u?"":void 0,"data-nested":k?"":void 0,role:k?"menuitem":void 0,"data-focus-inside":h?"":void 0,ref:Kn(O.setReference,E.ref,c),tabIndex:k?y.activeIndex===E.index?0:-1:void 0}):m.jsxs("button",{type:"button",className:N,"data-open":u?"":void 0,"data-nested":k?"":void 0,role:k?"menuitem":void 0,"data-focus-inside":h?"":void 0,ref:Kn(O.setReference,E.ref,c),tabIndex:k?y.activeIndex===E.index?0:-1:void 0,...D(y.getItemProps({...l,onFocus(W){l.onFocus?.(W),f(!1),y.setHasFocusInside(!0)}})),children:[s,k&&m.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[m.jsx("span",{className:"sr-only",children:"Next menu"}),m.jsx(Fu,{size:14})]})]})}),m.jsx(sf.Provider,{value:{activeIndex:b,setActiveIndex:g,getItemProps:F,setHasFocusInside:f,isOpen:u},children:m.jsx(lN,{elementsRef:p,labelsRef:v,children:u&&m.jsx(yr,{preserveTabOrder:!0,children:m.jsx(Zr,{context:_,modal:!1,initialFocus:k?-1:0,returnFocus:o?i:!k,children:m.jsx(t,{...A(),ref:O.setFloating,style:{...l.style,...C},className:ke("isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-none",a),children:e})})})})})]})}),aL=S.forwardRef(({title:e,Right:t,disabled:n,children:r,...o},i)=>{const a=S.useContext(sf),s=Qb({label:n?null:e}),l=vr(),c=s.index===a.activeIndex;return m.jsxs("button",{...o,title:e,type:"button",role:"menuitem",disabled:n,"data-active":c,"data-open":a.isOpen,tabIndex:c?0:-1,ref:Kn(s.ref,i),className:Q0(`${o.className??""} ${c?"bg-primary text-primary-foreground":""}`),...a.getItemProps({onClick(u){o.onClick?.(u),l?.events.emit("click")},onFocus(u){o.onFocus?.(u),a.setHasFocusInside(!0)}}),children:[r,t?m.jsx(t,{size:16}):null]})}),sL=S.forwardRef((e,t)=>gr()===null?m.jsx(gN,{children:m.jsx(J0,{...e,isParent:!0,ref:t})}):m.jsx(J0,{...e,isParent:!1,ref:t})),lL=e=>m.jsx(et.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),Us=0,wr=1,Xo=2,ew=4;function tw(e){return()=>e}function cL(e){e()}function oa(e,t){return n=>e(t(n))}function nw(e,t){return()=>e(t)}function uL(e,t){return n=>e(t,n)}function lf(e){return e!==void 0}function dL(...e){return()=>{e.map(cL)}}function Qo(){}function Ks(e,t){return t(e),e}function fL(e,t){return t(e)}function dt(...e){return e}function rt(e,t){return e(wr,t)}function Ve(e,t){e(Us,t)}function cf(e){e(Xo)}function Ft(e){return e(ew)}function ye(e,t){return rt(e,uL(t,Us))}function $n(e,t){const n=e(wr,r=>{n(),t(r)});return n}function rw(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function ow(e,t){return e===t}function ft(e=ow){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Ce(e){return t=>n=>{e(n)&&t(n)}}function fe(e){return t=>oa(t,e)}function jn(e){return t=>()=>{t(e)}}function oe(e,...t){const n=pL(...t);return(r,o)=>{switch(r){case Xo:cf(e);return;case wr:return rt(e,n(o))}}}function zn(e,t){return n=>r=>{n(t=e(t,r))}}function Jo(e){return t=>n=>{e>0?e--:t(n)}}function Sr(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function je(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);rt(i,l=>{const c=n;n=n|s,t[a]=l,c!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>{i([a].concat(t))};n===o?s():r=s}}function pL(...e){return t=>e.reduceRight(fL,t)}function hL(e){let t,n;const r=()=>t?.();return function(o,i){switch(o){case wr:return i?n===i?void 0:(r(),n=i,t=rt(e,i),t):(r(),Qo);case Xo:r(),n=null;return}}}function se(e){let t=e;const n=Be();return(r,o)=>{switch(r){case Us:t=o;break;case wr:{o(t);break}case ew:return t}return n(r,o)}}function Wt(e,t){return Ks(se(t),n=>ye(e,n))}function Be(){const e=[];return(t,n)=>{switch(t){case Us:e.slice().forEach(r=>{r(n)});return;case Xo:e.splice(0,e.length);return;case wr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}}}function on(e){return Ks(Be(),t=>ye(e,t))}function Ye(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:mL(),singleton:n}}const mL=()=>Symbol();function gL(e){const t=new Map,n=({constructor:r,dependencies:o,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);const s=r(o.map(l=>n(l)));return a&&t.set(i,s),s};return n(e)}function _t(...e){const t=Be(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);rt(i,l=>{n[a]=l,r=r|s,r===o&&Ve(t,n)})}),function(i,a){switch(i){case Xo:{cf(t);return}case wr:return r===o&&a(n),rt(t,a)}}}function Ae(e,t=ow){return oe(e,ft(t))}function iw(...e){return function(t,n){switch(t){case Xo:return;case wr:return dL(...e.map(r=>rt(r,n)))}}}var Jt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Jt||{});const vL={0:"debug",3:"error",1:"log",2:"warn"},yL=()=>typeof globalThis>"u"?window:globalThis,Tr=Ye(()=>{const e=se(3);return{log:se((t,n,r=1)=>{var o;const i=(o=yL().VIRTUOSO_LOG_LEVEL)!=null?o:Ft(e);r>=i&&console[vL[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function Rn(e,t,n){return uf(e,t,n).callbackRef}function uf(e,t,n){const r=S.useRef(null);let o=a=>{};const i=S.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const s=()=>{const l=a[0].target;l.offsetParent!==null&&e(l)};n?s():requestAnimationFrame(s)}):null,[e,n]);return o=a=>{a&&t?(i?.observe(a),r.current=a):(r.current&&i?.unobserve(r.current),r.current=null)},{callbackRef:o,ref:r}}function aw(e,t,n,r,o,i,a,s,l){const c=S.useCallback(u=>{const d=bL(u.children,t,s?"offsetWidth":"offsetHeight",o);let h=u.parentElement;for(;!h.dataset.virtuosoScroller;)h=h.parentElement;const f=h.lastElementChild.dataset.viewportType==="window";let b;f&&(b=h.ownerDocument.defaultView);const g=a?s?a.scrollLeft:a.scrollTop:f?s?b.scrollX||b.document.documentElement.scrollLeft:b.scrollY||b.document.documentElement.scrollTop:s?h.scrollLeft:h.scrollTop,p=a?s?a.scrollWidth:a.scrollHeight:f?s?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight:s?h.scrollWidth:h.scrollHeight,v=a?s?a.offsetWidth:a.offsetHeight:f?s?b.innerWidth:b.innerHeight:s?h.offsetWidth:h.offsetHeight;r({scrollHeight:p,scrollTop:Math.max(g,0),viewportHeight:v}),i?.(s?sw("column-gap",getComputedStyle(u).columnGap,o):sw("row-gap",getComputedStyle(u).rowGap,o)),d!==null&&e(d)},[e,t,o,i,a,r,s]);return uf(c,n,l)}function bL(e,t,n,r){const o=e.length;if(o===0)return null;const i=[];for(let a=0;a<o;a++){const s=e.item(a);if(s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),c=parseFloat(s.dataset.knownSize),u=t(s,n);if(u===0&&r("Zero-sized element, this should not happen",{child:s},Jt.ERROR),u===c)continue;const d=i[i.length-1];i.length===0||d.size!==u||d.endIndex!==l-1?i.push({endIndex:l,size:u,startIndex:l}):i[i.length-1].endIndex++}return i}function sw(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jt.WARN),t==="normal"?0:parseInt(t??"0",10)}function df(e,t,n){const r=S.useRef(null),o=S.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),u=c.width;let d,h;if(t){const f=t.getBoundingClientRect(),b=c.top-f.top;h=f.height-Math.max(0,b),d=b+t.scrollTop}else{const f=a.current.ownerDocument.defaultView;h=f.innerHeight-Math.max(0,c.top),d=c.top+f.scrollY}r.current={offsetTop:d,visibleHeight:h,visibleWidth:u},e(r.current)},[e,t]),{callbackRef:i,ref:a}=uf(o,!0,n),s=S.useCallback(()=>{o(a.current)},[o,a]);return S.useEffect(()=>{var l;if(t){t.addEventListener("scroll",s);const c=new ResizeObserver(()=>{requestAnimationFrame(s)});return c.observe(t),()=>{t.removeEventListener("scroll",s),c.unobserve(t)}}else{const c=(l=a.current)==null?void 0:l.ownerDocument.defaultView;return c?.addEventListener("scroll",s),c?.addEventListener("resize",s),()=>{c?.removeEventListener("scroll",s),c?.removeEventListener("resize",s)}}},[s,t,a]),i}const Kt=Ye(()=>{const e=Be(),t=Be(),n=se(0),r=Be(),o=se(0),i=Be(),a=Be(),s=se(0),l=se(0),c=se(0),u=se(0),d=Be(),h=Be(),f=se(!1),b=se(!1),g=se(!1);return ye(oe(e,fe(({scrollTop:p})=>p)),t),ye(oe(e,fe(({scrollHeight:p})=>p)),a),ye(t,o),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:u,headerHeight:s,horizontalDirection:b,scrollBy:h,scrollContainerState:e,scrollHeight:a,scrollingInProgress:f,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:i}},[],{singleton:!0}),ia={lvl:0};function lw(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let a=1;a<n;a++){const{index:s,value:l}=t(e[a]);i.push({end:s-1,start:r,value:o}),r=s,o=l}return i.push({end:1/0,start:r,value:o}),i}function at(e){return e===ia}function aa(e,t){if(!at(e))return t===e.k?e.v:t<e.k?aa(e.l,t):aa(e.r,t)}function Tn(e,t,n="k"){if(at(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Tn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Tn(e.l,t,n)}function an(e,t,n){return at(e)?dw(t,n,1):t===e.k?Ot(e,{k:t,v:n}):t<e.k?fw(Ot(e,{l:an(e.l,t,n)})):fw(Ot(e,{r:an(e.r,t,n)}))}function ei(){return ia}function Ys(e,t,n){if(at(e))return[];const r=Tn(e,t)[0];return xL(pf(e,r,n))}function ff(e,t){if(at(e))return ia;const{k:n,l:r,r:o}=e;if(t===n){if(at(r))return o;if(at(o))return r;{const[i,a]=uw(r);return Gs(Ot(e,{k:i,l:cw(r),v:a}))}}else return t<n?Gs(Ot(e,{l:ff(r,t)})):Gs(Ot(e,{r:ff(o,t)}))}function eo(e){return at(e)?[]:[...eo(e.l),{k:e.k,v:e.v},...eo(e.r)]}function pf(e,t,n){if(at(e))return[];const{k:r,l:o,r:i,v:a}=e;let s=[];return r>t&&(s=s.concat(pf(o,t,n))),r>=t&&r<=n&&s.push({k:r,v:a}),r<=n&&(s=s.concat(pf(i,t,n))),s}function Gs(e){const{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(hf(t))return pw(Ot(e,{lvl:n-1}));if(!at(t)&&!at(t.r))return Ot(t.r,{l:Ot(t,{r:t.r.l}),lvl:n,r:Ot(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(hf(e))return mf(Ot(e,{lvl:n-1}));if(!at(r)&&!at(r.l)){const o=r.l,i=hf(o)?r.lvl-1:r.lvl;return Ot(o,{l:Ot(e,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:mf(Ot(r,{l:o.r,lvl:i}))})}else throw new Error("Unexpected empty nodes")}}function Ot(e,t){return dw(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function cw(e){return at(e.r)?e.l:Gs(Ot(e,{r:cw(e.r)}))}function hf(e){return at(e)||e.lvl>e.r.lvl}function uw(e){return at(e.r)?[e.k,e.v]:uw(e.r)}function dw(e,t,n,r=ia,o=ia){return{k:e,l:r,lvl:n,r:o,v:t}}function fw(e){return mf(pw(e))}function pw(e){const{l:t}=e;return!at(t)&&t.lvl===e.lvl?Ot(t,{r:Ot(e,{l:t.r})}):e}function mf(e){const{lvl:t,r:n}=e;return!at(n)&&!at(n.r)&&n.lvl===t&&n.r.lvl===t?Ot(n,{l:Ot(e,{r:n.l}),lvl:t+1}):e}function xL(e){return lw(e,({k:t,v:n})=>({index:t,value:n}))}function hw(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function sa(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const gf=Ye(()=>({recalcInProgress:se(!1)}),[],{singleton:!0});function mw(e,t,n){return e[Zs(e,t,n)]}function Zs(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=e[i],s=n(a,t);if(s===0)return i;if(s===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function wL(e,t,n,r){const o=Zs(e,t,r),i=Zs(e,n,r,o);return e.slice(o,i+1)}function En(e,t){return Math.round(e.getBoundingClientRect()[t])}function Xs(e){return!at(e.groupOffsetTree)}function vf({index:e},t){return t===e?0:t<e?-1:1}function SL(){return{groupIndices:[],groupOffsetTree:ei(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:ei()}}function TL(e,t){let n=at(e)?0:1/0;for(const r of t){const{endIndex:o,size:i,startIndex:a}=r;if(n=Math.min(n,a),at(e)){e=an(e,0,i);continue}const s=Ys(e,a-1,o+1);if(s.some(_L(r)))continue;let l=!1,c=!1;for(const{end:u,start:d,value:h}of s)l?(o>=d||i===h)&&(e=ff(e,d)):(c=h!==i,l=!0),u>o&&o>=d&&h!==i&&(e=an(e,o+1,h));c&&(e=an(e,a,i))}return[e,n]}function EL(e){return typeof e.groupIndex<"u"}function kL({offset:e},t){return t===e?0:t<e?-1:1}function la(e,t,n){if(t.length===0)return 0;const{index:r,offset:o,size:i}=mw(t,e,vf),a=e-r,s=i*a+(a-1)*n+o;return s>0?s+n:s}function gw(e,t){if(!Xs(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function vw(e,t,n){if(EL(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=gw(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function CL(e,t,n,r=0){return r>0&&(t=Math.max(t,mw(e,r,vf).offset)),lw(wL(e,t,n,kL),IL)}function AL(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Jt.DEBUG);const i=e.sizeTree;let a=i,s=0;if(n.length>0&&at(i)&&t.length===2){const h=t[0].size,f=t[1].size;a=n.reduce((b,g)=>an(an(b,g,h),g+1,f),a)}else[a,s]=TL(a,t);if(a===i)return e;const{lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d}=yf(e.offsetTree,s,a,o);return{groupIndices:n,groupOffsetTree:n.reduce((h,f)=>an(h,f,la(f,d,o)),ei()),lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d,sizeTree:a}}function PL(e){return eo(e).map(({k:t,v:n},r,o)=>{const i=o[r+1];return{endIndex:i?i.k-1:1/0,size:n,startIndex:t}})}function yw(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function yf(e,t,n,r){let o=e,i=0,a=0,s=0,l=0;if(t!==0){l=Zs(o,t-1,vf),s=o[l].offset;const c=Tn(n,t-1);i=c[0],a=c[1],o.length&&o[l].size===Tn(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of Ys(n,t,1/0)){const d=c-i,h=d*a+s+d*r;o.push({index:c,offset:h,size:u}),i=c,s=h,a=u}return{lastIndex:i,lastOffset:s,lastSize:a,offsetTree:o}}function IL(e){return{index:e.index,value:e}}function _L(e){const{endIndex:t,size:n,startIndex:r}=e;return o=>o.start===r&&(o.end===t||o.end===1/0)&&o.value===n}const OL={offsetHeight:"height",offsetWidth:"width"},Bn=Ye(([{log:e},{recalcInProgress:t}])=>{const n=Be(),r=Be(),o=Wt(r,0),i=Be(),a=Be(),s=se(0),l=se([]),c=se(void 0),u=se(void 0),d=se((w,E)=>En(w,OL[E])),h=se(void 0),f=se(0),b=SL(),g=Wt(oe(n,je(l,e,f),zn(AL,b),ft()),b),p=Wt(oe(l,ft(),zn((w,E)=>({current:E,prev:w.current}),{current:[],prev:[]}),fe(({prev:w})=>w)),[]);ye(oe(l,Ce(w=>w.length>0),je(g,f),fe(([w,E,k])=>{const C=w.reduce((O,_,V)=>an(O,_,la(_,E.offsetTree,k)||V),ei());return{...E,groupIndices:w,groupOffsetTree:C}})),g),ye(oe(r,je(g),Ce(([w,{lastIndex:E}])=>w<E),fe(([w,{lastIndex:E,lastSize:k}])=>[{endIndex:E,size:k,startIndex:w}])),n),ye(c,u);const v=Wt(oe(c,fe(w=>w===void 0)),!0);ye(oe(u,Ce(w=>w!==void 0&&at(Ft(g).sizeTree)),fe(w=>[{endIndex:0,size:w,startIndex:0}])),n);const y=on(oe(n,je(g),zn(({sizes:w},[E,k])=>({changed:k!==w,sizes:k}),{changed:!1,sizes:b}),fe(w=>w.changed)));rt(oe(s,zn((w,E)=>({diff:w.prev-E,prev:E}),{diff:0,prev:0}),fe(w=>w.diff)),w=>{const{groupIndices:E}=Ft(g);if(w>0)Ve(t,!0),Ve(i,w+yw(w,E));else if(w<0){const k=Ft(p);k.length>0&&(w-=yw(-w,k)),Ve(a,w)}}),rt(oe(s,je(e)),([w,E])=>{w<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Jt.ERROR)});const x=on(i);ye(oe(i,je(g),fe(([w,E])=>{const k=E.groupIndices.length>0,C=[],O=E.lastSize;if(k){const _=aa(E.sizeTree,0);let V=0,L=0;for(;V<w;){const I=E.groupIndices[L],M=E.groupIndices.length===L+1?1/0:E.groupIndices[L+1]-I-1;C.push({endIndex:I,size:_,startIndex:I}),C.push({endIndex:I+1+M-1,size:O,startIndex:I+1}),L++,V+=M+1}const R=eo(E.sizeTree);return V!==w&&R.shift(),R.reduce((I,{k:M,v:H})=>{let D=I.ranges;return I.prevSize!==0&&(D=[...I.ranges,{endIndex:M+w-1,size:I.prevSize,startIndex:I.prevIndex}]),{prevIndex:M+w,prevSize:H,ranges:D}},{prevIndex:w,prevSize:0,ranges:C}).ranges}return eo(E.sizeTree).reduce((_,{k:V,v:L})=>({prevIndex:V+w,prevSize:L,ranges:[..._.ranges,{endIndex:V+w-1,size:_.prevSize,startIndex:_.prevIndex}]}),{prevIndex:0,prevSize:O,ranges:[]}).ranges})),n);const T=on(oe(a,je(g,f),fe(([w,{offsetTree:E},k])=>{const C=-w;return la(C,E,k)})));return ye(oe(a,je(g,f),fe(([w,E,k])=>{if(E.groupIndices.length>0){if(at(E.sizeTree))return E;let C=ei();const O=Ft(p);let _=0,V=0,L=0;for(;_<-w;){L=O[V];const R=O[V+1]-L-1;V++,_+=R+1}if(C=eo(E.sizeTree).reduce((R,{k:I,v:M})=>an(R,Math.max(0,I+w),M),C),_!==-w){const R=aa(E.sizeTree,L);C=an(C,0,R);const I=Tn(E.sizeTree,-w+1)[1];C=an(C,1,I)}return{...E,sizeTree:C,...yf(E.offsetTree,0,C,k)}}else{const C=eo(E.sizeTree).reduce((O,{k:_,v:V})=>an(O,Math.max(0,_+w),V),ei());return{...E,sizeTree:C,...yf(E.offsetTree,0,C,k)}}})),g),{beforeUnshiftWith:x,data:h,defaultItemSize:u,firstItemIndex:s,fixedItemSize:c,gap:f,groupIndices:l,itemSize:d,listRefresh:y,shiftWith:a,shiftWithOffset:T,sizeRanges:n,sizes:g,statefulTotalCount:o,totalCount:r,trackItemSizes:v,unshiftWith:i}},dt(Tr,gf),{singleton:!0});function ML(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const bw=Ye(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const i=Be(),a=Be(),s=on(oe(i,fe(ML)));return ye(oe(s,fe(l=>l.totalCount)),n),ye(oe(s,fe(l=>l.groupIndices)),e),ye(oe(_t(o,t,r),Ce(([l,c])=>Xs(c)),fe(([l,c,u])=>Tn(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),ft(),fe(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},dt(Bn,Kt)),Er=Ye(([{log:e}])=>{const t=se(!1),n=on(oe(t,Ce(r=>r),ft()));return rt(t,r=>{r&&Ft(e)("props updated",{},Jt.DEBUG)}),{didMount:n,propsReady:t}},dt(Tr),{singleton:!0}),DL=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function xw(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!DL)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ca=Ye(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:i,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:u,viewportHeight:d},{log:h}])=>{const f=Be(),b=Be(),g=se(0);let p=null,v=null,y=null;function x(){p&&(p(),p=null),y&&(y(),y=null),v&&(clearTimeout(v),v=null),Ve(l,!1)}return ye(oe(f,je(n,d,r,g,s,a,h),je(e,i,o),fe(([[T,w,E,k,C,O,_,V],L,R,I])=>{const M=xw(T),{align:H,behavior:D,offset:A}=M,F=k-1,N=vw(M,w,F);let W=la(N,w.offsetTree,L)+O;H==="end"?(W+=R+Tn(w.sizeTree,N)[1]-E+I,N===F&&(W+=_)):H==="center"?W+=(R+Tn(w.sizeTree,N)[1]-E+I)/2:W-=C,A&&(W+=A);const j=Z=>{x(),Z?(V("retrying to scroll to",{location:T},Jt.DEBUG),Ve(f,T)):(Ve(b,!0),V("list did not change, scroll successful",{},Jt.DEBUG))};if(x(),D==="smooth"){let Z=!1;y=rt(t,G=>{Z=Z||G}),p=$n(u,()=>{j(Z)})}else p=$n(oe(t,NL(150)),j);return v=setTimeout(()=>{x()},1200),Ve(l,!0),V("scrolling from index to",{behavior:D,index:N,top:W},Jt.DEBUG),{behavior:D,top:W}})),c),{scrollTargetReached:b,scrollToIndex:f,topListHeight:g}},dt(Bn,Kt,Tr),{singleton:!0});function NL(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}function bf(e,t){e==0?t():requestAnimationFrame(()=>{bf(e-1,t)})}function xf(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const ua=Ye(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:i},{didMount:a}])=>{const s=se(!0),l=se(0),c=se(!0);return ye(oe(a,je(l),Ce(([u,d])=>!!d),jn(!1)),s),ye(oe(a,je(l),Ce(([u,d])=>!!d),jn(!1)),c),rt(oe(_t(t,a),je(s,n,e,c),Ce(([[,u],d,{sizeTree:h},f,b])=>u&&(!at(h)||lf(f))&&!d&&!b),je(l)),([,u])=>{$n(o,()=>{Ve(c,!0)}),bf(4,()=>{$n(r,()=>{Ve(s,!0)}),Ve(i,u)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:s}},dt(Bn,Kt,ca,Er),{singleton:!0});function ww(e,t){return Math.abs(e-t)<1.01}const da="up",fa="down",FL="none",LL={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},VL=0,pa=Ye(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:i}])=>{const a=se(!1),s=se(!0),l=Be(),c=Be(),u=se(4),d=se(VL),h=Wt(oe(iw(oe(Ae(o),Jo(1),jn(!0)),oe(Ae(o),Jo(1),jn(!1),rw(100))),ft()),!1),f=Wt(oe(iw(oe(n,jn(!0)),oe(n,jn(!1),rw(200))),ft()),!1);ye(oe(_t(Ae(o),Ae(d)),fe(([y,x])=>y<=x),ft()),s),ye(oe(s,Sr(50)),c);const b=on(oe(_t(r,Ae(i),Ae(t),Ae(e),Ae(u)),zn((y,[{scrollHeight:x,scrollTop:T},w,E,k,C])=>{const O=T+w-x>-C,_={scrollHeight:x,scrollTop:T,viewportHeight:w};if(O){let L,R;return T>y.state.scrollTop?(L="SCROLLED_DOWN",R=y.state.scrollTop-T):(L="SIZE_DECREASED",R=y.state.scrollTop-T||y.scrollTopDelta),{atBottom:!0,atBottomBecause:L,scrollTopDelta:R,state:_}}let V;return _.scrollHeight>y.state.scrollHeight?V="SIZE_INCREASED":w<y.state.viewportHeight?V="VIEWPORT_HEIGHT_DECREASING":T<y.state.scrollTop?V="SCROLLING_UPWARDS":V="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:V,state:_}},LL),ft((y,x)=>y&&y.atBottom===x.atBottom))),g=Wt(oe(r,zn((y,{scrollHeight:x,scrollTop:T,viewportHeight:w})=>{if(ww(y.scrollHeight,x))return{changed:!1,jump:0,scrollHeight:x,scrollTop:T};{const E=x-(T+w)<1;return y.scrollTop!==T&&E?{changed:!0,jump:y.scrollTop-T,scrollHeight:x,scrollTop:T}:{changed:!0,jump:0,scrollHeight:x,scrollTop:T}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Ce(y=>y.changed),fe(y=>y.jump)),0);ye(oe(b,fe(y=>y.atBottom)),a),ye(oe(a,Sr(50)),l);const p=se(fa);ye(oe(r,fe(({scrollTop:y})=>y),ft(),zn((y,x)=>Ft(f)?{direction:y.direction,prevScrollTop:x}:{direction:x<y.prevScrollTop?da:fa,prevScrollTop:x},{direction:fa,prevScrollTop:0}),fe(y=>y.direction)),p),ye(oe(r,Sr(50),jn(FL)),p);const v=se(0);return ye(oe(h,Ce(y=>!y),jn(0)),v),ye(oe(o,Sr(100),je(h),Ce(([y,x])=>!!x),zn(([y,x],[T])=>[x,T],[0,0]),fe(([y,x])=>x-y)),v),{atBottomState:b,atBottomStateChange:l,atBottomThreshold:u,atTopStateChange:c,atTopThreshold:d,isAtBottom:a,isAtTop:s,isScrolling:h,lastJumpDueToItemResize:g,scrollDirection:p,scrollVelocity:v}},dt(Kt)),Qs="top",Js="bottom",Sw="none";function Tw(e,t,n){return typeof e=="number"?n===da&&t===Qs||n===fa&&t===Js?e:0:n===da?t===Qs?e.main:e.reverse:t===Js?e.main:e.reverse}function Ew(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const wf=Ye(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const i=Be(),a=se(0),s=se(0),l=se(0),c=Wt(oe(_t(Ae(r),Ae(o),Ae(n),Ae(i,sa),Ae(l),Ae(a),Ae(t),Ae(e),Ae(s)),fe(([u,d,h,[f,b],g,p,v,y,x])=>{const T=u-y,w=p+v,E=Math.max(h-T,0);let k=Sw;const C=Ew(x,Qs),O=Ew(x,Js);return f-=y,f+=h+v,b+=h+v,b-=y,f>u+w-C&&(k=da),b<u-E+d+O&&(k=fa),k!==Sw?[Math.max(T-h-Tw(g,Qs,k)-C,0),T-E-v+d+Tw(g,Js,k)+O]:null}),Ce(u=>u!=null),ft(sa)),[0,0]);return{increaseViewportBy:s,listBoundary:i,overscan:l,topListHeight:a,visibleRange:c}},dt(Kt),{singleton:!0});function $L(e,t,n){if(Xs(t)){const r=gw(e,t);return[{index:Tn(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}const Sf={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function el(e,t,n,r,o,i){const{lastIndex:a,lastOffset:s,lastSize:l}=o;let c=0,u=0;if(e.length>0){c=e[0].offset;const g=e[e.length-1];u=g.offset+g.size}const d=n-a,h=s+d*l+(d-1)*r,f=c,b=h-u;return{bottom:u,firstItemIndex:i,items:Cw(e,o,i),offsetBottom:b,offsetTop:c,top:f,topItems:Cw(t,o,i),topListHeight:t.reduce((g,p)=>p.size+g,0),totalCount:n}}function kw(e,t,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-a>=e)break;a++}const s=e+a,l=xf(t,s),c=Array.from({length:s}).map((u,d)=>({data:i[d+l],index:d+l,offset:0,size:0}));return el(c,[],s,o,n,r)}function Cw(e,t,n){if(e.length===0)return[];if(!Xs(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,i=[],a=Ys(t.groupOffsetTree,r,o);let s,l=0;for(const c of e){(!s||s.end<c.index)&&(s=a.shift(),l=t.groupIndices.indexOf(s.start));let u;c.index===s.start?u={index:l,type:"group"}:u={groupIndex:l,index:c.index-(l+1)+n},i.push({...u,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}const to=Ye(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:o},i,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:u},{topListHeight:d},h,{didMount:f},{recalcInProgress:b}])=>{const g=se([]),p=se(0),v=Be();ye(i.topItemsIndexes,g);const y=Wt(oe(_t(f,b,Ae(l,sa),Ae(o),Ae(r),Ae(c),u,Ae(g),Ae(t),Ae(n),e),Ce(([E,k,,C,,,,,,,O])=>{const _=O&&O.length!==C;return E&&!k&&!_}),fe(([,,[E,k],C,O,_,V,L,R,I,M])=>{const H=O,{offsetTree:D,sizeTree:A}=H,F=Ft(p);if(C===0)return{...Sf,totalCount:C};if(E===0&&k===0)return F===0?{...Sf,totalCount:C}:kw(F,_,O,R,I,M||[]);if(at(A))return F>0?null:el($L(xf(_,C),H,M),[],C,I,H,R);const N=[];if(L.length>0){const re=L[0],te=L[L.length-1];let ee=0;for(const B of Ys(A,re,te)){const U=B.value,X=Math.max(B.start,re),Q=Math.min(B.end,te);for(let z=X;z<=Q;z++)N.push({data:M?.[z],index:z,offset:ee,size:U}),ee+=U}}if(!V)return el([],N,C,I,H,R);const W=L.length>0?L[L.length-1]+1:0,j=CL(D,E,k,W);if(j.length===0)return null;const Z=C-1,G=Ks([],re=>{for(const te of j){const ee=te.value;let B=ee.offset,U=te.start;const X=ee.size;if(ee.offset<E){U+=Math.floor((E-ee.offset+I)/(X+I));const z=U-te.start;B+=z*X+z*I}U<W&&(B+=(W-U)*X,U=W);const Q=Math.min(te.end,Z);for(let z=U;z<=Q&&!(B>=k);z++)re.push({data:M?.[z],index:z,offset:B,size:X}),B+=X+I}});return el(G,N,C,I,H,R)}),Ce(E=>E!==null),ft()),Sf);ye(oe(e,Ce(lf),fe(E=>E?.length)),o),ye(oe(y,fe(E=>E.topListHeight)),d),ye(d,s),ye(oe(y,fe(E=>[E.top,E.bottom])),a),ye(oe(y,fe(E=>E.items)),v);const x=on(oe(y,Ce(({items:E})=>E.length>0),je(o,e),Ce(([{items:E},k])=>E[E.length-1].originalIndex===k-1),fe(([,E,k])=>[E-1,k]),ft(sa),fe(([E])=>E))),T=on(oe(y,Sr(200),Ce(({items:E,topItems:k})=>E.length>0&&E[0].originalIndex===k.length),fe(({items:E})=>E[0].index),ft())),w=on(oe(y,Ce(({items:E})=>E.length>0),fe(({items:E})=>{let k=0,C=E.length-1;for(;E[k].type==="group"&&k<C;)k++;for(;E[C].type==="group"&&C>k;)C--;return{endIndex:E[C].index,startIndex:E[k].index}}),ft(hw)));return{endReached:x,initialItemCount:p,itemsRendered:v,listState:y,rangeChanged:w,startReached:T,topItemsIndexes:g,...h}},dt(Bn,bw,wf,ua,ca,pa,Er,gf),{singleton:!0}),Aw=Ye(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:o}])=>{const i=Be(),a=Wt(oe(_t(n,e,r,t,o),fe(([s,l,c,u,d])=>s+l+c+u+d.offsetBottom+d.bottom)),0);return ye(Ae(a),i),{totalListHeight:a,totalListHeightChanged:i}},dt(Kt,to),{singleton:!0}),jL=Ye(([{viewportHeight:e},{totalListHeight:t}])=>{const n=se(!1),r=Wt(oe(_t(n,e,t),Ce(([o])=>o),fe(([,o,i])=>Math.max(0,o-i)),Sr(0),ft()),0);return{alignToBottom:n,paddingTopAddition:r}},dt(Kt,Aw),{singleton:!0});function Pw(e){return e?e==="smooth"?"smooth":"auto":!1}const zL=(e,t)=>typeof e=="function"?Pw(e(t)):t&&Pw(e),RL=Ye(([{listRefresh:e,totalCount:t,fixedItemSize:n},{atBottomState:r,isAtBottom:o},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:s,propsReady:l},{log:c},{scrollingInProgress:u}])=>{const d=se(!1),h=Be();let f=null;function b(p){Ve(i,{align:"end",behavior:p,index:"LAST"})}rt(oe(_t(oe(Ae(t),Jo(1)),s),je(Ae(d),o,a,u),fe(([[p,v],y,x,T,w])=>{let E=v&&T,k="auto";return E&&(k=zL(y,x||w),E=E&&!!k),{followOutputBehavior:k,shouldFollow:E,totalCount:p}}),Ce(({shouldFollow:p})=>p)),({followOutputBehavior:p,totalCount:v})=>{f&&(f(),f=null),Ft(n)?requestAnimationFrame(()=>{Ft(c)("following output to ",{totalCount:v},Jt.DEBUG),b(p)}):f=$n(e,()=>{Ft(c)("following output to ",{totalCount:v},Jt.DEBUG),b(p),f=null})});function g(p){const v=$n(r,y=>{p&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!f&&(Ft(c)("scrolling to bottom due to increased size",{},Jt.DEBUG),b("auto"))});setTimeout(v,100)}return rt(oe(_t(Ae(d),t,l),Ce(([p,,v])=>p&&v),zn(({value:p},[,v])=>({refreshed:p===v,value:v}),{refreshed:!1,value:0}),Ce(({refreshed:p})=>p),je(d,t)),([,p])=>{Ft(a)&&g(p!==!1)}),rt(h,()=>{g(Ft(d)!==!1)}),rt(_t(Ae(d),r),([p,v])=>{p&&!v.atBottom&&v.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&b("auto")}),{autoscrollToBottom:h,followOutput:d}},dt(Bn,pa,ca,ua,Er,Tr,Kt)),BL=Ye(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(ye(oe(s,je(i),Ce(([,l])=>l!==0),je(o,r,t,n,e),fe(([[,l],c,u,d,h,f=[]])=>kw(l,c,u,d,h,f))),a),{}),dt(Bn,ua,to,Er),{singleton:!0}),HL=Ye(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=se(0);return rt(oe(e,je(r),Ce(([,o])=>o!==0),fe(([,o])=>({top:o}))),o=>{$n(oe(n,Jo(1),Ce(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Ve(t,o)})})}),{initialScrollTop:r}},dt(Er,Kt,to),{singleton:!0}),WL=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...o},viewportBottom:i,viewportTop:a})=>t<a?{...o,align:n??"start",behavior:r}:e>i?{...o,align:n??"end",behavior:r}:null,qL=Ye(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:i,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:c}])=>{const u=Be();return ye(oe(u,je(t,l,n,i,o,r,s),je(e),fe(([[d,h,f,b,g,p,v,y],x])=>{const{align:T,behavior:w,calculateViewLocation:E=WL,done:k,...C}=d,O=vw(d,h,b-1),_=la(O,h.offsetTree,x)+g+p,V=_+Tn(h.sizeTree,O)[1],L=y+p,R=y+f-v,I=E({itemBottom:V,itemTop:_,locationParams:{align:T,behavior:w,...C},viewportBottom:R,viewportTop:L});return I?k&&$n(oe(a,Ce(M=>!M),Jo(Ft(a)?1:2)),k):k&&k(),I}),Ce(d=>d!==null)),c),{scrollIntoView:u}},dt(Bn,Kt,ca,to,Tr),{singleton:!0}),Iw=Ye(([{scrollVelocity:e}])=>{const t=se(!1),n=Be(),r=se(!1);return ye(oe(e,je(r,t,n),Ce(([o,i])=>!!i),fe(([o,i,a,s])=>{const{enter:l,exit:c}=i;if(a){if(c(o,s))return!1}else if(l(o,s))return!0;return a}),ft()),t),rt(oe(_t(t,e,n),je(r)),([[o,i,a],s])=>{o&&s&&s.change&&s.change(i,a)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},dt(pa),{singleton:!0}),Tf=Ye(([{scrollContainerState:e,scrollTo:t}])=>{const n=Be(),r=Be(),o=Be(),i=se(!1),a=se(void 0);return ye(oe(_t(n,r),fe(([{scrollHeight:s,scrollTop:l,viewportHeight:c},{offsetTop:u}])=>({scrollHeight:s,scrollTop:Math.max(0,l-u),viewportHeight:c}))),e),ye(oe(t,je(r),fe(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{customScrollParent:a,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}},dt(Kt)),UL=Ye(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:i},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{const c=Be(),u=se(void 0),d=se(null),h=se(null);return ye(s,d),ye(l,h),rt(oe(c,je(t,r,a,d,h,n)),([f,b,g,p,v,y,x])=>{const T=PL(b.sizeTree);p&&v!==null&&y!==null&&(g=v.scrollTop-y.offsetTop),g-=x,f({ranges:T,scrollTop:g})}),ye(oe(u,Ce(lf),fe(KL)),o),ye(oe(i,je(u),Ce(([,f])=>f!==void 0),ft(),fe(([,f])=>f.ranges)),e),{getState:c,restoreStateFrom:u}},dt(Bn,Kt,ua,Er,Tf));function KL(e){return{align:"start",index:0,offset:e.scrollTop}}const YL=Ye(([{topItemsIndexes:e}])=>{const t=se(0);return ye(oe(t,Ce(n=>n>=0),fe(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},dt(to));function _w(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const GL=_w(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),ZL=Ye(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:i,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:c,gap:u,shiftWithOffset:d,sizes:h},{log:f},{recalcInProgress:b}])=>{const g=on(oe(l,je(a),zn(([,v,y,x],[{bottom:T,items:w,offsetBottom:E,totalCount:k},C])=>{const O=T+E;let _=0;return y===k&&v.length>0&&w.length>0&&(w[0].originalIndex===0&&v[0].originalIndex===0||(_=O-x,_!==0&&(_+=C))),[_,w,k,O]},[0,[],0,0]),Ce(([v])=>v!==0),je(r,s,n,o,f,b),Ce(([,v,y,x,,,T])=>!T&&!x&&v!==0&&y===da),fe(([[v],,,,,y])=>(y("Upward scrolling compensation",{amount:v},Jt.DEBUG),v))));function p(v){v>0?(Ve(t,{behavior:"auto",top:-v}),Ve(e,0)):(Ve(e,0),Ve(t,{behavior:"auto",top:-v}))}return rt(oe(g,je(e,i)),([v,y,x])=>{x&&GL()?Ve(e,y-v):p(-v)}),rt(oe(_t(Wt(i,!1),e,b),Ce(([v,y,x])=>!v&&!x&&y!==0),fe(([v,y])=>y),Sr(1)),p),ye(oe(d,fe(v=>({top:-v}))),t),rt(oe(c,je(h,u),fe(([v,{groupIndices:y,lastSize:x,sizeTree:T},w])=>{function E(k){return k*(x+w)}if(y.length===0)return E(v);{let k=0;const C=aa(T,0);let O=0,_=0;for(;O<v;){O++,k+=C;let V=y.length===_+1?1/0:y[_+1]-y[_]-1;O+V>v&&(k-=C,V=v-O+1),O+=V,k+=E(V),_++}return k}})),v=>{Ve(e,v),requestAnimationFrame(()=>{Ve(t,{top:v}),requestAnimationFrame(()=>{Ve(e,0),Ve(b,!1)})})}),{deviation:e}},dt(Kt,pa,to,Bn,Tr,gf)),XL=Ye(([e,t,n,r,o,i,a,s,l,c])=>({...e,...t,...n,...r,...o,...i,...a,...s,...l,...c}),dt(wf,BL,Er,Iw,Aw,HL,jL,Tf,qL,Tr)),Ow=Ye(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:i,itemSize:a,sizeRanges:s,sizes:l,statefulTotalCount:c,totalCount:u,trackItemSizes:d},{initialItemFinalLocationReached:h,initialTopMostItemIndex:f,scrolledToInitialItem:b},g,p,v,{listState:y,topItemsIndexes:x,...T},{scrollToIndex:w},E,{topItemCount:k},{groupCounts:C},O])=>(ye(T.rangeChanged,O.scrollSeekRangeChanged),ye(oe(O.windowViewportRect,fe(_=>_.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:C,initialItemFinalLocationReached:h,initialTopMostItemIndex:f,scrolledToInitialItem:b,sizeRanges:s,topItemCount:k,topItemsIndexes:x,totalCount:u,...v,groupIndices:i,itemSize:a,listState:y,scrollToIndex:w,statefulTotalCount:c,trackItemSizes:d,...T,...O,...g,sizes:l,...p}),dt(Bn,ua,Kt,UL,RL,to,ca,ZL,YL,bw,XL));function QL(e,t){const n={},r={};let o=0;const i=e.length;for(;o<i;)r[e[o]]=1,o+=1;for(const a in t)Object.hasOwn(r,a)||(n[a]=t[a]);return n}const tl=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Ef(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),i=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),s=S.createContext({});function l(p,v){p.propsReady&&Ve(p.propsReady,!1);for(const y of r){const x=p[t.required[y]];Ve(x,v[y])}for(const y of o)if(y in v){const x=p[t.optional[y]];Ve(x,v[y])}p.propsReady&&Ve(p.propsReady,!0)}function c(p){return i.reduce((v,y)=>(v[y]=x=>{const T=p[t.methods[y]];Ve(T,x)},v),{})}function u(p){return a.reduce((v,y)=>(v[y]=hL(p[t.events[y]]),v),{})}const d=S.forwardRef((p,v)=>{const{children:y,...x}=p,[T]=S.useState(()=>Ks(gL(e),k=>{l(k,x)})),[w]=S.useState(nw(u,T));tl(()=>{for(const k of a)k in x&&rt(w[k],x[k]);return()=>{Object.values(w).map(cf)}},[x,w,T]),tl(()=>{l(T,x)}),S.useImperativeHandle(v,tw(c(T)));const E=n;return m.jsx(s.Provider,{value:T,children:n?m.jsx(E,{...QL([...r,...o,...a],x),children:y}):y})}),h=p=>{const v=S.useContext(s);return S.useCallback(y=>{Ve(v[p],y)},[v,p])},f=p=>{const v=S.useContext(s)[p],y=S.useCallback(x=>rt(v,x),[v]);return S.useSyncExternalStore(y,()=>Ft(v),()=>Ft(v))},b=p=>{const v=S.useContext(s)[p],[y,x]=S.useState(nw(Ft,v));return tl(()=>rt(v,T=>{T!==y&&x(tw(T))}),[v,y]),y},g=S.version.startsWith("18")?f:b;return{Component:d,useEmitter:(p,v)=>{const y=S.useContext(s)[p];tl(()=>rt(y,v),[v,y])},useEmitterValue:g,usePublisher:h}}const nl=S.createContext(void 0),Mw=S.createContext(void 0),Dw=typeof document<"u"?S.useLayoutEffect:S.useEffect;function kf(e){return"self"in e}function JL(e){return"body"in e}function Nw(e,t,n,r=Qo,o,i){const a=S.useRef(null),s=S.useRef(null),l=S.useRef(null),c=S.useCallback(h=>{let f,b,g;const p=h.target;if(JL(p)||kf(p)){const y=kf(p)?p:p.defaultView;g=i?y.scrollX:y.scrollY,f=i?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight,b=i?y.innerWidth:y.innerHeight}else g=i?p.scrollLeft:p.scrollTop,f=i?p.scrollWidth:p.scrollHeight,b=i?p.offsetWidth:p.offsetHeight;const v=()=>{e({scrollHeight:f,scrollTop:Math.max(g,0),viewportHeight:b})};h.suppressFlushSync?v():so.flushSync(v),s.current!==null&&(g===s.current||g<=0||g===f-b)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);S.useEffect(()=>{const h=o||a.current;return r(o||a.current),c({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",c,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",c)}},[a,c,n,r,o]);function u(h){const f=a.current;if(!f||(i?"offsetWidth"in f&&f.offsetWidth===0:"offsetHeight"in f&&f.offsetHeight===0))return;const b=h.behavior==="smooth";let g,p,v;kf(f)?(p=Math.max(En(f.document.documentElement,i?"width":"height"),i?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight),g=i?f.innerWidth:f.innerHeight,v=i?window.scrollX:window.scrollY):(p=f[i?"scrollWidth":"scrollHeight"],g=En(f,i?"width":"height"),v=f[i?"scrollLeft":"scrollTop"]);const y=p-g;if(h.top=Math.ceil(Math.max(Math.min(y,h.top),0)),ww(g,p)||h.top===v){e({scrollHeight:p,scrollTop:v,viewportHeight:g}),b&&t(!0);return}b?(s.current=h.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,i&&(h={behavior:h.behavior,left:h.top}),f.scrollTo(h)}function d(h){i&&(h={behavior:h.behavior,left:h.top}),a.current.scrollBy(h)}return{scrollByCallback:d,scrollerRef:a,scrollToCallback:u}}const Cf="-webkit-sticky",Fw="sticky",Af=_w(()=>{if(typeof document>"u")return Fw;const e=document.createElement("div");return e.style.position=Cf,e.style.position===Cf?Cf:Fw});function Pf(e){return e}const eV=Ye(()=>{const e=se(l=>`Item ${l}`),t=se(null),n=se(l=>`Group ${l}`),r=se({}),o=se(Pf),i=se("div"),a=se(Qo),s=(l,c=null)=>Wt(oe(r,fe(u=>u[l]),ft()),c);return{components:r,computeItemKey:o,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),tV=Ye(([e,t])=>({...e,...t}),dt(Ow,eV)),nV=({height:e})=>m.jsx("div",{style:{height:e}}),rV={overflowAnchor:"none",position:Af(),zIndex:1},Lw={overflowAnchor:"none"},oV={...Lw,display:"inline-block",height:"100%"},Vw=S.memo(function({showTopList:e=!1}){const t=Ie("listState"),n=gn("sizeRanges"),r=Ie("useWindowScroll"),o=Ie("customScrollParent"),i=gn("windowScrollContainerState"),a=gn("scrollContainerState"),s=o||r?i:a,l=Ie("itemContent"),c=Ie("context"),u=Ie("groupContent"),d=Ie("trackItemSizes"),h=Ie("itemSize"),f=Ie("log"),b=gn("gap"),g=Ie("horizontalDirection"),{callbackRef:p}=aw(n,h,d,e?Qo:s,f,b,o,g,Ie("skipAnimationFrameInResizeObserver")),[v,y]=S.useState(0);Of("deviation",I=>{v!==I&&y(I)});const x=Ie("EmptyPlaceholder"),T=Ie("ScrollSeekPlaceholder")||nV,w=Ie("ListComponent"),E=Ie("ItemComponent"),k=Ie("GroupComponent"),C=Ie("computeItemKey"),O=Ie("isSeeking"),_=Ie("groupIndices").length>0,V=Ie("alignToBottom"),L=Ie("initialItemFinalLocationReached"),R=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:v!==0?v:V?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:v!==0?v:V?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...L?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&x?m.jsx(x,{...lt(x,c)}):m.jsx(w,{...lt(w,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:p,style:R,children:(e?t.topItems:t.items).map(I=>{const M=I.originalIndex,H=C(M+t.firstItemIndex,I.data,c);return O?S.createElement(T,{...lt(T,c),height:I.size,index:I.index,key:H,type:I.type||"item",...I.type==="group"?{}:{groupIndex:I.groupIndex}}):I.type==="group"?S.createElement(k,{...lt(k,c),"data-index":M,"data-item-index":I.index,"data-known-size":I.size,key:H,style:rV},u(I.index,c)):S.createElement(E,{...lt(E,c),...$w(E,I.data),"data-index":M,"data-item-group-index":I.groupIndex,"data-item-index":I.index,"data-known-size":I.size,key:H,style:g?oV:Lw},_?l(I.index,I.groupIndex,I.data,c):l(I.index,I.data,c))})})}),iV={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},aV={outline:"none",overflowX:"auto",position:"relative"},ti=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),sV={position:Af(),top:0,width:"100%",zIndex:1};function lt(e,t){if(typeof e!="string")return{context:t}}function $w(e,t){return{item:typeof e=="string"?void 0:t}}const lV=S.memo(function(){const e=Ie("HeaderComponent"),t=gn("headerHeight"),n=Ie("HeaderFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,Ie("skipAnimationFrameInResizeObserver")),o=Ie("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null}),cV=S.memo(function(){const e=Ie("FooterComponent"),t=gn("footerHeight"),n=Ie("HeaderFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,Ie("skipAnimationFrameInResizeObserver")),o=Ie("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null});function If({useEmitter:e,useEmitterValue:t,usePublisher:n}){return S.memo(function({children:r,style:o,...i}){const a=n("scrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=t("scrollerRef"),u=t("context"),d=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:f,scrollToCallback:b}=Nw(a,l,s,c,void 0,d);return e("scrollTo",b),e("scrollBy",h),m.jsx(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...d?aV:iV,...o},tabIndex:0,...i,...lt(s,u),children:r})})}function _f({useEmitter:e,useEmitterValue:t,usePublisher:n}){return S.memo(function({children:r,style:o,...i}){const a=n("windowScrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=t("totalListHeight"),u=t("deviation"),d=t("customScrollParent"),h=t("context"),f=S.useRef(null),b=t("scrollerRef"),{scrollByCallback:g,scrollerRef:p,scrollToCallback:v}=Nw(a,l,s,b,d);return Dw(()=>{var y;return p.current=d||((y=f.current)==null?void 0:y.ownerDocument.defaultView),()=>{p.current=null}},[p,d]),e("windowScrollTo",v),e("scrollBy",g),m.jsx(s,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...c!==0?{height:c+u}:{}},...i,...lt(s,h),children:r})})}const uV=({children:e})=>{const t=S.useContext(nl),n=gn("viewportHeight"),r=gn("fixedItemHeight"),o=Ie("alignToBottom"),i=Ie("horizontalDirection"),a=S.useMemo(()=>oa(n,l=>En(l,i?"width":"height")),[n,i]),s=Rn(a,!0,Ie("skipAnimationFrameInResizeObserver"));return S.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),m.jsx("div",{"data-viewport-type":"element",ref:s,style:ti(o),children:e})},dV=({children:e})=>{const t=S.useContext(nl),n=gn("windowViewportRect"),r=gn("fixedItemHeight"),o=Ie("customScrollParent"),i=df(n,o,Ie("skipAnimationFrameInResizeObserver")),a=Ie("alignToBottom");return S.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),m.jsx("div",{"data-viewport-type":"window",ref:i,style:ti(a),children:e})},fV=({children:e})=>{const t=Ie("TopItemListComponent")||"div",n=Ie("headerHeight"),r={...sV,marginTop:`${n}px`},o=Ie("context");return m.jsx(t,{style:r,...lt(t,o),children:e})},pV=S.memo(function(e){const t=Ie("useWindowScroll"),n=Ie("topItemsIndexes").length>0,r=Ie("customScrollParent"),o=Ie("context"),i=r||t?gV:mV,a=r||t?dV:uV;return m.jsxs(i,{...e,...lt(i,o),children:[n&&m.jsx(fV,{children:m.jsx(Vw,{showTopList:!0})}),m.jsxs(a,{children:[m.jsx(lV,{}),m.jsx(Vw,{}),m.jsx(cV,{})]})]})}),{Component:hV,useEmitter:Of,useEmitterValue:Ie,usePublisher:gn}=Ef(tV,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},pV),mV=If({useEmitter:Of,useEmitterValue:Ie,usePublisher:gn}),gV=_f({useEmitter:Of,useEmitterValue:Ie,usePublisher:gn}),Mf=hV,vV=Ye(()=>{const e=se(c=>m.jsxs("td",{children:["Item $",c]})),t=se(null),n=se(c=>m.jsxs("td",{colSpan:1e3,children:["Group ",c]})),r=se(null),o=se(null),i=se({}),a=se(Pf),s=se(Qo),l=(c,u=null)=>Wt(oe(i,fe(d=>d[c]),ft()),u);return{components:i,computeItemKey:a,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),yV=Ye(([e,t])=>({...e,...t}),dt(Ow,vV)),bV=({height:e})=>m.jsx("tr",{children:m.jsx("td",{style:{height:e}})}),xV=({height:e})=>m.jsx("tr",{children:m.jsx("td",{style:{border:0,height:e,padding:0}})}),wV={overflowAnchor:"none"},jw={position:Af(),zIndex:2,overflowAnchor:"none"},zw=S.memo(function({showTopList:e=!1}){const t=De("listState"),n=De("computeItemKey"),r=De("firstItemIndex"),o=De("context"),i=De("isSeeking"),a=De("fixedHeaderHeight"),s=De("groupIndices").length>0,l=De("itemContent"),c=De("groupContent"),u=De("ScrollSeekPlaceholder")||bV,d=De("GroupComponent"),h=De("TableRowComponent"),f=(e?t.topItems:[]).reduce((g,p,v)=>(v===0?g.push(p.size):g.push(g[v-1]+p.size),g),[]),b=(e?t.topItems:t.items).map(g=>{const p=g.originalIndex,v=n(p+r,g.data,o),y=e?p===0?0:f[p-1]:0;return i?S.createElement(u,{...lt(u,o),height:g.size,index:g.index,key:v,type:g.type||"item"}):g.type==="group"?S.createElement(d,{...lt(d,o),"data-index":p,"data-item-index":g.index,"data-known-size":g.size,key:v,style:{...jw,top:a}},c(g.index,o)):S.createElement(h,{...lt(h,o),...$w(h,g.data),"data-index":p,"data-item-index":g.index,"data-known-size":g.size,"data-item-group-index":g.groupIndex,key:v,style:e?{...jw,top:a+y}:wV},s?l(g.index,g.groupIndex,g.data,o):l(g.index,g.data,o))});return m.jsx(m.Fragment,{children:b})}),SV=S.memo(function(){const e=De("listState"),t=De("topItemsIndexes").length>0,n=kn("sizeRanges"),r=De("useWindowScroll"),o=De("customScrollParent"),i=kn("windowScrollContainerState"),a=kn("scrollContainerState"),s=o||r?i:a,l=De("trackItemSizes"),c=De("itemSize"),u=De("log"),{callbackRef:d,ref:h}=aw(n,c,l,s,u,void 0,o,!1,De("skipAnimationFrameInResizeObserver")),[f,b]=S.useState(0);Df("deviation",_=>{f!==_&&(h.current.style.marginTop=`${_}px`,b(_))});const g=De("EmptyPlaceholder"),p=De("FillerRow")||xV,v=De("TableBodyComponent"),y=De("paddingTopAddition"),x=De("statefulTotalCount"),T=De("context");if(x===0&&g)return m.jsx(g,{...lt(g,T)});const w=(t?e.topItems:[]).reduce((_,V)=>_+V.size,0),E=e.offsetTop+y+f-w,k=e.offsetBottom,C=E>0?m.jsx(p,{context:T,height:E},"padding-top"):null,O=k>0?m.jsx(p,{context:T,height:k},"padding-bottom"):null;return m.jsxs(v,{"data-testid":"virtuoso-item-list",ref:d,...lt(v,T),children:[C,t&&m.jsx(zw,{showTopList:!0}),m.jsx(zw,{}),O]})}),TV=({children:e})=>{const t=S.useContext(nl),n=kn("viewportHeight"),r=kn("fixedItemHeight"),o=Rn(S.useMemo(()=>oa(n,i=>En(i,"height")),[n]),!0,De("skipAnimationFrameInResizeObserver"));return S.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),m.jsx("div",{"data-viewport-type":"element",ref:o,style:ti(!1),children:e})},EV=({children:e})=>{const t=S.useContext(nl),n=kn("windowViewportRect"),r=kn("fixedItemHeight"),o=De("customScrollParent"),i=df(n,o,De("skipAnimationFrameInResizeObserver"));return S.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),m.jsx("div",{"data-viewport-type":"window",ref:i,style:ti(!1),children:e})},kV=S.memo(function(e){const t=De("useWindowScroll"),n=De("customScrollParent"),r=kn("fixedHeaderHeight"),o=kn("fixedFooterHeight"),i=De("fixedHeaderContent"),a=De("fixedFooterContent"),s=De("context"),l=Rn(S.useMemo(()=>oa(r,v=>En(v,"height")),[r]),!0,De("skipAnimationFrameInResizeObserver")),c=Rn(S.useMemo(()=>oa(o,v=>En(v,"height")),[o]),!0,De("skipAnimationFrameInResizeObserver")),u=n||t?PV:AV,d=n||t?EV:TV,h=De("TableComponent"),f=De("TableHeadComponent"),b=De("TableFooterComponent"),g=i?m.jsx(f,{ref:l,style:{position:"sticky",top:0,zIndex:2},...lt(f,s),children:i()},"TableHead"):null,p=a?m.jsx(b,{ref:c,style:{bottom:0,position:"sticky",zIndex:1},...lt(b,s),children:a()},"TableFoot"):null;return m.jsx(u,{...e,...lt(u,s),children:m.jsx(d,{children:m.jsxs(h,{style:{borderSpacing:0,overflowAnchor:"none"},...lt(h,s),children:[g,m.jsx(SV,{},"TableBody"),p]})})})}),{Component:CV,useEmitter:Df,useEmitterValue:De,usePublisher:kn}=Ef(yV,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},kV),AV=If({useEmitter:Df,useEmitterValue:De,usePublisher:kn}),PV=_f({useEmitter:Df,useEmitterValue:De,usePublisher:kn}),IV=CV,Rw={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},_V={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Bw,floor:rl,max:ha,min:Nf,round:Hw}=Math;function Ww(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({data:n===null?null:n[o+e],index:o+e}))}function OV(e){return{..._V,items:e}}function ol(e,t){return e&&e.width===t.width&&e.height===t.height}function MV(e,t){return e&&e.column===t.column&&e.row===t.row}const DV=Ye(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:o,headerHeight:i,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:c,smoothScrollTargetReached:u,viewportHeight:d},h,f,{didMount:b,propsReady:g},{customScrollParent:p,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:T},w])=>{const E=se(0),k=se(0),C=se(Rw),O=se({height:0,width:0}),_=se({height:0,width:0}),V=Be(),L=Be(),R=se(0),I=se(null),M=se({column:0,row:0}),H=Be(),D=Be(),A=se(!1),F=se(0),N=se(!0),W=se(!1),j=se(!1);rt(oe(b,je(F),Ce(([B,U])=>!!U)),()=>{Ve(N,!1)}),rt(oe(_t(b,N,_,O,F,W),Ce(([B,U,X,Q,,z])=>B&&!U&&X.height!==0&&Q.height!==0&&!z)),([,,,,B])=>{Ve(W,!0),bf(1,()=>{Ve(V,B)}),$n(oe(c),()=>{Ve(t,[0,0]),Ve(N,!0)})}),ye(oe(D,Ce(B=>B!=null&&B.scrollTop>0),jn(0)),k),rt(oe(b,je(D),Ce(([,B])=>B!=null)),([,B])=>{B&&(Ve(O,B.viewport),Ve(_,B.item),Ve(M,B.gap),B.scrollTop>0&&(Ve(A,!0),$n(oe(c,Jo(1)),U=>{Ve(A,!1)}),Ve(l,{top:B.scrollTop})))}),ye(oe(O,fe(({height:B})=>B)),d),ye(oe(_t(Ae(O,ol),Ae(_,ol),Ae(M,(B,U)=>B&&B.column===U.column&&B.row===U.row),Ae(c)),fe(([B,U,X,Q])=>({gap:X,item:U,scrollTop:Q,viewport:B}))),H),ye(oe(_t(Ae(E),r,Ae(M,MV),Ae(_,ol),Ae(O,ol),Ae(I),Ae(k),Ae(A),Ae(N),Ae(F)),Ce(([,,,,,,,B])=>!B),fe(([B,[U,X],Q,z,ae,le,be,,we,Se])=>{const{column:Pe,row:Te}=Q,{height:ve,width:Re}=z,{width:de}=ae;if(be===0&&(B===0||de===0))return Rw;if(Re===0){const xt=xf(Se,B),Yt=xt+Math.max(be-1,0);return OV(Ww(xt,Yt,le))}const Y=qw(de,Re,Pe);let $,J;we?U===0&&X===0&&be>0?($=0,J=be-1):($=Y*rl((U+Te)/(ve+Te)),J=Y*Bw((X+Te)/(ve+Te))-1,J=Nf(B-1,ha(J,Y-1)),$=Nf(J,ha(0,$))):($=0,J=-1);const ce=Ww($,J,le),{bottom:xe,top:Ne}=Uw(ae,Q,z,ce),Ge=Bw(B/Y),Lt=Ge*ve+(Ge-1)*Te-xe;return{bottom:xe,itemHeight:ve,items:ce,itemWidth:Re,offsetBottom:Lt,offsetTop:Ne,top:Ne}})),C),ye(oe(I,Ce(B=>B!==null),fe(B=>B.length)),E),ye(oe(_t(O,_,C,M),Ce(([B,U,{items:X}])=>X.length>0&&U.height!==0&&B.height!==0),fe(([B,U,{items:X},Q])=>{const{bottom:z,top:ae}=Uw(B,Q,U,X);return[ae,z]}),ft(sa)),t);const Z=se(!1);ye(oe(c,je(Z),fe(([B,U])=>U||B!==0)),Z);const G=on(oe(_t(C,E),Ce(([{items:B}])=>B.length>0),je(Z),Ce(([[B,U],X])=>{const Q=B.items[B.items.length-1].index===U-1;return(X||B.bottom>0&&B.itemHeight>0&&B.offsetBottom===0&&B.items.length===U)&&Q}),fe(([[,B]])=>B-1),ft())),re=on(oe(Ae(C),Ce(({items:B})=>B.length>0&&B[0].index===0),jn(0),ft())),te=on(oe(Ae(C),je(A),Ce(([{items:B},U])=>B.length>0&&!U),fe(([{items:B}])=>({endIndex:B[B.length-1].index,startIndex:B[0].index})),ft(hw),Sr(0)));ye(te,f.scrollSeekRangeChanged),ye(oe(V,je(O,_,E,M),fe(([B,U,X,Q,z])=>{const ae=xw(B),{align:le,behavior:be,offset:we}=ae;let Se=ae.index;Se==="LAST"&&(Se=Q-1),Se=ha(0,Se,Nf(Q-1,Se));let Pe=Ff(U,z,X,Se);return le==="end"?Pe=Hw(Pe-U.height+X.height):le==="center"&&(Pe=Hw(Pe-U.height/2+X.height/2)),we&&(Pe+=we),{behavior:be,top:Pe}})),l);const ee=Wt(oe(C,fe(B=>B.offsetBottom+B.bottom)),0);return ye(oe(T,fe(B=>({height:B.visibleHeight,width:B.visibleWidth}))),O),{customScrollParent:p,data:I,deviation:R,footerHeight:o,gap:M,headerHeight:i,increaseViewportBy:e,initialItemCount:k,itemDimensions:_,overscan:n,restoreStateFrom:D,scrollBy:a,scrollContainerState:s,scrollHeight:L,scrollTo:l,scrollToIndex:V,scrollTop:c,smoothScrollTargetReached:u,totalCount:E,useWindowScroll:v,viewportDimensions:O,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:T,...f,gridState:C,horizontalDirection:j,initialTopMostItemIndex:F,totalListHeight:ee,...h,endReached:G,propsReady:g,rangeChanged:te,startReached:re,stateChanged:H,stateRestoreInProgress:A,...w}},dt(wf,Kt,pa,Iw,Er,Tf,Tr));function qw(e,t,n){return ha(1,rl((e+n)/(rl(t)+n)))}function Uw(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{bottom:0,top:0};const i=Ff(e,t,n,r[0].index);return{bottom:Ff(e,t,n,r[r.length-1].index)+o,top:i}}function Ff(e,t,n,r){const o=qw(e.width,n.width,t.column),i=rl(r/o),a=i*n.height+ha(0,i-1)*t.row;return a>0?a+t.row:a}const NV=Ye(()=>{const e=se(d=>`Item ${d}`),t=se({}),n=se(null),r=se("virtuoso-grid-item"),o=se("virtuoso-grid-list"),i=se(Pf),a=se("div"),s=se(Qo),l=(d,h=null)=>Wt(oe(t,fe(f=>f[d]),ft()),h),c=se(!1),u=se(!1);return ye(Ae(u),c),{components:t,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:o,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:u,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),FV=Ye(([e,t])=>({...e,...t}),dt(DV,NV)),LV=S.memo(function(){const e=pt("gridState"),t=pt("listClassName"),n=pt("itemClassName"),r=pt("itemContent"),o=pt("computeItemKey"),i=pt("isSeeking"),a=vn("scrollHeight"),s=pt("ItemComponent"),l=pt("ListComponent"),c=pt("ScrollSeekPlaceholder"),u=pt("context"),d=vn("itemDimensions"),h=vn("gap"),f=pt("log"),b=pt("stateRestoreInProgress"),g=vn("reportReadyState"),p=Rn(S.useMemo(()=>v=>{const y=v.parentElement.parentElement.scrollHeight;a(y);const x=v.firstChild;if(x){const{height:T,width:w}=x.getBoundingClientRect();d({height:T,width:w})}h({column:Yw("column-gap",getComputedStyle(v).columnGap,f),row:Yw("row-gap",getComputedStyle(v).rowGap,f)})},[a,d,h,f]),!0,!1);return Dw(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),b?null:m.jsx(l,{className:t,ref:p,...lt(l,u),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(v=>{const y=o(v.index,v.data,u);return i?m.jsx(c,{...lt(c,u),height:e.itemHeight,index:v.index,width:e.itemWidth},y):S.createElement(s,{...lt(s,u),className:n,"data-index":v.index,key:y},r(v.index,v.data,u))})})}),VV=S.memo(function(){const e=pt("HeaderComponent"),t=vn("headerHeight"),n=pt("headerFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,!1),o=pt("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null}),$V=S.memo(function(){const e=pt("FooterComponent"),t=vn("footerHeight"),n=pt("headerFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,!1),o=pt("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null}),jV=({children:e})=>{const t=S.useContext(Mw),n=vn("itemDimensions"),r=vn("viewportDimensions"),o=Rn(S.useMemo(()=>i=>{r(i.getBoundingClientRect())},[r]),!0,!1);return S.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),m.jsx("div",{ref:o,style:ti(!1),children:e})},zV=({children:e})=>{const t=S.useContext(Mw),n=vn("windowViewportRect"),r=vn("itemDimensions"),o=pt("customScrollParent"),i=df(n,o,!1);return S.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),m.jsx("div",{ref:i,style:ti(!1),children:e})},RV=S.memo(function({...e}){const t=pt("useWindowScroll"),n=pt("customScrollParent"),r=n||t?HV:BV,o=n||t?zV:jV,i=pt("context");return m.jsx(r,{...e,...lt(r,i),children:m.jsxs(o,{children:[m.jsx(VV,{}),m.jsx(LV,{}),m.jsx($V,{})]})})}),{useEmitter:Kw,useEmitterValue:pt,usePublisher:vn}=Ef(FV,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},RV),BV=If({useEmitter:Kw,useEmitterValue:pt,usePublisher:vn}),HV=_f({useEmitter:Kw,useEmitterValue:pt,usePublisher:vn});function Yw(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jt.WARN),t==="normal"?0:parseInt(t??"0",10)}const WV=e=>m.jsx(S.Fragment,{children:e.children}),qV={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},UV=[],KV=S.forwardRef(function(t,n){return m.jsx(et.ul,{...t,ref:n,className:"w-full overscroll-contain rounded-lg",children:m.jsx(Xn,{children:t.children})})}),YV=S.forwardRef(function({item:t,context:n,...r},o){return m.jsx(et.li,{...r,ref:o,className:"first:rounded-t-lg last:rounded-t-lg"})}),GV={List:KV,Item:YV},ni=44,ZV=S.forwardRef(({left:e,error:t,right:n,loading:r,options:o,container:i,rightLabel:a,interactive:s,emptyMessage:l,optionalText:c,labelClassName:u,feedback:d=null,hideLeft:h=!1,required:f=!1,dynamicOption:b=!1,...g},p)=>{const v=S.useRef(null),y=S.useRef(null),x=S.useRef(null),T=g.value??g.defaultValue??"",w=Et(),[E,k]=S.useState(()=>Math.min(320,ni*o.length)),[C,O]=S.useState(!1),[_,V]=S.useState(""),[L,R]=S.useState(T),[I,M]=S.useState(()=>o.find(Y=>Y.value===T)?.label??T),[H,D]=S.useState(null),A=S.useRef(UV),F=rf(C,"block-only"),N=b&&_!==""?[{value:_,label:_,"data-dynamic":"true"},...o]:o,W=()=>so.flushSync(()=>O(!0)),j=_?tf(N,"value",[{key:"value",value:_},{key:"label",value:_}]):N,Z=()=>{O(!1),k(0)},G=j.filter(Y=>Y.hidden!==!0),re=b?void 0:`^(${o.map(Y=>`${rd(Y.value)}${Y.label?"|"+rd(Y.label):""}`).join("|")})$`,{x:te,y:ee,strategy:B,refs:U,context:X}=tr({open:C,transform:!0,onOpenChange:O,placement:"bottom-start",whileElementsMounted:Ho,middleware:[Xi(4),Gb({padding:10,elementContext:"reference",apply(Y){const J=Y.elements.floating.querySelector("ul")?.getBoundingClientRect().height||0,ce=bi(U.reference.current,window.innerHeight),xe=Math.min(J<ni?ce:J,ce,Y.availableHeight),Ne=G.length===0?ni:Math.min(xe,ce,J),Ge=`${y.current.getBoundingClientRect().width}px`;Object.assign(Y.elements.floating.style,{width:Ge,maxWidth:Ge,height:Ne})}})]}),Q=Ix(X,qV),{getReferenceProps:z,getFloatingProps:ae,getItemProps:le}=nr([xr(X,{role:"listbox"}),br(X),Ns(X,{cols:0,listRef:A,loop:!0,virtual:!0,allowEscape:!0,activeIndex:H,selectedIndex:H,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0})]);S.useEffect(()=>{if(g.value){const Y=o.find($=>$.value===g.value);Y&&(M(Y.label??Y.value),R(g.value))}},[g.value,o.length]),S.useEffect(()=>{if(!C)return k(0);const Y=U.reference;if(Y.current===null)return;const $=bi(Y.current,window.innerHeight);setTimeout(()=>k(Math.min($,G.length*ni)),100)},[_,C,U.reference,G.length]),S.useEffect(()=>{const Y=U.reference.current;if(Y)return yi(Y)},[]);const be=(Y,$)=>{R(Y.value);const J=U.reference.current;if(!J)return;J?.setAttribute("data-value",Y.value),J.value=Y.value;const ce=new Event("change",{bubbles:!1,cancelable:!0});J.dispatchEvent(ce),g.onChange&&g.onChange(ce),M(Y.label??""),Z(),V(""),D($)},we=Y=>{const $=Y.target.value;return V($),!C&&$===""?O(!0):(Y.target.name=g.name||"",$?O(!0):g.onChange?.(Y))},Se=()=>{W(),V(""),U.reference.current?.focus()},Pe=()=>{D(Y=>Y===null?0:Y),W(),V("")},Te=()=>{U.reference.current?.setAttribute("data-value",""),V(""),R(""),M(""),Yh(U.reference.current),Z()},ve=g.id||g.name,Re=`${ve}-shadow`,de=G.length===0;return m.jsxs(na,{...g,left:e,error:t,ref:y,form:g.form,loading:r,name:g.name,feedback:d,hideLeft:h,required:f,title:g.title,container:i,rightLabel:a,interactive:s,id:Re,optionalText:c,componentName:"autocomplete",labelClassName:u,placeholder:g.placeholder,right:m.jsxs("span",{className:"flex items-center gap-0.5",children:[n,m.jsxs("button",{type:"button",className:"p-2 transition-colors link:text-primary md:p-1",onClick:Se,children:[m.jsx(Nu,{size:20}),m.jsx("span",{className:"sr-only",children:w.inputCaretDown})]}),L?m.jsx("button",{type:"button",onClick:Te,className:"p-2 transition-colors link:text-danger md:p-1",children:m.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.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:[m.jsx("input",{"data-shadow":"true",...z({...g,onFocus:Pe,pattern:re,onChange:we,id:Re,name:Re,ref:U.setReference,onClick:Y=>Y.currentTarget.focus(),onKeyDown(Y){if(Y.key==="Escape")return Y.currentTarget.blur(),Z();if(C){if(Y.key==="ArrowDown"){let $=$e.number(H)?H+1:0;return $>G.length-1&&($=0),x.current?.scrollIntoView({index:$}),D($)}if(Y.key==="ArrowUp"){let $=$e.number(H)?H-1:G.length-1;return $<0&&($=G.length-1),x.current?.scrollIntoView({index:$}),D($)}if(Y.key==="Enter"){if(H!==null&&G[H])return Y.preventDefault(),be(G[H],H);if(G.length===1)return Y.preventDefault(),be(G[0],0)}}}}),"data-value":L,"data-error":!!t,"data-name":ve,"data-target":ve,required:f,value:C?_:o.length===0?"":I||L,"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","text-base group-focus-within:border-primary group-hover:border-primary",g.className)}),m.jsx("input",{id:ve,name:ve,type:"hidden","data-origin":ve,ref:p,required:f,defaultValue:g.value||L||void 0}),m.jsx(yr,{preserveTabOrder:!0,children:C?m.jsx(Zr,{modal:!0,guards:!0,returnFocus:!1,context:X,initialFocus:-1,visuallyHiddenDismiss:!0,children:m.jsxs(et.div,{...ae({ref:Kn(F,U.setFloating),style:{...Q.styles,left:te,top:ee??0,position:B}}),initial:!1,"data-floating":"true",animate:{height:de?"auto":E},className:"isolate z-floating m-0 max-h-80 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating ease-in-out",onAnimationComplete:()=>{if(!C)return k(0);const $=U.floating.current.querySelectorAll("li").item(0),J=($?$.getBoundingClientRect().height:ni)*G.length;return so.flushSync(()=>k(J+10))},children:[de?m.jsx("div",{role:"option",className:"w-full border-b border-tooltip-border",children:m.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:l||w.autocompleteEmpty})}):null,m.jsx(Mf,{overscan:40,ref:x,hidden:de,data:G,style:{height:E-10},defaultItemHeight:ni,components:GV,scrollerRef:Y=>void(v.current=Y),className:"max-h-[calc(100%-2px)] overscroll-contain rounded-lg border-floating bg-floating-background p-0 text-foreground",itemContent:(Y,$)=>{const J=$.Render??WV,ce=L===$.value||L===$.label,xe=H===Y,Ne=$.label??$.value;return m.jsx("button",{"data-value":$.value,...le({ref:Ge=>void(A.current[Y]=Ge),role:"option",type:"button","aria-checked":ce,"aria-current":ce,"aria-selected":ce,"aria-busy":$.disabled,onClick:()=>be($,Y),className:`cursor-pointer min-h-10 hover:bg-floating-hover w-full p-2 text-left ${ce?"bg-primary-hover text-primary-foreground":""} ${xe?"bg-floating-hover text-floating-foreground":""}`}),children:m.jsx(J,{...g,label:$.label,value:$.value,children:Ne})})}})]})}):null})]})}),Lf=S.forwardRef(({children:e,asTask:t=!1,labelClassName:n,loading:r,error:o,className:i="",size:a,container:s,...l},c)=>{const u=l.disabled||r;return m.jsxs("label",{"aria-disabled":u,"data-disabled":u,"data-task":t,"data-component":"checkbox",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:[m.jsx("input",{...l,ref:c,disabled:u,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",i)}),e,m.jsx("span",{"data-name":"checkbox-label",className:ke("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:o})]})}),Gw=new Date(1970,11,31),Vf={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],hour:()=>[/\d/,/\d/],minute:()=>[/\d/,/\d/],literal:e=>e.split("")},Zw={day:()=>"dd",hour:()=>"HH",month:()=>"MM",minute:()=>"mm",year:()=>"yyyy",literal:e=>e},XV={literal:(e,t)=>t,hour:e=>e.getHours().toString(),year:e=>e.getFullYear().toString(),minute:e=>e.getMinutes().toString(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},$f=(e,t)=>{try{return e.formatToParts(t).map(n=>n.type==="literal"&&n.value===", "?{type:n.type,value:" "}:n)}catch{return[]}},QV=S.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,clickToClose:i,type:a,...s},l)=>{console.log(s.datetimeTitle,s);const c=td(t),u=S.useId(),d=Et(),h=S.useMemo(()=>new Intl.DateTimeFormat(c,a==="datetime"?{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}:{day:"numeric",month:"numeric",year:"numeric"}),[c,a]),[f,b]=S.useState(e||void 0),[g,p]=S.useState(!1),v=$f(h,Gw).flatMap(O=>$e.keyof(Vf,O.type)?Vf[O.type](O.value):[]),y=$f(h,Gw).reduce((O,_)=>O+($e.keyof(Zw,_.type)?Zw[_.type](_.value):""),""),[x,T]=S.useState(f?$f(h,f).reduce((O,_)=>O+($e.keyof(Vf,_.type)?XV[_.type](f,_.value):""),""):""),w=O=>{const _=O.target.value;if(T(_),v.length===_.length&&v.every((L,R)=>{const I=_.charAt(R);return typeof L=="string"?I===L:L.test(I)})){const L=JO(_,y,new Date),R=a==="datetime"?L:Hr(L);return b(R),r?.(R)}return b(void 0),r?.(void 0)},E=O=>(b(O),r?.(O),i&&p(!1),T(O?Ny(O,y):"")),k=$u(f),C=k?f.toISOString():void 0;return m.jsx(Ko,{...s,mask:v,value:x,id:void 0,name:void 0,"data-value":C,formNoValidate:!g,"data-target":s.name,"data-component":"date-picker",onChange:w,required:s.required??!0,error:g?void 0:s.error,placeholder:s.placeholder||y,right:m.jsxs(S.Fragment,{children:[m.jsx("input",{"data-origin":s.name,defaultValue:C,form:s.form,hidden:!0,id:s.name,name:s.name,ref:l,type:"date"}),m.jsx(Zo,{open:g,onChange:p,buttonProps:{"aria-describedby":u},trigger:m.jsxs("span",{"aria-labelledby":u,children:[m.jsx("span",{id:u,className:"sr-only",children:d.datePickerCalendarButtonLabel}),m.jsx(FI,{})]}),children:m.jsx(zx,{...s,type:a,locale:c,changeOnlyOnClick:!0,markToday:o,onChange:E,disabledDate:n,date:k?f:void 0})})]})})}),JV=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],e$=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],t$=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],n$=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Xw=(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},Qw=e=>{if(typeof e=="number")return Math.log10(e);const t=e.toString(10);return t.length+Math.log10("0."+t.slice(0,15))},r$=e=>typeof e=="number"?Math.log(e):Qw(e)*Math.log(10),o$=(e,t)=>{if(typeof e=="number")return e/t;const n=e/BigInt(t),r=e%BigInt(t);return Number(n)+Number(r)/t};function i$(e,t){if(typeof e!="bigint"&&!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?n$:t$:t.binary?e$:JV,r=t.space?" ":"";if(t.signed&&(typeof e=="number"?e===0:e===0n))return` 0${r}${n[0]}`;const o=e<0,i=o?"-":t.signed?"+":"";o&&(e=-e);let a;if(t.minimumFractionDigits!==void 0&&(a={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(a={maximumFractionDigits:t.maximumFractionDigits,...a}),e<1){const u=Xw(e,t.locale,a);return i+u+r+n[0]}const s=Math.min(Math.floor(t.binary?r$(e)/Math.log(1024):Qw(e)/3),n.length-1);e=o$(e,(t.binary?1024:1e3)**s),a||(e=e.toPrecision(3));const l=Xw(Number(e),t.locale,a),c=n[s];return i+l+r+c}var il={exports:{}},al={exports:{}},Xe={};/** @license React v16.13.1
222
+ Defaulting to \`null\`.`}var O2=r0,M2=i0,c0=["PageUp","PageDown"],u0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],d0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Go="Slider",[Hd,D2,N2]=Ux(Go),[f0,TB]=Ls(Go,[N2]),[F2,js]=f0(Go),p0=P.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:b,...g}=e,p=P.useRef(new Set),v=P.useRef(0),x=a==="horizontal"?L2:V2,[T=[],w]=Kx({prop:u,defaultProp:c,onChange:V=>{[...p.current][v.current]?.focus(),d(V)}}),E=P.useRef(T);function k(V){const L=B2(T,V);_(V,L)}function C(V){_(V,v.current)}function O(){const V=E.current[v.current];T[v.current]!==V&&h(T)}function _(V,L,{commit:R}={commit:!1}){const I=U2(i),M=K2(Math.round((V-r)/i)*i+r,I),H=n0(M,[r,o]);w((D=[])=>{const A=z2(D,H,L);if(q2(A,l*i)){v.current=A.indexOf(H);const F=String(A)!==String(D);return F&&R&&h(A),F?A:D}else return D})}return m.jsx(F2,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:v,thumbs:p.current,values:T,orientation:a,form:b,children:m.jsx(Hd.Provider,{scope:e.__scopeSlider,children:m.jsx(Hd.Slot,{scope:e.__scopeSlider,children:m.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...g,ref:t,onPointerDown:It(g.onPointerDown,()=>{s||(E.current=T)}),min:r,max:o,inverted:f,onSlideStart:s?void 0:k,onSlideMove:s?void 0:C,onSlideEnd:s?void 0:O,onHomeKeyDown:()=>!s&&_(r,0,{commit:!0}),onEndKeyDown:()=>!s&&_(o,T.length-1,{commit:!0}),onStepKeyDown:({event:V,direction:L})=>{if(!s){const M=c0.includes(V.key)||V.shiftKey&&u0.includes(V.key)?10:1,H=v.current,D=T[H],A=i*M*L;_(D+A,H,{commit:!0})}}})})})})});p0.displayName=Go;var[h0,m0]=f0(Go,{startEdge:"left",endEdge:"right",size:"width",direction:1}),L2=P.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,h]=P.useState(null),f=rn(t,x=>h(x)),b=P.useRef(void 0),g=f2(o),p=g==="ltr",v=p&&!i||!p&&i;function y(x){const T=b.current||d.getBoundingClientRect(),w=[0,T.width],k=Ud(w,v?[n,r]:[r,n]);return b.current=T,k(x-T.left)}return m.jsx(h0,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:m.jsx(g0,{dir:g,"data-orientation":"horizontal",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const T=y(x.clientX);a?.(T)},onSlideMove:x=>{const T=y(x.clientX);s?.(T)},onSlideEnd:()=>{b.current=void 0,l?.()},onStepKeyDown:x=>{const w=d0[v?"from-left":"from-right"].includes(x.key);c?.({event:x,direction:w?-1:1})}})})}),V2=P.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=P.useRef(null),d=rn(t,u),h=P.useRef(void 0),f=!o;function b(g){const p=h.current||u.current.getBoundingClientRect(),v=[0,p.height],x=Ud(v,f?[r,n]:[n,r]);return h.current=p,x(g-p.top)}return m.jsx(h0,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:m.jsx(g0,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const p=b(g.clientY);i?.(p)},onSlideMove:g=>{const p=b(g.clientY);a?.(p)},onSlideEnd:()=>{h.current=void 0,s?.()},onStepKeyDown:g=>{const v=d0[f?"from-bottom":"from-top"].includes(g.key);l?.({event:g,direction:v?-1:1})}})})}),g0=P.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=js(Go,n);return m.jsx(Rt.span,{...c,ref:t,onKeyDown:It(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):c0.concat(u0).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:It(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(h)?h.focus():r(d)}),onPointerMove:It(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:It(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),i(d))})})}),v0="SliderTrack",y0=P.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=js(v0,n);return m.jsx(Rt.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});y0.displayName=v0;var Wd="SliderRange",b0=P.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=js(Wd,n),i=m0(Wd,n),a=P.useRef(null),s=rn(t,a),l=o.values.length,c=o.values.map(h=>S0(h,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return m.jsx(Rt.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});b0.displayName=Wd;var qd="SliderThumb",x0=P.forwardRef((e,t)=>{const n=D2(e.__scopeSlider),[r,o]=P.useState(null),i=rn(t,s=>o(s)),a=P.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return m.jsx($2,{...e,ref:i,index:a})}),$2=P.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=js(qd,n),s=m0(qd,n),[l,c]=P.useState(null),u=rn(t,y=>c(y)),d=l?a.form||!!l.closest("form"):!0,h=E2(l),f=a.values[r],b=f===void 0?0:S0(f,a.min,a.max),g=R2(r,a.values.length),p=h?.[s.size],v=p?H2(p,b,s.direction):0;return P.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),m.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${b}% + ${v}px)`},children:[m.jsx(Hd.ItemSlot,{scope:e.__scopeSlider,children:m.jsx(Rt.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":f,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:f===void 0?{display:"none"}:e.style,onFocus:It(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&m.jsx(w0,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:f},r)]})});x0.displayName=qd;var j2="RadioBubbleInput",w0=P.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=P.useRef(null),i=rn(o,r),a=T2(t);return P.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("input",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),m.jsx(Rt.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});w0.displayName=j2;function z2(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function S0(e,t,n){const i=100/(n-t)*(e-t);return n0(i,[0,100])}function R2(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function B2(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function H2(e,t,n){const r=e/2,i=Ud([0,50],[0,r]);return(r-i(t)*n)*n}function W2(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function q2(e,t){if(t>0){const n=W2(e);return Math.min(...n)>=t}return!0}function Ud(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function U2(e){return(String(e).split(".")[1]||"").length}function K2(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Y2=p0,G2=y0,Z2=b0,X2=x0,Kd="ToastProvider",[Yd,Q2,J2]=Ux("Toast"),[T0,EB]=Ls("Toast",[J2]),[eF,zs]=T0(Kd),E0=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=e,[s,l]=P.useState(null),[c,u]=P.useState(0),d=P.useRef(!1),h=P.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Kd}\`. Expected non-empty \`string\`.`),m.jsx(Yd.Provider,{scope:t,children:m.jsx(eF,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:P.useCallback(()=>u(f=>f+1),[]),onToastRemove:P.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:a})})};E0.displayName=Kd;var k0="ToastViewport",tF=["F8"],Gd="toast.viewportPause",Zd="toast.viewportResume",C0=P.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=tF,label:o="Notifications ({hotkey})",...i}=e,a=zs(k0,n),s=Q2(n),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),h=rn(t,d,a.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;P.useEffect(()=>{const p=v=>{r.length!==0&&r.every(x=>v[x]||v.code===x)&&d.current?.focus()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),P.useEffect(()=>{const p=l.current,v=d.current;if(b&&p&&v){const y=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(Gd);v.dispatchEvent(E),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(Zd);v.dispatchEvent(E),a.isClosePausedRef.current=!1}},T=E=>{!p.contains(E.relatedTarget)&&x()},w=()=>{p.contains(document.activeElement)||x()};return p.addEventListener("focusin",y),p.addEventListener("focusout",T),p.addEventListener("pointermove",y),p.addEventListener("pointerleave",w),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{p.removeEventListener("focusin",y),p.removeEventListener("focusout",T),p.removeEventListener("pointermove",y),p.removeEventListener("pointerleave",w),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,a.isClosePausedRef]);const g=P.useCallback(({tabbingDirection:p})=>{const y=s().map(x=>{const T=x.ref.current,w=[T,...mF(T)];return p==="forwards"?w:w.reverse()});return(p==="forwards"?y.reverse():y).flat()},[s]);return P.useEffect(()=>{const p=d.current;if(p){const v=y=>{const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const w=document.activeElement,E=y.shiftKey;if(y.target===p&&E){c.current?.focus();return}const O=g({tabbingDirection:E?"backwards":"forwards"}),_=O.findIndex(V=>V===w);Jd(O.slice(_+1))?y.preventDefault():E?c.current?.focus():u.current?.focus()}};return p.addEventListener("keydown",v),()=>p.removeEventListener("keydown",v)}},[s,g]),m.jsxs(w2,{ref:l,role:"region","aria-label":o.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&m.jsx(Xd,{ref:c,onFocusFromOutsideViewport:()=>{const p=g({tabbingDirection:"forwards"});Jd(p)}}),m.jsx(Yd.Slot,{scope:n,children:m.jsx(Rt.ol,{tabIndex:-1,...i,ref:h})}),b&&m.jsx(Xd,{ref:u,onFocusFromOutsideViewport:()=>{const p=g({tabbingDirection:"backwards"});Jd(p)}})]})});C0.displayName=k0;var A0="ToastFocusProxy",Xd=P.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=zs(A0,n);return m.jsx(jd,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:a=>{const s=a.relatedTarget;!i.viewport?.contains(s)&&r()}})});Xd.displayName=A0;var ra="Toast",nF="toast.swipeStart",rF="toast.swipeMove",oF="toast.swipeCancel",iF="toast.swipeEnd",P0=P.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=e,[s,l]=Kx({prop:r,defaultProp:o??!0,onChange:i,caller:ra});return m.jsx(Yx,{present:n||s,children:m.jsx(lF,{open:s,...a,ref:t,onClose:()=>l(!1),onPause:Qr(e.onPause),onResume:Qr(e.onResume),onSwipeStart:It(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:It(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:It(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:It(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});P0.displayName=ra;var[aF,sF]=T0(ra,{onClose(){}}),lF=P.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:f,...b}=e,g=zs(ra,n),[p,v]=P.useState(null),y=rn(t,I=>v(I)),x=P.useRef(null),T=P.useRef(null),w=o||g.duration,E=P.useRef(0),k=P.useRef(w),C=P.useRef(0),{onToastAdd:O,onToastRemove:_}=g,V=Qr(()=>{p?.contains(document.activeElement)&&g.viewport?.focus(),a()}),L=P.useCallback(I=>{!I||I===1/0||(window.clearTimeout(C.current),E.current=new Date().getTime(),C.current=window.setTimeout(V,I))},[V]);P.useEffect(()=>{const I=g.viewport;if(I){const M=()=>{L(k.current),c?.()},H=()=>{const D=new Date().getTime()-E.current;k.current=k.current-D,window.clearTimeout(C.current),l?.()};return I.addEventListener(Gd,H),I.addEventListener(Zd,M),()=>{I.removeEventListener(Gd,H),I.removeEventListener(Zd,M)}}},[g.viewport,w,l,c,L]),P.useEffect(()=>{i&&!g.isClosePausedRef.current&&L(w)},[i,w,g.isClosePausedRef,L]),P.useEffect(()=>(O(),()=>_()),[O,_]);const R=P.useMemo(()=>p?N0(p):null,[p]);return g.viewport?m.jsxs(m.Fragment,{children:[R&&m.jsx(cF,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:R}),m.jsx(aF,{scope:n,onClose:V,children:gi.createPortal(m.jsx(Yd.ItemSlot,{scope:n,children:m.jsx(x2,{asChild:!0,onEscapeKeyDown:It(s,()=>{g.isFocusedToastEscapeKeyDownRef.current||V(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:m.jsx(Rt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:It(e.onKeyDown,I=>{I.key==="Escape"&&(s?.(I.nativeEvent),I.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:It(e.onPointerDown,I=>{I.button===0&&(x.current={x:I.clientX,y:I.clientY})}),onPointerMove:It(e.onPointerMove,I=>{if(!x.current)return;const M=I.clientX-x.current.x,H=I.clientY-x.current.y,D=!!T.current,A=["left","right"].includes(g.swipeDirection),F=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,N=A?F(0,M):0,W=A?0:F(0,H),j=I.pointerType==="touch"?10:2,Z={x:N,y:W},G={originalEvent:I,delta:Z};D?(T.current=Z,Rs(rF,d,G,{discrete:!1})):F0(Z,g.swipeDirection,j)?(T.current=Z,Rs(nF,u,G,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(M)>j||Math.abs(H)>j)&&(x.current=null)}),onPointerUp:It(e.onPointerUp,I=>{const M=T.current,H=I.target;if(H.hasPointerCapture(I.pointerId)&&H.releasePointerCapture(I.pointerId),T.current=null,x.current=null,M){const D=I.currentTarget,A={originalEvent:I,delta:M};F0(M,g.swipeDirection,g.swipeThreshold)?Rs(iF,f,A,{discrete:!0}):Rs(oF,h,A,{discrete:!0}),D.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),cF=e=>{const{__scopeToast:t,children:n,...r}=e,o=zs(ra,t),[i,a]=P.useState(!1),[s,l]=P.useState(!1);return pF(()=>a(!0)),P.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:m.jsx(t0,{asChild:!0,children:m.jsx(jd,{...r,children:i&&m.jsxs(m.Fragment,{children:[o.label," ",n]})})})},uF="ToastTitle",I0=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return m.jsx(Rt.div,{...r,ref:t})});I0.displayName=uF;var dF="ToastDescription",_0=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return m.jsx(Rt.div,{...r,ref:t})});_0.displayName=dF;var O0="ToastAction",fF=P.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?m.jsx(D0,{altText:n,asChild:!0,children:m.jsx(Qd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${O0}\`. Expected non-empty \`string\`.`),null)});fF.displayName=O0;var M0="ToastClose",Qd=P.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=sF(M0,n);return m.jsx(D0,{asChild:!0,children:m.jsx(Rt.button,{type:"button",...r,ref:t,onClick:It(e.onClick,o.onClose)})})});Qd.displayName=M0;var D0=P.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return m.jsx(Rt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function N0(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),hF(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...N0(r))}}),t}function Rs(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?qx(o,i):o.dispatchEvent(i)}var F0=(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 pF(e=()=>{}){const t=Qr(e);Yo(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function hF(e){return e.nodeType===e.ELEMENT_NODE}function mF(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 Jd(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var gF=E0,vF=C0,yF=P0,bF=I0,xF=_0,wF=Qd;const SF=e=>{const[t,n]=S.useState(!1),r=()=>n(!0),o=()=>n(!1);return S.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},TF=lo("relative isolate z-tooltip flex justify-between overflow-hidden whitespace-nowrap rounded-lg border text-sm shadow-shadow-notification",{variants:{theme:{default:"border-card-border bg-card-background text-foreground",info:"bg-alert-info-bg text-alert-info-text border-alert-info-border",warn:"bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",danger:"bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",success:"bg-alert-success-bg text-alert-success-text border-alert-success-border",secondary:"bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",muted:"bg-alert-muted-bg text-alert-muted-text border-alert-muted-border"}},defaultVariants:{theme:"default"}}),L0=S.createContext(()=>{throw new Error("Not implemented")}),EF=()=>S.useContext(L0),V0={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]}},kF=S.forwardRef(function(t,n){const r=t.closable??!0,o=t.duration,i=t.hover?"hover":t.isLast?"isLast":"other",a=TF({theme:t.theme||"default"});return m.jsx(yF,{ref:n,asChild:!0,forceMount:!0,onOpenChange:t.onClose,duration:o,children:m.jsx(et.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:V0[t.reversedIndex]||V0.default},transition:{type:"spring",mass:1.2,damping:30,stiffness:200},exit:{opacity:[.9,0],transition:{opacity:{bounce:.25,duration:.3}}},children:m.jsxs("div",{className:a,children:[m.jsxs("div",{className:"flex flex-col p-4",children:[t.title?m.jsx(bF,{className:"select-text truncate text-lg font-medium leading-relaxed",children:t.title}):null,m.jsx(xF,{className:"select-text truncate",children:t.text})]}),r?m.jsx(wF,{className:"absolute right-2 top-2 rounded-full p-1 text-foreground transition hover:bg-danger/10 hover:text-danger-hover",children:m.jsx(Ao,{className:"size-5"})}):null]})})})});function CF({children:e,max:t=5,duration:n=5e3}){const r=S.useRef(null),o=SF(r),[i,a]=S.useState([]),s=S.useCallback(()=>a([]),[]);S.useEffect(()=>s,[s]);const l=S.useCallback((c,u)=>{const d=window.crypto.randomUUID();return a(f=>{const b=[...f,{...u,id:d,text:c}];return b.length>t?b.slice(b.length-t,b.length+1):b}),{clear:s,close:()=>a(f=>f.filter(b=>b.id!==d))}},[t]);return m.jsxs(gF,{duration:n,swipeThreshold:150,children:[m.jsx(L0.Provider,{value:l,children:e}),m.jsx(et.ol,{children:m.jsx(Xn,{presenceAffectsLayout:!0,mode:"popLayout",children:i.map((c,u,d)=>{const h=()=>a(f=>f.filter(b=>b.id!==c.id));return S.createElement(kF,{...c,hover:o,index:u,key:c.id,onClose:h,isLast:d.length-1===u,reversedIndex:d.length-(u+1)})})})}),m.jsx(vF,{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 AF=e=>m.jsxs(O2,{max:e.max,value:e.percent,style:{transform:"translateZ(0)"},className:ke("overflow-hidden relative w-full rounded-full h-6 bg-background",e.container),children:[m.jsx(M2,{style:{transform:$e.number(e.percent)?`translateX(-${100-e.percent}%)`:void 0},className:ke("bg-primary transition-transform ease-in-out size-full duration-500",e.className)}),$e.number(e.percent)?m.jsx("p",{className:ke("flex absolute inset-0 justify-center items-center w-full font-semibold tabular-nums text-primary-foreground",e.textClassName),children:e.label?e.label:`${e.percent} %`}):null]}),PF=e=>m.jsxs("div",{className:"divide-y divide-card-border rounded-card border border-card-border bg-card-background shadow-shadow-card",children:[m.jsxs("header",{className:"flex items-start gap-4 p-6",children:[m.jsx("div",{className:ke("flex aspect-square size-10 items-center justify-center rounded-card bg-primary p-8",e.iconContainer),children:m.jsx("div",{children:m.jsx(e.Icon,{className:"aspect-square size-10 text-primary-foreground"})})}),m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("header",{children:m.jsx("h3",{className:"text-base leading-none",children:e.title})}),m.jsx("p",{className:"text-4xl font-semibold",children:e.children})]})]}),e.footer?m.jsx("footer",{className:"px-6 py-2",children:e.footer}):null]}),$0=(e,t)=>{const[n,r]=S.useState(()=>t||e);return S.useEffect(()=>{r(e)},[e]),[n,r]},j0={ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight"},z0=S.createContext(""),IF=e=>e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true",ef=(e,t,n)=>{const r=n==="forward"?1:-1,o=t+r;for(let i=o;i>=0&&i<e.length;i+=r){const a=e[i];if(!IF(a))return a}return n==="backward"?ef(e,e.length-1,"backward"):ef(e,-1,"forward")},R0=(e,t)=>{const n=Array.from(e.querySelectorAll("li")),r=n.findIndex(i=>i.dataset.active==="true");if(r===-1)return null;const o=ef(n,r,t);return o===null?null:(o.querySelector("button")?.focus({preventScroll:!1}),o.getAttribute("data-id")||"")},B0={[j0.ArrowLeft]:(e,t)=>R0(t,"backward"),[j0.ArrowRight]:(e,t)=>R0(t,"forward")},_F=e=>{const[t,n]=$0(e.active),r=S.useRef(null),o=ir(e.onChange);S.useEffect(()=>{const l=r.current;if(l===null)return;let c=l.querySelector("li[data-active=true]");if(c===null){c=l.querySelector("li[data-id]");const u=c.getAttribute("data-id")||"";n(u)}},[e.active,n]),S.useEffect(()=>{o.current&&o.current(t)},[o,t]);const i=S.Children.toArray(e.children),a=l=>{const c=l.currentTarget;n(c.dataset.id||"")},s=l=>{if(r.current===null)return;const c=l.key;if($e.keyof(B0,c)){const u=B0[c],d=u(l,r.current);if(d===null)return;n(d)}};return m.jsx(z0.Provider,{value:t,children:m.jsx($d,{className:e.className,container:ke("pt-0 max-w-full w-full min-w-0",e.container),header:m.jsxs("header",{className:"relative mb-2 overflow-x-auto",children:[m.jsx("div",{className:"absolute bottom-0 h-[1px] w-full bg-card-border"}),m.jsx("nav",{className:"min-w-0",children:m.jsx("ul",{onKeyDown:s,ref:r,className:"flex w-0 min-w-full flex-1 justify-start overflow-x-auto",children:i.map(l=>{const c=l.props,u=t===c.id;return m.jsx("li",{"data-id":c.id,"data-active":u,"aria-disabled":c.disabled,className:ke("relative w-fit border-b border-transparent transition-all",u?"border-primary font-medium text-primary":"",c.disabled?"aria-disabled:text-disabled":""),children:m.jsx(un,{as:"button",type:"button","data-id":c.id,"aria-current":"page",disabled:c.disabled,onClick:c.disabled?void 0:a,className:"block w-full whitespace-nowrap px-10 py-4 disabled:cursor-not-allowed",children:c.title})},`tab-header-${c.id}`)})})})]}),children:e.children})})},OF=()=>S.useContext(z0),MF=e=>{const t=OF();return m.jsx(S.Fragment,{children:e.id===t?e.children:null})},Bs=e=>m.jsxs("li",{"data-component":"timeline-item",className:"relative pb-12",role:"listitem",children:[m.jsx("span",{"aria-hidden":"true",className:"absolute left-6 top-8 -ml-px h-full w-0.5 bg-card-border"}),m.jsx("div",{className:"relative flex items-stretch justify-start space-x-3",children:e.children})]});Bs.Icon=function(t){return m.jsx("header",{...t,className:ke("flex size-12 items-center justify-center rounded-full bg-primary p-2 text-primary-foreground",t.className),children:t.children})},Bs.Body=function(t){return m.jsx(un,{...t,className:ke("min-w-0 flex-1",t.className),children:t.children})},Bs.Right=function(t){return m.jsx("footer",{className:"flex gap-6 self-stretch px-4 align-baseline",children:m.jsx(un,{...t,type:"button"})})};const DF=e=>m.jsx("ul",{"data-component":"timeline",role:"list",className:"flow-root [&>li:last-child>span[aria-hidden=true]]:hidden",children:e.children}),NF=({item:e,context:t,setter:n,get:r,refs:o})=>m.jsx(yr,{children:m.jsx(bg,{reducedMotion:"user",transition:{type:"tween",stiffness:25,duration:.3},children:m.jsxs(Xn,{presenceAffectsLayout:!0,children:[e?m.jsx(et.div,{exit:{opacity:0},animate:{opacity:1},initial:{opacity:0},className:"pointer-events-none fixed inset-0 top-0 z-overlay h-screen w-screen bg-floating-overlay/70"}):null,e?m.jsx(Md,{lockScroll:!0,className:"absolute inset-0 z-floating flex items-center justify-center",children:m.jsx(Zr,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:t,children:m.jsxs(et.div,{layout:!0,layoutId:`item-${e.id}`,className:"relative flex h-min w-min min-w-xs flex-col gap-4 rounded-card border border-card-border bg-card-background p-6 py-4 pb-8 shadow-shadow-card",ref:o.setFloating,...r(),children:[m.jsx("nav",{className:"absolute right-4 top-1 lg:right-2",children:m.jsx("button",{type:"button",onClick:n,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:m.jsx(Ao,{})})}),m.jsxs("header",{className:"flex w-full flex-wrap items-center justify-between gap-2",children:[m.jsx("h3",{className:"min-w-full text-balance text-2xl font-medium",children:e.title}),m.jsx("p",{className:"text-sm leading-snug text-secondary",children:e.description})]}),e.children]})})}):null]})})}),FF=e=>{const[t,n]=S.useState(null),r=S.useId(),{context:o,refs:i}=tr({open:t!==null,transform:!0,onOpenChange:h=>h?void 0:n(null)}),a=qo(o),s=xr(o,{role:"dialog"}),l=br(o,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:c}=nr([a,s,l]),u=S.useCallback(()=>{n(null)},[]),d=S.Children.toArray(e.children);return m.jsxs(S.Fragment,{children:[m.jsx(NF,{refs:i,context:o,get:c,item:t,setter:u}),m.jsx("ul",{role:"list",children:d.map((h,f)=>{const b=h.props,g=`${r}-${f}`,p=()=>n({...b,id:g}),v=b.leading;return m.jsx(et.li,{layout:!0,layoutId:`item-${g}`,className:"border-b border-card-border py-2 last:border-transparent",children:m.jsx(et.div,{layoutId:`toast-${g}`,className:"relative",children:m.jsx("div",{className:"relative flex items-start space-x-3",children:m.jsxs(S.Fragment,{children:[b.avatar?m.jsx("div",{children:m.jsx("div",{className:"relative px-1",children:m.jsx("button",{onClick:p,className:"flex size-10 items-center justify-center ring-primary",children:b.avatar})})}):null,m.jsx("div",{className:"min-w-0 flex-1 py-1 text-foreground",children:m.jsxs("div",{className:"flex flex-row flex-nowrap justify-between gap-4",children:[m.jsxs("button",{onClick:p,className:"cursor-pointer text-left transition-all ease-out hover:text-primary",children:[m.jsx("h3",{children:b.title}),m.jsx("p",{className:"text-sm leading-snug text-secondary",children:b.description})]}),v?m.jsx(v,{open:p}):null]})})]})})})},g)})})]})},LF=e=>m.jsx(S.Fragment,{children:e.children}),VF=/Mac|iPod|iPhone|iPad/,Hs=()=>VF.test(navigator.userAgent),$F=e=>e.split("+").map(t=>{const n=t.trim();return n==="Mod"?Hs()?"Meta":"Control":n==="Hyper"?Hs()?"Meta+Shift+Alt":"Control+Shift+Alt":n}),H0=e=>e.map(t=>t.trim()).join("+");class jF{constructor(t=[]){this.combinations=[],this.combinations=this.combinations.concat(t),this.combinations.forEach(n=>{this.add(n.key,n.fn)})}add(t,n){const r=H0($F(t));if(!this.combinations.find(o=>o.key===r))return this.combinations.push({fn:n,key:r}),this}register(){const t=new AbortController,n=r=>{const o=r.target;if((o.tagName==="INPUT"||o.tagName==="TEXTAREA")&&o.getAttribute("data-combikeysbypass")!=="true")return;const i=new Set;if(r.metaKey&&i.add("Meta"),r.ctrlKey&&i.add("Control"),r.altKey&&i.add("Alt"),r.key.charCodeAt(0)>127){const s=r.code.replace(/^Digit/,"").replace(/^Key/,"");i.add(r.shiftKey?s.toUpperCase():s.toLowerCase())}else i.add(r.shiftKey?r.key.toUpperCase():r.key);const a=H0(Array.from(i));this.combinations.forEach(s=>{if(s.key===a)return r.preventDefault(),void s.fn(r)})};return window.addEventListener("keydown",n,{signal:t.signal}),()=>t.abort()}}class wn extends Map{constructor(t){super(t),this.list=[],this.list=[],Array.isArray(t)&&(this.list=t),t instanceof wn&&(this.list=Array.from(t.entries()))}set(t,n){return super.set(t,n),this.list=(this.list??[]).concat([[t,n]]),this}remove(t){return super.delete(t),this.list=Array.from(this.entries())??[],this}map(t){return this.list.map((n,r)=>t(n[1],r))}clone(t){const n=new wn(this);return t?t(n):n}static from(t,n){return new wn(t.map(r=>[n(r),r]))}static unique(t,n){return Array.from(wn.from(t,n).values())}toArray(){return Array.from(this.values())}}const zF=(e,t)=>{e=String(e).toLocaleLowerCase(),t=String(t).toLocaleLowerCase();const n=t[0],r=e.split("").map((a,s)=>a===n?s:!1).filter(a=>a!==!1);if(r.length===0)return null;const o=[];if(r.forEach(a=>{let s=a+1;const l=[a];for(let c=1;c<t.length;c++){const u=t[c];if(s=e.indexOf(u,s),s===-1)return;l.push(s),s++}o.push(l)}),o.length===0)return null;const i=o.sort((a,s)=>{if(a.length===1)return a[0]-s[0];const l=a[a.length-1]-a[0],c=s[s.length-1]-s[0];return l-c})[0];return e===t?1:i.length>1?2+(i[i.length-1]-i[0]):2+i[0]},W0=(e,t,n)=>{const r=e.split(t).filter(Boolean);let o=n;for(const i of r){if(o==null)return o;o=o[i]}return o},q0={basic:/[,[\]]+?/,extend:/[,[\].]+?/},U0=(e,t)=>{const n=W0(t,q0.basic,e);return n!==void 0&&n!==e?n:W0(t,q0.extend,e)},K0=e=>e.replace(/[^0-9]/g,""),Ws=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),Y0=(e,t,n,r="FUZZY")=>r==="CONTAINS"?e.includes(t):r==="EQUAL"?e===t:r==="CONTAINS_NUMBERS"?K0(e).includes(K0(t)):r==="STARTS_WITH"?e.startsWith(t):r==="ENDS_WITH"?e.endsWith(t):r==="FUZZY"?zF(e,t)!==null:!1,RF=(e,t,n,r="FUZZY")=>Array.isArray(t)?t.some(o=>Y0(e,o,n,r)):Y0(e,t,n,r),tf=(e,t,n)=>{if(n.length===0)return e;const r=new Map,o=n.map(i=>({...i,value:$e.array(i.value)?i.value.map(Ws):Ws(`${i.value}`)}));return e.forEach(i=>{const a=U0(i,t);o.forEach(s=>{const l=U0(i,s.key);if(!l)return;const c=Ws(`${s.value}`.toLocaleLowerCase()).trim(),u=Ws(`${l}`.toLocaleLowerCase()).trim();if(RF(u,c,s.score,s.match))return void r.set(a,i);$e.function(s.ifNotMatch)&&s.ifNotMatch(c,u)&&r.set(a,i)})}),Array.from(r.values())},BF=e=>(e=e.trim(),e==="Alt"?Hs()?m.jsx(WI,{"aria-label":"Option",size:14}):"Alt":e==="Mod"?Hs()?m.jsx($I,{"aria-label":"Command",size:14}):"Ctrl":e),HF=e=>{const t=e.value.trim().split("+");return m.jsx("span",{className:"flex items-center gap-1",children:t.map((n,r)=>{const o=t.length-1===r;return m.jsxs(S.Fragment,{children:[m.jsx("kbd",{"aria-label":n,children:BF(n)}),o?null:m.jsx("span",{children:"+"})]},`${e.value}-${n}-key-${r}`)})})},nf=m.jsx("div",{className:"h-2 w-10/12 animate-pulse rounded bg-table-border"}),WF=(e,t)=>dr()?t:window.matchMedia(e).matches,qF=(e,t=!0)=>{const[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=window.matchMedia(e),i=()=>r(WF(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},G0=()=>window.matchMedia("@media (pointer: coarse)"),UF=()=>{const e=S.useRef(dr()?null:G0()),[t,n]=S.useState(dr()?!1:e.current?.matches??!1);return S.useEffect(()=>{(e.current===null?G0():e.current).addEventListener("change",o=>n(o.matches))},[]),t},rf=(e,t="overflow-hidden")=>{const n=S.useRef(null),r=UF(),o=S.useRef(dr()?"":document.documentElement.style.overflowY);return S.useEffect(()=>{if(!(n.current===null&&!e)&&t!=="block-only"&&t==="overflow-hidden")if(e){if(o.current=document.documentElement.style.overflowY,document.documentElement.style.overflowY="hidden",r||pb())return;document.documentElement.style.padding=Gh(document.documentElement)?"0 15px 0 0":""}else document.documentElement.style.padding="",document.documentElement.style.overflowY=o.current},[e,r,t]),S.useEffect(()=>{if(!e)return;const i=new AbortController,a=document.documentElement,s=l=>{const c=n.current;if(c&&c.contains(l.target)){const u=c.getBoundingClientRect(),d=c.style.height?Number(kT(c.style.height)):null,h=$e.number(d)?d:u.height,f=c.scrollHeight<=h;return h===c.scrollHeight?e?l.preventDefault():void 0:f?void 0:e?l.preventDefault():void 0}return l.currentTarget===document.documentElement,e?l.preventDefault():void 0};return a.addEventListener("wheel",s,{signal:i.signal,passive:!1}),a.addEventListener("scroll",s,{signal:i.signal,passive:!1}),()=>{i.abort()}},[e]),n},KF=Wx,Sn="500ms",YF={exit:{x:["0%","-30%"],opacity:0,animationDuration:Sn},enter:{x:["-30%","0%"],opacity:1,animationDuration:Sn},initial:{x:["-30%","0%"],opacity:.8,animationDuration:Sn}},GF={initial:{x:["30%","0%"],opacity:.8},enter:{x:"0%",opacity:1,animationDuration:Sn},exit:{x:["0%","30%"],opacity:0,animationDuration:Sn}},of={drawer:e=>e==="left"?YF:GF,sheet:{initial:{opacity:.5,y:"25%",animationDuration:Sn,transformOrigin:"bottom"},enter:{opacity:1,y:"0%",animationDuration:Sn,transformOrigin:"bottom"},exit:{opacity:.1,y:"50%",animationDuration:Sn,transformOrigin:"bottom"}},dialog:{exit:{opacity:0,scale:.95,animationDuration:Sn},initial:{opacity:.5,scale:.95,animationDuration:Sn,transition:{duration:.5,ease:"easeInOut"}},enter:{opacity:1,scale:[1.05,1],animationDuration:Sn}}},ZF=lo("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 max-h-[calc(100vh-15%)] max-h-[calc(100svh-5%)] h-screen 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"}}),Z0={top:0,left:0,right:0,bottom:0},X0=e=>e*.6,XF=e=>{const t=(n,r)=>{if(e.parent.current){if(!e.sheet){const u=e.parent.current,d=e.value.get()||u.getBoundingClientRect().width,h=e.position==="right"?-r.delta.x:r.delta.x,f=Math.abs(d+h);return e.value.set(f)}const i=e.parent.current.getBoundingClientRect(),a=e.value.get()||i.height,s=Math.abs(a-r.delta.y),l=window.outerHeight,c=X0(l);return s>=c?e.value.set(s):(document.activeElement instanceof HTMLElement&&document.activeElement?.blur(),e.onChange(!1),setTimeout(()=>e.value.set(void 0),350))}};return m.jsx(et.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:Z0,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?m.jsx("div",{className:"h-2 w-1/4 rounded-lg bg-floating-border"}):null})},qs={drawer:"right",sheet:"none",dialog:"none"},QF=(e,t,n,r)=>{const o=n||"dialog";return e?n==="drawer"?r??qs.drawer:qs[o]:t?qs[o]:qs.sheet},JF=[],af=S.forwardRef(({open:e,title:t,footer:n,asChild:r,trigger:o,children:i,onChange:a,ariaTitle:s,className:l,bodyClassName:c,resizer:u=!0,animated:d=!0,closable:h=!0,forceType:f=!1,layoutId:b=void 0,overlayClassName:g="",type:p="dialog",position:v,overlayClickClose:y=!1,role:x="dialog",interactions:T=JF,...w},E)=>{const k=rf(e,"block-only"),C=S.useId(),O=S.useId(),_=qF("(min-width: 64rem)"),V=p!=="dialog",L=QF(_,f,p,v),R=_||f?of[p]:of.sheet,I=typeof R=="function"?R(L):R,M=_||f?p:"sheet",H=tr({open:e,onOpenChange:a}),D=qo(H.context,{}),A=xr(H.context,{role:x}),F=br(H.context,{escapeKey:!0,outsidePress:y}),N=nr([D,A,F].concat(T)),W=o,j=qa(void 0);S.useEffect(()=>{j.set(void 0)},[M]);const Z=()=>a(!1);S.useImperativeHandle(E,()=>({context:H.context,floating:k.current}),[H.context,k]);const G=(ee,B)=>{const U=H.refs.floating;if(U.current&&M==="sheet"){const Q=U.current.getBoundingClientRect(),z=j.get()||Q.height,ae=Math.abs(z-B.delta.y),le=X0(window.outerHeight);return ae<le?(Z(),setTimeout(()=>j.set(window.outerHeight),350)):j.set(ae)}},re={layoutId:b,layout:!0,exit:"exit",animate:"enter",initial:"initial",variants:I},te=d&&M==="sheet"?{...re,dragElastic:0,onDrag:G,dragConstraints:Z0,dragListener:!0,dragMomentum:!0,dragPropagation:!0,dragSnapToOrigin:!0,dragDirectionLock:!0,draggable:M==="sheet",drag:M==="sheet"?"y":"x"}:re;return m.jsxs(S.Fragment,{children:[o?m.jsx(S.Fragment,{children:r?m.jsx(KF,{ref:H.refs.setReference,...N.getReferenceProps({layoutId:b}),children:W}):m.jsx(et.button,{ref:H.refs.setReference,...N.getReferenceProps(),layoutId:b,type:"button",children:W})}):null,m.jsx(yr,{preserveTabOrder:!0,children:m.jsx(Xn,{propagate:!0,mode:"wait",initial:!1,children:e?m.jsx(Md,{lockScroll:!0,className:ke("inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70",M==="drawer"?"":"flex items-start justify-center p-10",g),children:m.jsx(Zr,{guards:!0,visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:H.context,children:m.jsxs(et.div,{...w,...te,...t?{"aria-labelledby":C,"aria-describedby":O}:{"aria-label":s},...N.getFloatingProps({"aria-modal":e,ref:Kn(H.refs.setFloating,k),className:ke(ZF({position:L,type:M}),l,"overscroll-contain")}),"data-component":"modal",style:M==="drawer"?{width:j}:{height:j},children:[t?m.jsx("header",{className:"relative w-full",children:t?m.jsx("h2",{id:C,className:"select-text border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed",children:t}):null}):null,m.jsx("section",{"data-component":"modal-body",className:ke("flex-1 select-text overflow-y-auto px-8 py-1",c),children:i}),n?m.jsx("footer",{className:"w-full select-text border-t border-floating-border px-8 pt-4",children:n}):null,h?m.jsx("nav",{className:"absolute right-4 top-1 z-floating",children:m.jsx("button",{type:"button",onClick:Z,className:"p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",children:m.jsx(Ao,{})})}):null,V&&u?m.jsx(XF,{onChange:a,value:j,sheet:M==="sheet",position:L,parent:H.refs.floating}):null]})})}):null},C)})]})}),eL=e=>m.jsx("span",{className:"flex h-full items-center text-left text-sm font-medium text-secondary",children:yc(e.item.title)?m.jsx(e.item.title,{text:e.text}):e.item.title}),tL=S.forwardRef((e,t)=>{const n=S.useId(),r=e.active,o=e.item;return o.type==="group"?m.jsx("div",{id:n,className:"h-10 px-2 pb-1 pt-2",children:m.jsx(eL,{text:e.text,item:o})}):o.type!=="shortcut"?m.jsx(S.Fragment,{}):m.jsxs("button",{...e,id:n,ref:t,role:"option",type:"button","aria-selected":r,"data-component":"command-palette-item",className:ke("flex h-10 items-center justify-between rounded-lg p-2 hover:bg-floating-hover",r?"bg-floating-hover":""),children:[m.jsxs("span",{className:"flex items-center gap-2",children:[o.Icon?o.Icon:null,m.jsx("span",{children:yc(o.title)?m.jsx(o.title,{text:e.text}):o.title})]}),o.shortcut?m.jsx(HF,{value:o.shortcut}):null]})}),nL=(e,t)=>{if(t.length===0)return e;const n=[{key:"title",value:t},{key:"shortcut",value:t},{key:"hint",value:t}],r=e.map(s=>({...s,title:$e.function(s.title)?s.title({text:t}):s.title})),o=r.reduce((s,l)=>{const c=$e.function(l.enabled)?l.enabled({text:t}):l.enabled??!0;return c&&s.push({...l,enabled:c}),s},[]),i=tf(o,"title",n),a=r.filter(s=>$e.function(s.enabled)?s.enabled({text:t}):!1);return wn.unique(i.concat(a),s=>s.title)},rL=[0,0,0,0,0],oL=e=>{const t=e.bind??"Mod + k",n=S.useRef([]),r=Et(),[o,i]=S.useState(""),a=ir(o),s=S.useId(),l=S.useRef(null),[c,u]=S.useState(null),d=tr({open:e.open,strategy:"absolute",onOpenChange:e.onChangeVisibility,whileElementsMounted:Ho}),h=Ns(d.context,{listRef:n,loop:!0,activeIndex:c,virtual:!0,allowEscape:!0,scrollItemIntoView:!0,onNavigate:y=>u(x=>$e.number(y)?y:e.open?x??0:null)}),{getItemProps:f}=nr([h]),b=e.commands.flatMap(y=>y.type==="group"?[y,...y.items]:[y]),g=nL(b,o),p=o===""?b:[{type:"group",title:"Results",items:[]},...g.filter(y=>y.type!=="group")];S.useEffect(()=>{const y=new jF;return y.add(t,()=>e.onChangeVisibility?.(!0)),b.forEach(x=>{x.type!=="group"&&x.type==="shortcut"&&x.shortcut!==void 0&&y.add(x.shortcut,T=>x.action({event:T,text:a.current,setOpen:e.onChangeVisibility}))}),y.register()},[t]);const v=e.Icon??hy;return m.jsx(S.Fragment,{children:m.jsxs(af,{ref:l,animated:!1,closable:!1,open:e.open,overlayClickClose:!0,interactions:[h],ariaTitle:"Command palette",bodyClassName:"px-0 py-0 pt-2","data-component":"command-palette",onChange:e.onChangeVisibility,className:"container relative py-0 md:max-w-screen-sm lg:max-w-screen-md",children:[m.jsxs("header",{className:"sticky top-0 isolate z-floating flex h-12 w-full items-center border-b border-floating-border bg-floating-background px-4",children:[m.jsx("div",{className:"flex size-10 items-center justify-center",children:m.jsx(v,{Default:hy,text:o,size:16})}),m.jsx("input",{autoFocus:!0,value:o,"data-combikeysbypass":"true",placeholder:"Search for...",onChange:y=>i(y.target.value),className:"h-12 w-full items-center bg-transparent px-2 py-2 pb-2 text-left text-lg outline-none",onKeyDown:y=>{if((y.key==="ArrowDown"||y.key==="ArrowUp")&&c!==null&&n.current[c]?.scrollIntoView({block:"start",inline:"start"}),y.key==="Enter"){if(c!==null&&p[c]){y.preventDefault();const x=p[c],T=y.currentTarget.value;if(x.type==="shortcut")return x.action({event:y,setOpen:e.onChangeVisibility,text:T})}if(p.length===1){y.preventDefault();const x=p[0],T=y.currentTarget.value;if(x.type==="shortcut")return x.action({event:y,setOpen:e.onChangeVisibility,text:T})}}}})]}),e.loading?m.jsxs("ul",{role:"listbox","data-component":"command-palette-list",className:"my-2 flex max-h-96 w-full origin-[top_center] flex-col gap-1 overflow-y-auto px-2",children:[m.jsx("div",{className:"h-10 px-2 pb-1 pt-2",children:r.commandPaletteLoading}),rL.map((y,x)=>m.jsx("li",{className:ke("flex h-10 items-center justify-between rounded-lg p-2 hover:bg-primary hover:text-primary-foreground"),children:nf},`${s}-${x}-skeleton-index`))]}):m.jsxs("div",{className:"flex min-w-full flex-row flex-nowrap","data-component":"command-palette-container",children:[m.jsxs("ul",{role:"listbox","data-component":"command-palette-list",className:"my-2 flex h-fit max-h-96 w-full origin-[top_center] flex-col gap-1 overflow-y-auto px-2",children:[p.map((y,x)=>S.createElement(tL,{...f({onMouseEnter:()=>u(x),ref(T){n.current[x]=T},onClick(T){T.preventDefault(),e.onChangeVisibility(!1),d.refs.domReference.current?.focus(),y.type==="shortcut"&&y.action({event:T,setOpen:e.onChangeVisibility,text:o})}}),item:y,text:o,active:c===x,key:`${s}-${y.type}-${x}`})),p.length===1?m.jsx("div",{className:ke("flex items-center justify-between rounded-lg p-2 text-secondary"),children:r.commandPaletteEmpty??e.emptyMessage}):null]}),e.Preview&&$e.number(c)?m.jsx(e.Preview,{command:p[c],text:o}):null]}),e.footer?m.jsx("footer",{className:"flex h-8 items-center rounded-b-lg bg-background p-2",children:e.footer}):null]})})},Zo=e=>{const t=S.useId(),[n,r]=S.useState(e.open);S.useEffect(()=>r(e.open),[e.open]);const o=S.useRef(null),i=S.useMemo(()=>[Xi(10),Ad({fallbackAxisSideDirection:"end"}),Cd(),Zb({padding:5,element:o})],[e.arrow]),{refs:a,floatingStyles:s,context:l}=tr({open:n,middleware:i,transform:!0,whileElementsMounted:Ho,onOpenChange:(b,g)=>{const p=g?.relatedTarget;p&&p.dataset.floating==="true"&&!b||(r(b),e.onChange?.(b))}}),c=qo(l),u=br(l),d=xr(l,{role:"tooltip"}),{getReferenceProps:h,getFloatingProps:f}=nr([c,u,d]);return m.jsxs(S.Fragment,{children:[m.jsx("button",{ref:a.setReference,...h(e.buttonProps),type:"button",children:e.trigger}),n&&m.jsx(yr,{preserveTabOrder:!0,id:`${t}-portal`,children:m.jsx(Zr,{guards:!0,restoreFocus:!0,returnFocus:!0,visuallyHiddenDismiss:!0,context:l,modal:!1,children:m.jsxs("div",{className:"relative isolate z-floating min-w-96 rounded-lg border border-floating-border bg-floating-background p-4 shadow-shadow-floating",ref:a.setFloating,style:s,"aria-labelledby":t,...f(),children:[m.jsx(ox,{ref:o,context:l,strokeWidth:.1,className:"fill-floating-background stroke-floating-border"}),m.jsx("header",{className:"mb-2",children:m.jsx("h3",{className:"text-left text-2xl font-medium leading-snug tracking-wide",children:e.title})}),e.children]})})})]})},iL=e=>{const t=S.useRef(null),n=S.useId(),r=`${n}:wrapper`,o=`${n}:title`,[i,a]=S.useState(e.open??!1);S.useEffect(()=>{a(e.open??!1)},[e.open]);const{context:s,refs:l}=tr({transform:!0,open:i!==null,nodeId:n,onOpenChange:a,strategy:"absolute"}),c=qo(s,{enabled:e.disabled??!0}),u=xr(s,{role:"tooltip"}),d=br(s,{escapeKey:!0,referencePress:!0,outsidePress:!0}),{getFloatingProps:h,getReferenceProps:f}=nr([c,u,d]);return m.jsxs("div",{className:"relative inline-flex items-center justify-center",ref:t,children:[m.jsx(ka,{...f(e),as:et.button,layoutId:r,ref:l.setReference,size:"small",onClick:()=>a(!0),children:m.jsx(et.span,{layoutId:o,children:e.trigger})}),m.jsx(Xn,{children:i?m.jsx(yr,{root:t,children:m.jsx(Zr,{visuallyHiddenDismiss:!0,modal:!0,closeOnFocusOut:!0,context:s,children:m.jsx(et.div,{...h(),ref:l.setFloating,layoutId:r,className:"absolute -left-1/4 -top-3/4",children:e.children})})}):null})]})},Q0=(e="")=>ke("w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left","hover:bg-primary focus:bg-primary aria-expanded:opacity-80","focus:text-primary-foreground hover:text-primary-foreground","first-of-type:rounded-t-lg last-of-type:rounded-b-lg","disabled:opacity-40 disabled:cursor-not-allowed",e),sf=S.createContext({isOpen:!1,activeIndex:null,getItemProps:()=>({}),setActiveIndex:()=>{},setHasFocusInside:()=>{}}),J0=S.forwardRef(({children:e,FloatingComponent:t="div",hover:n=!0,open:r,isParent:o=!1,restoreFocus:i=!1,floatingClassName:a="",label:s,...l},c)=>{const[u,d]=S.useState(r??!1),[h,f]=S.useState(!1),[b,g]=S.useState(null),p=S.useRef([]),v=S.useRef([]),y=S.useContext(sf),x=gr(),T=vr(),w=hN(),E=Qb(),k=x!==null,{floatingStyles:C,refs:O,context:_}=tr({nodeId:w,open:u,transform:!0,strategy:"absolute",onOpenChange:d,whileElementsMounted:Ho,placement:k?"right":"bottom-start",middleware:[Xi({mainAxis:k?0:4,alignmentAxis:k?-4:0}),Ad(),Cd()]}),V=xr(_,{role:"menu"}),L=br(_,{bubbles:!0}),R=cx(_,{move:!1,enabled:n,delay:{open:Mx},handleClose:Ox({blockPointerEvents:!0,requireIntent:!1})}),I=qo(_,{toggle:!k,event:"mousedown",ignoreMouse:k,keyboardHandlers:!0}),M=Ns(_,{loop:!0,activeIndex:b,nested:k,listRef:p,onNavigate:g}),H=jN(_,{activeIndex:b,listRef:v,resetMs:BN,onMatch:u?g:void 0}),{getReferenceProps:D,getFloatingProps:A,getItemProps:F}=nr([R,I,V,L,M,H]);S.useEffect(()=>{if(!T)return;const W=()=>d(!1),j=Z=>{Z.nodeId!==w&&Z.parentId===x&&d(!1)};return T.events.on("click",W),T.events.on("menuopen",j),()=>{T.events.off("click",W),T.events.off("menuopen",j)}},[T,w,x]),S.useEffect(()=>{u&&T&&T.events.emit("menuopen",{parentId:x,nodeId:w})},[T,u,w,x]);const N=o?l.className:ke(Q0(l.className));return m.jsxs(mN,{id:w,children:[m.jsx(S.Fragment,{children:l.asChild?m.jsx(Wx,{...D(y.getItemProps({...l,onFocus(W){l.onFocus?.(W),f(!1),y.setHasFocusInside(!0)}})),children:s,className:N,"data-open":u?"":void 0,"data-nested":k?"":void 0,role:k?"menuitem":void 0,"data-focus-inside":h?"":void 0,ref:Kn(O.setReference,E.ref,c),tabIndex:k?y.activeIndex===E.index?0:-1:void 0}):m.jsxs("button",{type:"button",className:N,"data-open":u?"":void 0,"data-nested":k?"":void 0,role:k?"menuitem":void 0,"data-focus-inside":h?"":void 0,ref:Kn(O.setReference,E.ref,c),tabIndex:k?y.activeIndex===E.index?0:-1:void 0,...D(y.getItemProps({...l,onFocus(W){l.onFocus?.(W),f(!1),y.setHasFocusInside(!0)}})),children:[s,k&&m.jsxs("span",{style:{marginLeft:10,fontSize:10},children:[m.jsx("span",{className:"sr-only",children:"Next menu"}),m.jsx(Fu,{size:14})]})]})}),m.jsx(sf.Provider,{value:{activeIndex:b,setActiveIndex:g,getItemProps:F,setHasFocusInside:f,isOpen:u},children:m.jsx(lN,{elementsRef:p,labelsRef:v,children:u&&m.jsx(yr,{preserveTabOrder:!0,children:m.jsx(Zr,{context:_,modal:!1,initialFocus:k?-1:0,returnFocus:o?i:!k,children:m.jsx(t,{...A(),ref:O.setFloating,style:{...l.style,...C},className:ke("isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-none",a),children:e})})})})})]})}),aL=S.forwardRef(({title:e,Right:t,disabled:n,children:r,...o},i)=>{const a=S.useContext(sf),s=Qb({label:n?null:e}),l=vr(),c=s.index===a.activeIndex;return m.jsxs("button",{...o,title:e,type:"button",role:"menuitem",disabled:n,"data-active":c,"data-open":a.isOpen,tabIndex:c?0:-1,ref:Kn(s.ref,i),className:Q0(`${o.className??""} ${c?"bg-primary text-primary-foreground":""}`),...a.getItemProps({onClick(u){o.onClick?.(u),l?.events.emit("click")},onFocus(u){o.onFocus?.(u),a.setHasFocusInside(!0)}}),children:[r,t?m.jsx(t,{size:16}):null]})}),sL=S.forwardRef((e,t)=>gr()===null?m.jsx(gN,{children:m.jsx(J0,{...e,isParent:!0,ref:t})}):m.jsx(J0,{...e,isParent:!1,ref:t})),lL=e=>m.jsx(et.div,{className:"sticky bottom-4 flex items-center justify-center rounded-lg border border-card-border bg-background p-4",children:e.children}),Us=0,wr=1,Xo=2,ew=4;function tw(e){return()=>e}function cL(e){e()}function oa(e,t){return n=>e(t(n))}function nw(e,t){return()=>e(t)}function uL(e,t){return n=>e(t,n)}function lf(e){return e!==void 0}function dL(...e){return()=>{e.map(cL)}}function Qo(){}function Ks(e,t){return t(e),e}function fL(e,t){return t(e)}function dt(...e){return e}function rt(e,t){return e(wr,t)}function Ve(e,t){e(Us,t)}function cf(e){e(Xo)}function Ft(e){return e(ew)}function ye(e,t){return rt(e,uL(t,Us))}function $n(e,t){const n=e(wr,r=>{n(),t(r)});return n}function rw(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function ow(e,t){return e===t}function ft(e=ow){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Ce(e){return t=>n=>{e(n)&&t(n)}}function fe(e){return t=>oa(t,e)}function jn(e){return t=>()=>{t(e)}}function oe(e,...t){const n=pL(...t);return(r,o)=>{switch(r){case Xo:cf(e);return;case wr:return rt(e,n(o))}}}function zn(e,t){return n=>r=>{n(t=e(t,r))}}function Jo(e){return t=>n=>{e>0?e--:t(n)}}function Sr(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function je(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);rt(i,l=>{const c=n;n=n|s,t[a]=l,c!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>{i([a].concat(t))};n===o?s():r=s}}function pL(...e){return t=>e.reduceRight(fL,t)}function hL(e){let t,n;const r=()=>t?.();return function(o,i){switch(o){case wr:return i?n===i?void 0:(r(),n=i,t=rt(e,i),t):(r(),Qo);case Xo:r(),n=null;return}}}function se(e){let t=e;const n=Be();return(r,o)=>{switch(r){case Us:t=o;break;case wr:{o(t);break}case ew:return t}return n(r,o)}}function Wt(e,t){return Ks(se(t),n=>ye(e,n))}function Be(){const e=[];return(t,n)=>{switch(t){case Us:e.slice().forEach(r=>{r(n)});return;case Xo:e.splice(0,e.length);return;case wr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}}}function on(e){return Ks(Be(),t=>ye(e,t))}function Ye(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:mL(),singleton:n}}const mL=()=>Symbol();function gL(e){const t=new Map,n=({constructor:r,dependencies:o,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);const s=r(o.map(l=>n(l)));return a&&t.set(i,s),s};return n(e)}function _t(...e){const t=Be(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);rt(i,l=>{n[a]=l,r=r|s,r===o&&Ve(t,n)})}),function(i,a){switch(i){case Xo:{cf(t);return}case wr:return r===o&&a(n),rt(t,a)}}}function Ae(e,t=ow){return oe(e,ft(t))}function iw(...e){return function(t,n){switch(t){case Xo:return;case wr:return dL(...e.map(r=>rt(r,n)))}}}var Jt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Jt||{});const vL={0:"debug",3:"error",1:"log",2:"warn"},yL=()=>typeof globalThis>"u"?window:globalThis,Tr=Ye(()=>{const e=se(3);return{log:se((t,n,r=1)=>{var o;const i=(o=yL().VIRTUOSO_LOG_LEVEL)!=null?o:Ft(e);r>=i&&console[vL[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function Rn(e,t,n){return uf(e,t,n).callbackRef}function uf(e,t,n){const r=S.useRef(null);let o=a=>{};const i=S.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const s=()=>{const l=a[0].target;l.offsetParent!==null&&e(l)};n?s():requestAnimationFrame(s)}):null,[e,n]);return o=a=>{a&&t?(i?.observe(a),r.current=a):(r.current&&i?.unobserve(r.current),r.current=null)},{callbackRef:o,ref:r}}function aw(e,t,n,r,o,i,a,s,l){const c=S.useCallback(u=>{const d=bL(u.children,t,s?"offsetWidth":"offsetHeight",o);let h=u.parentElement;for(;!h.dataset.virtuosoScroller;)h=h.parentElement;const f=h.lastElementChild.dataset.viewportType==="window";let b;f&&(b=h.ownerDocument.defaultView);const g=a?s?a.scrollLeft:a.scrollTop:f?s?b.scrollX||b.document.documentElement.scrollLeft:b.scrollY||b.document.documentElement.scrollTop:s?h.scrollLeft:h.scrollTop,p=a?s?a.scrollWidth:a.scrollHeight:f?s?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight:s?h.scrollWidth:h.scrollHeight,v=a?s?a.offsetWidth:a.offsetHeight:f?s?b.innerWidth:b.innerHeight:s?h.offsetWidth:h.offsetHeight;r({scrollHeight:p,scrollTop:Math.max(g,0),viewportHeight:v}),i?.(s?sw("column-gap",getComputedStyle(u).columnGap,o):sw("row-gap",getComputedStyle(u).rowGap,o)),d!==null&&e(d)},[e,t,o,i,a,r,s]);return uf(c,n,l)}function bL(e,t,n,r){const o=e.length;if(o===0)return null;const i=[];for(let a=0;a<o;a++){const s=e.item(a);if(s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),c=parseFloat(s.dataset.knownSize),u=t(s,n);if(u===0&&r("Zero-sized element, this should not happen",{child:s},Jt.ERROR),u===c)continue;const d=i[i.length-1];i.length===0||d.size!==u||d.endIndex!==l-1?i.push({endIndex:l,size:u,startIndex:l}):i[i.length-1].endIndex++}return i}function sw(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jt.WARN),t==="normal"?0:parseInt(t??"0",10)}function df(e,t,n){const r=S.useRef(null),o=S.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),u=c.width;let d,h;if(t){const f=t.getBoundingClientRect(),b=c.top-f.top;h=f.height-Math.max(0,b),d=b+t.scrollTop}else{const f=a.current.ownerDocument.defaultView;h=f.innerHeight-Math.max(0,c.top),d=c.top+f.scrollY}r.current={offsetTop:d,visibleHeight:h,visibleWidth:u},e(r.current)},[e,t]),{callbackRef:i,ref:a}=uf(o,!0,n),s=S.useCallback(()=>{o(a.current)},[o,a]);return S.useEffect(()=>{var l;if(t){t.addEventListener("scroll",s);const c=new ResizeObserver(()=>{requestAnimationFrame(s)});return c.observe(t),()=>{t.removeEventListener("scroll",s),c.unobserve(t)}}else{const c=(l=a.current)==null?void 0:l.ownerDocument.defaultView;return c?.addEventListener("scroll",s),c?.addEventListener("resize",s),()=>{c?.removeEventListener("scroll",s),c?.removeEventListener("resize",s)}}},[s,t,a]),i}const Kt=Ye(()=>{const e=Be(),t=Be(),n=se(0),r=Be(),o=se(0),i=Be(),a=Be(),s=se(0),l=se(0),c=se(0),u=se(0),d=Be(),h=Be(),f=se(!1),b=se(!1),g=se(!1);return ye(oe(e,fe(({scrollTop:p})=>p)),t),ye(oe(e,fe(({scrollHeight:p})=>p)),a),ye(t,o),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:u,headerHeight:s,horizontalDirection:b,scrollBy:h,scrollContainerState:e,scrollHeight:a,scrollingInProgress:f,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:i}},[],{singleton:!0}),ia={lvl:0};function lw(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let a=1;a<n;a++){const{index:s,value:l}=t(e[a]);i.push({end:s-1,start:r,value:o}),r=s,o=l}return i.push({end:1/0,start:r,value:o}),i}function at(e){return e===ia}function aa(e,t){if(!at(e))return t===e.k?e.v:t<e.k?aa(e.l,t):aa(e.r,t)}function Tn(e,t,n="k"){if(at(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Tn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Tn(e.l,t,n)}function an(e,t,n){return at(e)?dw(t,n,1):t===e.k?Ot(e,{k:t,v:n}):t<e.k?fw(Ot(e,{l:an(e.l,t,n)})):fw(Ot(e,{r:an(e.r,t,n)}))}function ei(){return ia}function Ys(e,t,n){if(at(e))return[];const r=Tn(e,t)[0];return xL(pf(e,r,n))}function ff(e,t){if(at(e))return ia;const{k:n,l:r,r:o}=e;if(t===n){if(at(r))return o;if(at(o))return r;{const[i,a]=uw(r);return Gs(Ot(e,{k:i,l:cw(r),v:a}))}}else return t<n?Gs(Ot(e,{l:ff(r,t)})):Gs(Ot(e,{r:ff(o,t)}))}function eo(e){return at(e)?[]:[...eo(e.l),{k:e.k,v:e.v},...eo(e.r)]}function pf(e,t,n){if(at(e))return[];const{k:r,l:o,r:i,v:a}=e;let s=[];return r>t&&(s=s.concat(pf(o,t,n))),r>=t&&r<=n&&s.push({k:r,v:a}),r<=n&&(s=s.concat(pf(i,t,n))),s}function Gs(e){const{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(hf(t))return pw(Ot(e,{lvl:n-1}));if(!at(t)&&!at(t.r))return Ot(t.r,{l:Ot(t,{r:t.r.l}),lvl:n,r:Ot(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(hf(e))return mf(Ot(e,{lvl:n-1}));if(!at(r)&&!at(r.l)){const o=r.l,i=hf(o)?r.lvl-1:r.lvl;return Ot(o,{l:Ot(e,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:mf(Ot(r,{l:o.r,lvl:i}))})}else throw new Error("Unexpected empty nodes")}}function Ot(e,t){return dw(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function cw(e){return at(e.r)?e.l:Gs(Ot(e,{r:cw(e.r)}))}function hf(e){return at(e)||e.lvl>e.r.lvl}function uw(e){return at(e.r)?[e.k,e.v]:uw(e.r)}function dw(e,t,n,r=ia,o=ia){return{k:e,l:r,lvl:n,r:o,v:t}}function fw(e){return mf(pw(e))}function pw(e){const{l:t}=e;return!at(t)&&t.lvl===e.lvl?Ot(t,{r:Ot(e,{l:t.r})}):e}function mf(e){const{lvl:t,r:n}=e;return!at(n)&&!at(n.r)&&n.lvl===t&&n.r.lvl===t?Ot(n,{l:Ot(e,{r:n.l}),lvl:t+1}):e}function xL(e){return lw(e,({k:t,v:n})=>({index:t,value:n}))}function hw(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function sa(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const gf=Ye(()=>({recalcInProgress:se(!1)}),[],{singleton:!0});function mw(e,t,n){return e[Zs(e,t,n)]}function Zs(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=e[i],s=n(a,t);if(s===0)return i;if(s===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function wL(e,t,n,r){const o=Zs(e,t,r),i=Zs(e,n,r,o);return e.slice(o,i+1)}function En(e,t){return Math.round(e.getBoundingClientRect()[t])}function Xs(e){return!at(e.groupOffsetTree)}function vf({index:e},t){return t===e?0:t<e?-1:1}function SL(){return{groupIndices:[],groupOffsetTree:ei(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:ei()}}function TL(e,t){let n=at(e)?0:1/0;for(const r of t){const{endIndex:o,size:i,startIndex:a}=r;if(n=Math.min(n,a),at(e)){e=an(e,0,i);continue}const s=Ys(e,a-1,o+1);if(s.some(_L(r)))continue;let l=!1,c=!1;for(const{end:u,start:d,value:h}of s)l?(o>=d||i===h)&&(e=ff(e,d)):(c=h!==i,l=!0),u>o&&o>=d&&h!==i&&(e=an(e,o+1,h));c&&(e=an(e,a,i))}return[e,n]}function EL(e){return typeof e.groupIndex<"u"}function kL({offset:e},t){return t===e?0:t<e?-1:1}function la(e,t,n){if(t.length===0)return 0;const{index:r,offset:o,size:i}=mw(t,e,vf),a=e-r,s=i*a+(a-1)*n+o;return s>0?s+n:s}function gw(e,t){if(!Xs(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function vw(e,t,n){if(EL(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=gw(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function CL(e,t,n,r=0){return r>0&&(t=Math.max(t,mw(e,r,vf).offset)),lw(wL(e,t,n,kL),IL)}function AL(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Jt.DEBUG);const i=e.sizeTree;let a=i,s=0;if(n.length>0&&at(i)&&t.length===2){const h=t[0].size,f=t[1].size;a=n.reduce((b,g)=>an(an(b,g,h),g+1,f),a)}else[a,s]=TL(a,t);if(a===i)return e;const{lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d}=yf(e.offsetTree,s,a,o);return{groupIndices:n,groupOffsetTree:n.reduce((h,f)=>an(h,f,la(f,d,o)),ei()),lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d,sizeTree:a}}function PL(e){return eo(e).map(({k:t,v:n},r,o)=>{const i=o[r+1];return{endIndex:i?i.k-1:1/0,size:n,startIndex:t}})}function yw(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function yf(e,t,n,r){let o=e,i=0,a=0,s=0,l=0;if(t!==0){l=Zs(o,t-1,vf),s=o[l].offset;const c=Tn(n,t-1);i=c[0],a=c[1],o.length&&o[l].size===Tn(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of Ys(n,t,1/0)){const d=c-i,h=d*a+s+d*r;o.push({index:c,offset:h,size:u}),i=c,s=h,a=u}return{lastIndex:i,lastOffset:s,lastSize:a,offsetTree:o}}function IL(e){return{index:e.index,value:e}}function _L(e){const{endIndex:t,size:n,startIndex:r}=e;return o=>o.start===r&&(o.end===t||o.end===1/0)&&o.value===n}const OL={offsetHeight:"height",offsetWidth:"width"},Bn=Ye(([{log:e},{recalcInProgress:t}])=>{const n=Be(),r=Be(),o=Wt(r,0),i=Be(),a=Be(),s=se(0),l=se([]),c=se(void 0),u=se(void 0),d=se((w,E)=>En(w,OL[E])),h=se(void 0),f=se(0),b=SL(),g=Wt(oe(n,je(l,e,f),zn(AL,b),ft()),b),p=Wt(oe(l,ft(),zn((w,E)=>({current:E,prev:w.current}),{current:[],prev:[]}),fe(({prev:w})=>w)),[]);ye(oe(l,Ce(w=>w.length>0),je(g,f),fe(([w,E,k])=>{const C=w.reduce((O,_,V)=>an(O,_,la(_,E.offsetTree,k)||V),ei());return{...E,groupIndices:w,groupOffsetTree:C}})),g),ye(oe(r,je(g),Ce(([w,{lastIndex:E}])=>w<E),fe(([w,{lastIndex:E,lastSize:k}])=>[{endIndex:E,size:k,startIndex:w}])),n),ye(c,u);const v=Wt(oe(c,fe(w=>w===void 0)),!0);ye(oe(u,Ce(w=>w!==void 0&&at(Ft(g).sizeTree)),fe(w=>[{endIndex:0,size:w,startIndex:0}])),n);const y=on(oe(n,je(g),zn(({sizes:w},[E,k])=>({changed:k!==w,sizes:k}),{changed:!1,sizes:b}),fe(w=>w.changed)));rt(oe(s,zn((w,E)=>({diff:w.prev-E,prev:E}),{diff:0,prev:0}),fe(w=>w.diff)),w=>{const{groupIndices:E}=Ft(g);if(w>0)Ve(t,!0),Ve(i,w+yw(w,E));else if(w<0){const k=Ft(p);k.length>0&&(w-=yw(-w,k)),Ve(a,w)}}),rt(oe(s,je(e)),([w,E])=>{w<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Jt.ERROR)});const x=on(i);ye(oe(i,je(g),fe(([w,E])=>{const k=E.groupIndices.length>0,C=[],O=E.lastSize;if(k){const _=aa(E.sizeTree,0);let V=0,L=0;for(;V<w;){const I=E.groupIndices[L],M=E.groupIndices.length===L+1?1/0:E.groupIndices[L+1]-I-1;C.push({endIndex:I,size:_,startIndex:I}),C.push({endIndex:I+1+M-1,size:O,startIndex:I+1}),L++,V+=M+1}const R=eo(E.sizeTree);return V!==w&&R.shift(),R.reduce((I,{k:M,v:H})=>{let D=I.ranges;return I.prevSize!==0&&(D=[...I.ranges,{endIndex:M+w-1,size:I.prevSize,startIndex:I.prevIndex}]),{prevIndex:M+w,prevSize:H,ranges:D}},{prevIndex:w,prevSize:0,ranges:C}).ranges}return eo(E.sizeTree).reduce((_,{k:V,v:L})=>({prevIndex:V+w,prevSize:L,ranges:[..._.ranges,{endIndex:V+w-1,size:_.prevSize,startIndex:_.prevIndex}]}),{prevIndex:0,prevSize:O,ranges:[]}).ranges})),n);const T=on(oe(a,je(g,f),fe(([w,{offsetTree:E},k])=>{const C=-w;return la(C,E,k)})));return ye(oe(a,je(g,f),fe(([w,E,k])=>{if(E.groupIndices.length>0){if(at(E.sizeTree))return E;let C=ei();const O=Ft(p);let _=0,V=0,L=0;for(;_<-w;){L=O[V];const R=O[V+1]-L-1;V++,_+=R+1}if(C=eo(E.sizeTree).reduce((R,{k:I,v:M})=>an(R,Math.max(0,I+w),M),C),_!==-w){const R=aa(E.sizeTree,L);C=an(C,0,R);const I=Tn(E.sizeTree,-w+1)[1];C=an(C,1,I)}return{...E,sizeTree:C,...yf(E.offsetTree,0,C,k)}}else{const C=eo(E.sizeTree).reduce((O,{k:_,v:V})=>an(O,Math.max(0,_+w),V),ei());return{...E,sizeTree:C,...yf(E.offsetTree,0,C,k)}}})),g),{beforeUnshiftWith:x,data:h,defaultItemSize:u,firstItemIndex:s,fixedItemSize:c,gap:f,groupIndices:l,itemSize:d,listRefresh:y,shiftWith:a,shiftWithOffset:T,sizeRanges:n,sizes:g,statefulTotalCount:o,totalCount:r,trackItemSizes:v,unshiftWith:i}},dt(Tr,gf),{singleton:!0});function ML(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const bw=Ye(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const i=Be(),a=Be(),s=on(oe(i,fe(ML)));return ye(oe(s,fe(l=>l.totalCount)),n),ye(oe(s,fe(l=>l.groupIndices)),e),ye(oe(_t(o,t,r),Ce(([l,c])=>Xs(c)),fe(([l,c,u])=>Tn(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),ft(),fe(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},dt(Bn,Kt)),Er=Ye(([{log:e}])=>{const t=se(!1),n=on(oe(t,Ce(r=>r),ft()));return rt(t,r=>{r&&Ft(e)("props updated",{},Jt.DEBUG)}),{didMount:n,propsReady:t}},dt(Tr),{singleton:!0}),DL=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function xw(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!DL)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ca=Ye(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:i,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:u,viewportHeight:d},{log:h}])=>{const f=Be(),b=Be(),g=se(0);let p=null,v=null,y=null;function x(){p&&(p(),p=null),y&&(y(),y=null),v&&(clearTimeout(v),v=null),Ve(l,!1)}return ye(oe(f,je(n,d,r,g,s,a,h),je(e,i,o),fe(([[T,w,E,k,C,O,_,V],L,R,I])=>{const M=xw(T),{align:H,behavior:D,offset:A}=M,F=k-1,N=vw(M,w,F);let W=la(N,w.offsetTree,L)+O;H==="end"?(W+=R+Tn(w.sizeTree,N)[1]-E+I,N===F&&(W+=_)):H==="center"?W+=(R+Tn(w.sizeTree,N)[1]-E+I)/2:W-=C,A&&(W+=A);const j=Z=>{x(),Z?(V("retrying to scroll to",{location:T},Jt.DEBUG),Ve(f,T)):(Ve(b,!0),V("list did not change, scroll successful",{},Jt.DEBUG))};if(x(),D==="smooth"){let Z=!1;y=rt(t,G=>{Z=Z||G}),p=$n(u,()=>{j(Z)})}else p=$n(oe(t,NL(150)),j);return v=setTimeout(()=>{x()},1200),Ve(l,!0),V("scrolling from index to",{behavior:D,index:N,top:W},Jt.DEBUG),{behavior:D,top:W}})),c),{scrollTargetReached:b,scrollToIndex:f,topListHeight:g}},dt(Bn,Kt,Tr),{singleton:!0});function NL(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}function bf(e,t){e==0?t():requestAnimationFrame(()=>{bf(e-1,t)})}function xf(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const ua=Ye(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:i},{didMount:a}])=>{const s=se(!0),l=se(0),c=se(!0);return ye(oe(a,je(l),Ce(([u,d])=>!!d),jn(!1)),s),ye(oe(a,je(l),Ce(([u,d])=>!!d),jn(!1)),c),rt(oe(_t(t,a),je(s,n,e,c),Ce(([[,u],d,{sizeTree:h},f,b])=>u&&(!at(h)||lf(f))&&!d&&!b),je(l)),([,u])=>{$n(o,()=>{Ve(c,!0)}),bf(4,()=>{$n(r,()=>{Ve(s,!0)}),Ve(i,u)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:s}},dt(Bn,Kt,ca,Er),{singleton:!0});function ww(e,t){return Math.abs(e-t)<1.01}const da="up",fa="down",FL="none",LL={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},VL=0,pa=Ye(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:i}])=>{const a=se(!1),s=se(!0),l=Be(),c=Be(),u=se(4),d=se(VL),h=Wt(oe(iw(oe(Ae(o),Jo(1),jn(!0)),oe(Ae(o),Jo(1),jn(!1),rw(100))),ft()),!1),f=Wt(oe(iw(oe(n,jn(!0)),oe(n,jn(!1),rw(200))),ft()),!1);ye(oe(_t(Ae(o),Ae(d)),fe(([y,x])=>y<=x),ft()),s),ye(oe(s,Sr(50)),c);const b=on(oe(_t(r,Ae(i),Ae(t),Ae(e),Ae(u)),zn((y,[{scrollHeight:x,scrollTop:T},w,E,k,C])=>{const O=T+w-x>-C,_={scrollHeight:x,scrollTop:T,viewportHeight:w};if(O){let L,R;return T>y.state.scrollTop?(L="SCROLLED_DOWN",R=y.state.scrollTop-T):(L="SIZE_DECREASED",R=y.state.scrollTop-T||y.scrollTopDelta),{atBottom:!0,atBottomBecause:L,scrollTopDelta:R,state:_}}let V;return _.scrollHeight>y.state.scrollHeight?V="SIZE_INCREASED":w<y.state.viewportHeight?V="VIEWPORT_HEIGHT_DECREASING":T<y.state.scrollTop?V="SCROLLING_UPWARDS":V="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:V,state:_}},LL),ft((y,x)=>y&&y.atBottom===x.atBottom))),g=Wt(oe(r,zn((y,{scrollHeight:x,scrollTop:T,viewportHeight:w})=>{if(ww(y.scrollHeight,x))return{changed:!1,jump:0,scrollHeight:x,scrollTop:T};{const E=x-(T+w)<1;return y.scrollTop!==T&&E?{changed:!0,jump:y.scrollTop-T,scrollHeight:x,scrollTop:T}:{changed:!0,jump:0,scrollHeight:x,scrollTop:T}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Ce(y=>y.changed),fe(y=>y.jump)),0);ye(oe(b,fe(y=>y.atBottom)),a),ye(oe(a,Sr(50)),l);const p=se(fa);ye(oe(r,fe(({scrollTop:y})=>y),ft(),zn((y,x)=>Ft(f)?{direction:y.direction,prevScrollTop:x}:{direction:x<y.prevScrollTop?da:fa,prevScrollTop:x},{direction:fa,prevScrollTop:0}),fe(y=>y.direction)),p),ye(oe(r,Sr(50),jn(FL)),p);const v=se(0);return ye(oe(h,Ce(y=>!y),jn(0)),v),ye(oe(o,Sr(100),je(h),Ce(([y,x])=>!!x),zn(([y,x],[T])=>[x,T],[0,0]),fe(([y,x])=>x-y)),v),{atBottomState:b,atBottomStateChange:l,atBottomThreshold:u,atTopStateChange:c,atTopThreshold:d,isAtBottom:a,isAtTop:s,isScrolling:h,lastJumpDueToItemResize:g,scrollDirection:p,scrollVelocity:v}},dt(Kt)),Qs="top",Js="bottom",Sw="none";function Tw(e,t,n){return typeof e=="number"?n===da&&t===Qs||n===fa&&t===Js?e:0:n===da?t===Qs?e.main:e.reverse:t===Js?e.main:e.reverse}function Ew(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const wf=Ye(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const i=Be(),a=se(0),s=se(0),l=se(0),c=Wt(oe(_t(Ae(r),Ae(o),Ae(n),Ae(i,sa),Ae(l),Ae(a),Ae(t),Ae(e),Ae(s)),fe(([u,d,h,[f,b],g,p,v,y,x])=>{const T=u-y,w=p+v,E=Math.max(h-T,0);let k=Sw;const C=Ew(x,Qs),O=Ew(x,Js);return f-=y,f+=h+v,b+=h+v,b-=y,f>u+w-C&&(k=da),b<u-E+d+O&&(k=fa),k!==Sw?[Math.max(T-h-Tw(g,Qs,k)-C,0),T-E-v+d+Tw(g,Js,k)+O]:null}),Ce(u=>u!=null),ft(sa)),[0,0]);return{increaseViewportBy:s,listBoundary:i,overscan:l,topListHeight:a,visibleRange:c}},dt(Kt),{singleton:!0});function $L(e,t,n){if(Xs(t)){const r=gw(e,t);return[{index:Tn(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}const Sf={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function el(e,t,n,r,o,i){const{lastIndex:a,lastOffset:s,lastSize:l}=o;let c=0,u=0;if(e.length>0){c=e[0].offset;const g=e[e.length-1];u=g.offset+g.size}const d=n-a,h=s+d*l+(d-1)*r,f=c,b=h-u;return{bottom:u,firstItemIndex:i,items:Cw(e,o,i),offsetBottom:b,offsetTop:c,top:f,topItems:Cw(t,o,i),topListHeight:t.reduce((g,p)=>p.size+g,0),totalCount:n}}function kw(e,t,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-a>=e)break;a++}const s=e+a,l=xf(t,s),c=Array.from({length:s}).map((u,d)=>({data:i[d+l],index:d+l,offset:0,size:0}));return el(c,[],s,o,n,r)}function Cw(e,t,n){if(e.length===0)return[];if(!Xs(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,i=[],a=Ys(t.groupOffsetTree,r,o);let s,l=0;for(const c of e){(!s||s.end<c.index)&&(s=a.shift(),l=t.groupIndices.indexOf(s.start));let u;c.index===s.start?u={index:l,type:"group"}:u={groupIndex:l,index:c.index-(l+1)+n},i.push({...u,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}const to=Ye(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:o},i,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:u},{topListHeight:d},h,{didMount:f},{recalcInProgress:b}])=>{const g=se([]),p=se(0),v=Be();ye(i.topItemsIndexes,g);const y=Wt(oe(_t(f,b,Ae(l,sa),Ae(o),Ae(r),Ae(c),u,Ae(g),Ae(t),Ae(n),e),Ce(([E,k,,C,,,,,,,O])=>{const _=O&&O.length!==C;return E&&!k&&!_}),fe(([,,[E,k],C,O,_,V,L,R,I,M])=>{const H=O,{offsetTree:D,sizeTree:A}=H,F=Ft(p);if(C===0)return{...Sf,totalCount:C};if(E===0&&k===0)return F===0?{...Sf,totalCount:C}:kw(F,_,O,R,I,M||[]);if(at(A))return F>0?null:el($L(xf(_,C),H,M),[],C,I,H,R);const N=[];if(L.length>0){const re=L[0],te=L[L.length-1];let ee=0;for(const B of Ys(A,re,te)){const U=B.value,X=Math.max(B.start,re),Q=Math.min(B.end,te);for(let z=X;z<=Q;z++)N.push({data:M?.[z],index:z,offset:ee,size:U}),ee+=U}}if(!V)return el([],N,C,I,H,R);const W=L.length>0?L[L.length-1]+1:0,j=CL(D,E,k,W);if(j.length===0)return null;const Z=C-1,G=Ks([],re=>{for(const te of j){const ee=te.value;let B=ee.offset,U=te.start;const X=ee.size;if(ee.offset<E){U+=Math.floor((E-ee.offset+I)/(X+I));const z=U-te.start;B+=z*X+z*I}U<W&&(B+=(W-U)*X,U=W);const Q=Math.min(te.end,Z);for(let z=U;z<=Q&&!(B>=k);z++)re.push({data:M?.[z],index:z,offset:B,size:X}),B+=X+I}});return el(G,N,C,I,H,R)}),Ce(E=>E!==null),ft()),Sf);ye(oe(e,Ce(lf),fe(E=>E?.length)),o),ye(oe(y,fe(E=>E.topListHeight)),d),ye(d,s),ye(oe(y,fe(E=>[E.top,E.bottom])),a),ye(oe(y,fe(E=>E.items)),v);const x=on(oe(y,Ce(({items:E})=>E.length>0),je(o,e),Ce(([{items:E},k])=>E[E.length-1].originalIndex===k-1),fe(([,E,k])=>[E-1,k]),ft(sa),fe(([E])=>E))),T=on(oe(y,Sr(200),Ce(({items:E,topItems:k})=>E.length>0&&E[0].originalIndex===k.length),fe(({items:E})=>E[0].index),ft())),w=on(oe(y,Ce(({items:E})=>E.length>0),fe(({items:E})=>{let k=0,C=E.length-1;for(;E[k].type==="group"&&k<C;)k++;for(;E[C].type==="group"&&C>k;)C--;return{endIndex:E[C].index,startIndex:E[k].index}}),ft(hw)));return{endReached:x,initialItemCount:p,itemsRendered:v,listState:y,rangeChanged:w,startReached:T,topItemsIndexes:g,...h}},dt(Bn,bw,wf,ua,ca,pa,Er,gf),{singleton:!0}),Aw=Ye(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:o}])=>{const i=Be(),a=Wt(oe(_t(n,e,r,t,o),fe(([s,l,c,u,d])=>s+l+c+u+d.offsetBottom+d.bottom)),0);return ye(Ae(a),i),{totalListHeight:a,totalListHeightChanged:i}},dt(Kt,to),{singleton:!0}),jL=Ye(([{viewportHeight:e},{totalListHeight:t}])=>{const n=se(!1),r=Wt(oe(_t(n,e,t),Ce(([o])=>o),fe(([,o,i])=>Math.max(0,o-i)),Sr(0),ft()),0);return{alignToBottom:n,paddingTopAddition:r}},dt(Kt,Aw),{singleton:!0});function Pw(e){return e?e==="smooth"?"smooth":"auto":!1}const zL=(e,t)=>typeof e=="function"?Pw(e(t)):t&&Pw(e),RL=Ye(([{listRefresh:e,totalCount:t,fixedItemSize:n},{atBottomState:r,isAtBottom:o},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:s,propsReady:l},{log:c},{scrollingInProgress:u}])=>{const d=se(!1),h=Be();let f=null;function b(p){Ve(i,{align:"end",behavior:p,index:"LAST"})}rt(oe(_t(oe(Ae(t),Jo(1)),s),je(Ae(d),o,a,u),fe(([[p,v],y,x,T,w])=>{let E=v&&T,k="auto";return E&&(k=zL(y,x||w),E=E&&!!k),{followOutputBehavior:k,shouldFollow:E,totalCount:p}}),Ce(({shouldFollow:p})=>p)),({followOutputBehavior:p,totalCount:v})=>{f&&(f(),f=null),Ft(n)?requestAnimationFrame(()=>{Ft(c)("following output to ",{totalCount:v},Jt.DEBUG),b(p)}):f=$n(e,()=>{Ft(c)("following output to ",{totalCount:v},Jt.DEBUG),b(p),f=null})});function g(p){const v=$n(r,y=>{p&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!f&&(Ft(c)("scrolling to bottom due to increased size",{},Jt.DEBUG),b("auto"))});setTimeout(v,100)}return rt(oe(_t(Ae(d),t,l),Ce(([p,,v])=>p&&v),zn(({value:p},[,v])=>({refreshed:p===v,value:v}),{refreshed:!1,value:0}),Ce(({refreshed:p})=>p),je(d,t)),([,p])=>{Ft(a)&&g(p!==!1)}),rt(h,()=>{g(Ft(d)!==!1)}),rt(_t(Ae(d),r),([p,v])=>{p&&!v.atBottom&&v.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&b("auto")}),{autoscrollToBottom:h,followOutput:d}},dt(Bn,pa,ca,ua,Er,Tr,Kt)),BL=Ye(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(ye(oe(s,je(i),Ce(([,l])=>l!==0),je(o,r,t,n,e),fe(([[,l],c,u,d,h,f=[]])=>kw(l,c,u,d,h,f))),a),{}),dt(Bn,ua,to,Er),{singleton:!0}),HL=Ye(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=se(0);return rt(oe(e,je(r),Ce(([,o])=>o!==0),fe(([,o])=>({top:o}))),o=>{$n(oe(n,Jo(1),Ce(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Ve(t,o)})})}),{initialScrollTop:r}},dt(Er,Kt,to),{singleton:!0}),WL=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...o},viewportBottom:i,viewportTop:a})=>t<a?{...o,align:n??"start",behavior:r}:e>i?{...o,align:n??"end",behavior:r}:null,qL=Ye(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:i,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:c}])=>{const u=Be();return ye(oe(u,je(t,l,n,i,o,r,s),je(e),fe(([[d,h,f,b,g,p,v,y],x])=>{const{align:T,behavior:w,calculateViewLocation:E=WL,done:k,...C}=d,O=vw(d,h,b-1),_=la(O,h.offsetTree,x)+g+p,V=_+Tn(h.sizeTree,O)[1],L=y+p,R=y+f-v,I=E({itemBottom:V,itemTop:_,locationParams:{align:T,behavior:w,...C},viewportBottom:R,viewportTop:L});return I?k&&$n(oe(a,Ce(M=>!M),Jo(Ft(a)?1:2)),k):k&&k(),I}),Ce(d=>d!==null)),c),{scrollIntoView:u}},dt(Bn,Kt,ca,to,Tr),{singleton:!0}),Iw=Ye(([{scrollVelocity:e}])=>{const t=se(!1),n=Be(),r=se(!1);return ye(oe(e,je(r,t,n),Ce(([o,i])=>!!i),fe(([o,i,a,s])=>{const{enter:l,exit:c}=i;if(a){if(c(o,s))return!1}else if(l(o,s))return!0;return a}),ft()),t),rt(oe(_t(t,e,n),je(r)),([[o,i,a],s])=>{o&&s&&s.change&&s.change(i,a)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},dt(pa),{singleton:!0}),Tf=Ye(([{scrollContainerState:e,scrollTo:t}])=>{const n=Be(),r=Be(),o=Be(),i=se(!1),a=se(void 0);return ye(oe(_t(n,r),fe(([{scrollHeight:s,scrollTop:l,viewportHeight:c},{offsetTop:u}])=>({scrollHeight:s,scrollTop:Math.max(0,l-u),viewportHeight:c}))),e),ye(oe(t,je(r),fe(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{customScrollParent:a,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}},dt(Kt)),UL=Ye(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:i},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{const c=Be(),u=se(void 0),d=se(null),h=se(null);return ye(s,d),ye(l,h),rt(oe(c,je(t,r,a,d,h,n)),([f,b,g,p,v,y,x])=>{const T=PL(b.sizeTree);p&&v!==null&&y!==null&&(g=v.scrollTop-y.offsetTop),g-=x,f({ranges:T,scrollTop:g})}),ye(oe(u,Ce(lf),fe(KL)),o),ye(oe(i,je(u),Ce(([,f])=>f!==void 0),ft(),fe(([,f])=>f.ranges)),e),{getState:c,restoreStateFrom:u}},dt(Bn,Kt,ua,Er,Tf));function KL(e){return{align:"start",index:0,offset:e.scrollTop}}const YL=Ye(([{topItemsIndexes:e}])=>{const t=se(0);return ye(oe(t,Ce(n=>n>=0),fe(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},dt(to));function _w(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const GL=_w(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),ZL=Ye(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:i,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:c,gap:u,shiftWithOffset:d,sizes:h},{log:f},{recalcInProgress:b}])=>{const g=on(oe(l,je(a),zn(([,v,y,x],[{bottom:T,items:w,offsetBottom:E,totalCount:k},C])=>{const O=T+E;let _=0;return y===k&&v.length>0&&w.length>0&&(w[0].originalIndex===0&&v[0].originalIndex===0||(_=O-x,_!==0&&(_+=C))),[_,w,k,O]},[0,[],0,0]),Ce(([v])=>v!==0),je(r,s,n,o,f,b),Ce(([,v,y,x,,,T])=>!T&&!x&&v!==0&&y===da),fe(([[v],,,,,y])=>(y("Upward scrolling compensation",{amount:v},Jt.DEBUG),v))));function p(v){v>0?(Ve(t,{behavior:"auto",top:-v}),Ve(e,0)):(Ve(e,0),Ve(t,{behavior:"auto",top:-v}))}return rt(oe(g,je(e,i)),([v,y,x])=>{x&&GL()?Ve(e,y-v):p(-v)}),rt(oe(_t(Wt(i,!1),e,b),Ce(([v,y,x])=>!v&&!x&&y!==0),fe(([v,y])=>y),Sr(1)),p),ye(oe(d,fe(v=>({top:-v}))),t),rt(oe(c,je(h,u),fe(([v,{groupIndices:y,lastSize:x,sizeTree:T},w])=>{function E(k){return k*(x+w)}if(y.length===0)return E(v);{let k=0;const C=aa(T,0);let O=0,_=0;for(;O<v;){O++,k+=C;let V=y.length===_+1?1/0:y[_+1]-y[_]-1;O+V>v&&(k-=C,V=v-O+1),O+=V,k+=E(V),_++}return k}})),v=>{Ve(e,v),requestAnimationFrame(()=>{Ve(t,{top:v}),requestAnimationFrame(()=>{Ve(e,0),Ve(b,!1)})})}),{deviation:e}},dt(Kt,pa,to,Bn,Tr,gf)),XL=Ye(([e,t,n,r,o,i,a,s,l,c])=>({...e,...t,...n,...r,...o,...i,...a,...s,...l,...c}),dt(wf,BL,Er,Iw,Aw,HL,jL,Tf,qL,Tr)),Ow=Ye(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:i,itemSize:a,sizeRanges:s,sizes:l,statefulTotalCount:c,totalCount:u,trackItemSizes:d},{initialItemFinalLocationReached:h,initialTopMostItemIndex:f,scrolledToInitialItem:b},g,p,v,{listState:y,topItemsIndexes:x,...T},{scrollToIndex:w},E,{topItemCount:k},{groupCounts:C},O])=>(ye(T.rangeChanged,O.scrollSeekRangeChanged),ye(oe(O.windowViewportRect,fe(_=>_.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:C,initialItemFinalLocationReached:h,initialTopMostItemIndex:f,scrolledToInitialItem:b,sizeRanges:s,topItemCount:k,topItemsIndexes:x,totalCount:u,...v,groupIndices:i,itemSize:a,listState:y,scrollToIndex:w,statefulTotalCount:c,trackItemSizes:d,...T,...O,...g,sizes:l,...p}),dt(Bn,ua,Kt,UL,RL,to,ca,ZL,YL,bw,XL));function QL(e,t){const n={},r={};let o=0;const i=e.length;for(;o<i;)r[e[o]]=1,o+=1;for(const a in t)Object.hasOwn(r,a)||(n[a]=t[a]);return n}const tl=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Ef(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),i=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),s=S.createContext({});function l(p,v){p.propsReady&&Ve(p.propsReady,!1);for(const y of r){const x=p[t.required[y]];Ve(x,v[y])}for(const y of o)if(y in v){const x=p[t.optional[y]];Ve(x,v[y])}p.propsReady&&Ve(p.propsReady,!0)}function c(p){return i.reduce((v,y)=>(v[y]=x=>{const T=p[t.methods[y]];Ve(T,x)},v),{})}function u(p){return a.reduce((v,y)=>(v[y]=hL(p[t.events[y]]),v),{})}const d=S.forwardRef((p,v)=>{const{children:y,...x}=p,[T]=S.useState(()=>Ks(gL(e),k=>{l(k,x)})),[w]=S.useState(nw(u,T));tl(()=>{for(const k of a)k in x&&rt(w[k],x[k]);return()=>{Object.values(w).map(cf)}},[x,w,T]),tl(()=>{l(T,x)}),S.useImperativeHandle(v,tw(c(T)));const E=n;return m.jsx(s.Provider,{value:T,children:n?m.jsx(E,{...QL([...r,...o,...a],x),children:y}):y})}),h=p=>{const v=S.useContext(s);return S.useCallback(y=>{Ve(v[p],y)},[v,p])},f=p=>{const v=S.useContext(s)[p],y=S.useCallback(x=>rt(v,x),[v]);return S.useSyncExternalStore(y,()=>Ft(v),()=>Ft(v))},b=p=>{const v=S.useContext(s)[p],[y,x]=S.useState(nw(Ft,v));return tl(()=>rt(v,T=>{T!==y&&x(tw(T))}),[v,y]),y},g=S.version.startsWith("18")?f:b;return{Component:d,useEmitter:(p,v)=>{const y=S.useContext(s)[p];tl(()=>rt(y,v),[v,y])},useEmitterValue:g,usePublisher:h}}const nl=S.createContext(void 0),Mw=S.createContext(void 0),Dw=typeof document<"u"?S.useLayoutEffect:S.useEffect;function kf(e){return"self"in e}function JL(e){return"body"in e}function Nw(e,t,n,r=Qo,o,i){const a=S.useRef(null),s=S.useRef(null),l=S.useRef(null),c=S.useCallback(h=>{let f,b,g;const p=h.target;if(JL(p)||kf(p)){const y=kf(p)?p:p.defaultView;g=i?y.scrollX:y.scrollY,f=i?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight,b=i?y.innerWidth:y.innerHeight}else g=i?p.scrollLeft:p.scrollTop,f=i?p.scrollWidth:p.scrollHeight,b=i?p.offsetWidth:p.offsetHeight;const v=()=>{e({scrollHeight:f,scrollTop:Math.max(g,0),viewportHeight:b})};h.suppressFlushSync?v():so.flushSync(v),s.current!==null&&(g===s.current||g<=0||g===f-b)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);S.useEffect(()=>{const h=o||a.current;return r(o||a.current),c({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",c,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",c)}},[a,c,n,r,o]);function u(h){const f=a.current;if(!f||(i?"offsetWidth"in f&&f.offsetWidth===0:"offsetHeight"in f&&f.offsetHeight===0))return;const b=h.behavior==="smooth";let g,p,v;kf(f)?(p=Math.max(En(f.document.documentElement,i?"width":"height"),i?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight),g=i?f.innerWidth:f.innerHeight,v=i?window.scrollX:window.scrollY):(p=f[i?"scrollWidth":"scrollHeight"],g=En(f,i?"width":"height"),v=f[i?"scrollLeft":"scrollTop"]);const y=p-g;if(h.top=Math.ceil(Math.max(Math.min(y,h.top),0)),ww(g,p)||h.top===v){e({scrollHeight:p,scrollTop:v,viewportHeight:g}),b&&t(!0);return}b?(s.current=h.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,i&&(h={behavior:h.behavior,left:h.top}),f.scrollTo(h)}function d(h){i&&(h={behavior:h.behavior,left:h.top}),a.current.scrollBy(h)}return{scrollByCallback:d,scrollerRef:a,scrollToCallback:u}}const Cf="-webkit-sticky",Fw="sticky",Af=_w(()=>{if(typeof document>"u")return Fw;const e=document.createElement("div");return e.style.position=Cf,e.style.position===Cf?Cf:Fw});function Pf(e){return e}const eV=Ye(()=>{const e=se(l=>`Item ${l}`),t=se(null),n=se(l=>`Group ${l}`),r=se({}),o=se(Pf),i=se("div"),a=se(Qo),s=(l,c=null)=>Wt(oe(r,fe(u=>u[l]),ft()),c);return{components:r,computeItemKey:o,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),tV=Ye(([e,t])=>({...e,...t}),dt(Ow,eV)),nV=({height:e})=>m.jsx("div",{style:{height:e}}),rV={overflowAnchor:"none",position:Af(),zIndex:1},Lw={overflowAnchor:"none"},oV={...Lw,display:"inline-block",height:"100%"},Vw=S.memo(function({showTopList:e=!1}){const t=Ie("listState"),n=gn("sizeRanges"),r=Ie("useWindowScroll"),o=Ie("customScrollParent"),i=gn("windowScrollContainerState"),a=gn("scrollContainerState"),s=o||r?i:a,l=Ie("itemContent"),c=Ie("context"),u=Ie("groupContent"),d=Ie("trackItemSizes"),h=Ie("itemSize"),f=Ie("log"),b=gn("gap"),g=Ie("horizontalDirection"),{callbackRef:p}=aw(n,h,d,e?Qo:s,f,b,o,g,Ie("skipAnimationFrameInResizeObserver")),[v,y]=S.useState(0);Of("deviation",I=>{v!==I&&y(I)});const x=Ie("EmptyPlaceholder"),T=Ie("ScrollSeekPlaceholder")||nV,w=Ie("ListComponent"),E=Ie("ItemComponent"),k=Ie("GroupComponent"),C=Ie("computeItemKey"),O=Ie("isSeeking"),_=Ie("groupIndices").length>0,V=Ie("alignToBottom"),L=Ie("initialItemFinalLocationReached"),R=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:v!==0?v:V?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:v!==0?v:V?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...L?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&x?m.jsx(x,{...lt(x,c)}):m.jsx(w,{...lt(w,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:p,style:R,children:(e?t.topItems:t.items).map(I=>{const M=I.originalIndex,H=C(M+t.firstItemIndex,I.data,c);return O?S.createElement(T,{...lt(T,c),height:I.size,index:I.index,key:H,type:I.type||"item",...I.type==="group"?{}:{groupIndex:I.groupIndex}}):I.type==="group"?S.createElement(k,{...lt(k,c),"data-index":M,"data-item-index":I.index,"data-known-size":I.size,key:H,style:rV},u(I.index,c)):S.createElement(E,{...lt(E,c),...$w(E,I.data),"data-index":M,"data-item-group-index":I.groupIndex,"data-item-index":I.index,"data-known-size":I.size,key:H,style:g?oV:Lw},_?l(I.index,I.groupIndex,I.data,c):l(I.index,I.data,c))})})}),iV={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},aV={outline:"none",overflowX:"auto",position:"relative"},ti=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),sV={position:Af(),top:0,width:"100%",zIndex:1};function lt(e,t){if(typeof e!="string")return{context:t}}function $w(e,t){return{item:typeof e=="string"?void 0:t}}const lV=S.memo(function(){const e=Ie("HeaderComponent"),t=gn("headerHeight"),n=Ie("HeaderFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,Ie("skipAnimationFrameInResizeObserver")),o=Ie("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null}),cV=S.memo(function(){const e=Ie("FooterComponent"),t=gn("footerHeight"),n=Ie("HeaderFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,Ie("skipAnimationFrameInResizeObserver")),o=Ie("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null});function If({useEmitter:e,useEmitterValue:t,usePublisher:n}){return S.memo(function({children:r,style:o,...i}){const a=n("scrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=t("scrollerRef"),u=t("context"),d=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:f,scrollToCallback:b}=Nw(a,l,s,c,void 0,d);return e("scrollTo",b),e("scrollBy",h),m.jsx(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...d?aV:iV,...o},tabIndex:0,...i,...lt(s,u),children:r})})}function _f({useEmitter:e,useEmitterValue:t,usePublisher:n}){return S.memo(function({children:r,style:o,...i}){const a=n("windowScrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=t("totalListHeight"),u=t("deviation"),d=t("customScrollParent"),h=t("context"),f=S.useRef(null),b=t("scrollerRef"),{scrollByCallback:g,scrollerRef:p,scrollToCallback:v}=Nw(a,l,s,b,d);return Dw(()=>{var y;return p.current=d||((y=f.current)==null?void 0:y.ownerDocument.defaultView),()=>{p.current=null}},[p,d]),e("windowScrollTo",v),e("scrollBy",g),m.jsx(s,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...c!==0?{height:c+u}:{}},...i,...lt(s,h),children:r})})}const uV=({children:e})=>{const t=S.useContext(nl),n=gn("viewportHeight"),r=gn("fixedItemHeight"),o=Ie("alignToBottom"),i=Ie("horizontalDirection"),a=S.useMemo(()=>oa(n,l=>En(l,i?"width":"height")),[n,i]),s=Rn(a,!0,Ie("skipAnimationFrameInResizeObserver"));return S.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),m.jsx("div",{"data-viewport-type":"element",ref:s,style:ti(o),children:e})},dV=({children:e})=>{const t=S.useContext(nl),n=gn("windowViewportRect"),r=gn("fixedItemHeight"),o=Ie("customScrollParent"),i=df(n,o,Ie("skipAnimationFrameInResizeObserver")),a=Ie("alignToBottom");return S.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),m.jsx("div",{"data-viewport-type":"window",ref:i,style:ti(a),children:e})},fV=({children:e})=>{const t=Ie("TopItemListComponent")||"div",n=Ie("headerHeight"),r={...sV,marginTop:`${n}px`},o=Ie("context");return m.jsx(t,{style:r,...lt(t,o),children:e})},pV=S.memo(function(e){const t=Ie("useWindowScroll"),n=Ie("topItemsIndexes").length>0,r=Ie("customScrollParent"),o=Ie("context"),i=r||t?gV:mV,a=r||t?dV:uV;return m.jsxs(i,{...e,...lt(i,o),children:[n&&m.jsx(fV,{children:m.jsx(Vw,{showTopList:!0})}),m.jsxs(a,{children:[m.jsx(lV,{}),m.jsx(Vw,{}),m.jsx(cV,{})]})]})}),{Component:hV,useEmitter:Of,useEmitterValue:Ie,usePublisher:gn}=Ef(tV,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},pV),mV=If({useEmitter:Of,useEmitterValue:Ie,usePublisher:gn}),gV=_f({useEmitter:Of,useEmitterValue:Ie,usePublisher:gn}),Mf=hV,vV=Ye(()=>{const e=se(c=>m.jsxs("td",{children:["Item $",c]})),t=se(null),n=se(c=>m.jsxs("td",{colSpan:1e3,children:["Group ",c]})),r=se(null),o=se(null),i=se({}),a=se(Pf),s=se(Qo),l=(c,u=null)=>Wt(oe(i,fe(d=>d[c]),ft()),u);return{components:i,computeItemKey:a,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),yV=Ye(([e,t])=>({...e,...t}),dt(Ow,vV)),bV=({height:e})=>m.jsx("tr",{children:m.jsx("td",{style:{height:e}})}),xV=({height:e})=>m.jsx("tr",{children:m.jsx("td",{style:{border:0,height:e,padding:0}})}),wV={overflowAnchor:"none"},jw={position:Af(),zIndex:2,overflowAnchor:"none"},zw=S.memo(function({showTopList:e=!1}){const t=De("listState"),n=De("computeItemKey"),r=De("firstItemIndex"),o=De("context"),i=De("isSeeking"),a=De("fixedHeaderHeight"),s=De("groupIndices").length>0,l=De("itemContent"),c=De("groupContent"),u=De("ScrollSeekPlaceholder")||bV,d=De("GroupComponent"),h=De("TableRowComponent"),f=(e?t.topItems:[]).reduce((g,p,v)=>(v===0?g.push(p.size):g.push(g[v-1]+p.size),g),[]),b=(e?t.topItems:t.items).map(g=>{const p=g.originalIndex,v=n(p+r,g.data,o),y=e?p===0?0:f[p-1]:0;return i?S.createElement(u,{...lt(u,o),height:g.size,index:g.index,key:v,type:g.type||"item"}):g.type==="group"?S.createElement(d,{...lt(d,o),"data-index":p,"data-item-index":g.index,"data-known-size":g.size,key:v,style:{...jw,top:a}},c(g.index,o)):S.createElement(h,{...lt(h,o),...$w(h,g.data),"data-index":p,"data-item-index":g.index,"data-known-size":g.size,"data-item-group-index":g.groupIndex,key:v,style:e?{...jw,top:a+y}:wV},s?l(g.index,g.groupIndex,g.data,o):l(g.index,g.data,o))});return m.jsx(m.Fragment,{children:b})}),SV=S.memo(function(){const e=De("listState"),t=De("topItemsIndexes").length>0,n=kn("sizeRanges"),r=De("useWindowScroll"),o=De("customScrollParent"),i=kn("windowScrollContainerState"),a=kn("scrollContainerState"),s=o||r?i:a,l=De("trackItemSizes"),c=De("itemSize"),u=De("log"),{callbackRef:d,ref:h}=aw(n,c,l,s,u,void 0,o,!1,De("skipAnimationFrameInResizeObserver")),[f,b]=S.useState(0);Df("deviation",_=>{f!==_&&(h.current.style.marginTop=`${_}px`,b(_))});const g=De("EmptyPlaceholder"),p=De("FillerRow")||xV,v=De("TableBodyComponent"),y=De("paddingTopAddition"),x=De("statefulTotalCount"),T=De("context");if(x===0&&g)return m.jsx(g,{...lt(g,T)});const w=(t?e.topItems:[]).reduce((_,V)=>_+V.size,0),E=e.offsetTop+y+f-w,k=e.offsetBottom,C=E>0?m.jsx(p,{context:T,height:E},"padding-top"):null,O=k>0?m.jsx(p,{context:T,height:k},"padding-bottom"):null;return m.jsxs(v,{"data-testid":"virtuoso-item-list",ref:d,...lt(v,T),children:[C,t&&m.jsx(zw,{showTopList:!0}),m.jsx(zw,{}),O]})}),TV=({children:e})=>{const t=S.useContext(nl),n=kn("viewportHeight"),r=kn("fixedItemHeight"),o=Rn(S.useMemo(()=>oa(n,i=>En(i,"height")),[n]),!0,De("skipAnimationFrameInResizeObserver"));return S.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),m.jsx("div",{"data-viewport-type":"element",ref:o,style:ti(!1),children:e})},EV=({children:e})=>{const t=S.useContext(nl),n=kn("windowViewportRect"),r=kn("fixedItemHeight"),o=De("customScrollParent"),i=df(n,o,De("skipAnimationFrameInResizeObserver"));return S.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),m.jsx("div",{"data-viewport-type":"window",ref:i,style:ti(!1),children:e})},kV=S.memo(function(e){const t=De("useWindowScroll"),n=De("customScrollParent"),r=kn("fixedHeaderHeight"),o=kn("fixedFooterHeight"),i=De("fixedHeaderContent"),a=De("fixedFooterContent"),s=De("context"),l=Rn(S.useMemo(()=>oa(r,v=>En(v,"height")),[r]),!0,De("skipAnimationFrameInResizeObserver")),c=Rn(S.useMemo(()=>oa(o,v=>En(v,"height")),[o]),!0,De("skipAnimationFrameInResizeObserver")),u=n||t?PV:AV,d=n||t?EV:TV,h=De("TableComponent"),f=De("TableHeadComponent"),b=De("TableFooterComponent"),g=i?m.jsx(f,{ref:l,style:{position:"sticky",top:0,zIndex:2},...lt(f,s),children:i()},"TableHead"):null,p=a?m.jsx(b,{ref:c,style:{bottom:0,position:"sticky",zIndex:1},...lt(b,s),children:a()},"TableFoot"):null;return m.jsx(u,{...e,...lt(u,s),children:m.jsx(d,{children:m.jsxs(h,{style:{borderSpacing:0,overflowAnchor:"none"},...lt(h,s),children:[g,m.jsx(SV,{},"TableBody"),p]})})})}),{Component:CV,useEmitter:Df,useEmitterValue:De,usePublisher:kn}=Ef(yV,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},kV),AV=If({useEmitter:Df,useEmitterValue:De,usePublisher:kn}),PV=_f({useEmitter:Df,useEmitterValue:De,usePublisher:kn}),IV=CV,Rw={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},_V={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Bw,floor:rl,max:ha,min:Nf,round:Hw}=Math;function Ww(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({data:n===null?null:n[o+e],index:o+e}))}function OV(e){return{..._V,items:e}}function ol(e,t){return e&&e.width===t.width&&e.height===t.height}function MV(e,t){return e&&e.column===t.column&&e.row===t.row}const DV=Ye(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:o,headerHeight:i,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:c,smoothScrollTargetReached:u,viewportHeight:d},h,f,{didMount:b,propsReady:g},{customScrollParent:p,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:T},w])=>{const E=se(0),k=se(0),C=se(Rw),O=se({height:0,width:0}),_=se({height:0,width:0}),V=Be(),L=Be(),R=se(0),I=se(null),M=se({column:0,row:0}),H=Be(),D=Be(),A=se(!1),F=se(0),N=se(!0),W=se(!1),j=se(!1);rt(oe(b,je(F),Ce(([B,U])=>!!U)),()=>{Ve(N,!1)}),rt(oe(_t(b,N,_,O,F,W),Ce(([B,U,X,Q,,z])=>B&&!U&&X.height!==0&&Q.height!==0&&!z)),([,,,,B])=>{Ve(W,!0),bf(1,()=>{Ve(V,B)}),$n(oe(c),()=>{Ve(t,[0,0]),Ve(N,!0)})}),ye(oe(D,Ce(B=>B!=null&&B.scrollTop>0),jn(0)),k),rt(oe(b,je(D),Ce(([,B])=>B!=null)),([,B])=>{B&&(Ve(O,B.viewport),Ve(_,B.item),Ve(M,B.gap),B.scrollTop>0&&(Ve(A,!0),$n(oe(c,Jo(1)),U=>{Ve(A,!1)}),Ve(l,{top:B.scrollTop})))}),ye(oe(O,fe(({height:B})=>B)),d),ye(oe(_t(Ae(O,ol),Ae(_,ol),Ae(M,(B,U)=>B&&B.column===U.column&&B.row===U.row),Ae(c)),fe(([B,U,X,Q])=>({gap:X,item:U,scrollTop:Q,viewport:B}))),H),ye(oe(_t(Ae(E),r,Ae(M,MV),Ae(_,ol),Ae(O,ol),Ae(I),Ae(k),Ae(A),Ae(N),Ae(F)),Ce(([,,,,,,,B])=>!B),fe(([B,[U,X],Q,z,ae,le,be,,we,Se])=>{const{column:Pe,row:Te}=Q,{height:ve,width:Re}=z,{width:de}=ae;if(be===0&&(B===0||de===0))return Rw;if(Re===0){const xt=xf(Se,B),Yt=xt+Math.max(be-1,0);return OV(Ww(xt,Yt,le))}const Y=qw(de,Re,Pe);let $,J;we?U===0&&X===0&&be>0?($=0,J=be-1):($=Y*rl((U+Te)/(ve+Te)),J=Y*Bw((X+Te)/(ve+Te))-1,J=Nf(B-1,ha(J,Y-1)),$=Nf(J,ha(0,$))):($=0,J=-1);const ce=Ww($,J,le),{bottom:xe,top:Ne}=Uw(ae,Q,z,ce),Ge=Bw(B/Y),Lt=Ge*ve+(Ge-1)*Te-xe;return{bottom:xe,itemHeight:ve,items:ce,itemWidth:Re,offsetBottom:Lt,offsetTop:Ne,top:Ne}})),C),ye(oe(I,Ce(B=>B!==null),fe(B=>B.length)),E),ye(oe(_t(O,_,C,M),Ce(([B,U,{items:X}])=>X.length>0&&U.height!==0&&B.height!==0),fe(([B,U,{items:X},Q])=>{const{bottom:z,top:ae}=Uw(B,Q,U,X);return[ae,z]}),ft(sa)),t);const Z=se(!1);ye(oe(c,je(Z),fe(([B,U])=>U||B!==0)),Z);const G=on(oe(_t(C,E),Ce(([{items:B}])=>B.length>0),je(Z),Ce(([[B,U],X])=>{const Q=B.items[B.items.length-1].index===U-1;return(X||B.bottom>0&&B.itemHeight>0&&B.offsetBottom===0&&B.items.length===U)&&Q}),fe(([[,B]])=>B-1),ft())),re=on(oe(Ae(C),Ce(({items:B})=>B.length>0&&B[0].index===0),jn(0),ft())),te=on(oe(Ae(C),je(A),Ce(([{items:B},U])=>B.length>0&&!U),fe(([{items:B}])=>({endIndex:B[B.length-1].index,startIndex:B[0].index})),ft(hw),Sr(0)));ye(te,f.scrollSeekRangeChanged),ye(oe(V,je(O,_,E,M),fe(([B,U,X,Q,z])=>{const ae=xw(B),{align:le,behavior:be,offset:we}=ae;let Se=ae.index;Se==="LAST"&&(Se=Q-1),Se=ha(0,Se,Nf(Q-1,Se));let Pe=Ff(U,z,X,Se);return le==="end"?Pe=Hw(Pe-U.height+X.height):le==="center"&&(Pe=Hw(Pe-U.height/2+X.height/2)),we&&(Pe+=we),{behavior:be,top:Pe}})),l);const ee=Wt(oe(C,fe(B=>B.offsetBottom+B.bottom)),0);return ye(oe(T,fe(B=>({height:B.visibleHeight,width:B.visibleWidth}))),O),{customScrollParent:p,data:I,deviation:R,footerHeight:o,gap:M,headerHeight:i,increaseViewportBy:e,initialItemCount:k,itemDimensions:_,overscan:n,restoreStateFrom:D,scrollBy:a,scrollContainerState:s,scrollHeight:L,scrollTo:l,scrollToIndex:V,scrollTop:c,smoothScrollTargetReached:u,totalCount:E,useWindowScroll:v,viewportDimensions:O,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:T,...f,gridState:C,horizontalDirection:j,initialTopMostItemIndex:F,totalListHeight:ee,...h,endReached:G,propsReady:g,rangeChanged:te,startReached:re,stateChanged:H,stateRestoreInProgress:A,...w}},dt(wf,Kt,pa,Iw,Er,Tf,Tr));function qw(e,t,n){return ha(1,rl((e+n)/(rl(t)+n)))}function Uw(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{bottom:0,top:0};const i=Ff(e,t,n,r[0].index);return{bottom:Ff(e,t,n,r[r.length-1].index)+o,top:i}}function Ff(e,t,n,r){const o=qw(e.width,n.width,t.column),i=rl(r/o),a=i*n.height+ha(0,i-1)*t.row;return a>0?a+t.row:a}const NV=Ye(()=>{const e=se(d=>`Item ${d}`),t=se({}),n=se(null),r=se("virtuoso-grid-item"),o=se("virtuoso-grid-list"),i=se(Pf),a=se("div"),s=se(Qo),l=(d,h=null)=>Wt(oe(t,fe(f=>f[d]),ft()),h),c=se(!1),u=se(!1);return ye(Ae(u),c),{components:t,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:o,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:u,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),FV=Ye(([e,t])=>({...e,...t}),dt(DV,NV)),LV=S.memo(function(){const e=pt("gridState"),t=pt("listClassName"),n=pt("itemClassName"),r=pt("itemContent"),o=pt("computeItemKey"),i=pt("isSeeking"),a=vn("scrollHeight"),s=pt("ItemComponent"),l=pt("ListComponent"),c=pt("ScrollSeekPlaceholder"),u=pt("context"),d=vn("itemDimensions"),h=vn("gap"),f=pt("log"),b=pt("stateRestoreInProgress"),g=vn("reportReadyState"),p=Rn(S.useMemo(()=>v=>{const y=v.parentElement.parentElement.scrollHeight;a(y);const x=v.firstChild;if(x){const{height:T,width:w}=x.getBoundingClientRect();d({height:T,width:w})}h({column:Yw("column-gap",getComputedStyle(v).columnGap,f),row:Yw("row-gap",getComputedStyle(v).rowGap,f)})},[a,d,h,f]),!0,!1);return Dw(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),b?null:m.jsx(l,{className:t,ref:p,...lt(l,u),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(v=>{const y=o(v.index,v.data,u);return i?m.jsx(c,{...lt(c,u),height:e.itemHeight,index:v.index,width:e.itemWidth},y):S.createElement(s,{...lt(s,u),className:n,"data-index":v.index,key:y},r(v.index,v.data,u))})})}),VV=S.memo(function(){const e=pt("HeaderComponent"),t=vn("headerHeight"),n=pt("headerFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,!1),o=pt("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null}),$V=S.memo(function(){const e=pt("FooterComponent"),t=vn("footerHeight"),n=pt("headerFooterTag"),r=Rn(S.useMemo(()=>i=>{t(En(i,"height"))},[t]),!0,!1),o=pt("context");return e?m.jsx(n,{ref:r,children:m.jsx(e,{...lt(e,o)})}):null}),jV=({children:e})=>{const t=S.useContext(Mw),n=vn("itemDimensions"),r=vn("viewportDimensions"),o=Rn(S.useMemo(()=>i=>{r(i.getBoundingClientRect())},[r]),!0,!1);return S.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),m.jsx("div",{ref:o,style:ti(!1),children:e})},zV=({children:e})=>{const t=S.useContext(Mw),n=vn("windowViewportRect"),r=vn("itemDimensions"),o=pt("customScrollParent"),i=df(n,o,!1);return S.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),m.jsx("div",{ref:i,style:ti(!1),children:e})},RV=S.memo(function({...e}){const t=pt("useWindowScroll"),n=pt("customScrollParent"),r=n||t?HV:BV,o=n||t?zV:jV,i=pt("context");return m.jsx(r,{...e,...lt(r,i),children:m.jsxs(o,{children:[m.jsx(VV,{}),m.jsx(LV,{}),m.jsx($V,{})]})})}),{useEmitter:Kw,useEmitterValue:pt,usePublisher:vn}=Ef(FV,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},RV),BV=If({useEmitter:Kw,useEmitterValue:pt,usePublisher:vn}),HV=_f({useEmitter:Kw,useEmitterValue:pt,usePublisher:vn});function Yw(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jt.WARN),t==="normal"?0:parseInt(t??"0",10)}const WV=e=>m.jsx(S.Fragment,{children:e.children}),qV={duration:300,initial:{transform:"scaleY(0)",opacity:.2},open:{transform:"scaleY(1)",opacity:1},close:{transform:"scaleY(0)",opacity:0}},UV=[],KV=S.forwardRef(function(t,n){return m.jsx(et.ul,{...t,ref:n,className:"w-full overscroll-contain rounded-lg",children:m.jsx(Xn,{children:t.children})})}),YV=S.forwardRef(function({item:t,context:n,...r},o){return m.jsx(et.li,{...r,ref:o,className:"first:rounded-t-lg last:rounded-t-lg"})}),GV={List:KV,Item:YV},ni=44,ZV=S.forwardRef(({left:e,error:t,right:n,loading:r,options:o,container:i,rightLabel:a,interactive:s,emptyMessage:l,optionalText:c,labelClassName:u,feedback:d=null,hideLeft:h=!1,required:f=!1,dynamicOption:b=!1,...g},p)=>{const v=S.useRef(null),y=S.useRef(null),x=S.useRef(null),T=g.value??g.defaultValue??"",w=Et(),[E,k]=S.useState(()=>Math.min(320,ni*o.length)),[C,O]=S.useState(!1),[_,V]=S.useState(""),[L,R]=S.useState(T),[I,M]=S.useState(()=>o.find(Y=>Y.value===T)?.label??T),[H,D]=S.useState(null),A=S.useRef(UV),F=rf(C,"block-only"),N=b&&_!==""?[{value:_,label:_,"data-dynamic":"true"},...o]:o,W=()=>so.flushSync(()=>O(!0)),j=_?tf(N,"value",[{key:"value",value:_},{key:"label",value:_}]):N,Z=()=>{O(!1),k(0)},G=j.filter(Y=>Y.hidden!==!0),re=b?void 0:`^(${o.map(Y=>`${rd(Y.value)}${Y.label?"|"+rd(Y.label):""}`).join("|")})$`,{x:te,y:ee,strategy:B,refs:U,context:X}=tr({open:C,transform:!0,onOpenChange:O,placement:"bottom-start",whileElementsMounted:Ho,middleware:[Xi(4),Gb({padding:10,elementContext:"reference",apply(Y){const J=Y.elements.floating.querySelector("ul")?.getBoundingClientRect().height||0,ce=bi(U.reference.current,window.innerHeight),xe=Math.min(J<ni?ce:J,ce,Y.availableHeight),Ne=G.length===0?ni:Math.min(xe,ce,J),Ge=`${y.current.getBoundingClientRect().width}px`;Object.assign(Y.elements.floating.style,{width:Ge,maxWidth:Ge,height:Ne})}})]}),Q=Ix(X,qV),{getReferenceProps:z,getFloatingProps:ae,getItemProps:le}=nr([xr(X,{role:"listbox"}),br(X),Ns(X,{cols:0,listRef:A,loop:!0,virtual:!0,allowEscape:!0,activeIndex:H,selectedIndex:H,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,scrollItemIntoView:!0})]);S.useEffect(()=>{if(g.value){const Y=o.find($=>$.value===g.value);Y&&(M(Y.label??Y.value),R(g.value))}},[g.value,o.length]),S.useEffect(()=>{if(!C)return k(0);const Y=U.reference;if(Y.current===null)return;const $=bi(Y.current,window.innerHeight);setTimeout(()=>k(Math.min($,G.length*ni)),100)},[_,C,U.reference,G.length]),S.useEffect(()=>{const Y=U.reference.current;if(Y)return yi(Y)},[]);const be=(Y,$)=>{R(Y.value);const J=U.reference.current;if(!J)return;J?.setAttribute("data-value",Y.value),J.value=Y.value;const ce=new Event("change",{bubbles:!1,cancelable:!0});J.dispatchEvent(ce),g.onChange&&g.onChange(ce),M(Y.label??""),Z(),V(""),D($)},we=Y=>{const $=Y.target.value;return V($),!C&&$===""?O(!0):(Y.target.name=g.name||"",$?O(!0):g.onChange?.(Y))},Se=()=>{W(),V(""),U.reference.current?.focus()},Pe=()=>{D(Y=>Y===null?0:Y),W(),V("")},Te=()=>{U.reference.current?.setAttribute("data-value",""),V(""),R(""),M(""),Yh(U.reference.current),Z()},ve=g.id||g.name,Re=`${ve}-shadow`,de=G.length===0;return m.jsxs(na,{...g,left:e,error:t,ref:y,form:g.form,loading:r,name:g.name,feedback:d,hideLeft:h,required:f,title:g.title,container:i,rightLabel:a,interactive:s,id:Re,optionalText:c,componentName:"autocomplete",labelClassName:u,placeholder:g.placeholder,right:m.jsxs("span",{className:"flex items-center gap-0.5",children:[n,m.jsxs("button",{type:"button",className:"p-2 transition-colors link:text-primary md:p-1",onClick:Se,children:[m.jsx(Nu,{size:20}),m.jsx("span",{className:"sr-only",children:w.inputCaretDown})]}),L?m.jsx("button",{type:"button",onClick:Te,className:"p-2 transition-colors link:text-danger md:p-1",children:m.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.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:[m.jsx("input",{"data-shadow":"true",...z({...g,onFocus:Pe,pattern:re,onChange:we,id:Re,name:Re,ref:U.setReference,onClick:Y=>Y.currentTarget.focus(),onKeyDown(Y){if(Y.key==="Escape")return Y.currentTarget.blur(),Z();if(C){if(Y.key==="ArrowDown"){let $=$e.number(H)?H+1:0;return $>G.length-1&&($=0),x.current?.scrollIntoView({index:$}),D($)}if(Y.key==="ArrowUp"){let $=$e.number(H)?H-1:G.length-1;return $<0&&($=G.length-1),x.current?.scrollIntoView({index:$}),D($)}if(Y.key==="Enter"){if(H!==null&&G[H])return Y.preventDefault(),be(G[H],H);if(G.length===1)return Y.preventDefault(),be(G[0],0)}}}}),"data-value":L,"data-error":!!t,"data-name":ve,"data-target":ve,required:f,value:C?_:o.length===0?"":I||L,"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","text-base group-focus-within:border-primary group-hover:border-primary",g.className)}),m.jsx("input",{id:ve,name:ve,type:"hidden","data-origin":ve,ref:p,required:f,defaultValue:g.value||L||void 0}),m.jsx(yr,{preserveTabOrder:!0,children:C?m.jsx(Zr,{modal:!0,guards:!0,returnFocus:!1,context:X,initialFocus:-1,visuallyHiddenDismiss:!0,children:m.jsxs(et.div,{...ae({ref:Kn(F,U.setFloating),style:{...Q.styles,left:te,top:ee??0,position:B}}),initial:!1,"data-floating":"true",animate:{height:de?"auto":E},className:"isolate z-floating m-0 max-h-80 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating ease-in-out",onAnimationComplete:()=>{if(!C)return k(0);const $=U.floating.current.querySelectorAll("li").item(0),J=($?$.getBoundingClientRect().height:ni)*G.length;return so.flushSync(()=>k(J+10))},children:[de?m.jsx("div",{role:"option",className:"w-full border-b border-tooltip-border",children:m.jsx("span",{className:"flex w-full justify-between p-2 text-left text-disabled",children:l||w.autocompleteEmpty})}):null,m.jsx(Mf,{overscan:40,ref:x,hidden:de,data:G,style:{height:E-10},defaultItemHeight:ni,components:GV,scrollerRef:Y=>void(v.current=Y),className:"max-h-[calc(100%-2px)] overscroll-contain rounded-lg border-floating bg-floating-background p-0 text-foreground",itemContent:(Y,$)=>{const J=$.Render??WV,ce=L===$.value||L===$.label,xe=H===Y,Ne=$.label??$.value;return m.jsx("button",{"data-value":$.value,...le({ref:Ge=>void(A.current[Y]=Ge),role:"option",type:"button","aria-checked":ce,"aria-current":ce,"aria-selected":ce,"aria-busy":$.disabled,onClick:()=>be($,Y),className:`cursor-pointer min-h-10 hover:bg-floating-hover w-full p-2 text-left ${ce?"bg-primary-hover text-primary-foreground":""} ${xe?"bg-floating-hover text-floating-foreground":""}`}),children:m.jsx(J,{...g,label:$.label,value:$.value,children:Ne})})}})]})}):null})]})}),Lf=S.forwardRef(({children:e,asTask:t=!1,labelClassName:n,loading:r,error:o,className:i="",size:a,container:s,...l},c)=>{const u=l.disabled||r;return m.jsxs("label",{"aria-disabled":u,"data-disabled":u,"data-task":t,"data-component":"checkbox",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:[m.jsx("input",{...l,ref:c,disabled:u,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",i)}),e,m.jsx("span",{"data-name":"checkbox-label",className:ke("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden",n),children:o})]})}),Gw=new Date(1970,11,31),Vf={year:()=>[/\d/,/\d/,/\d/,/\d/],month:()=>[/\d/,/\d/],day:()=>[/\d/,/\d/],hour:()=>[/\d/,/\d/],minute:()=>[/\d/,/\d/],literal:e=>e.split("")},Zw={day:()=>"dd",hour:()=>"HH",month:()=>"MM",minute:()=>"mm",year:()=>"yyyy",literal:e=>e},XV={literal:(e,t)=>t,hour:e=>e.getHours().toString(),year:e=>e.getFullYear().toString(),minute:e=>e.getMinutes().toString(),day:e=>e.getDate().toString().padStart(2,"0"),month:e=>(e.getMonth()+1).toString().padStart(2,"0")},$f=(e,t)=>{try{return e.formatToParts(t).map(n=>n.type==="literal"&&n.value===", "?{type:n.type,value:" "}:n)}catch{return[]}},QV=S.forwardRef(({date:e,locale:t,disabledDate:n,onChange:r,markToday:o,clickToClose:i,type:a,...s},l)=>{const c=td(t),u=S.useId(),d=Et(),h=S.useMemo(()=>new Intl.DateTimeFormat(c,a==="datetime"?{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}:{day:"numeric",month:"numeric",year:"numeric"}),[c,a]),[f,b]=S.useState(e||void 0),[g,p]=S.useState(!1),v=$f(h,Gw).flatMap(O=>$e.keyof(Vf,O.type)?Vf[O.type](O.value):[]),y=$f(h,Gw).reduce((O,_)=>O+($e.keyof(Zw,_.type)?Zw[_.type](_.value):""),""),[x,T]=S.useState(f?$f(h,f).reduce((O,_)=>O+($e.keyof(Vf,_.type)?XV[_.type](f,_.value):""),""):""),w=O=>{const _=O.target.value;if(T(_),v.length===_.length&&v.every((L,R)=>{const I=_.charAt(R);return typeof L=="string"?I===L:L.test(I)})){const L=JO(_,y,new Date),R=a==="datetime"?L:Hr(L);return b(R),r?.(R)}return b(void 0),r?.(void 0)},E=O=>(b(O),r?.(O),i&&p(!1),T(O?Ny(O,y):"")),k=$u(f),C=k?f.toISOString():void 0;return m.jsx(Ko,{...s,mask:v,value:x,id:void 0,name:void 0,"data-value":C,formNoValidate:!g,"data-target":s.name,"data-component":"date-picker",onChange:w,required:s.required??!0,error:g?void 0:s.error,placeholder:s.placeholder||y,right:m.jsxs(S.Fragment,{children:[m.jsx("input",{"data-origin":s.name,defaultValue:C,form:s.form,hidden:!0,id:s.name,name:s.name,ref:l,type:"date"}),m.jsx(Zo,{open:g,onChange:p,buttonProps:{"aria-describedby":u},trigger:m.jsxs("span",{"aria-labelledby":u,children:[m.jsx("span",{id:u,className:"sr-only",children:d.datePickerCalendarButtonLabel}),m.jsx(FI,{})]}),children:m.jsx(zx,{...s,type:a,locale:c,changeOnlyOnClick:!0,markToday:o,onChange:E,disabledDate:n,date:k?f:void 0})})]})})}),JV=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],e$=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],t$=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],n$=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Xw=(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},Qw=e=>{if(typeof e=="number")return Math.log10(e);const t=e.toString(10);return t.length+Math.log10("0."+t.slice(0,15))},r$=e=>typeof e=="number"?Math.log(e):Qw(e)*Math.log(10),o$=(e,t)=>{if(typeof e=="number")return e/t;const n=e/BigInt(t),r=e%BigInt(t);return Number(n)+Number(r)/t};function i$(e,t){if(typeof e!="bigint"&&!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?n$:t$:t.binary?e$:JV,r=t.space?" ":"";if(t.signed&&(typeof e=="number"?e===0:e===0n))return` 0${r}${n[0]}`;const o=e<0,i=o?"-":t.signed?"+":"";o&&(e=-e);let a;if(t.minimumFractionDigits!==void 0&&(a={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(a={maximumFractionDigits:t.maximumFractionDigits,...a}),e<1){const u=Xw(e,t.locale,a);return i+u+r+n[0]}const s=Math.min(Math.floor(t.binary?r$(e)/Math.log(1024):Qw(e)/3),n.length-1);e=o$(e,(t.binary?1024:1e3)**s),a||(e=e.toPrecision(3));const l=Xw(Number(e),t.locale,a),c=n[s];return i+l+r+c}var il={exports:{}},al={exports:{}},Xe={};/** @license React v16.13.1
223
223
  * react-is.production.min.js
224
224
  *
225
225
  * Copyright (c) Facebook, Inc. and its affiliates.