import{c as ue,p as be,q as ct,r as v,s as Ge,j as p,P as X,t as F,v as Q,w as gt,x as ft,y as Ue,z as Ce,A as Dn,D as $n,E as Vn,F as An,G as Nn,H as jn,I as Gn,J as On,K as pt,a as T,o as Tn,M as Ln,N as kn,B as oe}from"./main-pzSpmpV2.js";import{S as Hn,a as zn,b as Bn,c as bn,d as Un}from"./FetchWrapper-DtDh1OOQ.js";import{a as Kn,C as qn}from"./chevron-right-aCSBeO6-.js";import{c as mt,R as Xn,A as Yn,C as Wn,a as Jn}from"./index-BtdXaa8D.js";import{C as Zn}from"./chevrons-up-down-ZAOsMAOK.js";/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const st=ue("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lt=ue("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qn=ue("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eo=ue("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
 * @license lucide-react v0.302.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const to=ue("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);var ye="rovingFocusGroup.onEntryFocus",no={bubbles:!1,cancelable:!0},ae="RovingFocusGroup",[Oe,vt,oo]=ct(ae),[ro,wt]=be(ae,[oo]),[io,so]=ro(ae),ht=v.forwardRef((e,o)=>p.jsx(Oe.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Oe.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(lo,{...e,ref:o})})}));ht.displayName=ae;var lo=v.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,...f}=e,c=v.useRef(null),u=Q(o,c),m=gt(i),[w,h]=ft({prop:s,defaultProp:l??null,onChange:a,caller:ae}),[S,M]=v.useState(!1),x=Ue(d),I=vt(t),P=v.useRef(!1),[N,G]=v.useState(0);return v.useEffect(()=>{const y=c.current;if(y)return y.addEventListener(ye,x),()=>y.removeEventListener(ye,x)},[x]),p.jsx(io,{scope:t,orientation:n,dir:m,loop:r,currentTabStopId:w,onItemFocus:v.useCallback(y=>h(y),[h]),onItemShiftTab:v.useCallback(()=>M(!0),[]),onFocusableItemAdd:v.useCallback(()=>G(y=>y+1),[]),onFocusableItemRemove:v.useCallback(()=>G(y=>y-1),[]),children:p.jsx(X.div,{tabIndex:S||N===0?-1:0,"data-orientation":n,...f,ref:u,style:{outline:"none",...e.style},onMouseDown:F(e.onMouseDown,()=>{P.current=!0}),onFocus:F(e.onFocus,y=>{const B=!P.current;if(y.target===y.currentTarget&&B&&!S){const L=new CustomEvent(ye,no);if(y.currentTarget.dispatchEvent(L),!L.defaultPrevented){const b=I().filter(k=>k.focusable),ee=b.find(k=>k.active),ge=b.find(k=>k.id===w),Fe=[ee,ge,...b].filter(Boolean).map(k=>k.ref.current);Rt(Fe,g)}}P.current=!1}),onBlur:F(e.onBlur,()=>M(!1))})})}),St="RovingFocusGroupItem",Ct=v.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:i,children:s,...l}=e,a=Ge(),d=i||a,g=so(St,t),f=g.currentTabStopId===d,c=vt(t),{onFocusableItemAdd:u,onFocusableItemRemove:m,currentTabStopId:w}=g;return v.useEffect(()=>{if(n)return u(),()=>m()},[n,u,m]),p.jsx(Oe.ItemSlot,{scope:t,id:d,focusable:n,active:r,children:p.jsx(X.span,{tabIndex:f?0:-1,"data-orientation":g.orientation,...l,ref:o,onMouseDown:F(e.onMouseDown,h=>{n?g.onItemFocus(d):h.preventDefault()}),onFocus:F(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:F(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){g.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const S=co(h,g.orientation,g.dir);if(S!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let x=c().filter(I=>I.focusable).map(I=>I.ref.current);if(S==="last")x.reverse();else if(S==="prev"||S==="next"){S==="prev"&&x.reverse();const I=x.indexOf(h.currentTarget);x=g.loop?go(x,I+1):x.slice(I+1)}setTimeout(()=>Rt(x))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:w!=null}):s})})});Ct.displayName=St;var uo={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ao(e,o){return o!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function co(e,o,t){const n=ao(e.key,t);if(!(o==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(o==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return uo[n]}function Rt(e,o=!1){const t=document.activeElement;for(const n of e)if(n===t||(n.focus({preventScroll:o}),document.activeElement!==t))return}function go(e,o){return e.map((t,n)=>e[(o+n)%e.length])}var fo=ht,po=Ct,Te=["Enter"," "],mo=["ArrowDown","PageUp","Home"],_t=["ArrowUp","PageDown","End"],vo=[...mo,..._t],wo={ltr:[...Te,"ArrowRight"],rtl:[...Te,"ArrowLeft"]},ho={ltr:["ArrowLeft"],rtl:["ArrowRight"]},de="Menu",[se,So,Co]=ct(de),[Y,xt]=be(de,[Co,mt,wt]),Re=mt(),Mt=wt(),[Ro,W]=Y(de),[_o,ce]=Y(de),Ft=e=>{const{__scopeMenu:o,open:t=!1,children:n,dir:r,onOpenChange:i,modal:s=!0}=e,l=Re(o),[a,d]=v.useState(null),g=v.useRef(!1),f=Ue(i),c=gt(r);return v.useEffect(()=>{const u=()=>{g.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>g.current=!1;return document.addEventListener("keydown",u,{capture:!0}),()=>{document.removeEventListener("keydown",u,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),p.jsx(Xn,{...l,children:p.jsx(Ro,{scope:o,open:t,onOpenChange:f,content:a,onContentChange:d,children:p.jsx(_o,{scope:o,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:g,dir:c,modal:s,children:n})})})};Ft.displayName=de;var xo="MenuAnchor",Ke=v.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e,r=Re(t);return p.jsx(Yn,{...r,...n,ref:o})});Ke.displayName=xo;var qe="MenuPortal",[Mo,It]=Y(qe,{forceMount:void 0}),Pt=e=>{const{__scopeMenu:o,forceMount:t,children:n,container:r}=e,i=W(qe,o);return p.jsx(Mo,{scope:o,forceMount:t,children:p.jsx(Ce,{present:t||i.open,children:p.jsx(Dn,{asChild:!0,container:r,children:n})})})};Pt.displayName=qe;var A="MenuContent",[Fo,Xe]=Y(A),yt=v.forwardRef((e,o)=>{const t=It(A,e.__scopeMenu),{forceMount:n=t.forceMount,...r}=e,i=W(A,e.__scopeMenu),s=ce(A,e.__scopeMenu);return p.jsx(se.Provider,{scope:e.__scopeMenu,children:p.jsx(Ce,{present:n||i.open,children:p.jsx(se.Slot,{scope:e.__scopeMenu,children:s.modal?p.jsx(Io,{...r,ref:o}):p.jsx(Po,{...r,ref:o})})})})}),Io=v.forwardRef((e,o)=>{const t=W(A,e.__scopeMenu),n=v.useRef(null),r=Q(o,n);return v.useEffect(()=>{const i=n.current;if(i)return $n(i)},[]),p.jsx(Ye,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:F(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Po=v.forwardRef((e,o)=>{const t=W(A,e.__scopeMenu);return p.jsx(Ye,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),yo=jn("MenuContent.ScrollLock"),Ye=v.forwardRef((e,o)=>{const{__scopeMenu:t,loop:n=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:a,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:f,onInteractOutside:c,onDismiss:u,disableOutsideScroll:m,...w}=e,h=W(A,t),S=ce(A,t),M=Re(t),x=Mt(t),I=So(t),[P,N]=v.useState(null),G=v.useRef(null),y=Q(o,G,h.onContentChange),B=v.useRef(0),L=v.useRef(""),b=v.useRef(0),ee=v.useRef(null),ge=v.useRef("right"),fe=v.useRef(0),Fe=m?Nn:v.Fragment,k=m?{as:yo,allowPinchZoom:!0}:void 0,En=_=>{var Z,rt;const V=L.current+_,O=I().filter(H=>!H.disabled),U=document.activeElement,Ie=(Z=O.find(H=>H.ref.current===U))==null?void 0:Z.textValue,Pe=O.map(H=>H.textValue),ot=ko(Pe,V,Ie),te=(rt=O.find(H=>H.textValue===ot))==null?void 0:rt.ref.current;(function H(it){L.current=it,window.clearTimeout(B.current),it!==""&&(B.current=window.setTimeout(()=>H(""),1e3))})(V),te&&setTimeout(()=>te.focus())};v.useEffect(()=>()=>window.clearTimeout(B.current),[]),An();const J=v.useCallback(_=>{var O,U;return ge.current===((O=ee.current)==null?void 0:O.side)&&zo(_,(U=ee.current)==null?void 0:U.area)},[]);return p.jsx(Fo,{scope:t,searchRef:L,onItemEnter:v.useCallback(_=>{J(_)&&_.preventDefault()},[J]),onItemLeave:v.useCallback(_=>{var V;J(_)||((V=G.current)==null||V.focus(),N(null))},[J]),onTriggerLeave:v.useCallback(_=>{J(_)&&_.preventDefault()},[J]),pointerGraceTimerRef:b,onPointerGraceIntentChange:v.useCallback(_=>{ee.current=_},[]),children:p.jsx(Fe,{...k,children:p.jsx(Gn,{asChild:!0,trapped:r,onMountAutoFocus:F(i,_=>{var V;_.preventDefault(),(V=G.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:p.jsx(On,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:f,onInteractOutside:c,onDismiss:u,children:p.jsx(fo,{asChild:!0,...x,dir:S.dir,orientation:"vertical",loop:n,currentTabStopId:P,onCurrentTabStopIdChange:N,onEntryFocus:F(a,_=>{S.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Wn,{role:"menu","aria-orientation":"vertical","data-state":bt(h.open),"data-radix-menu-content":"",dir:S.dir,...M,...w,ref:y,style:{outline:"none",...w.style},onKeyDown:F(w.onKeyDown,_=>{const O=_.target.closest("[data-radix-menu-content]")===_.currentTarget,U=_.ctrlKey||_.altKey||_.metaKey,Ie=_.key.length===1;O&&(_.key==="Tab"&&_.preventDefault(),!U&&Ie&&En(_.key));const Pe=G.current;if(_.target!==Pe||!vo.includes(_.key))return;_.preventDefault();const te=I().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);_t.includes(_.key)&&te.reverse(),To(te)}),onBlur:F(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(B.current),L.current="")}),onPointerMove:F(e.onPointerMove,le(_=>{const V=_.target,O=fe.current!==_.clientX;if(_.currentTarget.contains(V)&&O){const U=_.clientX>fe.current?"right":"left";ge.current=U,fe.current=_.clientX}}))})})})})})})});yt.displayName=A;var Eo="MenuGroup",We=v.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return p.jsx(X.div,{role:"group",...n,ref:o})});We.displayName=Eo;var Do="MenuLabel",Et=v.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return p.jsx(X.div,{...n,ref:o})});Et.displayName=Do;var he="MenuItem",ut="menu.itemSelect",_e=v.forwardRef((e,o)=>{const{disabled:t=!1,onSelect:n,...r}=e,i=v.useRef(null),s=ce(he,e.__scopeMenu),l=Xe(he,e.__scopeMenu),a=Q(o,i),d=v.useRef(!1),g=()=>{const f=i.current;if(!t&&f){const c=new CustomEvent(ut,{bubbles:!0,cancelable:!0});f.addEventListener(ut,u=>n==null?void 0:n(u),{once:!0}),Vn(f,c),c.defaultPrevented?d.current=!1:s.onClose()}};return p.jsx(Dt,{...r,ref:a,disabled:t,onClick:F(e.onClick,g),onPointerDown:f=>{var c;(c=e.onPointerDown)==null||c.call(e,f),d.current=!0},onPointerUp:F(e.onPointerUp,f=>{var c;d.current||(c=f.currentTarget)==null||c.click()}),onKeyDown:F(e.onKeyDown,f=>{const c=l.searchRef.current!=="";t||c&&f.key===" "||Te.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});_e.displayName=he;var Dt=v.forwardRef((e,o)=>{const{__scopeMenu:t,disabled:n=!1,textValue:r,...i}=e,s=Xe(he,t),l=Mt(t),a=v.useRef(null),d=Q(o,a),[g,f]=v.useState(!1),[c,u]=v.useState("");return v.useEffect(()=>{const m=a.current;m&&u((m.textContent??"").trim())},[i.children]),p.jsx(se.ItemSlot,{scope:t,disabled:n,textValue:r??c,children:p.jsx(po,{asChild:!0,...l,focusable:!n,children:p.jsx(X.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:F(e.onPointerMove,le(m=>{n?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:F(e.onPointerLeave,le(m=>s.onItemLeave(m))),onFocus:F(e.onFocus,()=>f(!0)),onBlur:F(e.onBlur,()=>f(!1))})})})}),$o="MenuCheckboxItem",$t=v.forwardRef((e,o)=>{const{checked:t=!1,onCheckedChange:n,...r}=e;return p.jsx(Gt,{scope:e.__scopeMenu,checked:t,children:p.jsx(_e,{role:"menuitemcheckbox","aria-checked":Se(t)?"mixed":t,...r,ref:o,"data-state":Ze(t),onSelect:F(r.onSelect,()=>n==null?void 0:n(Se(t)?!0:!t),{checkForDefaultPrevented:!1})})})});$t.displayName=$o;var Vt="MenuRadioGroup",[Vo,Ao]=Y(Vt,{value:void 0,onValueChange:()=>{}}),At=v.forwardRef((e,o)=>{const{value:t,onValueChange:n,...r}=e,i=Ue(n);return p.jsx(Vo,{scope:e.__scopeMenu,value:t,onValueChange:i,children:p.jsx(We,{...r,ref:o})})});At.displayName=Vt;var Nt="MenuRadioItem",jt=v.forwardRef((e,o)=>{const{value:t,...n}=e,r=Ao(Nt,e.__scopeMenu),i=t===r.value;return p.jsx(Gt,{scope:e.__scopeMenu,checked:i,children:p.jsx(_e,{role:"menuitemradio","aria-checked":i,...n,ref:o,"data-state":Ze(i),onSelect:F(n.onSelect,()=>{var s;return(s=r.onValueChange)==null?void 0:s.call(r,t)},{checkForDefaultPrevented:!1})})})});jt.displayName=Nt;var Je="MenuItemIndicator",[Gt,No]=Y(Je,{checked:!1}),Ot=v.forwardRef((e,o)=>{const{__scopeMenu:t,forceMount:n,...r}=e,i=No(Je,t);return p.jsx(Ce,{present:n||Se(i.checked)||i.checked===!0,children:p.jsx(X.span,{...r,ref:o,"data-state":Ze(i.checked)})})});Ot.displayName=Je;var jo="MenuSeparator",Tt=v.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e;return p.jsx(X.div,{role:"separator","aria-orientation":"horizontal",...n,ref:o})});Tt.displayName=jo;var Go="MenuArrow",Lt=v.forwardRef((e,o)=>{const{__scopeMenu:t,...n}=e,r=Re(t);return p.jsx(Jn,{...r,...n,ref:o})});Lt.displayName=Go;var Oo="MenuSub",[Ii,kt]=Y(Oo),re="MenuSubTrigger",Ht=v.forwardRef((e,o)=>{const t=W(re,e.__scopeMenu),n=ce(re,e.__scopeMenu),r=kt(re,e.__scopeMenu),i=Xe(re,e.__scopeMenu),s=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:a}=i,d={__scopeMenu:e.__scopeMenu},g=v.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return v.useEffect(()=>g,[g]),v.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),a(null)}},[l,a]),p.jsx(Ke,{asChild:!0,...d,children:p.jsx(Dt,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":bt(t.open),...e,ref:pt(o,r.onTriggerChange),onClick:f=>{var c;(c=e.onClick)==null||c.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:F(e.onPointerMove,le(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!t.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{t.onOpenChange(!0),g()},100))})),onPointerLeave:F(e.onPointerLeave,le(f=>{var u,m;g();const c=(u=t.content)==null?void 0:u.getBoundingClientRect();if(c){const w=(m=t.content)==null?void 0:m.dataset.side,h=w==="right",S=h?-5:5,M=c[h?"left":"right"],x=c[h?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+S,y:f.clientY},{x:M,y:c.top},{x,y:c.top},{x,y:c.bottom},{x:M,y:c.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:F(e.onKeyDown,f=>{var u;const c=i.searchRef.current!=="";e.disabled||c&&f.key===" "||wo[n.dir].includes(f.key)&&(t.onOpenChange(!0),(u=t.content)==null||u.focus(),f.preventDefault())})})})});Ht.displayName=re;var zt="MenuSubContent",Bt=v.forwardRef((e,o)=>{const t=It(A,e.__scopeMenu),{forceMount:n=t.forceMount,...r}=e,i=W(A,e.__scopeMenu),s=ce(A,e.__scopeMenu),l=kt(zt,e.__scopeMenu),a=v.useRef(null),d=Q(o,a);return p.jsx(se.Provider,{scope:e.__scopeMenu,children:p.jsx(Ce,{present:n||i.open,children:p.jsx(se.Slot,{scope:e.__scopeMenu,children:p.jsx(Ye,{id:l.contentId,"aria-labelledby":l.triggerId,...r,ref:d,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var f;s.isUsingKeyboardRef.current&&((f=a.current)==null||f.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:F(e.onFocusOutside,g=>{g.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:F(e.onEscapeKeyDown,g=>{s.onClose(),g.preventDefault()}),onKeyDown:F(e.onKeyDown,g=>{var u;const f=g.currentTarget.contains(g.target),c=ho[s.dir].includes(g.key);f&&c&&(i.onOpenChange(!1),(u=l.trigger)==null||u.focus(),g.preventDefault())})})})})})});Bt.displayName=zt;function bt(e){return e?"open":"closed"}function Se(e){return e==="indeterminate"}function Ze(e){return Se(e)?"indeterminate":e?"checked":"unchecked"}function To(e){const o=document.activeElement;for(const t of e)if(t===o||(t.focus(),document.activeElement!==o))return}function Lo(e,o){return e.map((t,n)=>e[(o+n)%e.length])}function ko(e,o,t){const r=o.length>1&&Array.from(o).every(d=>d===o[0])?o[0]:o,i=t?e.indexOf(t):-1;let s=Lo(e,Math.max(i,0));r.length===1&&(s=s.filter(d=>d!==t));const a=s.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Ho(e,o){const{x:t,y:n}=e;let r=!1;for(let i=0,s=o.length-1;i<o.length;s=i++){const l=o[i],a=o[s],d=l.x,g=l.y,f=a.x,c=a.y;g>n!=c>n&&t<(f-d)*(n-g)/(c-g)+d&&(r=!r)}return r}function zo(e,o){if(!o)return!1;const t={x:e.clientX,y:e.clientY};return Ho(t,o)}function le(e){return o=>o.pointerType==="mouse"?e(o):void 0}var Bo=Ft,bo=Ke,Uo=Pt,Ko=yt,qo=We,Xo=Et,Yo=_e,Wo=$t,Jo=At,Zo=jt,Qo=Ot,er=Tt,tr=Lt,nr=Ht,or=Bt,xe="DropdownMenu",[rr,Pi]=be(xe,[xt]),D=xt(),[ir,Ut]=rr(xe),Kt=e=>{const{__scopeDropdownMenu:o,children:t,dir:n,open:r,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,a=D(o),d=v.useRef(null),[g,f]=ft({prop:r,defaultProp:i??!1,onChange:s,caller:xe});return p.jsx(ir,{scope:o,triggerId:Ge(),triggerRef:d,contentId:Ge(),open:g,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(c=>!c),[f]),modal:l,children:p.jsx(Bo,{...a,open:g,onOpenChange:f,dir:n,modal:l,children:t})})};Kt.displayName=xe;var qt="DropdownMenuTrigger",Xt=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,disabled:n=!1,...r}=e,i=Ut(qt,t),s=D(t);return p.jsx(bo,{asChild:!0,...s,children:p.jsx(X.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:pt(o,i.triggerRef),onPointerDown:F(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:F(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Xt.displayName=qt;var sr="DropdownMenuPortal",Yt=e=>{const{__scopeDropdownMenu:o,...t}=e,n=D(o);return p.jsx(Uo,{...n,...t})};Yt.displayName=sr;var Wt="DropdownMenuContent",Jt=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=Ut(Wt,t),i=D(t),s=v.useRef(!1);return p.jsx(Ko,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...n,ref:o,onCloseAutoFocus:F(e.onCloseAutoFocus,l=>{var a;s.current||(a=r.triggerRef.current)==null||a.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:F(e.onInteractOutside,l=>{const a=l.detail.originalEvent,d=a.button===0&&a.ctrlKey===!0,g=a.button===2||d;(!r.modal||g)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Jt.displayName=Wt;var lr="DropdownMenuGroup",ur=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(qo,{...r,...n,ref:o})});ur.displayName=lr;var ar="DropdownMenuLabel",Zt=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(Xo,{...r,...n,ref:o})});Zt.displayName=ar;var dr="DropdownMenuItem",Qt=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(Yo,{...r,...n,ref:o})});Qt.displayName=dr;var cr="DropdownMenuCheckboxItem",en=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(Wo,{...r,...n,ref:o})});en.displayName=cr;var gr="DropdownMenuRadioGroup",fr=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(Jo,{...r,...n,ref:o})});fr.displayName=gr;var pr="DropdownMenuRadioItem",tn=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(Zo,{...r,...n,ref:o})});tn.displayName=pr;var mr="DropdownMenuItemIndicator",nn=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(Qo,{...r,...n,ref:o})});nn.displayName=mr;var vr="DropdownMenuSeparator",on=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(er,{...r,...n,ref:o})});on.displayName=vr;var wr="DropdownMenuArrow",hr=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(tr,{...r,...n,ref:o})});hr.displayName=wr;var Sr="DropdownMenuSubTrigger",rn=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(nr,{...r,...n,ref:o})});rn.displayName=Sr;var Cr="DropdownMenuSubContent",sn=v.forwardRef((e,o)=>{const{__scopeDropdownMenu:t,...n}=e,r=D(t);return p.jsx(or,{...r,...n,ref:o,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sn.displayName=Cr;var Rr=Kt,_r=Xt,xr=Yt,ln=Jt,un=Zt,an=Qt,dn=en,cn=tn,gn=nn,fn=on,pn=rn,mn=sn;const Mr=Rr,Fr=_r,Ir=v.forwardRef(({className:e,inset:o,children:t,...n},r)=>p.jsxs(pn,{ref:r,className:T("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",o&&"pl-8",e),...n,children:[t,p.jsx(Ln,{className:"ml-auto h-4 w-4"})]}));Ir.displayName=pn.displayName;const Pr=v.forwardRef(({className:e,...o},t)=>p.jsx(mn,{ref:t,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Pr.displayName=mn.displayName;const vn=v.forwardRef(({className:e,sideOffset:o=4,...t},n)=>p.jsx(xr,{children:p.jsx(ln,{ref:n,sideOffset:o,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));vn.displayName=ln.displayName;const we=v.forwardRef(({className:e,inset:o,...t},n)=>p.jsx(an,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-8",e),...t}));we.displayName=an.displayName;const yr=v.forwardRef(({className:e,children:o,checked:t,...n},r)=>p.jsxs(dn,{ref:r,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t,...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(gn,{children:p.jsx(Tn,{className:"h-4 w-4"})})}),o]}));yr.displayName=dn.displayName;const Er=v.forwardRef(({className:e,children:o,...t},n)=>p.jsxs(cn,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(gn,{children:p.jsx(kn,{className:"h-4 w-4 fill-current"})})}),o]}));Er.displayName=cn.displayName;const Dr=v.forwardRef(({className:e,inset:o,...t},n)=>p.jsx(un,{ref:n,className:T("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",e),...t}));Dr.displayName=un.displayName;const wn=v.forwardRef(({className:e,...o},t)=>p.jsx(fn,{ref:t,className:T("-mx-1 my-1 h-px bg-muted",e),...o}));wn.displayName=fn.displayName;/**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function K(e,o){return typeof e=="function"?e(o):e}function $(e,o){return t=>{o.setState(n=>({...n,[e]:K(t,n[e])}))}}function Me(e){return e instanceof Function}function $r(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function Vr(e,o){const t=[],n=r=>{r.forEach(i=>{t.push(i);const s=o(i);s!=null&&s.length&&n(s)})};return n(e),t}function C(e,o,t){let n=[],r;return i=>{let s;t.key&&t.debug&&(s=Date.now());const l=e(i);if(!(l.length!==n.length||l.some((g,f)=>n[f]!==g)))return r;n=l;let d;if(t.key&&t.debug&&(d=Date.now()),r=o(...l),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const g=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-d)*100)/100,c=f/16,u=(m,w)=>{for(m=String(m);m.length<w;)m=" "+m;return m};console.info(`%c⏱ ${u(f,5)} /${u(g,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*c,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function R(e,o,t,n){return{debug:()=>{var r;return(r=e==null?void 0:e.debugAll)!=null?r:e[o]},key:!1,onChange:n}}function Ar(e,o,t,n){const r=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:r,getContext:C(()=>[e,t,o,i],(s,l,a,d)=>({table:s,column:l,row:a,cell:d,getValue:d.getValue,renderValue:d.renderValue}),R(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,o,e)},{}),i}function Nr(e,o,t,n){var r,i;const l={...e._getDefaultColumnDef(),...o},a=l.accessorKey;let d=(r=(i=l.id)!=null?i:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,g;if(l.accessorFn?g=l.accessorFn:a&&(a.includes(".")?g=c=>{let u=c;for(const w of a.split(".")){var m;u=(m=u)==null?void 0:m[w]}return u}:g=c=>c[l.accessorKey]),!d)throw new Error;let f={id:`${String(d)}`,accessorFn:g,parent:n,depth:t,columnDef:l,columns:[],getFlatColumns:C(()=>[!0],()=>{var c;return[f,...(c=f.columns)==null?void 0:c.flatMap(u=>u.getFlatColumns())]},R(e.options,"debugColumns")),getLeafColumns:C(()=>[e._getOrderColumnsFn()],c=>{var u;if((u=f.columns)!=null&&u.length){let m=f.columns.flatMap(w=>w.getLeafColumns());return c(m)}return[f]},R(e.options,"debugColumns"))};for(const c of e._features)c.createColumn==null||c.createColumn(f,e);return f}const E="debugHeaders";function at(e,o,t){var n;let i={id:(n=t.id)!=null?n:o.id,column:o,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],l=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(l),s.push(a)};return l(i),s},getContext:()=>({table:e,header:i,column:o})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const jr={createTable:e=>{e.getHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,r)=>{var i,s;const l=(i=n==null?void 0:n.map(f=>t.find(c=>c.id===f)).filter(Boolean))!=null?i:[],a=(s=r==null?void 0:r.map(f=>t.find(c=>c.id===f)).filter(Boolean))!=null?s:[],d=t.filter(f=>!(n!=null&&n.includes(f.id))&&!(r!=null&&r.includes(f.id)));return pe(o,[...l,...d,...a],e)},R(e.options,E)),e.getCenterHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,r)=>(t=t.filter(i=>!(n!=null&&n.includes(i.id))&&!(r!=null&&r.includes(i.id))),pe(o,t,e,"center")),R(e.options,E)),e.getLeftHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var r;const i=(r=n==null?void 0:n.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?r:[];return pe(o,i,e,"left")},R(e.options,E)),e.getRightHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var r;const i=(r=n==null?void 0:n.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?r:[];return pe(o,i,e,"right")},R(e.options,E)),e.getFooterGroups=C(()=>[e.getHeaderGroups()],o=>[...o].reverse(),R(e.options,E)),e.getLeftFooterGroups=C(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),R(e.options,E)),e.getCenterFooterGroups=C(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),R(e.options,E)),e.getRightFooterGroups=C(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),R(e.options,E)),e.getFlatHeaders=C(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,E)),e.getLeftFlatHeaders=C(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,E)),e.getCenterFlatHeaders=C(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,E)),e.getRightFlatHeaders=C(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,E)),e.getCenterLeafHeaders=C(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,E)),e.getLeftLeafHeaders=C(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,E)),e.getRightLeafHeaders=C(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,E)),e.getLeafHeaders=C(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var r,i,s,l,a,d;return[...(r=(i=o[0])==null?void 0:i.headers)!=null?r:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(a=(d=n[0])==null?void 0:d.headers)!=null?a:[]].map(g=>g.getLeafHeaders()).flat()},R(e.options,E))}};function pe(e,o,t,n){var r,i;let s=0;const l=function(c,u){u===void 0&&(u=1),s=Math.max(s,u),c.filter(m=>m.getIsVisible()).forEach(m=>{var w;(w=m.columns)!=null&&w.length&&l(m.columns,u+1)},0)};l(e);let a=[];const d=(c,u)=>{const m={depth:u,id:[n,`${u}`].filter(Boolean).join("_"),headers:[]},w=[];c.forEach(h=>{const S=[...w].reverse()[0],M=h.column.depth===m.depth;let x,I=!1;if(M&&h.column.parent?x=h.column.parent:(x=h.column,I=!0),S&&(S==null?void 0:S.column)===x)S.subHeaders.push(h);else{const P=at(t,x,{id:[n,u,x.id,h==null?void 0:h.id].filter(Boolean).join("_"),isPlaceholder:I,placeholderId:I?`${w.filter(N=>N.column===x).length}`:void 0,depth:u,index:w.length});P.subHeaders.push(h),w.push(P)}m.headers.push(h),h.headerGroup=m}),a.push(m),u>0&&d(w,u-1)},g=o.map((c,u)=>at(t,c,{depth:s,index:u}));d(g,s-1),a.reverse();const f=c=>c.filter(m=>m.column.getIsVisible()).map(m=>{let w=0,h=0,S=[0];m.subHeaders&&m.subHeaders.length?(S=[],f(m.subHeaders).forEach(x=>{let{colSpan:I,rowSpan:P}=x;w+=I,S.push(P)})):w=1;const M=Math.min(...S);return h=h+M,m.colSpan=w,m.rowSpan=h,{colSpan:w,rowSpan:h}});return f((r=(i=a[0])==null?void 0:i.headers)!=null?r:[]),a}const Qe=(e,o,t,n,r,i,s)=>{let l={id:o,index:n,original:t,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(l._valuesCache.hasOwnProperty(a))return l._valuesCache[a];const d=e.getColumn(a);if(d!=null&&d.accessorFn)return l._valuesCache[a]=d.accessorFn(l.original,n),l._valuesCache[a]},getUniqueValues:a=>{if(l._uniqueValuesCache.hasOwnProperty(a))return l._uniqueValuesCache[a];const d=e.getColumn(a);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[a]=d.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[a]):(l._uniqueValuesCache[a]=[l.getValue(a)],l._uniqueValuesCache[a])},renderValue:a=>{var d;return(d=l.getValue(a))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Vr(l.subRows,a=>a.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let a=[],d=l;for(;;){const g=d.getParentRow();if(!g)break;a.push(g),d=g}return a.reverse()},getAllCells:C(()=>[e.getAllLeafColumns()],a=>a.map(d=>Ar(e,l,d,d.id)),R(e.options,"debugRows")),_getAllCellsByColumnId:C(()=>[l.getAllCells()],a=>a.reduce((d,g)=>(d[g.column.id]=g,d),{}),R(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const d=e._features[a];d==null||d.createRow==null||d.createRow(l,e)}return l},Gr={createColumn:(e,o)=>{e._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():o.getPreFilteredRowModel(),e._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},hn=(e,o,t)=>{var n,r;const i=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((r=e.getValue(o))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};hn.autoRemove=e=>j(e);const Sn=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};Sn.autoRemove=e=>j(e);const Cn=(e,o,t)=>{var n;return((n=e.getValue(o))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(t==null?void 0:t.toLowerCase())};Cn.autoRemove=e=>j(e);const Rn=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};Rn.autoRemove=e=>j(e);const _n=(e,o,t)=>!t.some(n=>{var r;return!((r=e.getValue(o))!=null&&r.includes(n))});_n.autoRemove=e=>j(e)||!(e!=null&&e.length);const xn=(e,o,t)=>t.some(n=>{var r;return(r=e.getValue(o))==null?void 0:r.includes(n)});xn.autoRemove=e=>j(e)||!(e!=null&&e.length);const Mn=(e,o,t)=>e.getValue(o)===t;Mn.autoRemove=e=>j(e);const Fn=(e,o,t)=>e.getValue(o)==t;Fn.autoRemove=e=>j(e);const et=(e,o,t)=>{let[n,r]=t;const i=e.getValue(o);return i>=n&&i<=r};et.resolveFilterValue=e=>{let[o,t]=e,n=typeof o!="number"?parseFloat(o):o,r=typeof t!="number"?parseFloat(t):t,i=o===null||Number.isNaN(n)?-1/0:n,s=t===null||Number.isNaN(r)?1/0:r;if(i>s){const l=i;i=s,s=l}return[i,s]};et.autoRemove=e=>j(e)||j(e[0])&&j(e[1]);const z={includesString:hn,includesStringSensitive:Sn,equalsString:Cn,arrIncludes:Rn,arrIncludesAll:_n,arrIncludesSome:xn,equals:Mn,weakEquals:Fn,inNumberRange:et};function j(e){return e==null||e===""}const Or={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,o)=>{e.getAutoFilterFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);return typeof n=="string"?z.includesString:typeof n=="number"?z.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?z.equals:Array.isArray(n)?z.arrIncludes:z.weakEquals},e.getFilterFn=()=>{var t,n;return Me(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=o.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:z[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=o.options.enableColumnFilters)!=null?n:!0)&&((r=o.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=o.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=o.getState().columnFilters)==null?void 0:n.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{o.setColumnFilters(n=>{const r=e.getFilterFn(),i=n==null?void 0:n.find(g=>g.id===e.id),s=K(t,i?i.value:void 0);if(dt(r,s,e)){var l;return(l=n==null?void 0:n.filter(g=>g.id!==e.id))!=null?l:[]}const a={id:e.id,value:s};if(i){var d;return(d=n==null?void 0:n.map(g=>g.id===e.id?a:g))!=null?d:[]}return n!=null&&n.length?[...n,a]:[a]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=r=>{var i;return(i=K(o,r))==null?void 0:i.filter(s=>{const l=t.find(a=>a.id===s.id);if(l){const a=l.getFilterFn();if(dt(a,s.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=o=>{var t,n;e.setColumnFilters(o?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dt(e,o,t){return(e&&e.autoRemove?e.autoRemove(o,t):!1)||typeof o>"u"||typeof o=="string"&&!o}const Tr=(e,o,t)=>t.reduce((n,r)=>{const i=r.getValue(e);return n+(typeof i=="number"?i:0)},0),Lr=(e,o,t)=>{let n;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}),n},kr=(e,o,t)=>{let n;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}),n},Hr=(e,o,t)=>{let n,r;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}),[n,r]},zr=(e,o)=>{let t=0,n=0;if(o.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,n+=i)}),t)return n/t},Br=(e,o)=>{if(!o.length)return;const t=o.map(i=>i.getValue(e));if(!$r(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),r=t.sort((i,s)=>i-s);return t.length%2!==0?r[n]:(r[n-1]+r[n])/2},br=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),Ur=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,Kr=(e,o)=>o.length,Ee={sum:Tr,min:Lr,max:kr,extent:Hr,mean:zr,median:Br,unique:br,uniqueCount:Ur,count:Kr},qr={getDefaultColumnDef:()=>({aggregatedCell:e=>{var o,t;return(o=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,o)=>{e.toggleGrouping=()=>{o.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=o.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);if(typeof n=="number")return Ee.sum;if(Object.prototype.toString.call(n)==="[object Date]")return Ee.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return Me(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=o.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:Ee[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=o=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(o),e.resetGrouping=o=>{var t,n;e.setGrouping(o?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,o)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=o.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,o,t,n)=>{e.getIsGrouped=()=>o.getIsGrouped()&&o.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&o.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function Xr(e,o,t){if(!(o!=null&&o.length)||!t)return e;const n=e.filter(i=>!o.includes(i.id));return t==="remove"?n:[...o.map(i=>e.find(s=>s.id===i)).filter(Boolean),...n]}const Yr={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=C(t=>[ie(o,t)],t=>t.findIndex(n=>n.id===e.id),R(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=ie(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const r=ie(o,t);return((n=r[r.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=o=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(o),e.resetColumnOrder=o=>{var t;e.setColumnOrder(o?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=C(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(o,t,n)=>r=>{let i=[];if(!(o!=null&&o.length))i=r;else{const s=[...o],l=[...r];for(;l.length&&s.length;){const a=s.shift(),d=l.findIndex(g=>g.id===a);d>-1&&i.push(l.splice(d,1)[0])}i=[...i,...l]}return Xr(i,t,n)},R(e.options,"debugTable"))}},De=()=>({left:[],right:[]}),Wr={getInitialState:e=>({columnPinning:De(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(r=>r.id).filter(Boolean);o.setColumnPinning(r=>{var i,s;if(t==="right"){var l,a;return{left:((l=r==null?void 0:r.left)!=null?l:[]).filter(f=>!(n!=null&&n.includes(f))),right:[...((a=r==null?void 0:r.right)!=null?a:[]).filter(f=>!(n!=null&&n.includes(f))),...n]}}if(t==="left"){var d,g;return{left:[...((d=r==null?void 0:r.left)!=null?d:[]).filter(f=>!(n!=null&&n.includes(f))),...n],right:((g=r==null?void 0:r.right)!=null?g:[]).filter(f=>!(n!=null&&n.includes(f)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(f=>!(n!=null&&n.includes(f))),right:((s=r==null?void 0:r.right)!=null?s:[]).filter(f=>!(n!=null&&n.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var r,i,s;return((r=n.columnDef.enablePinning)!=null?r:!0)&&((i=(s=o.options.enableColumnPinning)!=null?s:o.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:n,right:r}=o.getState().columnPinning,i=t.some(l=>n==null?void 0:n.includes(l)),s=t.some(l=>r==null?void 0:r.includes(l));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,n;const r=e.getIsPinned();return r?(t=(n=o.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,o)=>{e.getCenterVisibleCells=C(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(s=>!i.includes(s.column.id))},R(o.options,"debugRows")),e.getLeftVisibleCells=C(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left],(t,n)=>(n??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),R(o.options,"debugRows")),e.getRightVisibleCells=C(()=>[e._getAllVisibleCells(),o.getState().columnPinning.right],(t,n)=>(n??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),R(o.options,"debugRows"))},createTable:e=>{e.setColumnPinning=o=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(o),e.resetColumnPinning=o=>{var t,n;return e.setColumnPinning(o?De():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:De())},e.getIsSomeColumnsPinned=o=>{var t;const n=e.getState().columnPinning;if(!o){var r,i;return!!((r=n.left)!=null&&r.length||(i=n.right)!=null&&i.length)}return!!((t=n[o])!=null&&t.length)},e.getLeftLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(o,t)=>(t??[]).map(n=>o.find(r=>r.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getRightLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(o,t)=>(t??[]).map(n=>o.find(r=>r.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getCenterLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n)=>{const r=[...t??[],...n??[]];return o.filter(i=>!r.includes(i.id))},R(e.options,"debugColumns"))}};function Jr(e){return e||(typeof document<"u"?document:null)}const me={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$e=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Zr={getDefaultColumnDef:()=>me,getInitialState:e=>({columnSizing:{},columnSizingInfo:$e(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$("columnSizing",e),onColumnSizingInfoChange:$("columnSizingInfo",e)}),createColumn:(e,o)=>{e.getSize=()=>{var t,n,r;const i=o.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:me.minSize,(n=i??e.columnDef.size)!=null?n:me.size),(r=e.columnDef.maxSize)!=null?r:me.maxSize)},e.getStart=C(t=>[t,ie(o,t),o.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),R(o.options,"debugColumns")),e.getAfter=C(t=>[t,ie(o,t),o.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),R(o.options,"debugColumns")),e.resetSize=()=>{o.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=o.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,o)=>{e.getSize=()=>{let t=0;const n=r=>{if(r.subHeaders.length)r.subHeaders.forEach(n);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=o.getColumn(e.column.id),r=n==null?void 0:n.getCanResize();return i=>{if(!n||!r||(i.persist==null||i.persist(),Ve(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(S=>[S.column.id,S.column.getSize()]):[[n.id,n.getSize()]],a=Ve(i)?Math.round(i.touches[0].clientX):i.clientX,d={},g=(S,M)=>{typeof M=="number"&&(o.setColumnSizingInfo(x=>{var I,P;const N=o.options.columnResizeDirection==="rtl"?-1:1,G=(M-((I=x==null?void 0:x.startOffset)!=null?I:0))*N,y=Math.max(G/((P=x==null?void 0:x.startSize)!=null?P:0),-.999999);return x.columnSizingStart.forEach(B=>{let[L,b]=B;d[L]=Math.round(Math.max(b+b*y,0)*100)/100}),{...x,deltaOffset:G,deltaPercentage:y}}),(o.options.columnResizeMode==="onChange"||S==="end")&&o.setColumnSizing(x=>({...x,...d})))},f=S=>g("move",S),c=S=>{g("end",S),o.setColumnSizingInfo(M=>({...M,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},u=Jr(t),m={moveHandler:S=>f(S.clientX),upHandler:S=>{u==null||u.removeEventListener("mousemove",m.moveHandler),u==null||u.removeEventListener("mouseup",m.upHandler),c(S.clientX)}},w={moveHandler:S=>(S.cancelable&&(S.preventDefault(),S.stopPropagation()),f(S.touches[0].clientX),!1),upHandler:S=>{var M;u==null||u.removeEventListener("touchmove",w.moveHandler),u==null||u.removeEventListener("touchend",w.upHandler),S.cancelable&&(S.preventDefault(),S.stopPropagation()),c((M=S.touches[0])==null?void 0:M.clientX)}},h=Qr()?{passive:!1}:!1;Ve(i)?(u==null||u.addEventListener("touchmove",w.moveHandler,h),u==null||u.addEventListener("touchend",w.upHandler,h)):(u==null||u.addEventListener("mousemove",m.moveHandler,h),u==null||u.addEventListener("mouseup",m.upHandler,h)),o.setColumnSizingInfo(S=>({...S,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=o=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(o),e.setColumnSizingInfo=o=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(o),e.resetColumnSizing=o=>{var t;e.setColumnSizing(o?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=o=>{var t;e.setColumnSizingInfo(o?$e():(t=e.initialState.columnSizingInfo)!=null?t:$e())},e.getTotalSize=()=>{var o,t;return(o=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?o:0},e.getLeftTotalSize=()=>{var o,t;return(o=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?o:0},e.getCenterTotalSize=()=>{var o,t;return(o=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?o:0},e.getRightTotalSize=()=>{var o,t;return(o=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,r)=>n+r.getSize(),0))!=null?o:0}}};let ve=null;function Qr(){if(typeof ve=="boolean")return ve;let e=!1;try{const o={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,o),window.removeEventListener("test",t)}catch{e=!1}return ve=e,ve}function Ve(e){return e.type==="touchstart"}const ei={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$("columnVisibility",e)}),createColumn:(e,o)=>{e.toggleVisibility=t=>{e.getCanHide()&&o.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(n=o.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=o.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,o)=>{e._getAllVisibleCells=C(()=>[e.getAllCells(),o.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),R(o.options,"debugRows")),e.getVisibleCells=C(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,r)=>[...t,...n,...r],R(o.options,"debugRows"))},createTable:e=>{const o=(t,n)=>C(()=>[n(),n().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),R(e.options,"debugColumns"));e.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function ie(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ti={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},ni={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[o.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,o)=>{e.getCanGlobalFilter=()=>{var t,n,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=o.options.enableGlobalFilter)!=null?n:!0)&&((r=o.options.enableFilters)!=null?r:!0)&&((i=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>z.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return Me(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:z[n]},e.setGlobalFilter=o=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(o)},e.resetGlobalFilter=o=>{e.setGlobalFilter(o?void 0:e.initialState.globalFilter)}}},oi={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let o=!1,t=!1;e._autoResetExpanded=()=>{var n,r;if(!o){e._queue(()=>{o=!0});return}if((n=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var r,i;e.setExpanded(n?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");n=Math.max(n,s.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,o)=>{e.toggleExpanded=t=>{o.setExpanded(n=>{var r;const i=n===!0?!0:!!(n!=null&&n[e.id]);let s={};if(n===!0?Object.keys(o.getRowModel().rowsById).forEach(l=>{s[l]=!0}):s=n,t=(r=t)!=null?r:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:l,...a}=s;return a}return n})},e.getIsExpanded=()=>{var t;const n=o.getState().expanded;return!!((t=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(e))!=null?t:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var t,n,r;return(t=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(e))!=null?t:((n=o.options.enableExpanding)!=null?n:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=o.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},Le=0,ke=10,Ae=()=>({pageIndex:Le,pageSize:ke}),ri={getInitialState:e=>({...e,pagination:{...Ae(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:$("pagination",e)}),createTable:e=>{let o=!1,t=!1;e._autoResetPageIndex=()=>{var n,r;if(!o){e._queue(()=>{o=!0});return}if((n=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const r=i=>K(n,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=n=>{var r;e.setPagination(n?Ae():(r=e.initialState.pagination)!=null?r:Ae())},e.setPageIndex=n=>{e.setPagination(r=>{let i=K(n,r.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...r,pageIndex:i}})},e.resetPageIndex=n=>{var r,i;e.setPageIndex(n?Le:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Le)},e.resetPageSize=n=>{var r,i;e.setPageSize(n?ke:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:ke)},e.setPageSize=n=>{e.setPagination(r=>{const i=Math.max(1,K(n,r.pageSize)),s=r.pageSize*r.pageIndex,l=Math.floor(s/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=n=>e.setPagination(r=>{var i;let s=K(n,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),e.getPageOptions=C(()=>[e.getPageCount()],n=>{let r=[];return n&&n>0&&(r=[...new Array(n)].fill(null).map((i,s)=>s)),r},R(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:n<r-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},Ne=()=>({top:[],bottom:[]}),ii={getInitialState:e=>({rowPinning:Ne(),...e}),getDefaultOptions:e=>({onRowPinningChange:$("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,r)=>{const i=n?e.getLeafRows().map(a=>{let{id:d}=a;return d}):[],s=r?e.getParentRows().map(a=>{let{id:d}=a;return d}):[],l=new Set([...s,e.id,...i]);o.setRowPinning(a=>{var d,g;if(t==="bottom"){var f,c;return{top:((f=a==null?void 0:a.top)!=null?f:[]).filter(w=>!(l!=null&&l.has(w))),bottom:[...((c=a==null?void 0:a.bottom)!=null?c:[]).filter(w=>!(l!=null&&l.has(w))),...Array.from(l)]}}if(t==="top"){var u,m;return{top:[...((u=a==null?void 0:a.top)!=null?u:[]).filter(w=>!(l!=null&&l.has(w))),...Array.from(l)],bottom:((m=a==null?void 0:a.bottom)!=null?m:[]).filter(w=>!(l!=null&&l.has(w)))}}return{top:((d=a==null?void 0:a.top)!=null?d:[]).filter(w=>!(l!=null&&l.has(w))),bottom:((g=a==null?void 0:a.bottom)!=null?g:[]).filter(w=>!(l!=null&&l.has(w)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:r}=o.options;return typeof n=="function"?n(e):(t=n??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:r}=o.getState().rowPinning,i=t.some(l=>n==null?void 0:n.includes(l)),s=t.some(l=>r==null?void 0:r.includes(l));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const r=e.getIsPinned();if(!r)return-1;const i=(t=r==="top"?o.getTopRows():o.getBottomRows())==null?void 0:t.map(s=>{let{id:l}=s;return l});return(n=i==null?void 0:i.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=o=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(o),e.resetRowPinning=o=>{var t,n;return e.setRowPinning(o?Ne():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:Ne())},e.getIsSomeRowsPinned=o=>{var t;const n=e.getState().rowPinning;if(!o){var r,i;return!!((r=n.top)!=null&&r.length||(i=n.bottom)!=null&&i.length)}return!!((t=n[o])!=null&&t.length)},e._getPinnedRows=(o,t,n)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(s=>{const l=e.getRow(s,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(s=>o.find(l=>l.id===s))).filter(Boolean).map(s=>({...s,position:n}))},e.getTopRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(o,t)=>e._getPinnedRows(o,t,"top"),R(e.options,"debugRows")),e.getBottomRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(o,t)=>e._getPinnedRows(o,t,"bottom"),R(e.options,"debugRows")),e.getCenterRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(o,t,n)=>{const r=new Set([...t??[],...n??[]]);return o.filter(i=>!r.has(i.id))},R(e.options,"debugRows"))}},si={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=o=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(o),e.resetRowSelection=o=>{var t;return e.setRowSelection(o?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=o=>{e.setRowSelection(t=>{o=typeof o<"u"?o:!e.getIsAllRowsSelected();const n={...t},r=e.getPreGroupedRowModel().flatRows;return o?r.forEach(i=>{i.getCanSelect()&&(n[i.id]=!0)}):r.forEach(i=>{delete n[i.id]}),n})},e.toggleAllPageRowsSelected=o=>e.setRowSelection(t=>{const n=typeof o<"u"?o:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{He(r,i.id,n,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=C(()=>[e.getState().rowSelection,e.getCoreRowModel()],(o,t)=>Object.keys(o).length?je(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getFilteredSelectedRowModel=C(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?je(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getGroupedSelectedRowModel=C(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?je(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const o=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(o.length&&Object.keys(t).length);return n&&o.some(r=>r.getCanSelect()&&!t[r.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let n=!!o.length;return n&&o.some(r=>!t[r.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var o;const t=Object.keys((o=e.getState().rowSelection)!=null?o:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:o.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>o=>{e.toggleAllRowsSelected(o.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>o=>{e.toggleAllPageRowsSelected(o.target.checked)}},createRow:(e,o)=>{e.toggleSelected=(t,n)=>{const r=e.getIsSelected();o.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const l={...i};return He(l,e.id,t,(s=n==null?void 0:n.selectChildren)!=null?s:!0,o),l})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return tt(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return ze(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return ze(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(e):(t=o.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(e):(t=o.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(e):(t=o.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected((r=n.target)==null?void 0:r.checked)}}}},He=(e,o,t,n,r)=>{var i;const s=r.getRow(o,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),s.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(l=>He(e,l.id,t,n,r))};function je(e,o){const t=e.getState().rowSelection,n=[],r={},i=function(s,l){return s.map(a=>{var d;const g=tt(a,t);if(g&&(n.push(a),r[a.id]=a),(d=a.subRows)!=null&&d.length&&(a={...a,subRows:i(a.subRows)}),g)return a}).filter(Boolean)};return{rows:i(o.rows),flatRows:n,rowsById:r}}function tt(e,o){var t;return(t=o[e.id])!=null?t:!1}function ze(e,o,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let r=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!r)&&(s.getCanSelect()&&(tt(s,o)?i=!0:r=!1),s.subRows&&s.subRows.length)){const l=ze(s,o);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Be=/([0-9]+)/gm,li=(e,o,t)=>In(q(e.getValue(t)).toLowerCase(),q(o.getValue(t)).toLowerCase()),ui=(e,o,t)=>In(q(e.getValue(t)),q(o.getValue(t))),ai=(e,o,t)=>nt(q(e.getValue(t)).toLowerCase(),q(o.getValue(t)).toLowerCase()),di=(e,o,t)=>nt(q(e.getValue(t)),q(o.getValue(t))),ci=(e,o,t)=>{const n=e.getValue(t),r=o.getValue(t);return n>r?1:n<r?-1:0},gi=(e,o,t)=>nt(e.getValue(t),o.getValue(t));function nt(e,o){return e===o?0:e>o?1:-1}function q(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function In(e,o){const t=e.split(Be).filter(Boolean),n=o.split(Be).filter(Boolean);for(;t.length&&n.length;){const r=t.shift(),i=n.shift(),s=parseInt(r,10),l=parseInt(i,10),a=[s,l].sort();if(isNaN(a[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(a[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-n.length}const ne={alphanumeric:li,alphanumericCaseSensitive:ui,text:ai,textCaseSensitive:di,datetime:ci,basic:gi},fi={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$("sorting",e),isMultiSortEvent:o=>o.shiftKey}),createColumn:(e,o)=>{e.getAutoSortingFn=()=>{const t=o.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const r of t){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ne.datetime;if(typeof i=="string"&&(n=!0,i.split(Be).length>1))return ne.alphanumeric}return n?ne.text:ne.basic},e.getAutoSortDir=()=>{const t=o.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return Me(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=o.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:ne[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;o.setSorting(s=>{const l=s==null?void 0:s.find(u=>u.id===e.id),a=s==null?void 0:s.findIndex(u=>u.id===e.id);let d=[],g,f=i?t:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&n?l?g="toggle":g="add":s!=null&&s.length&&a!==s.length-1?g="replace":l?g="toggle":g="replace",g==="toggle"&&(i||r||(g="remove")),g==="add"){var c;d=[...s,{id:e.id,desc:f}],d.splice(0,d.length-((c=o.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else g==="toggle"?d=s.map(u=>u.id===e.id?{...u,desc:f}:u):g==="remove"?d=s.filter(u=>u.id!==e.id):d=[{id:e.id,desc:f}];return d})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:o.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,r;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((n=o.options.enableSortingRemoval)==null||n)&&(!(t&&(r=o.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=o.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:o.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=o.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=o.getState().sorting)==null?void 0:n.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{o.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=o=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(o),e.resetSorting=o=>{var t,n;e.setSorting(o?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},pi=[jr,ei,Yr,Wr,Gr,Or,ti,ni,fi,qr,oi,ri,ii,si,Zr];function mi(e){var o,t;const n=[...pi,...(o=e._features)!=null?o:[]];let r={_features:n};const i=r._features.reduce((c,u)=>Object.assign(c,u.getDefaultOptions==null?void 0:u.getDefaultOptions(r)),{}),s=c=>r.options.mergeOptions?r.options.mergeOptions(i,c):{...i,...c};let a={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(c=>{var u;a=(u=c.getInitialState==null?void 0:c.getInitialState(a))!=null?u:a});const d=[];let g=!1;const f={_features:n,options:{...i,...e},initialState:a,_queue:c=>{d.push(c),g||(g=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();g=!1}).catch(u=>setTimeout(()=>{throw u})))},reset:()=>{r.setState(r.initialState)},setOptions:c=>{const u=K(c,r.options);r.options=s(u)},getState:()=>r.options.state,setState:c=>{r.options.onStateChange==null||r.options.onStateChange(c)},_getRowId:(c,u,m)=>{var w;return(w=r.options.getRowId==null?void 0:r.options.getRowId(c,u,m))!=null?w:`${m?[m.id,u].join("."):u}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(c,u)=>{let m=(u?r.getPrePaginationRowModel():r.getRowModel()).rowsById[c];if(!m&&(m=r.getCoreRowModel().rowsById[c],!m))throw new Error;return m},_getDefaultColumnDef:C(()=>[r.options.defaultColumn],c=>{var u;return c=(u=c)!=null?u:{},{header:m=>{const w=m.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:m=>{var w,h;return(w=(h=m.renderValue())==null||h.toString==null?void 0:h.toString())!=null?w:null},...r._features.reduce((m,w)=>Object.assign(m,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...c}},R(e,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:C(()=>[r._getColumnDefs()],c=>{const u=function(m,w,h){return h===void 0&&(h=0),m.map(S=>{const M=Nr(r,S,h,w),x=S;return M.columns=x.columns?u(x.columns,M,h+1):[],M})};return u(c)},R(e,"debugColumns")),getAllFlatColumns:C(()=>[r.getAllColumns()],c=>c.flatMap(u=>u.getFlatColumns()),R(e,"debugColumns")),_getAllFlatColumnsById:C(()=>[r.getAllFlatColumns()],c=>c.reduce((u,m)=>(u[m.id]=m,u),{}),R(e,"debugColumns")),getAllLeafColumns:C(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(c,u)=>{let m=c.flatMap(w=>w.getLeafColumns());return u(m)},R(e,"debugColumns")),getColumn:c=>r._getAllFlatColumnsById()[c]};Object.assign(r,f);for(let c=0;c<r._features.length;c++){const u=r._features[c];u==null||u.createTable==null||u.createTable(r)}return r}function yi(){return e=>C(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(r,i,s){i===void 0&&(i=0);const l=[];for(let d=0;d<r.length;d++){const g=Qe(e,e._getRowId(r[d],d,s),r[d],d,i,void 0,s==null?void 0:s.id);if(t.flatRows.push(g),t.rowsById[g.id]=g,l.push(g),e.options.getSubRows){var a;g.originalSubRows=e.options.getSubRows(r[d],d),(a=g.originalSubRows)!=null&&a.length&&(g.subRows=n(g.originalSubRows,i+1,g))}}return l};return t.rows=n(o),t},R(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ei(){return e=>C(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(o,t,n)=>!t.rows.length||o!==!0&&!Object.keys(o??{}).length||!n?t:Pn(t),R(e.options,"debugTable"))}function Pn(e){const o=[],t=n=>{var r;o.push(n),(r=n.subRows)!=null&&r.length&&n.getIsExpanded()&&n.subRows.forEach(t)};return e.rows.forEach(t),{rows:o,flatRows:e.flatRows,rowsById:e.rowsById}}function yn(e,o,t){return t.options.filterFromLeafRows?vi(e,o,t):wi(e,o,t)}function vi(e,o,t){var n;const r=[],i={},s=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,l=function(a,d){d===void 0&&(d=0);const g=[];for(let c=0;c<a.length;c++){var f;let u=a[c];const m=Qe(t,u.id,u.original,u.index,u.depth,void 0,u.parentId);if(m.columnFilters=u.columnFilters,(f=u.subRows)!=null&&f.length&&d<s){if(m.subRows=l(u.subRows,d+1),u=m,o(u)&&!m.subRows.length){g.push(u),i[u.id]=u,r.push(u);continue}if(o(u)||m.subRows.length){g.push(u),i[u.id]=u,r.push(u);continue}}else u=m,o(u)&&(g.push(u),i[u.id]=u,r.push(u))}return g};return{rows:l(e),flatRows:r,rowsById:i}}function wi(e,o,t){var n;const r=[],i={},s=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,l=function(a,d){d===void 0&&(d=0);const g=[];for(let c=0;c<a.length;c++){let u=a[c];if(o(u)){var f;if((f=u.subRows)!=null&&f.length&&d<s){const w=Qe(t,u.id,u.original,u.index,u.depth,void 0,u.parentId);w.subRows=l(u.subRows,d+1),u=w}g.push(u),r.push(u),i[u.id]=u}}return g};return{rows:l(e),flatRows:r,rowsById:i}}function Di(){return(e,o)=>C(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r)return t;const i=[...n.map(l=>l.id).filter(l=>l!==o),r?"__global__":void 0].filter(Boolean),s=l=>{for(let a=0;a<i.length;a++)if(l.columnFilters[i[a]]===!1)return!1;return!0};return yn(t.rows,s,e)},R(e.options,"debugTable"))}function $i(){return(e,o)=>C(()=>{var t;return[(t=e.getColumn(o))==null?void 0:t.getFacetedRowModel()]},t=>{if(!t)return new Map;let n=new Map;for(let i=0;i<t.flatRows.length;i++){const s=t.flatRows[i].getUniqueValues(o);for(let l=0;l<s.length;l++){const a=s[l];if(n.has(a)){var r;n.set(a,((r=n.get(a))!=null?r:0)+1)}else n.set(a,1)}}return n},R(e.options,"debugTable"))}function Vi(){return e=>C(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(o,t,n)=>{if(!o.rows.length||!(t!=null&&t.length)&&!n){for(let c=0;c<o.flatRows.length;c++)o.flatRows[c].columnFilters={},o.flatRows[c].columnFiltersMeta={};return o}const r=[],i=[];(t??[]).forEach(c=>{var u;const m=e.getColumn(c.id);if(!m)return;const w=m.getFilterFn();w&&r.push({id:c.id,filterFn:w,resolvedValue:(u=w.resolveFilterValue==null?void 0:w.resolveFilterValue(c.value))!=null?u:c.value})});const s=(t??[]).map(c=>c.id),l=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(c=>c.getCanGlobalFilter());n&&l&&a.length&&(s.push("__global__"),a.forEach(c=>{var u;i.push({id:c.id,filterFn:l,resolvedValue:(u=l.resolveFilterValue==null?void 0:l.resolveFilterValue(n))!=null?u:n})}));let d,g;for(let c=0;c<o.flatRows.length;c++){const u=o.flatRows[c];if(u.columnFilters={},r.length)for(let m=0;m<r.length;m++){d=r[m];const w=d.id;u.columnFilters[w]=d.filterFn(u,w,d.resolvedValue,h=>{u.columnFiltersMeta[w]=h})}if(i.length){for(let m=0;m<i.length;m++){g=i[m];const w=g.id;if(g.filterFn(u,w,g.resolvedValue,h=>{u.columnFiltersMeta[w]=h})){u.columnFilters.__global__=!0;break}}u.columnFilters.__global__!==!0&&(u.columnFilters.__global__=!1)}}const f=c=>{for(let u=0;u<s.length;u++)if(c.columnFilters[s[u]]===!1)return!1;return!0};return yn(o.rows,f,e)},R(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ai(e){return o=>C(()=>[o.getState().pagination,o.getPrePaginationRowModel(),o.options.paginateExpandedRows?void 0:o.getState().expanded],(t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:i}=t;let{rows:s,flatRows:l,rowsById:a}=n;const d=r*i,g=d+r;s=s.slice(d,g);let f;o.options.paginateExpandedRows?f={rows:s,flatRows:l,rowsById:a}:f=Pn({rows:s,flatRows:l,rowsById:a}),f.flatRows=[];const c=u=>{f.flatRows.push(u),u.subRows.length&&u.subRows.forEach(c)};return f.rows.forEach(c),f},R(o.options,"debugTable"))}function Ni(){return e=>C(()=>[e.getState().sorting,e.getPreSortedRowModel()],(o,t)=>{if(!t.rows.length||!(o!=null&&o.length))return t;const n=e.getState().sorting,r=[],i=n.filter(a=>{var d;return(d=e.getColumn(a.id))==null?void 0:d.getCanSort()}),s={};i.forEach(a=>{const d=e.getColumn(a.id);d&&(s[a.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=a=>{const d=a.map(g=>({...g}));return d.sort((g,f)=>{for(let u=0;u<i.length;u+=1){var c;const m=i[u],w=s[m.id],h=w.sortUndefined,S=(c=m==null?void 0:m.desc)!=null?c:!1;let M=0;if(h){const x=g.getValue(m.id),I=f.getValue(m.id),P=x===void 0,N=I===void 0;if(P||N){if(h==="first")return P?-1:1;if(h==="last")return P?1:-1;M=P&&N?0:P?h:-h}}if(M===0&&(M=w.sortingFn(g,f,m.id)),M!==0)return S&&(M*=-1),w.invertSorting&&(M*=-1),M}return g.index-f.index}),d.forEach(g=>{var f;r.push(g),(f=g.subRows)!=null&&f.length&&(g.subRows=l(g.subRows))}),d};return{rows:l(t.rows),flatRows:r,rowsById:t.rowsById}},R(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
   * react-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function ji(e,o){return e?hi(e)?v.createElement(e,o):e:null}function hi(e){return Si(e)||typeof e=="function"||Ci(e)}function Si(e){return typeof e=="function"&&(()=>{const o=Object.getPrototypeOf(e);return o.prototype&&o.prototype.isReactComponent})()}function Ci(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Gi(e){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=v.useState(()=>({current:mi(o)})),[n,r]=v.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...n,...e.state},onStateChange:s=>{r(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}function Oi({table:e}){return p.jsxs("div",{className:"flex items-center justify-between px-2",children:[p.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[e.getFilteredSelectedRowModel().rows.length," of"," ",e.getFilteredRowModel().rows.length," row(s) selected."]}),p.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),p.jsxs(Hn,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>{e.setPageSize(Number(o))},children:[p.jsx(zn,{className:"h-8 w-[70px]",children:p.jsx(Bn,{placeholder:e.getState().pagination.pageSize})}),p.jsx(bn,{side:"top",children:[10,20,30,40,50].map(o=>p.jsx(Un,{value:`${o}`,children:o},o))})]})]}),p.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",e.getState().pagination.pageIndex+1," of"," ",e.getPageCount()]}),p.jsxs("div",{className:"flex items-center space-x-2",children:[p.jsxs(oe,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[p.jsx("span",{className:"sr-only",children:"Go to first page"}),p.jsx(Qn,{})]}),p.jsxs(oe,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[p.jsx("span",{className:"sr-only",children:"Go to previous page"}),p.jsx(Kn,{})]}),p.jsxs(oe,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[p.jsx("span",{className:"sr-only",children:"Go to next page"}),p.jsx(qn,{})]}),p.jsxs(oe,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[p.jsx("span",{className:"sr-only",children:"Go to last page"}),p.jsx(eo,{})]})]})]})]})}function Ti({column:e,title:o,className:t}){return e.getCanSort()?p.jsx("div",{className:T("flex items-center space-x-2",t),children:p.jsxs(Mr,{children:[p.jsx(Fr,{asChild:!0,children:p.jsxs(oe,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[p.jsx("span",{children:o}),e.getIsSorted()==="desc"?p.jsx(st,{}):e.getIsSorted()==="asc"?p.jsx(lt,{}):p.jsx(Zn,{})]})}),p.jsxs(vn,{align:"start",children:[p.jsxs(we,{onClick:()=>e.toggleSorting(!1),children:[p.jsx(lt,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),p.jsxs(we,{onClick:()=>e.toggleSorting(!0),children:[p.jsx(st,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),p.jsx(wn,{}),p.jsxs(we,{onClick:()=>e.toggleVisibility(!1),children:[p.jsx(to,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):p.jsx("div",{className:T(t),children:o})}export{st as A,Mr as D,Xt as a,vn as b,Dr as c,wn as d,yr as e,Ti as f,ji as g,Oi as h,$i as i,Di as j,Ni as k,Ai as l,Vi as m,yi as n,lt as o,Ei as p,Gi as u};
//# sourceMappingURL=data-table-column-header-DXeZFhtt.js.map
