import{c as ve,m as H,ar as he,as as Re}from"./vendor-5507c805.js";/**
 * 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 ue={À:"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"},we=Object.keys(ue).join("|"),_e=new RegExp(we,"g");function $e(e){return e.replace(_e,t=>ue[t])}/**
 * @name match-sorter
 * @license MIT license.
 * @copyright (c) 2099 Kent C. Dodds
 * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
 */const F={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function pn(e,t,n){var o;if(n=n||{},n.threshold=(o=n.threshold)!=null?o:F.MATCHES,!n.accessors){const l=ne(e,t,n);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:n.threshold,passed:l>=n.threshold}}const r=Me(e,n.accessors),i={rankedValue:e,rank:F.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let l=0;l<r.length;l++){const s=r[l];let u=ne(s.itemValue,t,n);const{minRanking:g,maxRanking:a,threshold:c=n.threshold}=s.attributes;u<g&&u>=F.MATCHES?u=g:u>a&&(u=a),u=Math.min(u,a),u>=c&&u>i.rank&&(i.rank=u,i.passed=!0,i.accessorIndex=l,i.accessorThreshold=c,i.rankedValue=s.itemValue)}return i}function ne(e,t,n){return e=te(e,n),t=te(t,n),t.length>e.length?F.NO_MATCH:e===t?F.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?F.EQUAL:e.startsWith(t)?F.STARTS_WITH:e.includes(` ${t}`)?F.WORD_STARTS_WITH:e.includes(t)?F.CONTAINS:t.length===1?F.NO_MATCH:Fe(e).includes(t)?F.ACRONYM:Ae(e,t))}function Fe(e){let t="";return e.split(" ").forEach(o=>{o.split("-").forEach(i=>{t+=i.substr(0,1)})}),t}function Ae(e,t){let n=0,o=0;function r(u,g,a){for(let c=a,f=g.length;c<f;c++)if(g[c]===u)return n+=1,c+1;return-1}function i(u){const g=1/u,a=n/t.length;return F.MATCHES+a*g}const l=r(t[0],e,0);if(l<0)return F.NO_MATCH;o=l;for(let u=1,g=t.length;u<g;u++){const a=t[u];if(o=r(a,e,o),!(o>-1))return F.NO_MATCH}const s=o-l;return i(s)}function te(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=$e(e)),e}function Ve(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const o=n(e);return o==null?[]:Array.isArray(o)?o:[String(o)]}function Me(e,t){const n=[];for(let o=0,r=t.length;o<r;o++){const i=t[o],l=Ie(i),s=Ve(e,i);for(let u=0,g=s.length;u<g;u++)n.push({itemValue:s[u],attributes:l})}return n}const oe={maxRanking:1/0,minRanking:-1/0};function Ie(e){return typeof e=="function"?oe:{...oe,...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 I(e,t){return typeof e=="function"?e(t):e}function A(e,t){return n=>{t.setState(o=>({...o,[e]:I(n,o[e])}))}}function L(e){return e instanceof Function}function ye(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function se(e,t){const n=[],o=r=>{r.forEach(i=>{n.push(i);const l=t(i);l!=null&&l.length&&o(l)})};return o(e),n}function S(e,t,n){let o=[],r;return()=>{let i;n.key&&n.debug&&(i=Date.now());const l=e();if(!(l.length!==o.length||l.some((g,a)=>o[a]!==g)))return r;o=l;let u;if(n.key&&n.debug&&(u=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-i)*100)/100,a=Math.round((Date.now()-u)*100)/100,c=a/16,f=(d,m)=>{for(d=String(d);d.length<m;)d=" "+d;return d};console.info(`%c⏱ ${f(a,5)} /${f(g,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*c,120))}deg 100% 31%);`,n==null?void 0:n.key)}return r}}function xe(e,t,n,o){var r,i;const s={...e._getDefaultColumnDef(),...t},u=s.accessorKey;let g=(r=(i=s.id)!=null?i:u?u.replace(".","_"):void 0)!=null?r:typeof s.header=="string"?s.header:void 0,a;if(s.accessorFn?a=s.accessorFn:u&&(u.includes(".")?a=f=>{let d=f;for(const p of u.split(".")){var m;d=(m=d)==null?void 0:m[p]}return d}:a=f=>f[s.accessorKey]),!g)throw new Error;let c={id:`${String(g)}`,accessorFn:a,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:S(()=>[!0],()=>{var f;return[c,...(f=c.columns)==null?void 0:f.flatMap(d=>d.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var f;return(f=e.options.debugAll)!=null?f:e.options.debugColumns}}),getLeafColumns:S(()=>[e._getOrderColumnsFn()],f=>{var d;if((d=c.columns)!=null&&d.length){let m=c.columns.flatMap(p=>p.getLeafColumns());return f(m)}return[c]},{key:"column.getLeafColumns",debug:()=>{var f;return(f=e.options.debugAll)!=null?f:e.options.debugColumns}})};for(const f of e._features)f.createColumn==null||f.createColumn(c,e);return c}function re(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),l.push(u)};return s(i),l},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}const Pe={createTable:e=>{e.getHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,l;const s=(i=o==null?void 0:o.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?i:[],u=(l=r==null?void 0:r.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?l:[],g=n.filter(c=>!(o!=null&&o.includes(c.id))&&!(r!=null&&r.includes(c.id)));return D(t,[...s,...g,...u],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),D(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o==null?void 0:o.map(l=>n.find(s=>s.id===l)).filter(Boolean))!=null?r:[];return D(t,i,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=S(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o==null?void 0:o.map(l=>n.find(s=>s.id===l)).filter(Boolean))!=null?r:[];return D(t,i,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=S(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=S(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=S(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=S(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=S(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=S(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=S(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=S(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=S(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=S(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=S(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=S(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,l,s,u,g;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(l=(s=n[0])==null?void 0:s.headers)!=null?l:[],...(u=(g=o[0])==null?void 0:g.headers)!=null?u:[]].map(a=>a.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function D(e,t,n,o){var r,i;let l=0;const s=function(f,d){d===void 0&&(d=1),l=Math.max(l,d),f.filter(m=>m.getIsVisible()).forEach(m=>{var p;(p=m.columns)!=null&&p.length&&s(m.columns,d+1)},0)};s(e);let u=[];const g=(f,d)=>{const m={depth:d,id:[o,`${d}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(C=>{const v=[...p].reverse()[0],$=C.column.depth===m.depth;let w,_=!1;if($&&C.column.parent?w=C.column.parent:(w=C.column,_=!0),v&&(v==null?void 0:v.column)===w)v.subHeaders.push(C);else{const R=re(n,w,{id:[o,d,w.id,C==null?void 0:C.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${p.filter(h=>h.column===w).length}`:void 0,depth:d,index:p.length});R.subHeaders.push(C),p.push(R)}m.headers.push(C),C.headerGroup=m}),u.push(m),d>0&&g(p,d-1)},a=t.map((f,d)=>re(n,f,{depth:l,index:d}));g(a,l-1),u.reverse();const c=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let p=0,C=0,v=[0];m.subHeaders&&m.subHeaders.length?(v=[],c(m.subHeaders).forEach(w=>{let{colSpan:_,rowSpan:R}=w;p+=_,v.push(R)})):p=1;const $=Math.min(...v);return C=C+$,m.colSpan=p,m.rowSpan=C,{colSpan:p,rowSpan:C}});return c((r=(i=u[0])==null?void 0:i.headers)!=null?r:[]),u}const G={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},k=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Ee={getDefaultColumnDef:()=>G,getInitialState:e=>({columnSizing:{},columnSizingInfo:k(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:A("columnSizing",e),onColumnSizingInfoChange:A("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:G.minSize,(o=i??e.columnDef.size)!=null?o:G.size),(r=e.columnDef.maxSize)!=null?r:G.maxSize)},e.getStart=n=>{const o=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),r=o.findIndex(i=>i.id===e.id);if(r>0){const i=o[r-1];return i.getStart(n)+i.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=()=>{const n=t.getColumn(e.column.id),o=n==null?void 0:n.getCanResize();return r=>{if(!n||!o||(r.persist==null||r.persist(),b(r)&&r.touches&&r.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(p=>[p.column.id,p.column.getSize()]):[[n.id,n.getSize()]],s=b(r)?Math.round(r.touches[0].clientX):r.clientX,u={},g=(p,C)=>{typeof C=="number"&&(t.setColumnSizingInfo(v=>{var $,w;const _=C-(($=v==null?void 0:v.startOffset)!=null?$:0),R=Math.max(_/((w=v==null?void 0:v.startSize)!=null?w:0),-.999999);return v.columnSizingStart.forEach(h=>{let[E,x]=h;u[E]=Math.round(Math.max(x+x*R,0)*100)/100}),{...v,deltaOffset:_,deltaPercentage:R}}),(t.options.columnResizeMode==="onChange"||p==="end")&&t.setColumnSizing(v=>({...v,...u})))},a=p=>g("move",p),c=p=>{g("end",p),t.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f={moveHandler:p=>a(p.clientX),upHandler:p=>{document.removeEventListener("mousemove",f.moveHandler),document.removeEventListener("mouseup",f.upHandler),c(p.clientX)}},d={moveHandler:p=>(p.cancelable&&(p.preventDefault(),p.stopPropagation()),a(p.touches[0].clientX),!1),upHandler:p=>{var C;document.removeEventListener("touchmove",d.moveHandler),document.removeEventListener("touchend",d.upHandler),p.cancelable&&(p.preventDefault(),p.stopPropagation()),c((C=p.touches[0])==null?void 0:C.clientX)}},m=He()?{passive:!1}:!1;b(r)?(document.addEventListener("touchmove",d.moveHandler,m),document.addEventListener("touchend",d.upHandler,m)):(document.addEventListener("mousemove",f.moveHandler,m),document.addEventListener("mouseup",f.upHandler,m)),t.setColumnSizingInfo(p=>({...p,startOffset:s,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?k():(n=e.initialState.columnSizingInfo)!=null?n:k())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}};let O=null;function He(){if(typeof O=="boolean")return O;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return O=e,O}function b(e){return e.type==="touchstart"}const De={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:A("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},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,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let l={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{l[s]=!0}):l=o,n=(r=n)!=null?r:!i,!i&&n)return{...l,[e.id]:!0};if(i&&!n){const{[e.id]:s,...u}=l;return u}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o!=null&&o[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ae=(e,t,n)=>{var o;const r=n.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(r))};ae.autoRemove=e=>V(e);const ge=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};ge.autoRemove=e=>V(e);const de=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(n==null?void 0:n.toLowerCase())};de.autoRemove=e=>V(e);const ce=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};ce.autoRemove=e=>V(e)||!(e!=null&&e.length);const fe=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});fe.autoRemove=e=>V(e)||!(e!=null&&e.length);const pe=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});pe.autoRemove=e=>V(e)||!(e!=null&&e.length);const me=(e,t,n)=>e.getValue(t)===n;me.autoRemove=e=>V(e);const Se=(e,t,n)=>e.getValue(t)==n;Se.autoRemove=e=>V(e);const Q=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};Q.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(r)?1/0:r;if(i>l){const s=i;i=l,l=s}return[i,l]};Q.autoRemove=e=>V(e)||V(e[0])&&V(e[1]);const M={includesString:ae,includesStringSensitive:ge,equalsString:de,arrIncludes:ce,arrIncludesAll:fe,arrIncludesSome:pe,equals:me,weakEquals:Se,inNumberRange:Q};function V(e){return e==null||e===""}const Ge={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:A("columnFilters",e),onGlobalFilterChange:A("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(e.id);return typeof o=="string"?M.includesString:typeof o=="number"?M.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?M.equals:Array.isArray(o)?M.arrIncludes:M.weakEquals},e.getFilterFn=()=>{var n,o;return L(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:M[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o==null?void 0:o.find(a=>a.id===e.id),l=I(n,i?i.value:void 0);if(ie(r,l,e)){var s;return(s=o==null?void 0:o.filter(a=>a.id!==e.id))!=null?s:[]}const u={id:e.id,value:l};if(i){var g;return(g=o==null?void 0:o.map(a=>a.id===e.id?u:a))!=null?g:[]}return o!=null&&o.length?[...o,u]:[u]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>M.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return L(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:M[o]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=I(t,r))==null?void 0:i.filter(l=>{const s=n.find(u=>u.id===l.id);if(s){const u=s.getFilterFn();if(ie(u,l.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},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()),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()}}};function ie(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Oe=(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),Le=(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},ze=(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},ke=(e,t,n)=>{let o,r;return n.forEach(i=>{const l=i.getValue(e);l!=null&&(o===void 0?l>=l&&(o=r=l):(o>l&&(o=l),r<l&&(r=l)))}),[o,r]},be=(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},Te=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!ye(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((i,l)=>i-l);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},Be=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Ue=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Ne=(e,t)=>t.length,T={sum:Oe,min:Le,max:ze,extent:ke,mean:be,median:Te,unique:Be,uniqueCount:Ue,count:Ne},qe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:A("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o,r,i;return(n=(o=(r=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?r:t.options.enableGrouping)!=null?o:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(e.id);if(typeof o=="number")return T.sum;if(Object.prototype.toString.call(o)==="[object Date]")return T.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return L(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:T[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},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,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function je(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(l=>l.id===i)).filter(Boolean),...o]}const Xe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:A("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=S(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const l=[...t],s=[...r];for(;s.length&&l.length;){const u=l.shift(),g=s.findIndex(a=>a.id===u);g>-1&&i.push(s.splice(g,1)[0])}i=[...i,...s]}return je(i,n,o)},{key:!1})}},j=0,X=10,B=()=>({pageIndex:j,pageSize:X}),We={getInitialState:e=>({...e,pagination:{...B(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:A("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=i=>I(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?B():(r=e.initialState.pagination)!=null?r:B())},e.setPageIndex=o=>{e.setPagination(r=>{let i=I(o,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=o=>{var r,i;e.setPageIndex(o?j:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:j)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?X:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:X)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,I(o,r.pageSize)),l=r.pageSize*r.pageIndex,s=Math.floor(l/i);return{...r,pageIndex:s,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let l=I(o,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...r,pageCount:l}}),e.getPageOptions=S(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,l)=>l)),r},{key:!1,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+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 o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},U=()=>({left:[],right:[]}),N=()=>({top:[],bottom:[]}),Ke={getInitialState:e=>({columnPinning:U(),rowPinning:N(),...e}),getDefaultOptions:e=>({onColumnPinningChange:A("columnPinning",e),onRowPinningChange:A("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,l;if(n==="right"){var s,u;return{left:((s=r==null?void 0:r.left)!=null?s:[]).filter(c=>!(o!=null&&o.includes(c))),right:[...((u=r==null?void 0:r.right)!=null?u:[]).filter(c=>!(o!=null&&o.includes(c))),...o]}}if(n==="left"){var g,a;return{left:[...((g=r==null?void 0:r.left)!=null?g:[]).filter(c=>!(o!=null&&o.includes(c))),...o],right:((a=r==null?void 0:r.right)!=null?a:[]).filter(c=>!(o!=null&&o.includes(c)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(c=>!(o!=null&&o.includes(c))),right:((l=r==null?void 0:r.right)!=null?l:[]).filter(c=>!(o!=null&&o.includes(c)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,l;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(l=t.options.enableColumnPinning)!=null?l:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(s=>o==null?void 0:o.includes(s)),l=n.some(s=>r==null?void 0:r.includes(s));return i?"left":l?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,o,r)=>{const i=o?e.getLeafRows().map(u=>{let{id:g}=u;return g}):[],l=r?e.getParentRows().map(u=>{let{id:g}=u;return g}):[],s=new Set([...l,e.id,...i]);t.setRowPinning(u=>{var g,a;if(n==="bottom"){var c,f;return{top:((c=u==null?void 0:u.top)!=null?c:[]).filter(p=>!(s!=null&&s.has(p))),bottom:[...((f=u==null?void 0:u.bottom)!=null?f:[]).filter(p=>!(s!=null&&s.has(p))),...Array.from(s)]}}if(n==="top"){var d,m;return{top:[...((d=u==null?void 0:u.top)!=null?d:[]).filter(p=>!(s!=null&&s.has(p))),...Array.from(s)],bottom:((m=u==null?void 0:u.bottom)!=null?m:[]).filter(p=>!(s!=null&&s.has(p)))}}return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(p=>!(s!=null&&s.has(p))),bottom:((a=u==null?void 0:u.bottom)!=null?a:[]).filter(p=>!(s!=null&&s.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(s=>o==null?void 0:o.includes(s)),l=n.some(s=>r==null?void 0:r.includes(s));return i?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const i=(n=t._getPinnedRows(r))==null?void 0:n.map(l=>{let{id:s}=l;return s});return(o=i==null?void 0:i.indexOf(e.id))!=null?o:-1},e.getCenterVisibleCells=S(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(l=>!i.includes(l.column.id))},{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=S(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=S(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?U():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:U())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=S(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?N():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:N())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=t=>S(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(o??[]).map(l=>{const s=e.getRow(l,!0);return s.getIsAllParentsExpanded()?s:null}):(o??[]).map(l=>n.find(s=>s.id===l))).filter(Boolean).map(l=>({...l,position:t}))},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=S(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},Ye={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:A("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{W(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=S(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?q(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=S(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?q(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=S(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?q(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(i=>{var l;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;const s={...i};return W(s,e.id,n,(l=o==null?void 0:o.selectChildren)!=null?l:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return J(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return K(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return K(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},W=(e,t,n,o,r)=>{var i;const l=r.getRow(t);n?(l.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),l.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(s=>W(e,s.id,n,o,r))};function q(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(l,s){return l.map(u=>{var g;const a=J(u,n);if(a&&(o.push(u),r[u.id]=u),(g=u.subRows)!=null&&g.length&&(u={...u,subRows:i(u.subRows)}),a)return u}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function J(e,t){var n;return(n=t[e.id])!=null?n:!1}function K(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(l=>{if(!(i&&!r)&&(l.getCanSelect()&&(J(l,t)?i=!0:r=!1),l.subRows&&l.subRows.length)){const s=K(l,t);s==="all"?i=!0:(s==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Y=/([0-9]+)/gm,Qe=(e,t,n)=>Ce(y(e.getValue(n)).toLowerCase(),y(t.getValue(n)).toLowerCase()),Je=(e,t,n)=>Ce(y(e.getValue(n)),y(t.getValue(n))),Ze=(e,t,n)=>Z(y(e.getValue(n)).toLowerCase(),y(t.getValue(n)).toLowerCase()),en=(e,t,n)=>Z(y(e.getValue(n)),y(t.getValue(n))),nn=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},tn=(e,t,n)=>Z(e.getValue(n),t.getValue(n));function Z(e,t){return e===t?0:e>t?1:-1}function y(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ce(e,t){const n=e.split(Y).filter(Boolean),o=t.split(Y).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),l=parseInt(r,10),s=parseInt(i,10),u=[l,s].sort();if(isNaN(u[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(u[1]))return isNaN(l)?-1:1;if(l>s)return 1;if(s>l)return-1}return n.length-o.length}const P={alphanumeric:Qe,alphanumericCaseSensitive:Je,text:Ze,textCaseSensitive:en,datetime:nn,basic:tn},on={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:A("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return P.datetime;if(typeof i=="string"&&(o=!0,i.split(Y).length>1))return P.alphanumeric}return o?P.text:P.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return L(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:P[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(l=>{const s=l==null?void 0:l.find(d=>d.id===e.id),u=l==null?void 0:l.findIndex(d=>d.id===e.id);let g=[],a,c=i?n:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&o?s?a="toggle":a="add":l!=null&&l.length&&u!==l.length-1?a="replace":s?a="toggle":a="replace",a==="toggle"&&(i||r||(a="remove")),a==="add"){var f;g=[...l,{id:e.id,desc:c}],g.splice(0,g.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else a==="toggle"?g=l.map(d=>d.id===e.id?{...d,desc:c}:d):a==="remove"?g=l.filter(d=>d.id!==e.id):g=[{id:e.id,desc:c}];return g})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const i=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:l==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},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())}},rn={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:A("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;return(n=(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=S(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=S(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,o)=>S(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}},le=[Pe,rn,Xe,Ke,Ge,on,qe,De,We,Ye,Ee];function ln(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:le};const o=n._features.reduce((a,c)=>Object.assign(a,c.getDefaultOptions==null?void 0:c.getDefaultOptions(n)),{}),r=a=>n.options.mergeOptions?n.options.mergeOptions(o,a):{...o,...a};let l={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(a=>{var c;l=(c=a.getInitialState==null?void 0:a.getInitialState(l))!=null?c:l});const s=[];let u=!1;const g={_features:le,options:{...o,...e},initialState:l,_queue:a=>{s.push(a),u||(u=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();u=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{n.setState(n.initialState)},setOptions:a=>{const c=I(a,n.options);n.options=r(c)},getState:()=>n.options.state,setState:a=>{n.options.onStateChange==null||n.options.onStateChange(a)},_getRowId:(a,c,f)=>{var d;return(d=n.options.getRowId==null?void 0:n.options.getRowId(a,c,f))!=null?d:`${f?[f.id,c].join("."):c}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(a,c)=>{const f=(c?n.getCoreRowModel():n.getRowModel()).rowsById[a];if(!f)throw new Error;return f},_getDefaultColumnDef:S(()=>[n.options.defaultColumn],a=>{var c;return a=(c=a)!=null?c:{},{header:f=>{const d=f.header.column.columnDef;return d.accessorKey?d.accessorKey:d.accessorFn?d.id:null},cell:f=>{var d,m;return(d=(m=f.renderValue())==null||m.toString==null?void 0:m.toString())!=null?d:null},...n._features.reduce((f,d)=>Object.assign(f,d.getDefaultColumnDef==null?void 0:d.getDefaultColumnDef()),{}),...a}},{debug:()=>{var a;return(a=n.options.debugAll)!=null?a:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:S(()=>[n._getColumnDefs()],a=>{const c=function(f,d,m){return m===void 0&&(m=0),f.map(p=>{const C=xe(n,p,m,d),v=p;return C.columns=v.columns?c(v.columns,C,m+1):[],C})};return c(a)},{key:!1,debug:()=>{var a;return(a=n.options.debugAll)!=null?a:n.options.debugColumns}}),getAllFlatColumns:S(()=>[n.getAllColumns()],a=>a.flatMap(c=>c.getFlatColumns()),{key:!1,debug:()=>{var a;return(a=n.options.debugAll)!=null?a:n.options.debugColumns}}),_getAllFlatColumnsById:S(()=>[n.getAllFlatColumns()],a=>a.reduce((c,f)=>(c[f.id]=f,c),{}),{key:!1,debug:()=>{var a;return(a=n.options.debugAll)!=null?a:n.options.debugColumns}}),getAllLeafColumns:S(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(a,c)=>{let f=a.flatMap(d=>d.getLeafColumns());return c(f)},{key:!1,debug:()=>{var a;return(a=n.options.debugAll)!=null?a:n.options.debugColumns}}),getColumn:a=>n._getAllFlatColumnsById()[a]};Object.assign(n,g);for(let a=0;a<n._features.length;a++){const c=n._features[a];c==null||c.createTable==null||c.createTable(n)}return n}function un(e,t,n,o){const r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:S(()=>[e,n,t,i],(l,s,u,g)=>({table:l,column:s,row:u,cell:g,getValue:g.getValue,renderValue:g.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,n,t,e)},{}),i}const z=(e,t,n,o,r,i,l)=>{let s={id:t,index:o,original:n,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const g=e.getColumn(u);if(g!=null&&g.accessorFn)return s._valuesCache[u]=g.accessorFn(s.original,o),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const g=e.getColumn(u);if(g!=null&&g.accessorFn)return g.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=g.columnDef.getUniqueValues(s.original,o),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var g;return(g=s.getValue(u))!=null?g:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>se(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],g=s;for(;;){const a=g.getParentRow();if(!a)break;u.push(a),g=a}return u.reverse()},getAllCells:S(()=>[e.getAllLeafColumns()],u=>u.map(g=>un(e,s,g,g.id)),{key:!1,debug:()=>{var u;return(u=e.options.debugAll)!=null?u:e.options.debugRows}}),_getAllCellsByColumnId:S(()=>[s.getAllCells()],u=>u.reduce((g,a)=>(g[a.column.id]=a,g),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var u;return(u=e.options.debugAll)!=null?u:e.options.debugRows}})};for(let u=0;u<e._features.length;u++){const g=e._features[u];g==null||g.createRow==null||g.createRow(s,e)}return s};function mn(){return e=>S(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,l){i===void 0&&(i=0);const s=[];for(let g=0;g<r.length;g++){const a=z(e,e._getRowId(r[g],g,l),r[g],g,i,void 0,l==null?void 0:l.id);if(n.flatRows.push(a),n.rowsById[a.id]=a,s.push(a),e.options.getSubRows){var u;a.originalSubRows=e.options.getSubRows(r[g],g),(u=a.originalSubRows)!=null&&u.length&&(a.subRows=o(a.originalSubRows,i+1,a))}}return s};return n.rows=o(t),n},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function sn(e,t,n){return n.options.filterFromLeafRows?an(e,t,n):gn(e,t,n)}function an(e,t,n){var o;const r=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,s=function(u,g){g===void 0&&(g=0);const a=[];for(let f=0;f<u.length;f++){var c;let d=u[f];const m=z(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(m.columnFilters=d.columnFilters,(c=d.subRows)!=null&&c.length&&g<l){if(m.subRows=s(d.subRows,g+1),d=m,t(d)&&!m.subRows.length){a.push(d),i[d.id]=d,r.push(d);continue}if(t(d)||m.subRows.length){a.push(d),i[d.id]=d,r.push(d);continue}}else d=m,t(d)&&(a.push(d),i[d.id]=d,r.push(d))}return a};return{rows:s(e),flatRows:r,rowsById:i}}function gn(e,t,n){var o;const r=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,s=function(u,g){g===void 0&&(g=0);const a=[];for(let f=0;f<u.length;f++){let d=u[f];if(t(d)){var c;if((c=d.subRows)!=null&&c.length&&g<l){const p=z(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);p.subRows=s(d.subRows,g+1),d=p}a.push(d),r.push(d),i[d.id]=d}}return a};return{rows:s(e),flatRows:r,rowsById:i}}function Sn(){return e=>S(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach(f=>{var d;const m=e.getColumn(f.id);if(!m)return;const p=m.getFilterFn();p&&r.push({id:f.id,filterFn:p,resolvedValue:(d=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?d:f.value})});const l=n.map(f=>f.id),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&s&&u.length&&(l.push("__global__"),u.forEach(f=>{var d;i.push({id:f.id,filterFn:s,resolvedValue:(d=s.resolveFilterValue==null?void 0:s.resolveFilterValue(o))!=null?d:o})}));let g,a;for(let f=0;f<t.flatRows.length;f++){const d=t.flatRows[f];if(d.columnFilters={},r.length)for(let m=0;m<r.length;m++){g=r[m];const p=g.id;d.columnFilters[p]=g.filterFn(d,p,g.resolvedValue,C=>{d.columnFiltersMeta[p]=C})}if(i.length){for(let m=0;m<i.length;m++){a=i[m];const p=a.id;if(a.filterFn(d,p,a.resolvedValue,C=>{d.columnFiltersMeta[p]=C})){d.columnFilters.__global__=!0;break}}d.columnFilters.__global__!==!0&&(d.columnFilters.__global__=!1)}}const c=f=>{for(let d=0;d<l.length;d++)if(f.columnFilters[l[d]]===!1)return!1;return!0};return sn(t.rows,c,e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Cn(){return e=>S(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(u=>{var g;return(g=e.getColumn(u.id))==null?void 0:g.getCanSort()}),l={};i.forEach(u=>{const g=e.getColumn(u.id);g&&(l[u.id]={sortUndefined:g.columnDef.sortUndefined,invertSorting:g.columnDef.invertSorting,sortingFn:g.getSortingFn()})});const s=u=>{const g=u.map(a=>({...a}));return g.sort((a,c)=>{for(let d=0;d<i.length;d+=1){var f;const m=i[d],p=l[m.id],C=(f=m==null?void 0:m.desc)!=null?f:!1;let v=0;if(p.sortUndefined){const $=a.getValue(m.id),w=c.getValue(m.id),_=$===void 0,R=w===void 0;(_||R)&&(v=_&&R?0:_?p.sortUndefined:-p.sortUndefined)}if(v===0&&(v=p.sortingFn(a,c,m.id)),v!==0)return C&&(v*=-1),p.invertSorting&&(v*=-1),v}return a.index-c.index}),g.forEach(a=>{var c;r.push(a),(c=a.subRows)!=null&&c.length&&(a.subRows=s(a.subRows))}),g};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function vn(){return e=>S(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n;const o=t.filter(u=>e.getColumn(u)),r=[],i={},l=function(u,g,a){if(g===void 0&&(g=0),g>=o.length)return u.map(m=>(m.depth=g,r.push(m),i[m.id]=m,m.subRows&&(m.subRows=l(m.subRows,g+1,m.id)),m));const c=o[g],f=dn(u,c);return Array.from(f.entries()).map((m,p)=>{let[C,v]=m,$=`${c}:${C}`;$=a?`${a}>${$}`:$;const w=l(v,g+1,$),_=g?se(v,h=>h.subRows):v,R=z(e,$,_[0].original,p,g,void 0,a);return Object.assign(R,{groupingColumnId:c,groupingValue:C,subRows:w,leafRows:_,getValue:h=>{if(o.includes(h)){if(R._valuesCache.hasOwnProperty(h))return R._valuesCache[h];if(v[0]){var E;R._valuesCache[h]=(E=v[0].getValue(h))!=null?E:void 0}return R._valuesCache[h]}if(R._groupingValuesCache.hasOwnProperty(h))return R._groupingValuesCache[h];const x=e.getColumn(h),ee=x==null?void 0:x.getAggregationFn();if(ee)return R._groupingValuesCache[h]=ee(h,_,v),R._groupingValuesCache[h]}}),w.forEach(h=>{r.push(h),i[h.id]=h}),R})},s=l(n.rows,0);return s.forEach(u=>{r.push(u),i[u.id]=u}),{rows:s,flatRows:r,rowsById:i}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}})}function dn(e,t){const n=new Map;return e.reduce((o,r)=>{const i=`${r.getGroupingValue(t)}`,l=o.get(i);return l?l.push(r):o.set(i,[r]),o},n)}function hn(){return e=>S(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(t,n,o)=>!n.rows.length||t!==!0&&!Object.keys(t??{}).length||!o?n:cn(n),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}})}function cn(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}/**
 * 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 Rn(e,t){return e?typeof e=="function"?ve(e,t):e:null}function wn(e){const t=H({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,l)=>H(i,l)},e),n=ln(t),[o,r]=he(n.initialState);return Re(()=>{n.setOptions(i=>H(i,e,{state:H(o,e.state||{}),onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}}))}),n}export{Cn as a,hn as b,wn as c,vn as d,mn as e,Rn as f,Sn as g,pn as r};
