import{r as A,j as _}from"./vendor-react-wBh_31cN.js";import{d as ue,G as Te}from"./index-dNe6i2rS.js";import{C as Se}from"./checkbox-BlA4MwH9.js";import{S as Be}from"./skeleton-C7BaXix8.js";import{B as Ne}from"./BlinkingDots-CJK9OJE3.js";import{H as ke}from"./LoadMore-Bg-Y-iGB.js";import{T as Re,a as ve,b as G,c as ne,d as he,e as z,f as we}from"./table-a0YeQrHM.js";import{ai as qe}from"./vendor-icons-BUUmD6ht.js";/**
   * 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 E(e,o){return typeof e=="function"?e(o):e}function $(e,o){return t=>{o.setState(n=>({...n,[e]:E(t,n[e])}))}}function X(e){return e instanceof Function}function Ue(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function Xe(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 s=e(i);if(!(s.length!==n.length||s.some((d,S)=>n[S]!==d)))return r;n=s;let a;if(t.key&&t.debug&&(a=Date.now()),r=o(...s),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const d=Math.round((Date.now()-l)*100)/100,S=Math.round((Date.now()-a)*100)/100,c=S/16,g=(p,f)=>{for(p=String(p);p.length<f;)p=" "+p;return p};console.info(`%c⏱ ${g(S,5)} /${g(d,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*c,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function 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 Ke(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,s,u,a)=>({table:l,column:s,row:u,cell:a,getValue:a.getValue,renderValue:a.renderValue}),C(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,t,o,e)},{}),i}function Je(e,o,t,n){var r,i;const s={...e._getDefaultColumnDef(),...o},u=s.accessorKey;let a=(r=(i=s.id)!=null?i:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?r:typeof s.header=="string"?s.header:void 0,d;if(s.accessorFn?d=s.accessorFn:u&&(u.includes(".")?d=c=>{let g=c;for(const f of u.split(".")){var p;g=(p=g)==null?void 0:p[f]}return g}:d=c=>c[s.accessorKey]),!a)throw new Error;let S={id:`${String(a)}`,accessorFn:d,parent:n,depth:t,columnDef:s,columns:[],getFlatColumns:m(()=>[!0],()=>{var c;return[S,...(c=S.columns)==null?void 0:c.flatMap(g=>g.getFlatColumns())]},C(e.options,"debugColumns")),getLeafColumns:m(()=>[e._getOrderColumnsFn()],c=>{var g;if((g=S.columns)!=null&&g.length){let p=S.columns.flatMap(f=>f.getLeafColumns());return c(p)}return[S]},C(e.options,"debugColumns"))};for(const c of e._features)c.createColumn==null||c.createColumn(S,e);return S}const x="debugHeaders";function me(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=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),l.push(u)};return s(i),l},getContext:()=>({table:e,header:i,column:o})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}const Qe={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 s=(i=n==null?void 0:n.map(S=>t.find(c=>c.id===S)).filter(Boolean))!=null?i:[],u=(l=r==null?void 0:r.map(S=>t.find(c=>c.id===S)).filter(Boolean))!=null?l:[],a=t.filter(S=>!(n!=null&&n.includes(S.id))&&!(r!=null&&r.includes(S.id)));return N(o,[...s,...a,...u],e)},C(e.options,x)),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))),N(o,t,e,"center")),C(e.options,x)),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(s=>s.id===l)).filter(Boolean))!=null?r:[];return N(o,i,e,"left")},C(e.options,x)),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(s=>s.id===l)).filter(Boolean))!=null?r:[];return N(o,i,e,"right")},C(e.options,x)),e.getFooterGroups=m(()=>[e.getHeaderGroups()],o=>[...o].reverse(),C(e.options,x)),e.getLeftFooterGroups=m(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),C(e.options,x)),e.getCenterFooterGroups=m(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),C(e.options,x)),e.getRightFooterGroups=m(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),C(e.options,x)),e.getFlatHeaders=m(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,x)),e.getLeftFlatHeaders=m(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,x)),e.getCenterFlatHeaders=m(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,x)),e.getRightFlatHeaders=m(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,x)),e.getCenterLeafHeaders=m(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,x)),e.getLeftLeafHeaders=m(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,x)),e.getRightLeafHeaders=m(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),C(e.options,x)),e.getLeafHeaders=m(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var r,i,l,s,u,a;return[...(r=(i=o[0])==null?void 0:i.headers)!=null?r:[],...(l=(s=t[0])==null?void 0:s.headers)!=null?l:[],...(u=(a=n[0])==null?void 0:a.headers)!=null?u:[]].map(d=>d.getLeafHeaders()).flat()},C(e.options,x))}};function N(e,o,t,n){var r,i;let l=0;const s=function(c,g){g===void 0&&(g=1),l=Math.max(l,g),c.filter(p=>p.getIsVisible()).forEach(p=>{var f;(f=p.columns)!=null&&f.length&&s(p.columns,g+1)},0)};s(e);let u=[];const a=(c,g)=>{const p={depth:g,id:[n,`${g}`].filter(Boolean).join("_"),headers:[]},f=[];c.forEach(v=>{const R=[...f].reverse()[0],w=v.column.depth===p.depth;let h,M=!1;if(w&&v.column.parent?h=v.column.parent:(h=v.column,M=!0),R&&(R==null?void 0:R.column)===h)R.subHeaders.push(v);else{const F=me(t,h,{id:[n,g,h.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${f.filter(P=>P.column===h).length}`:void 0,depth:g,index:f.length});F.subHeaders.push(v),f.push(F)}p.headers.push(v),v.headerGroup=p}),u.push(p),g>0&&a(f,g-1)},d=o.map((c,g)=>me(t,c,{depth:l,index:g}));a(d,l-1),u.reverse();const S=c=>c.filter(p=>p.column.getIsVisible()).map(p=>{let f=0,v=0,R=[0];p.subHeaders&&p.subHeaders.length?(R=[],S(p.subHeaders).forEach(h=>{let{colSpan:M,rowSpan:F}=h;f+=M,R.push(F)})):f=1;const w=Math.min(...R);return v=v+w,p.colSpan=f,p.rowSpan=v,{colSpan:f,rowSpan:v}});return S((r=(i=u[0])==null?void 0:i.headers)!=null?r:[]),u}const We=(e,o,t,n,r,i,l)=>{let s={id:o,index:n,original:t,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const a=e.getColumn(u);if(a!=null&&a.accessorFn)return s._valuesCache[u]=a.accessorFn(s.original,n),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const a=e.getColumn(u);if(a!=null&&a.accessorFn)return a.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=a.columnDef.getUniqueValues(s.original,n),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var a;return(a=s.getValue(u))!=null?a:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Xe(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],a=s;for(;;){const d=a.getParentRow();if(!d)break;u.push(d),a=d}return u.reverse()},getAllCells:m(()=>[e.getAllLeafColumns()],u=>u.map(a=>Ke(e,s,a,a.id)),C(e.options,"debugRows")),_getAllCellsByColumnId:m(()=>[s.getAllCells()],u=>u.reduce((a,d)=>(a[d.column.id]=d,a),{}),C(e.options,"debugRows"))};for(let u=0;u<e._features.length;u++){const a=e._features[u];a==null||a.createRow==null||a.createRow(s,e)}return s},Ye={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()}}},_e=(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))};_e.autoRemove=e=>V(e);const xe=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};xe.autoRemove=e=>V(e);const Fe=(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())};Fe.autoRemove=e=>V(e);const $e=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};$e.autoRemove=e=>V(e);const Me=(e,o,t)=>!t.some(n=>{var r;return!((r=e.getValue(o))!=null&&r.includes(n))});Me.autoRemove=e=>V(e)||!(e!=null&&e.length);const Ve=(e,o,t)=>t.some(n=>{var r;return(r=e.getValue(o))==null?void 0:r.includes(n)});Ve.autoRemove=e=>V(e)||!(e!=null&&e.length);const Pe=(e,o,t)=>e.getValue(o)===t;Pe.autoRemove=e=>V(e);const Ie=(e,o,t)=>e.getValue(o)==t;Ie.autoRemove=e=>V(e);const ae=(e,o,t)=>{let[n,r]=t;const i=e.getValue(o);return i>=n&&i<=r};ae.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 s=i;i=l,l=s}return[i,l]};ae.autoRemove=e=>V(e)||V(e[0])&&V(e[1]);const y={includesString:_e,includesStringSensitive:xe,equalsString:Fe,arrIncludes:$e,arrIncludesAll:Me,arrIncludesSome:Ve,equals:Pe,weakEquals:Ie,inNumberRange:ae};function V(e){return e==null||e===""}const Ze={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,o)=>{e.getAutoFilterFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);return typeof n=="string"?y.includesString:typeof n=="number"?y.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?y.equals:Array.isArray(n)?y.arrIncludes:y.weakEquals},e.getFilterFn=()=>{var t,n;return X(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:y[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(d=>d.id===e.id),l=E(t,i?i.value:void 0);if(Ce(r,l,e)){var s;return(s=n==null?void 0:n.filter(d=>d.id!==e.id))!=null?s:[]}const u={id:e.id,value:l};if(i){var a;return(a=n==null?void 0:n.map(d=>d.id===e.id?u:d))!=null?a:[]}return n!=null&&n.length?[...n,u]:[u]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=r=>{var i;return(i=E(o,r))==null?void 0:i.filter(l=>{const s=t.find(u=>u.id===l.id);if(s){const u=s.getFilterFn();if(Ce(u,l.value,s))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 Ce(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),et=(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},tt=(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},nt=(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]},ot=(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},rt=(e,o)=>{if(!o.length)return;const t=o.map(i=>i.getValue(e));if(!Ue(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},it=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),lt=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,st=(e,o)=>o.length,Q={sum:be,min:et,max:tt,extent:nt,mean:ot,median:rt,unique:it,uniqueCount:lt,count:st},ut={getDefaultColumnDef:()=>({aggregatedCell:e=>{var o,t;return(o=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,o)=>{e.toggleGrouping=()=>{o.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=o.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t==null?void 0:t.getValue(e.id);if(typeof n=="number")return Q.sum;if(Object.prototype.toString.call(n)==="[object Date]")return Q.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return X(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 at(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 gt={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=m(t=>[j(o,t)],t=>t.findIndex(n=>n.id===e.id),C(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=j(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const r=j(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],s=[...r];for(;s.length&&l.length;){const u=l.shift(),a=s.findIndex(d=>d.id===u);a>-1&&i.push(s.splice(a,1)[0])}i=[...i,...s]}return at(i,t,n)},C(e.options,"debugTable"))}},W=()=>({left:[],right:[]}),dt={getInitialState:e=>({columnPinning:W(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(r=>r.id).filter(Boolean);o.setColumnPinning(r=>{var i,l;if(t==="right"){var s,u;return{left:((s=r==null?void 0:r.left)!=null?s:[]).filter(S=>!(n!=null&&n.includes(S))),right:[...((u=r==null?void 0:r.right)!=null?u:[]).filter(S=>!(n!=null&&n.includes(S))),...n]}}if(t==="left"){var a,d;return{left:[...((a=r==null?void 0:r.left)!=null?a:[]).filter(S=>!(n!=null&&n.includes(S))),...n],right:((d=r==null?void 0:r.right)!=null?d:[]).filter(S=>!(n!=null&&n.includes(S)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(S=>!(n!=null&&n.includes(S))),right:((l=r==null?void 0:r.right)!=null?l:[]).filter(S=>!(n!=null&&n.includes(S)))}})},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(s=>s.id),{left:n,right:r}=o.getState().columnPinning,i=t.some(s=>n==null?void 0:n.includes(s)),l=t.some(s=>r==null?void 0:r.includes(s));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?W():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:W())},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"))}};function ct(e){return e||(typeof document<"u"?document:null)}const k={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Y=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ft={getDefaultColumnDef:()=>k,getInitialState:e=>({columnSizing:{},columnSizingInfo:Y(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$("columnSizing",e),onColumnSizingInfoChange:$("columnSizingInfo",e)}),createColumn:(e,o)=>{e.getSize=()=>{var t,n,r;const i=o.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:k.minSize,(n=i??e.columnDef.size)!=null?n:k.size),(r=e.columnDef.maxSize)!=null?r:k.maxSize)},e.getStart=m(t=>[t,j(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,j(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(),Z(i)&&i.touches&&i.touches.length>1))return;const l=e.getSize(),s=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[n.id,n.getSize()]],u=Z(i)?Math.round(i.touches[0].clientX):i.clientX,a={},d=(R,w)=>{typeof w=="number"&&(o.setColumnSizingInfo(h=>{var M,F;const P=o.options.columnResizeDirection==="rtl"?-1:1,T=(w-((M=h==null?void 0:h.startOffset)!=null?M:0))*P,B=Math.max(T/((F=h==null?void 0:h.startSize)!=null?F:0),-.999999);return h.columnSizingStart.forEach(K=>{let[J,L]=K;a[J]=Math.round(Math.max(L+L*B,0)*100)/100}),{...h,deltaOffset:T,deltaPercentage:B}}),(o.options.columnResizeMode==="onChange"||R==="end")&&o.setColumnSizing(h=>({...h,...a})))},S=R=>d("move",R),c=R=>{d("end",R),o.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=ct(t),p={moveHandler:R=>S(R.clientX),upHandler:R=>{g==null||g.removeEventListener("mousemove",p.moveHandler),g==null||g.removeEventListener("mouseup",p.upHandler),c(R.clientX)}},f={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),S(R.touches[0].clientX),!1),upHandler:R=>{var w;g==null||g.removeEventListener("touchmove",f.moveHandler),g==null||g.removeEventListener("touchend",f.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),c((w=R.touches[0])==null?void 0:w.clientX)}},v=pt()?{passive:!1}:!1;Z(i)?(g==null||g.addEventListener("touchmove",f.moveHandler,v),g==null||g.addEventListener("touchend",f.upHandler,v)):(g==null||g.addEventListener("mousemove",p.moveHandler,v),g==null||g.addEventListener("mouseup",p.upHandler,v)),o.setColumnSizingInfo(R=>({...R,startOffset:u,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,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?Y():(t=e.initialState.columnSizingInfo)!=null?t:Y())},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 q=null;function pt(){if(typeof q=="boolean")return q;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 q=e,q}function Z(e){return e.type==="touchstart"}const St={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$("columnVisibility",e)}),createColumn:(e,o)=>{e.toggleVisibility=t=>{e.getCanHide()&&o.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(n=o.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=o.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,o)=>{e._getAllVisibleCells=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 j(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const mt={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()}}},Ct={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[o.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,o)=>{e.getCanGlobalFilter=()=>{var t,n,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=o.options.enableGlobalFilter)!=null?n:!0)&&((r=o.options.enableFilters)!=null?r:!0)&&((i=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>y.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return X(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:y[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:$("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(s=>{l[s]=!0}):l=n,t=(r=t)!=null?r:!i,!i&&t)return{...l,[e.id]:!0};if(i&&!t){const{[e.id]:s,...u}=l;return u}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()}}}},oe=0,re=10,b=()=>({pageIndex:oe,pageSize:re}),vt={getInitialState:e=>({...e,pagination:{...b(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:$("pagination",e)}),createTable:e=>{let o=!1,t=!1;e._autoResetPageIndex=()=>{var n,r;if(!o){e._queue(()=>{o=!0});return}if((n=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const r=i=>E(n,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=n=>{var r;e.setPagination(n?b():(r=e.initialState.pagination)!=null?r:b())},e.setPageIndex=n=>{e.setPagination(r=>{let i=E(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?oe:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:oe)},e.resetPageSize=n=>{var r,i;e.setPageSize(n?re:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:re)},e.setPageSize=n=>{e.setPagination(r=>{const i=Math.max(1,E(n,r.pageSize)),l=r.pageSize*r.pageIndex,s=Math.floor(l/i);return{...r,pageIndex:s,pageSize:i}})},e.setPageCount=n=>e.setPagination(r=>{var i;let l=E(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}}},ee=()=>({top:[],bottom:[]}),ht={getInitialState:e=>({rowPinning:ee(),...e}),getDefaultOptions:e=>({onRowPinningChange:$("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,r)=>{const i=n?e.getLeafRows().map(u=>{let{id:a}=u;return a}):[],l=r?e.getParentRows().map(u=>{let{id:a}=u;return a}):[],s=new Set([...l,e.id,...i]);o.setRowPinning(u=>{var a,d;if(t==="bottom"){var S,c;return{top:((S=u==null?void 0:u.top)!=null?S:[]).filter(f=>!(s!=null&&s.has(f))),bottom:[...((c=u==null?void 0:u.bottom)!=null?c:[]).filter(f=>!(s!=null&&s.has(f))),...Array.from(s)]}}if(t==="top"){var g,p;return{top:[...((g=u==null?void 0:u.top)!=null?g:[]).filter(f=>!(s!=null&&s.has(f))),...Array.from(s)],bottom:((p=u==null?void 0:u.bottom)!=null?p:[]).filter(f=>!(s!=null&&s.has(f)))}}return{top:((a=u==null?void 0:u.top)!=null?a:[]).filter(f=>!(s!=null&&s.has(f))),bottom:((d=u==null?void 0:u.bottom)!=null?d:[]).filter(f=>!(s!=null&&s.has(f)))}})},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(s=>n==null?void 0:n.includes(s)),l=t.some(s=>r==null?void 0:r.includes(s));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:s}=l;return s});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?ee():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:ee())},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 s=e.getRow(l,!0);return s.getIsAllParentsExpanded()?s:null}):(t??[]).map(l=>o.find(s=>s.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"))}},wt={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=o=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(o),e.resetRowSelection=o=>{var t;return e.setRowSelection(o?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=o=>{e.setRowSelection(t=>{o=typeof o<"u"?o:!e.getIsAllRowsSelected();const n={...t},r=e.getPreGroupedRowModel().flatRows;return o?r.forEach(i=>{i.getCanSelect()&&(n[i.id]=!0)}):r.forEach(i=>{delete n[i.id]}),n})},e.toggleAllPageRowsSelected=o=>e.setRowSelection(t=>{const n=typeof o<"u"?o:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{ie(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?te(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getFilteredSelectedRowModel=m(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?te(e,t):{rows:[],flatRows:[],rowsById:{}},C(e.options,"debugTable")),e.getGroupedSelectedRowModel=m(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?te(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 s={...i};return ie(s,e.id,t,(l=n==null?void 0:n.selectChildren)!=null?l:!0,o),s})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return ge(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return le(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return le(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)}}}},ie=(e,o,t,n,r)=>{var i;const l=r.getRow(o,!0);t?(l.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),l.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(s=>ie(e,s.id,t,n,r))};function te(e,o){const t=e.getState().rowSelection,n=[],r={},i=function(l,s){return l.map(u=>{var a;const d=ge(u,t);if(d&&(n.push(u),r[u.id]=u),(a=u.subRows)!=null&&a.length&&(u={...u,subRows:i(u.subRows)}),d)return u}).filter(Boolean)};return{rows:i(o.rows),flatRows:n,rowsById:r}}function ge(e,o){var t;return(t=o[e.id])!=null?t:!1}function le(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()&&(ge(l,o)?i=!0:r=!1),l.subRows&&l.subRows.length)){const s=le(l,o);s==="all"?i=!0:(s==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const se=/([0-9]+)/gm,_t=(e,o,t)=>ye(H(e.getValue(t)).toLowerCase(),H(o.getValue(t)).toLowerCase()),xt=(e,o,t)=>ye(H(e.getValue(t)),H(o.getValue(t))),Ft=(e,o,t)=>de(H(e.getValue(t)).toLowerCase(),H(o.getValue(t)).toLowerCase()),$t=(e,o,t)=>de(H(e.getValue(t)),H(o.getValue(t))),Mt=(e,o,t)=>{const n=e.getValue(t),r=o.getValue(t);return n>r?1:n<r?-1:0},Vt=(e,o,t)=>de(e.getValue(t),o.getValue(t));function de(e,o){return e===o?0:e>o?1:-1}function H(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ye(e,o){const t=e.split(se).filter(Boolean),n=o.split(se).filter(Boolean);for(;t.length&&n.length;){const r=t.shift(),i=n.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 t.length-n.length}const O={alphanumeric:_t,alphanumericCaseSensitive:xt,text:Ft,textCaseSensitive:$t,datetime:Mt,basic:Vt},Pt={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$("sorting",e),isMultiSortEvent:o=>o.shiftKey}),createColumn:(e,o)=>{e.getAutoSortingFn=()=>{const t=o.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const r of t){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return O.datetime;if(typeof i=="string"&&(n=!0,i.split(se).length>1))return O.alphanumeric}return n?O.text:O.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 X(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:O[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;o.setSorting(l=>{const s=l==null?void 0:l.find(g=>g.id===e.id),u=l==null?void 0:l.findIndex(g=>g.id===e.id);let a=[],d,S=i?t:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&n?s?d="toggle":d="add":l!=null&&l.length&&u!==l.length-1?d="replace":s?d="toggle":d="replace",d==="toggle"&&(i||r||(d="remove")),d==="add"){var c;a=[...l,{id:e.id,desc:S}],a.splice(0,a.length-((c=o.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else d==="toggle"?a=l.map(g=>g.id===e.id?{...g,desc:S}:g):d==="remove"?a=l.filter(g=>g.id!==e.id):a=[{id:e.id,desc:S}];return a})},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())}},It=[Qe,St,gt,dt,Ye,Ze,mt,Ct,Pt,ut,Rt,vt,ht,wt,ft];function yt(e){var o,t;const n=[...It,...(o=e._features)!=null?o:[]];let r={_features:n};const i=r._features.reduce((c,g)=>Object.assign(c,g.getDefaultOptions==null?void 0:g.getDefaultOptions(r)),{}),l=c=>r.options.mergeOptions?r.options.mergeOptions(i,c):{...i,...c};let u={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(c=>{var g;u=(g=c.getInitialState==null?void 0:c.getInitialState(u))!=null?g:u});const a=[];let d=!1;const S={_features:n,options:{...i,...e},initialState:u,_queue:c=>{a.push(c),d||(d=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{r.setState(r.initialState)},setOptions:c=>{const g=E(c,r.options);r.options=l(g)},getState:()=>r.options.state,setState:c=>{r.options.onStateChange==null||r.options.onStateChange(c)},_getRowId:(c,g,p)=>{var f;return(f=r.options.getRowId==null?void 0:r.options.getRowId(c,g,p))!=null?f:`${p?[p.id,g].join("."):g}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(c,g)=>{let p=(g?r.getPrePaginationRowModel():r.getRowModel()).rowsById[c];if(!p&&(p=r.getCoreRowModel().rowsById[c],!p))throw new Error;return p},_getDefaultColumnDef:m(()=>[r.options.defaultColumn],c=>{var g;return c=(g=c)!=null?g:{},{header:p=>{const f=p.header.column.columnDef;return f.accessorKey?f.accessorKey:f.accessorFn?f.id:null},cell:p=>{var f,v;return(f=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?f:null},...r._features.reduce((p,f)=>Object.assign(p,f.getDefaultColumnDef==null?void 0:f.getDefaultColumnDef()),{}),...c}},C(e,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:m(()=>[r._getColumnDefs()],c=>{const g=function(p,f,v){return v===void 0&&(v=0),p.map(R=>{const w=Je(r,R,v,f),h=R;return w.columns=h.columns?g(h.columns,w,v+1):[],w})};return g(c)},C(e,"debugColumns")),getAllFlatColumns:m(()=>[r.getAllColumns()],c=>c.flatMap(g=>g.getFlatColumns()),C(e,"debugColumns")),_getAllFlatColumnsById:m(()=>[r.getAllFlatColumns()],c=>c.reduce((g,p)=>(g[p.id]=p,g),{}),C(e,"debugColumns")),getAllLeafColumns:m(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(c,g)=>{let p=c.flatMap(f=>f.getLeafColumns());return g(p)},C(e,"debugColumns")),getColumn:c=>r._getAllFlatColumnsById()[c]};Object.assign(r,S);for(let c=0;c<r._features.length;c++){const g=r._features[c];g==null||g.createTable==null||g.createTable(r)}return r}function De(){return e=>m(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(r,i,l){i===void 0&&(i=0);const s=[];for(let a=0;a<r.length;a++){const d=We(e,e._getRowId(r[a],a,l),r[a],a,i,void 0,l==null?void 0:l.id);if(t.flatRows.push(d),t.rowsById[d.id]=d,s.push(d),e.options.getSubRows){var u;d.originalSubRows=e.options.getSubRows(r[a],a),(u=d.originalSubRows)!=null&&u.length&&(d.subRows=n(d.originalSubRows,i+1,d))}}return s};return t.rows=n(o),t},C(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Dt(){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(u=>{var a;return(a=e.getColumn(u.id))==null?void 0:a.getCanSort()}),l={};i.forEach(u=>{const a=e.getColumn(u.id);a&&(l[u.id]={sortUndefined:a.columnDef.sortUndefined,invertSorting:a.columnDef.invertSorting,sortingFn:a.getSortingFn()})});const s=u=>{const a=u.map(d=>({...d}));return a.sort((d,S)=>{for(let g=0;g<i.length;g+=1){var c;const p=i[g],f=l[p.id],v=f.sortUndefined,R=(c=p==null?void 0:p.desc)!=null?c:!1;let w=0;if(v){const h=d.getValue(p.id),M=S.getValue(p.id),F=h===void 0,P=M===void 0;if(F||P){if(v==="first")return F?-1:1;if(v==="last")return F?1:-1;w=F&&P?0:F?v:-v}}if(w===0&&(w=f.sortingFn(d,S,p.id)),w!==0)return R&&(w*=-1),f.invertSorting&&(w*=-1),w}return d.index-S.index}),a.forEach(d=>{var S;r.push(d),(S=d.subRows)!=null&&S.length&&(d.subRows=s(d.subRows))}),a};return{rows:s(t.rows),flatRows:r,rowsById:t.rowsById}},C(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
   * react-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function U(e,o){return e?Et(e)?A.createElement(e,o):e:null}function Et(e){return Ht(e)||typeof e=="function"||Gt(e)}function Ht(e){return typeof e=="function"&&(()=>{const o=Object.getPrototypeOf(e);return o.prototype&&o.prototype.isReactComponent})()}function Gt(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ee(e){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=A.useState(()=>({current:yt(o)})),[n,r]=A.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...n,...e.state},onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}})),t.current}function At(){return{id:"_select",header:({table:e})=>_.jsx(Se,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:o=>e.toggleAllPageRowsSelected(!!o),"aria-label":"Select all"}),cell:({row:e})=>_.jsx(Se,{checked:e.getIsSelected(),onCheckedChange:o=>e.toggleSelected(!!o),"aria-label":"Select row"}),enableSorting:!1,meta:{className:"w-10"}}}function Ut({columns:e,data:o,sorting:t,onSortingChange:n,enableSorting:r=!1,rowSelection:i,onRowSelectionChange:l,enableRowSelection:s=!1,onRowClick:u,onRowContextMenu:a,onRowMouseEnter:d,loading:S=!1,emptyMessage:c,getRowId:g,className:p,tableClassName:f,rowClassName:v,hasMore:R,onLoadMore:w,isLoadingMore:h,loadMoreTrigger:M="auto",renderRow:F,manualSorting:P=!1}){const[T,B]=A.useState([]),K=t??T,J=n??B,L=r||P,[He,Ge]=A.useState({}),Ae=i??He,ze=l??Ge,ce=A.useMemo(()=>s?[At(),...e]:e,[e,s]),fe=Ee({data:o,columns:ce,state:{sorting:K,rowSelection:Ae},onSortingChange:J,onRowSelectionChange:ze,getCoreRowModel:De(),getSortedRowModel:L&&!P?Dt():void 0,enableSorting:L,manualSorting:P,enableRowSelection:s,getRowId:g}),Le=!!S,Oe=typeof S=="number"?S:5,je=ce.length;return _.jsx("div",{className:ue("relative w-full",p),children:_.jsxs(Re,{className:f,children:[_.jsx(ve,{children:fe.getHeaderGroups().map(pe=>_.jsx(G,{className:"hover:bg-transparent",children:pe.headers.map(D=>{const I=D.column.columnDef.meta;return _.jsx(ne,{sortable:D.column.getCanSort(),sortDirection:D.column.getIsSorted(),onSort:()=>D.column.toggleSorting(),primary:I==null?void 0:I.primary,truncate:I==null?void 0:I.truncate,className:I==null?void 0:I.className,children:D.isPlaceholder?null:U(D.column.columnDef.header,D.getContext())},D.id)})},pe.id))}),_.jsx(he,{children:_.jsx(zt,{table:fe,isLoading:Le,skeletonRows:Oe,totalColumns:je,emptyMessage:c,onRowClick:u,onRowContextMenu:a,onRowMouseEnter:d,rowClassName:v,hasMore:R,onLoadMore:w,isLoadingMore:h,loadMoreTrigger:M,renderRow:F})})]})})}function zt({table:e,isLoading:o,skeletonRows:t,totalColumns:n,emptyMessage:r,onRowClick:i,onRowContextMenu:l,onRowMouseEnter:s,rowClassName:u,hasMore:a,onLoadMore:d,isLoadingMore:S,loadMoreTrigger:c="auto",renderRow:g}){if(o)return Array.from({length:t}).map((f,v)=>_.jsx(G,{className:"hover:bg-transparent",children:Array.from({length:n}).map((R,w)=>_.jsx(z,{children:_.jsx(Be,{className:"h-4 w-full"})},`skeleton-cell-${w}`))},`skeleton-${v}`));const{rows:p}=e.getRowModel();return p.length===0?_.jsx(we,{colSpan:n,children:r}):_.jsxs(_.Fragment,{children:[p.map(f=>{const v=f.getVisibleCells().some(w=>{var h;return(h=w.column.columnDef.meta)==null?void 0:h.expandOnHover}),R=_.jsx(G,{"data-state":f.getIsSelected()?"selected":void 0,className:ue(i&&"cursor-pointer",v&&"group/row",u==null?void 0:u(f.original)),onClick:i?w=>i(f.original,f.index,w):void 0,onContextMenu:l?w=>{w.preventDefault(),l(f.original,f.index,w)}:void 0,onMouseEnter:s?()=>s(f.original,f.index):void 0,children:f.getVisibleCells().map(w=>{const{meta:h}=w.column.columnDef;return _.jsx(z,{primary:h==null?void 0:h.primary,truncate:h==null?void 0:h.truncate,expandOnHover:h==null?void 0:h.expandOnHover,className:h==null?void 0:h.className,children:U(w.column.columnDef.cell,w.getContext())},w.id)})});return _.jsx(A.Fragment,{children:g?g(f.original,R,f.index):R},f.id)}),S&&_.jsx(G,{className:"hover:bg-transparent",children:_.jsx(z,{colSpan:n,className:"text-center",children:_.jsx(Ne,{className:"text-[30px]"})})}),a&&!S&&d&&_.jsx(G,{className:"hover:bg-transparent border-0",children:_.jsx(z,{colSpan:n,children:c==="manual"?_.jsx("div",{className:"flex justify-center",children:_.jsx(Te,{variant:"secondary",onClick:d,children:"Load more"})}):_.jsx(ke,{onLoadMore:d})})})]})}function Xt({columns:e,data:o,updateData:t,onDeleteRow:n,state:r,className:i}){const l=Ee({data:o,columns:e,state:r,getCoreRowModel:De(),meta:{updateData:t}});return _.jsx("div",{className:ue("relative w-full",i),children:_.jsxs(Re,{children:[_.jsx(ve,{children:l.getHeaderGroups().map(s=>_.jsxs(G,{className:"hover:bg-transparent",children:[n&&_.jsx(ne,{className:"w-10"}),s.headers.map(u=>{const a=u.column.columnDef.meta;return _.jsx(ne,{primary:a==null?void 0:a.primary,truncate:a==null?void 0:a.truncate,className:a==null?void 0:a.className,children:u.isPlaceholder?null:U(u.column.columnDef.header,u.getContext())},u.id)})]},s.id))}),_.jsx(he,{children:o.length===0?_.jsx(we,{colSpan:e.length+(n?1:0),children:"No rows."}):l.getRowModel().rows.map(s=>_.jsxs(G,{children:[n&&_.jsx(z,{className:"w-10 text-center",children:_.jsx("button",{type:"button",className:"inline-flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors",onClick:()=>n(s.index),"aria-label":"Delete row",children:_.jsx(qe,{className:"size-4"})})}),s.getVisibleCells().map(u=>{const a=u.column.columnDef.meta;return _.jsx(z,{primary:a==null?void 0:a.primary,truncate:a==null?void 0:a.truncate,expandOnHover:a==null?void 0:a.expandOnHover,className:a==null?void 0:a.className,children:U(u.column.columnDef.cell,u.getContext())},u.id)})]},s.id))})]})})}export{Ut as D,Xt as E};
