import{N as U,d as Fe,q as L,an as Ie,ao as $e}from"./index-Csmv4Fkv.js";/**
 * @license @tabler/icons-solidjs v3.26.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Ft=U("outline","player-pause","IconPlayerPause",[["path",{d:"M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}],["path",{d:"M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}]]);/**
 * @license @tabler/icons-solidjs v3.26.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var It=U("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z"}]]);/**
 * @license @tabler/icons-solidjs v3.26.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var $t=U("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0"}],["path",{d:"M4 12l7 0"}],["path",{d:"M4 18l9 0"}],["path",{d:"M15 9l3 -3l3 3"}],["path",{d:"M18 6l0 12"}]]);/**
 * @license @tabler/icons-solidjs v3.26.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Mt=U("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0"}],["path",{d:"M4 12l7 0"}],["path",{d:"M4 18l7 0"}],["path",{d:"M15 15l3 3l3 -3"}],["path",{d:"M18 6l0 12"}]]);/**
   * match-sorter-utils
   *
   * 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
   */const de={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",Ĳ:"IJ",ĳ:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ŉ:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Me=Object.keys(de).join("|"),Ve=new RegExp(Me,"g");function Pe(e){return e.replace(Ve,o=>de[o])}/**
 * @name match-sorter
 * @license MIT license.
 * @copyright (c) 2099 Kent C. Dodds
 * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
 */const M={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Vt(e,o,t){var n;if(t=t||{},t.threshold=(n=t.threshold)!=null?n:M.MATCHES,!t.accessors){const l=le(e,o,t);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:t.threshold,passed:l>=t.threshold}}const r=Ae(e,t.accessors),i={rankedValue:e,rank:M.NO_MATCH,accessorIndex:-1,accessorThreshold:t.threshold,passed:!1};for(let l=0;l<r.length;l++){const u=r[l];let s=le(u.itemValue,o,t);const{minRanking:g,maxRanking:c,threshold:p=t.threshold}=u.attributes;s<g&&s>=M.MATCHES?s=g:s>c&&(s=c),s=Math.min(s,c),s>=p&&s>i.rank&&(i.rank=s,i.passed=!0,i.accessorIndex=l,i.accessorThreshold=p,i.rankedValue=u.itemValue)}return i}function le(e,o,t){return e=se(e,t),o=se(o,t),o.length>e.length?M.NO_MATCH:e===o?M.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),o=o.toLowerCase(),e===o?M.EQUAL:e.startsWith(o)?M.STARTS_WITH:e.includes(` ${o}`)?M.WORD_STARTS_WITH:e.includes(o)?M.CONTAINS:o.length===1?M.NO_MATCH:xe(e).includes(o)?M.ACRONYM:ye(e,o))}function xe(e){let o="";return e.split(" ").forEach(n=>{n.split("-").forEach(i=>{o+=i.substr(0,1)})}),o}function ye(e,o){let t=0,n=0;function r(s,g,c){for(let p=c,d=g.length;p<d;p++)if(g[p]===s)return t+=1,p+1;return-1}function i(s){const g=1/s,c=t/o.length;return M.MATCHES+c*g}const l=r(o[0],e,0);if(l<0)return M.NO_MATCH;n=l;for(let s=1,g=o.length;s<g;s++){const c=o[s];if(n=r(c,e,n),!(n>-1))return M.NO_MATCH}const u=n-l;return i(u)}function se(e,o){let{keepDiacritics:t}=o;return e=`${e}`,t||(e=Pe(e)),e}function Ee(e,o){let t=o;typeof o=="object"&&(t=o.accessor);const n=t(e);return n==null?[]:Array.isArray(n)?n:[String(n)]}function Ae(e,o){const t=[];for(let n=0,r=o.length;n<r;n++){const i=o[n],l=De(i),u=Ee(e,i);for(let s=0,g=u.length;s<g;s++)t.push({itemValue:u[s],attributes:l})}return t}const ue={maxRanking:1/0,minRanking:-1/0};function De(e){return typeof e=="function"?ue:{...ue,...e}}/**
   * 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 y(e,o){return typeof e=="function"?e(o):e}function V(e,o){return t=>{o.setState(n=>({...n,[e]:y(t,n[e])}))}}function N(e){return e instanceof Function}function He(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function ce(e,o){const t=[],n=r=>{r.forEach(i=>{t.push(i);const l=o(i);l!=null&&l.length&&n(l)})};return n(e),t}function m(e,o,t){let n=[],r;return i=>{let l;t.key&&t.debug&&(l=Date.now());const u=e(i);if(!(u.length!==n.length||u.some((c,p)=>n[p]!==c)))return r;n=u;let g;if(t.key&&t.debug&&(g=Date.now()),r=o(...u),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const c=Math.round((Date.now()-l)*100)/100,p=Math.round((Date.now()-g)*100)/100,d=p/16,a=(f,S)=>{for(f=String(f);f.length<S;)f=" "+f;return f};console.info(`%c⏱ ${a(p,5)} /${a(c,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function C(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 Ge(e,o,t,n){const r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:r,getContext:m(()=>[e,t,o,i],(l,u,s,g)=>({table:l,column:u,row:s,cell:g,getValue:g.getValue,renderValue:g.renderValue}),C(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,t,o,e)},{}),i}function Oe(e,o,t,n){var r,i;const u={...e._getDefaultColumnDef(),...o},s=u.accessorKey;let g=(r=(i=u.id)!=null?i:s?typeof String.prototype.replaceAll=="function"?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)!=null?r:typeof u.header=="string"?u.header:void 0,c;if(u.accessorFn?c=u.accessorFn:s&&(s.includes(".")?c=d=>{let a=d;for(const S of s.split(".")){var f;a=(f=a)==null?void 0:f[S]}return a}:c=d=>d[u.accessorKey]),!g)throw new Error;let p={id:`${String(g)}`,accessorFn:c,parent:n,depth:t,columnDef:u,columns:[],getFlatColumns:m(()=>[!0],()=>{var d;return[p,...(d=p.columns)==null?void 0:d.flatMap(a=>a.getFlatColumns())]},C(e.options,"debugColumns")),getLeafColumns:m(()=>[e._getOrderColumnsFn()],d=>{var a;if((a=p.columns)!=null&&a.length){let f=p.columns.flatMap(S=>S.getLeafColumns());return d(f)}return[p]},C(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(p,e);return p}const I="debugHeaders";function ae(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 l=[],u=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(u),l.push(s)};return u(i),l},getContext:()=>({table:e,header:i,column:o})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}const Le={createTable:e=>{e.getHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,r)=>{var i,l;const u=(i=n==null?void 0:n.map(p=>t.find(d=>d.id===p)).filter(Boolean))!=null?i:[],s=(l=r==null?void 0:r.map(p=>t.find(d=>d.id===p)).filter(Boolean))!=null?l:[],g=t.filter(p=>!(n!=null&&n.includes(p.id))&&!(r!=null&&r.includes(p.id)));return z(o,[...u,...g,...s],e)},C(e.options,I)),e.getCenterHeaderGroups=m(()=>[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))),z(o,t,e,"center")),C(e.options,I)),e.getLeftHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var r;const i=(r=n==null?void 0:n.map(l=>t.find(u=>u.id===l)).filter(Boolean))!=null?r:[];return z(o,i,e,"left")},C(e.options,I)),e.getRightHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var r;const i=(r=n==null?void 0:n.map(l=>t.find(u=>u.id===l)).filter(Boolean))!=null?r:[];return z(o,i,e,"right")},C(e.options,I)),e.getFooterGroups=m(()=>[e.getHeaderGroups()],o=>[...o].reverse(),C(e.options,I)),e.getLeftFooterGroups=m(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),C(e.options,I)),e.getCenterFooterGroups=m(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),C(e.options,I)),e.getRightFooterGroups=m(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),C(e.options,I)),e.getFlatHeaders=m(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,I)),e.getLeftFlatHeaders=m(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,I)),e.getCenterFlatHeaders=m(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,I)),e.getRightFlatHeaders=m(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,I)),e.getCenterLeafHeaders=m(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,I)),e.getLeftLeafHeaders=m(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,I)),e.getRightLeafHeaders=m(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,I)),e.getLeafHeaders=m(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var r,i,l,u,s,g;return[...(r=(i=o[0])==null?void 0:i.headers)!=null?r:[],...(l=(u=t[0])==null?void 0:u.headers)!=null?l:[],...(s=(g=n[0])==null?void 0:g.headers)!=null?s:[]].map(c=>c.getLeafHeaders()).flat()},C(e.options,I))}};function z(e,o,t,n){var r,i;let l=0;const u=function(d,a){a===void 0&&(a=1),l=Math.max(l,a),d.filter(f=>f.getIsVisible()).forEach(f=>{var S;(S=f.columns)!=null&&S.length&&u(f.columns,a+1)},0)};u(e);let s=[];const g=(d,a)=>{const f={depth:a,id:[n,`${a}`].filter(Boolean).join("_"),headers:[]},S=[];d.forEach(R=>{const h=[...S].reverse()[0],w=R.column.depth===f.depth;let _,$=!1;if(w&&R.column.parent?_=R.column.parent:(_=R.column,$=!0),h&&(h==null?void 0:h.column)===_)h.subHeaders.push(R);else{const F=ae(t,_,{id:[n,a,_.id,R==null?void 0:R.id].filter(Boolean).join("_"),isPlaceholder:$,placeholderId:$?`${S.filter(v=>v.column===_).length}`:void 0,depth:a,index:S.length});F.subHeaders.push(R),S.push(F)}f.headers.push(R),R.headerGroup=f}),s.push(f),a>0&&g(S,a-1)},c=o.map((d,a)=>ae(t,d,{depth:l,index:a}));g(c,l-1),s.reverse();const p=d=>d.filter(f=>f.column.getIsVisible()).map(f=>{let S=0,R=0,h=[0];f.subHeaders&&f.subHeaders.length?(h=[],p(f.subHeaders).forEach(_=>{let{colSpan:$,rowSpan:F}=_;S+=$,h.push(F)})):S=1;const w=Math.min(...h);return R=R+w,f.colSpan=S,f.rowSpan=R,{colSpan:S,rowSpan:R}});return p((r=(i=s[0])==null?void 0:i.headers)!=null?r:[]),s}const k=(e,o,t,n,r,i,l)=>{let u={id:o,index:n,original:t,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:s=>{if(u._valuesCache.hasOwnProperty(s))return u._valuesCache[s];const g=e.getColumn(s);if(g!=null&&g.accessorFn)return u._valuesCache[s]=g.accessorFn(u.original,n),u._valuesCache[s]},getUniqueValues:s=>{if(u._uniqueValuesCache.hasOwnProperty(s))return u._uniqueValuesCache[s];const g=e.getColumn(s);if(g!=null&&g.accessorFn)return g.columnDef.getUniqueValues?(u._uniqueValuesCache[s]=g.columnDef.getUniqueValues(u.original,n),u._uniqueValuesCache[s]):(u._uniqueValuesCache[s]=[u.getValue(s)],u._uniqueValuesCache[s])},renderValue:s=>{var g;return(g=u.getValue(s))!=null?g:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ce(u.subRows,s=>s.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let s=[],g=u;for(;;){const c=g.getParentRow();if(!c)break;s.push(c),g=c}return s.reverse()},getAllCells:m(()=>[e.getAllLeafColumns()],s=>s.map(g=>Ge(e,u,g,g.id)),C(e.options,"debugRows")),_getAllCellsByColumnId:m(()=>[u.getAllCells()],s=>s.reduce((g,c)=>(g[c.column.id]=c,g),{}),C(e.options,"debugRows"))};for(let s=0;s<e._features.length;s++){const g=e._features[s];g==null||g.createRow==null||g.createRow(u,e)}return u},ze={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()}}},fe=(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))};fe.autoRemove=e=>P(e);const pe=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};pe.autoRemove=e=>P(e);const Se=(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())};Se.autoRemove=e=>P(e);const me=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};me.autoRemove=e=>P(e)||!(e!=null&&e.length);const Ce=(e,o,t)=>!t.some(n=>{var r;return!((r=e.getValue(o))!=null&&r.includes(n))});Ce.autoRemove=e=>P(e)||!(e!=null&&e.length);const he=(e,o,t)=>t.some(n=>{var r;return(r=e.getValue(o))==null?void 0:r.includes(n)});he.autoRemove=e=>P(e)||!(e!=null&&e.length);const Re=(e,o,t)=>e.getValue(o)===t;Re.autoRemove=e=>P(e);const we=(e,o,t)=>e.getValue(o)==t;we.autoRemove=e=>P(e);const ne=(e,o,t)=>{let[n,r]=t;const i=e.getValue(o);return i>=n&&i<=r};ne.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,l=t===null||Number.isNaN(r)?1/0:r;if(i>l){const u=i;i=l,l=u}return[i,l]};ne.autoRemove=e=>P(e)||P(e[0])&&P(e[1]);const x={includesString:fe,includesStringSensitive:pe,equalsString:Se,arrIncludes:me,arrIncludesAll:Ce,arrIncludesSome:he,equals:Re,weakEquals:we,inNumberRange:ne};function P(e){return e==null||e===""}const Te={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:V("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"?x.includesString:typeof n=="number"?x.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?x.equals:Array.isArray(n)?x.arrIncludes:x.weakEquals},e.getFilterFn=()=>{var t,n;return N(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:x[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(c=>c.id===e.id),l=y(t,i?i.value:void 0);if(ge(r,l,e)){var u;return(u=n==null?void 0:n.filter(c=>c.id!==e.id))!=null?u:[]}const s={id:e.id,value:l};if(i){var g;return(g=n==null?void 0:n.map(c=>c.id===e.id?s:c))!=null?g:[]}return n!=null&&n.length?[...n,s]:[s]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=r=>{var i;return(i=y(o,r))==null?void 0:i.filter(l=>{const u=t.find(s=>s.id===l.id);if(u){const s=u.getFilterFn();if(ge(s,l.value,u))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 ge(e,o,t){return(e&&e.autoRemove?e.autoRemove(o,t):!1)||typeof o>"u"||typeof o=="string"&&!o}const Be=(e,o,t)=>t.reduce((n,r)=>{const i=r.getValue(e);return n+(typeof i=="number"?i:0)},0),Ue=(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},Ne=(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},ke=(e,o,t)=>{let n,r;return t.forEach(i=>{const l=i.getValue(e);l!=null&&(n===void 0?l>=l&&(n=r=l):(n>l&&(n=l),r<l&&(r=l)))}),[n,r]},qe=(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},je=(e,o)=>{if(!o.length)return;const t=o.map(i=>i.getValue(e));if(!He(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),r=t.sort((i,l)=>i-l);return t.length%2!==0?r[n]:(r[n-1]+r[n])/2},Xe=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),We=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,Ke=(e,o)=>o.length,q={sum:Be,min:Ue,max:Ne,extent:ke,mean:qe,median:je,unique:Xe,uniqueCount:We,count:Ke},Ye={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:V("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 q.sum;if(Object.prototype.toString.call(n)==="[object Date]")return q.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return N(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:q[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 Qe(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(l=>l.id===i)).filter(Boolean),...n]}const Je={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:V("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=m(t=>[G(o,t)],t=>t.findIndex(n=>n.id===e.id),C(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=G(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const r=G(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=m(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(o,t,n)=>r=>{let i=[];if(!(o!=null&&o.length))i=r;else{const l=[...o],u=[...r];for(;u.length&&l.length;){const s=l.shift(),g=u.findIndex(c=>c.id===s);g>-1&&i.push(u.splice(g,1)[0])}i=[...i,...u]}return Qe(i,t,n)},C(e.options,"debugTable"))}},j=()=>({left:[],right:[]}),Ze={getInitialState:e=>({columnPinning:j(),...e}),getDefaultOptions:e=>({onColumnPinningChange:V("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(r=>r.id).filter(Boolean);o.setColumnPinning(r=>{var i,l;if(t==="right"){var u,s;return{left:((u=r==null?void 0:r.left)!=null?u:[]).filter(p=>!(n!=null&&n.includes(p))),right:[...((s=r==null?void 0:r.right)!=null?s:[]).filter(p=>!(n!=null&&n.includes(p))),...n]}}if(t==="left"){var g,c;return{left:[...((g=r==null?void 0:r.left)!=null?g:[]).filter(p=>!(n!=null&&n.includes(p))),...n],right:((c=r==null?void 0:r.right)!=null?c:[]).filter(p=>!(n!=null&&n.includes(p)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(p=>!(n!=null&&n.includes(p))),right:((l=r==null?void 0:r.right)!=null?l:[]).filter(p=>!(n!=null&&n.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var r,i,l;return((r=n.columnDef.enablePinning)!=null?r:!0)&&((i=(l=o.options.enableColumnPinning)!=null?l:o.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(u=>u.id),{left:n,right:r}=o.getState().columnPinning,i=t.some(u=>n==null?void 0:n.includes(u)),l=t.some(u=>r==null?void 0:r.includes(u));return i?"left":l?"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=m(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(l=>!i.includes(l.column.id))},C(o.options,"debugRows")),e.getLeftVisibleCells=m(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left],(t,n)=>(n??[]).map(i=>t.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),C(o.options,"debugRows")),e.getRightVisibleCells=m(()=>[e._getAllVisibleCells(),o.getState().columnPinning.right],(t,n)=>(n??[]).map(i=>t.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),C(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?j():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:j())},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=m(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(o,t)=>(t??[]).map(n=>o.find(r=>r.id===n)).filter(Boolean),C(e.options,"debugColumns")),e.getRightLeafColumns=m(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(o,t)=>(t??[]).map(n=>o.find(r=>r.id===n)).filter(Boolean),C(e.options,"debugColumns")),e.getCenterLeafColumns=m(()=>[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))},C(e.options,"debugColumns"))}},T={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},X=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),be={getDefaultColumnDef:()=>T,getInitialState:e=>({columnSizing:{},columnSizingInfo:X(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:V("columnSizing",e),onColumnSizingInfoChange:V("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:T.minSize,(n=i??e.columnDef.size)!=null?n:T.size),(r=e.columnDef.maxSize)!=null?r:T.maxSize)},e.getStart=m(t=>[t,G(o,t),o.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),C(o.options,"debugColumns")),e.getAfter=m(t=>[t,G(o,t),o.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),C(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(),W(i)&&i.touches&&i.touches.length>1))return;const l=e.getSize(),u=e?e.getLeafHeaders().map(h=>[h.column.id,h.column.getSize()]):[[n.id,n.getSize()]],s=W(i)?Math.round(i.touches[0].clientX):i.clientX,g={},c=(h,w)=>{typeof w=="number"&&(o.setColumnSizingInfo(_=>{var $,F;const v=o.options.columnResizeDirection==="rtl"?-1:1,A=(w-(($=_==null?void 0:_.startOffset)!=null?$:0))*v,D=Math.max(A/((F=_==null?void 0:_.startSize)!=null?F:0),-.999999);return _.columnSizingStart.forEach(O=>{let[_e,ie]=O;g[_e]=Math.round(Math.max(ie+ie*D,0)*100)/100}),{..._,deltaOffset:A,deltaPercentage:D}}),(o.options.columnResizeMode==="onChange"||h==="end")&&o.setColumnSizing(_=>({..._,...g})))},p=h=>c("move",h),d=h=>{c("end",h),o.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},a=t||typeof document<"u"?document:null,f={moveHandler:h=>p(h.clientX),upHandler:h=>{a==null||a.removeEventListener("mousemove",f.moveHandler),a==null||a.removeEventListener("mouseup",f.upHandler),d(h.clientX)}},S={moveHandler:h=>(h.cancelable&&(h.preventDefault(),h.stopPropagation()),p(h.touches[0].clientX),!1),upHandler:h=>{var w;a==null||a.removeEventListener("touchmove",S.moveHandler),a==null||a.removeEventListener("touchend",S.upHandler),h.cancelable&&(h.preventDefault(),h.stopPropagation()),d((w=h.touches[0])==null?void 0:w.clientX)}},R=et()?{passive:!1}:!1;W(i)?(a==null||a.addEventListener("touchmove",S.moveHandler,R),a==null||a.addEventListener("touchend",S.upHandler,R)):(a==null||a.addEventListener("mousemove",f.moveHandler,R),a==null||a.addEventListener("mouseup",f.upHandler,R)),o.setColumnSizingInfo(h=>({...h,startOffset:s,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,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?X():(t=e.initialState.columnSizingInfo)!=null?t:X())},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 B=null;function et(){if(typeof B=="boolean")return B;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 B=e,B}function W(e){return e.type==="touchstart"}const tt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:V("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=m(()=>[e.getAllCells(),o.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),C(o.options,"debugRows")),e.getVisibleCells=m(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,r)=>[...t,...n,...r],C(o.options,"debugRows"))},createTable:e=>{const o=(t,n)=>m(()=>[n(),n().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),C(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 G(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const nt={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()}}},ot={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:V("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=()=>x.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return N(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:x[n]},e.setGlobalFilter=o=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(o)},e.resetGlobalFilter=o=>{e.setGlobalFilter(o?void 0:e.initialState.globalFilter)}}},rt={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:V("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 l=i.split(".");n=Math.max(n,l.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 l={};if(n===!0?Object.keys(o.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=n,t=(r=t)!=null?r:!i,!i&&t)return{...l,[e.id]:!0};if(i&&!t){const{[e.id]:u,...s}=l;return s}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()}}}},J=0,Z=10,K=()=>({pageIndex:J,pageSize:Z}),it={getInitialState:e=>({...e,pagination:{...K(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:V("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=>y(n,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=n=>{var r;e.setPagination(n?K():(r=e.initialState.pagination)!=null?r:K())},e.setPageIndex=n=>{e.setPagination(r=>{let i=y(n,r.pageIndex);const l=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,l)),{...r,pageIndex:i}})},e.resetPageIndex=n=>{var r,i;e.setPageIndex(n?J:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:J)},e.resetPageSize=n=>{var r,i;e.setPageSize(n?Z:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Z)},e.setPageSize=n=>{e.setPagination(r=>{const i=Math.max(1,y(n,r.pageSize)),l=r.pageSize*r.pageIndex,u=Math.floor(l/i);return{...r,pageIndex:u,pageSize:i}})},e.setPageCount=n=>e.setPagination(r=>{var i;let l=y(n,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...r,pageCount:l}}),e.getPageOptions=m(()=>[e.getPageCount()],n=>{let r=[];return n&&n>0&&(r=[...new Array(n)].fill(null).map((i,l)=>l)),r},C(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}}},Y=()=>({top:[],bottom:[]}),lt={getInitialState:e=>({rowPinning:Y(),...e}),getDefaultOptions:e=>({onRowPinningChange:V("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,r)=>{const i=n?e.getLeafRows().map(s=>{let{id:g}=s;return g}):[],l=r?e.getParentRows().map(s=>{let{id:g}=s;return g}):[],u=new Set([...l,e.id,...i]);o.setRowPinning(s=>{var g,c;if(t==="bottom"){var p,d;return{top:((p=s==null?void 0:s.top)!=null?p:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((d=s==null?void 0:s.bottom)!=null?d:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)]}}if(t==="top"){var a,f;return{top:[...((a=s==null?void 0:s.top)!=null?a:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)],bottom:((f=s==null?void 0:s.bottom)!=null?f:[]).filter(S=>!(u!=null&&u.has(S)))}}return{top:((g=s==null?void 0:s.top)!=null?g:[]).filter(S=>!(u!=null&&u.has(S))),bottom:((c=s==null?void 0:s.bottom)!=null?c:[]).filter(S=>!(u!=null&&u.has(S)))}})},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(u=>n==null?void 0:n.includes(u)),l=t.some(u=>r==null?void 0:r.includes(u));return i?"top":l?"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(l=>{let{id:u}=l;return u});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?Y():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:Y())},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(l=>{const u=e.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(t??[]).map(l=>o.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:n}))},e.getTopRows=m(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(o,t)=>e._getPinnedRows(o,t,"top"),C(e.options,"debugRows")),e.getBottomRows=m(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(o,t)=>e._getPinnedRows(o,t,"bottom"),C(e.options,"debugRows")),e.getCenterRows=m(()=>[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))},C(e.options,"debugRows"))}},st={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:V("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=>{b(r,i.id,n,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=m(()=>[e.getState().rowSelection,e.getCoreRowModel()],(o,t)=>Object.keys(o).length?Q(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getFilteredSelectedRowModel=m(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?Q(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getGroupedSelectedRowModel=m(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?Q(e,t):{rows:[],flatRows:[],rowsById:{}},C(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 l;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const u={...i};return b(u,e.id,t,(l=n==null?void 0:n.selectChildren)!=null?l:!0,o),u})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return oe(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return ee(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return ee(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)}}}},b=(e,o,t,n,r)=>{var i;const l=r.getRow(o,!0);t?(l.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),l.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>b(e,u.id,t,n,r))};function Q(e,o){const t=e.getState().rowSelection,n=[],r={},i=function(l,u){return l.map(s=>{var g;const c=oe(s,t);if(c&&(n.push(s),r[s.id]=s),(g=s.subRows)!=null&&g.length&&(s={...s,subRows:i(s.subRows)}),c)return s}).filter(Boolean)};return{rows:i(o.rows),flatRows:n,rowsById:r}}function oe(e,o){var t;return(t=o[e.id])!=null?t:!1}function ee(e,o,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let r=!0,i=!1;return e.subRows.forEach(l=>{if(!(i&&!r)&&(l.getCanSelect()&&(oe(l,o)?i=!0:r=!1),l.subRows&&l.subRows.length)){const u=ee(l,o);u==="all"?i=!0:(u==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const te=/([0-9]+)/gm,ut=(e,o,t)=>ve(E(e.getValue(t)).toLowerCase(),E(o.getValue(t)).toLowerCase()),at=(e,o,t)=>ve(E(e.getValue(t)),E(o.getValue(t))),gt=(e,o,t)=>re(E(e.getValue(t)).toLowerCase(),E(o.getValue(t)).toLowerCase()),dt=(e,o,t)=>re(E(e.getValue(t)),E(o.getValue(t))),ct=(e,o,t)=>{const n=e.getValue(t),r=o.getValue(t);return n>r?1:n<r?-1:0},ft=(e,o,t)=>re(e.getValue(t),o.getValue(t));function re(e,o){return e===o?0:e>o?1:-1}function E(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ve(e,o){const t=e.split(te).filter(Boolean),n=o.split(te).filter(Boolean);for(;t.length&&n.length;){const r=t.shift(),i=n.shift(),l=parseInt(r,10),u=parseInt(i,10),s=[l,u].sort();if(isNaN(s[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return t.length-n.length}const H={alphanumeric:ut,alphanumericCaseSensitive:at,text:gt,textCaseSensitive:dt,datetime:ct,basic:ft},pt={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:V("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 H.datetime;if(typeof i=="string"&&(n=!0,i.split(te).length>1))return H.alphanumeric}return n?H.text:H.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 N(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:H[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;o.setSorting(l=>{const u=l==null?void 0:l.find(a=>a.id===e.id),s=l==null?void 0:l.findIndex(a=>a.id===e.id);let g=[],c,p=i?t:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&n?u?c="toggle":c="add":l!=null&&l.length&&s!==l.length-1?c="replace":u?c="toggle":c="replace",c==="toggle"&&(i||r||(c="remove")),c==="add"){var d;g=[...l,{id:e.id,desc:p}],g.splice(0,g.length-((d=o.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else c==="toggle"?g=l.map(a=>a.id===e.id?{...a,desc:p}:a):c==="remove"?g=l.filter(a=>a.id!==e.id):g=[{id:e.id,desc:p}];return g})},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(),l=e.getIsSorted();return l?l!==i&&((n=o.options.enableSortingRemoval)==null||n)&&(!(t&&(r=o.options.enableMultiRemove)!=null)||r)?!1:l==="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())}},St=[Le,tt,Je,Ze,ze,Te,nt,ot,pt,Ye,rt,it,lt,st,be];function mt(e){var o,t;const n=[...St,...(o=e._features)!=null?o:[]];let r={_features:n};const i=r._features.reduce((d,a)=>Object.assign(d,a.getDefaultOptions==null?void 0:a.getDefaultOptions(r)),{}),l=d=>r.options.mergeOptions?r.options.mergeOptions(i,d):{...i,...d};let s={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(d=>{var a;s=(a=d.getInitialState==null?void 0:d.getInitialState(s))!=null?a:s});const g=[];let c=!1;const p={_features:n,options:{...i,...e},initialState:s,_queue:d=>{g.push(d),c||(c=!0,Promise.resolve().then(()=>{for(;g.length;)g.shift()();c=!1}).catch(a=>setTimeout(()=>{throw a})))},reset:()=>{r.setState(r.initialState)},setOptions:d=>{const a=y(d,r.options);r.options=l(a)},getState:()=>r.options.state,setState:d=>{r.options.onStateChange==null||r.options.onStateChange(d)},_getRowId:(d,a,f)=>{var S;return(S=r.options.getRowId==null?void 0:r.options.getRowId(d,a,f))!=null?S:`${f?[f.id,a].join("."):a}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(d,a)=>{let f=(a?r.getPrePaginationRowModel():r.getRowModel()).rowsById[d];if(!f&&(f=r.getCoreRowModel().rowsById[d],!f))throw new Error;return f},_getDefaultColumnDef:m(()=>[r.options.defaultColumn],d=>{var a;return d=(a=d)!=null?a:{},{header:f=>{const S=f.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:f=>{var S,R;return(S=(R=f.renderValue())==null||R.toString==null?void 0:R.toString())!=null?S:null},...r._features.reduce((f,S)=>Object.assign(f,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...d}},C(e,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:m(()=>[r._getColumnDefs()],d=>{const a=function(f,S,R){return R===void 0&&(R=0),f.map(h=>{const w=Oe(r,h,R,S),_=h;return w.columns=_.columns?a(_.columns,w,R+1):[],w})};return a(d)},C(e,"debugColumns")),getAllFlatColumns:m(()=>[r.getAllColumns()],d=>d.flatMap(a=>a.getFlatColumns()),C(e,"debugColumns")),_getAllFlatColumnsById:m(()=>[r.getAllFlatColumns()],d=>d.reduce((a,f)=>(a[f.id]=f,a),{}),C(e,"debugColumns")),getAllLeafColumns:m(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(d,a)=>{let f=d.flatMap(S=>S.getLeafColumns());return a(f)},C(e,"debugColumns")),getColumn:d=>r._getAllFlatColumnsById()[d]};Object.assign(r,p);for(let d=0;d<r._features.length;d++){const a=r._features[d];a==null||a.createTable==null||a.createTable(r)}return r}function Pt(){return e=>m(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(r,i,l){i===void 0&&(i=0);const u=[];for(let g=0;g<r.length;g++){const c=k(e,e._getRowId(r[g],g,l),r[g],g,i,void 0,l==null?void 0:l.id);if(t.flatRows.push(c),t.rowsById[c.id]=c,u.push(c),e.options.getSubRows){var s;c.originalSubRows=e.options.getSubRows(r[g],g),(s=c.originalSubRows)!=null&&s.length&&(c.subRows=n(c.originalSubRows,i+1,c))}}return u};return t.rows=n(o),t},C(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function xt(){return e=>m(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(o,t,n)=>!t.rows.length||o!==!0&&!Object.keys(o??{}).length||!n?t:Ct(t),C(e.options,"debugTable"))}function Ct(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 ht(e,o,t){return t.options.filterFromLeafRows?Rt(e,o,t):wt(e,o,t)}function Rt(e,o,t){var n;const r=[],i={},l=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,u=function(s,g){g===void 0&&(g=0);const c=[];for(let d=0;d<s.length;d++){var p;let a=s[d];const f=k(t,a.id,a.original,a.index,a.depth,void 0,a.parentId);if(f.columnFilters=a.columnFilters,(p=a.subRows)!=null&&p.length&&g<l){if(f.subRows=u(a.subRows,g+1),a=f,o(a)&&!f.subRows.length){c.push(a),i[a.id]=a,r.push(a);continue}if(o(a)||f.subRows.length){c.push(a),i[a.id]=a,r.push(a);continue}}else a=f,o(a)&&(c.push(a),i[a.id]=a,r.push(a))}return c};return{rows:u(e),flatRows:r,rowsById:i}}function wt(e,o,t){var n;const r=[],i={},l=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,u=function(s,g){g===void 0&&(g=0);const c=[];for(let d=0;d<s.length;d++){let a=s[d];if(o(a)){var p;if((p=a.subRows)!=null&&p.length&&g<l){const S=k(t,a.id,a.original,a.index,a.depth,void 0,a.parentId);S.subRows=u(a.subRows,g+1),a=S}c.push(a),r.push(a),i[a.id]=a}}return c};return{rows:u(e),flatRows:r,rowsById:i}}function yt(){return e=>m(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(o,t,n)=>{if(!o.rows.length||!(t!=null&&t.length)&&!n){for(let d=0;d<o.flatRows.length;d++)o.flatRows[d].columnFilters={},o.flatRows[d].columnFiltersMeta={};return o}const r=[],i=[];(t??[]).forEach(d=>{var a;const f=e.getColumn(d.id);if(!f)return;const S=f.getFilterFn();S&&r.push({id:d.id,filterFn:S,resolvedValue:(a=S.resolveFilterValue==null?void 0:S.resolveFilterValue(d.value))!=null?a:d.value})});const l=(t??[]).map(d=>d.id),u=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());n&&u&&s.length&&(l.push("__global__"),s.forEach(d=>{var a;i.push({id:d.id,filterFn:u,resolvedValue:(a=u.resolveFilterValue==null?void 0:u.resolveFilterValue(n))!=null?a:n})}));let g,c;for(let d=0;d<o.flatRows.length;d++){const a=o.flatRows[d];if(a.columnFilters={},r.length)for(let f=0;f<r.length;f++){g=r[f];const S=g.id;a.columnFilters[S]=g.filterFn(a,S,g.resolvedValue,R=>{a.columnFiltersMeta[S]=R})}if(i.length){for(let f=0;f<i.length;f++){c=i[f];const S=c.id;if(c.filterFn(a,S,c.resolvedValue,R=>{a.columnFiltersMeta[S]=R})){a.columnFilters.__global__=!0;break}}a.columnFilters.__global__!==!0&&(a.columnFilters.__global__=!1)}}const p=d=>{for(let a=0;a<l.length;a++)if(d.columnFilters[l[a]]===!1)return!1;return!0};return ht(o.rows,p,e)},C(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Et(){return e=>m(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(o,t)=>{if(!t.rows.length||!o.length)return t.rows.forEach(s=>{s.depth=0,s.parentId=void 0}),t;const n=o.filter(s=>e.getColumn(s)),r=[],i={},l=function(s,g,c){if(g===void 0&&(g=0),g>=n.length)return s.map(f=>(f.depth=g,r.push(f),i[f.id]=f,f.subRows&&(f.subRows=l(f.subRows,g+1,f.id)),f));const p=n[g],d=vt(s,p);return Array.from(d.entries()).map((f,S)=>{let[R,h]=f,w=`${p}:${R}`;w=c?`${c}>${w}`:w;const _=l(h,g+1,w);_.forEach(v=>{v.parentId=w});const $=g?ce(h,v=>v.subRows):h,F=k(e,w,$[0].original,S,g,void 0,c);return Object.assign(F,{groupingColumnId:p,groupingValue:R,subRows:_,leafRows:$,getValue:v=>{if(n.includes(v)){if(F._valuesCache.hasOwnProperty(v))return F._valuesCache[v];if(h[0]){var A;F._valuesCache[v]=(A=h[0].getValue(v))!=null?A:void 0}return F._valuesCache[v]}if(F._groupingValuesCache.hasOwnProperty(v))return F._groupingValuesCache[v];const D=e.getColumn(v),O=D==null?void 0:D.getAggregationFn();if(O)return F._groupingValuesCache[v]=O(v,$,h),F._groupingValuesCache[v]}}),_.forEach(v=>{r.push(v),i[v.id]=v}),F})},u=l(t.rows,0);return u.forEach(s=>{r.push(s),i[s.id]=s}),{rows:u,flatRows:r,rowsById:i}},C(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function vt(e,o){const t=new Map;return e.reduce((n,r)=>{const i=`${r.getGroupingValue(o)}`,l=n.get(i);return l?l.push(r):n.set(i,[r]),n},t)}function At(){return e=>m(()=>[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(s=>{var g;return(g=e.getColumn(s.id))==null?void 0:g.getCanSort()}),l={};i.forEach(s=>{const g=e.getColumn(s.id);g&&(l[s.id]={sortUndefined:g.columnDef.sortUndefined,invertSorting:g.columnDef.invertSorting,sortingFn:g.getSortingFn()})});const u=s=>{const g=s.map(c=>({...c}));return g.sort((c,p)=>{for(let a=0;a<i.length;a+=1){var d;const f=i[a],S=l[f.id],R=S.sortUndefined,h=(d=f==null?void 0:f.desc)!=null?d:!1;let w=0;if(R){const _=c.getValue(f.id),$=p.getValue(f.id),F=_===void 0,v=$===void 0;if(F||v){if(R==="first")return F?-1:1;if(R==="last")return F?1:-1;w=F&&v?0:F?R:-R}}if(w===0&&(w=S.sortingFn(c,p,f.id)),w!==0)return h&&(w*=-1),S.invertSorting&&(w*=-1),w}return c.index-p.index}),g.forEach(c=>{var p;r.push(c),(p=c.subRows)!=null&&p.length&&(c.subRows=u(c.subRows))}),g};return{rows:u(t.rows),flatRows:r,rowsById:t.rowsById}},C(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
   * solid-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 Dt(e,o){return e?typeof e=="function"?Fe(e,o):e:null}function Ht(e){const o=L({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,l)=>L(i,l)},e),t=mt(o),[n,r]=Ie(t.initialState);return $e(()=>{t.setOptions(i=>L(i,e,{state:L(n,e.state||{}),onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}}))}),t}export{It as I,Ft as a,$t as b,Ht as c,Mt as d,At as e,Dt as f,yt as g,xt as h,Et as i,Pt as j,Vt as r};
