Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tanstack/table-core

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/table-core - npm Package Compare versions

Comparing version 8.5.17 to 8.5.18

16

build/cjs/core/row.js

@@ -25,2 +25,3 @@ /**

_valuesCache: {},
_uniqueValuesCache: {},
getValue: columnId => {

@@ -37,2 +38,17 @@ if (row._valuesCache.hasOwnProperty(columnId)) {

},
getUniqueValues: columnId => {
if (row._uniqueValuesCache.hasOwnProperty(columnId)) {
return row._uniqueValuesCache[columnId];
}
const column = table.getColumn(columnId);
if (!column.accessorFn) {
return undefined;
}
if (!column.columnDef.getUniqueValues) {
row._uniqueValuesCache[columnId] = [row.getValue(columnId)];
return row._uniqueValuesCache[columnId];
}
row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
return row._uniqueValuesCache[columnId];
},
renderValue: columnId => row.getValue(columnId) ?? table.options.renderFallbackValue,

@@ -39,0 +55,0 @@ subRows: subRows ?? [],

15

build/cjs/utils/getFacetedMinMaxValues.js

@@ -20,3 +20,3 @@ /**

var _facetedRowModel$flat;
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getUniqueValues(columnId);
if (typeof firstValue === 'undefined') {

@@ -27,7 +27,10 @@ return undefined;

for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
const value = facetedRowModel.flatRows[i].getValue(columnId);
if (value < facetedMinMaxValues[0]) {
facetedMinMaxValues[0] = value;
} else if (value > facetedMinMaxValues[1]) {
facetedMinMaxValues[1] = value;
const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
for (let j = 0; j < values.length; j++) {
const value = values[j];
if (value < facetedMinMaxValues[0]) {
facetedMinMaxValues[0] = value;
} else if (value > facetedMinMaxValues[1]) {
facetedMinMaxValues[1] = value;
}
}

@@ -34,0 +37,0 @@ }

14

build/cjs/utils/getFacetedUniqueValues.js

@@ -21,8 +21,10 @@ /**

for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
var _facetedRowModel$flat;
const value = (_facetedRowModel$flat = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
if (facetedUniqueValues.has(value)) {
facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
} else {
facetedUniqueValues.set(value, 1);
const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
for (let j = 0; j < values.length; j++) {
const value = values[j];
if (facetedUniqueValues.has(value)) {
facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
} else {
facetedUniqueValues.set(value, 1);
}
}

@@ -29,0 +31,0 @@ }

@@ -13,3 +13,3 @@ {

{
"uid": "1d0e-64",
"uid": "0c68-64",
"name": "utils.ts"

@@ -21,19 +21,19 @@ },

{
"uid": "1d0e-66",
"uid": "0c68-66",
"name": "column.ts"
},
{
"uid": "1d0e-68",
"uid": "0c68-68",
"name": "headers.ts"
},
{
"uid": "1d0e-96",
"uid": "0c68-96",
"name": "table.ts"
},
{
"uid": "1d0e-98",
"uid": "0c68-98",
"name": "cell.ts"
},
{
"uid": "1d0e-100",
"uid": "0c68-100",
"name": "row.ts"

@@ -47,39 +47,39 @@ }

{
"uid": "1d0e-70",
"uid": "0c68-70",
"name": "ColumnSizing.ts"
},
{
"uid": "1d0e-72",
"uid": "0c68-72",
"name": "Expanding.ts"
},
{
"uid": "1d0e-76",
"uid": "0c68-76",
"name": "Filters.ts"
},
{
"uid": "1d0e-80",
"uid": "0c68-80",
"name": "Grouping.ts"
},
{
"uid": "1d0e-82",
"uid": "0c68-82",
"name": "Ordering.ts"
},
{
"uid": "1d0e-84",
"uid": "0c68-84",
"name": "Pagination.ts"
},
{
"uid": "1d0e-86",
"uid": "0c68-86",
"name": "Pinning.ts"
},
{
"uid": "1d0e-88",
"uid": "0c68-88",
"name": "RowSelection.ts"
},
{
"uid": "1d0e-92",
"uid": "0c68-92",
"name": "Sorting.ts"
},
{
"uid": "1d0e-94",
"uid": "0c68-94",
"name": "Visibility.ts"

@@ -90,15 +90,15 @@ }

{
"uid": "1d0e-74",
"uid": "0c68-74",
"name": "filterFns.ts"
},
{
"uid": "1d0e-78",
"uid": "0c68-78",
"name": "aggregationFns.ts"
},
{
"uid": "1d0e-90",
"uid": "0c68-90",
"name": "sortingFns.ts"
},
{
"uid": "1d0e-102",
"uid": "0c68-102",
"name": "columnHelper.ts"

@@ -110,39 +110,39 @@ },

{
"uid": "1d0e-104",
"uid": "0c68-104",
"name": "getCoreRowModel.ts"
},
{
"uid": "1d0e-106",
"uid": "0c68-106",
"name": "filterRowsUtils.ts"
},
{
"uid": "1d0e-108",
"uid": "0c68-108",
"name": "getFilteredRowModel.ts"
},
{
"uid": "1d0e-110",
"uid": "0c68-110",
"name": "getFacetedRowModel.ts"
},
{
"uid": "1d0e-112",
"uid": "0c68-112",
"name": "getFacetedUniqueValues.ts"
},
{
"uid": "1d0e-114",
"uid": "0c68-114",
"name": "getFacetedMinMaxValues.ts"
},
{
"uid": "1d0e-116",
"uid": "0c68-116",
"name": "getSortedRowModel.ts"
},
{
"uid": "1d0e-118",
"uid": "0c68-118",
"name": "getGroupedRowModel.ts"
},
{
"uid": "1d0e-120",
"uid": "0c68-120",
"name": "getExpandedRowModel.ts"
},
{
"uid": "1d0e-122",
"uid": "0c68-122",
"name": "getPaginationRowModel.ts"

@@ -153,3 +153,3 @@ }

{
"uid": "1d0e-124",
"uid": "0c68-124",
"name": "index.ts"

@@ -165,194 +165,194 @@ }

"nodeParts": {
"1d0e-64": {
"0c68-64": {
"renderedLength": 2276,
"gzipLength": 835,
"brotliLength": 0,
"mainUid": "1d0e-63"
"mainUid": "0c68-63"
},
"1d0e-66": {
"0c68-66": {
"renderedLength": 2315,
"gzipLength": 789,
"brotliLength": 0,
"mainUid": "1d0e-65"
"mainUid": "0c68-65"
},
"1d0e-68": {
"0c68-68": {
"renderedLength": 12758,
"gzipLength": 2299,
"brotliLength": 0,
"mainUid": "1d0e-67"
"mainUid": "0c68-67"
},
"1d0e-70": {
"0c68-70": {
"renderedLength": 9827,
"gzipLength": 2131,
"brotliLength": 0,
"mainUid": "1d0e-69"
"mainUid": "0c68-69"
},
"1d0e-72": {
"0c68-72": {
"renderedLength": 5137,
"gzipLength": 1235,
"brotliLength": 0,
"mainUid": "1d0e-71"
"mainUid": "0c68-71"
},
"1d0e-74": {
"0c68-74": {
"renderedLength": 3228,
"gzipLength": 759,
"brotliLength": 0,
"mainUid": "1d0e-73"
"mainUid": "0c68-73"
},
"1d0e-76": {
"0c68-76": {
"renderedLength": 9342,
"gzipLength": 1745,
"brotliLength": 0,
"mainUid": "1d0e-75"
"mainUid": "0c68-75"
},
"1d0e-78": {
"0c68-78": {
"renderedLength": 2432,
"gzipLength": 653,
"brotliLength": 0,
"mainUid": "1d0e-77"
"mainUid": "0c68-77"
},
"1d0e-80": {
"0c68-80": {
"renderedLength": 4715,
"gzipLength": 1240,
"brotliLength": 0,
"mainUid": "1d0e-79"
"mainUid": "0c68-79"
},
"1d0e-82": {
"0c68-82": {
"renderedLength": 2151,
"gzipLength": 737,
"brotliLength": 0,
"mainUid": "1d0e-81"
"mainUid": "0c68-81"
},
"1d0e-84": {
"0c68-84": {
"renderedLength": 5418,
"gzipLength": 1251,
"brotliLength": 0,
"mainUid": "1d0e-83"
"mainUid": "0c68-83"
},
"1d0e-86": {
"0c68-86": {
"renderedLength": 6528,
"gzipLength": 1229,
"brotliLength": 0,
"mainUid": "1d0e-85"
"mainUid": "0c68-85"
},
"1d0e-88": {
"0c68-88": {
"renderedLength": 12344,
"gzipLength": 2410,
"brotliLength": 0,
"mainUid": "1d0e-87"
"mainUid": "0c68-87"
},
"1d0e-90": {
"0c68-90": {
"renderedLength": 2933,
"gzipLength": 929,
"brotliLength": 0,
"mainUid": "1d0e-89"
"mainUid": "0c68-89"
},
"1d0e-92": {
"0c68-92": {
"renderedLength": 8211,
"gzipLength": 2005,
"brotliLength": 0,
"mainUid": "1d0e-91"
"mainUid": "0c68-91"
},
"1d0e-94": {
"0c68-94": {
"renderedLength": 4056,
"gzipLength": 979,
"brotliLength": 0,
"mainUid": "1d0e-93"
"mainUid": "0c68-93"
},
"1d0e-96": {
"0c68-96": {
"renderedLength": 6382,
"gzipLength": 1631,
"brotliLength": 0,
"mainUid": "1d0e-95"
"mainUid": "0c68-95"
},
"1d0e-98": {
"0c68-98": {
"renderedLength": 829,
"gzipLength": 381,
"brotliLength": 0,
"mainUid": "1d0e-97"
"mainUid": "0c68-97"
},
"1d0e-100": {
"renderedLength": 1671,
"gzipLength": 613,
"0c68-100": {
"renderedLength": 2324,
"gzipLength": 679,
"brotliLength": 0,
"mainUid": "1d0e-99"
"mainUid": "0c68-99"
},
"1d0e-102": {
"0c68-102": {
"renderedLength": 1194,
"gzipLength": 414,
"brotliLength": 0,
"mainUid": "1d0e-101"
"mainUid": "0c68-101"
},
"1d0e-104": {
"0c68-104": {
"renderedLength": 1836,
"gzipLength": 729,
"brotliLength": 0,
"mainUid": "1d0e-103"
"mainUid": "0c68-103"
},
"1d0e-106": {
"0c68-106": {
"renderedLength": 2419,
"gzipLength": 590,
"brotliLength": 0,
"mainUid": "1d0e-105"
"mainUid": "0c68-105"
},
"1d0e-108": {
"0c68-108": {
"renderedLength": 3766,
"gzipLength": 1021,
"brotliLength": 0,
"mainUid": "1d0e-107"
"mainUid": "0c68-107"
},
"1d0e-110": {
"0c68-110": {
"renderedLength": 1060,
"gzipLength": 469,
"brotliLength": 0,
"mainUid": "1d0e-109"
"mainUid": "0c68-109"
},
"1d0e-112": {
"renderedLength": 838,
"gzipLength": 369,
"0c68-112": {
"renderedLength": 849,
"gzipLength": 364,
"brotliLength": 0,
"mainUid": "1d0e-111"
"mainUid": "0c68-111"
},
"1d0e-114": {
"renderedLength": 995,
"gzipLength": 400,
"0c68-114": {
"renderedLength": 1115,
"gzipLength": 430,
"brotliLength": 0,
"mainUid": "1d0e-113"
"mainUid": "0c68-113"
},
"1d0e-116": {
"0c68-116": {
"renderedLength": 2909,
"gzipLength": 958,
"brotliLength": 0,
"mainUid": "1d0e-115"
"mainUid": "0c68-115"
},
"1d0e-118": {
"0c68-118": {
"renderedLength": 5108,
"gzipLength": 1426,
"brotliLength": 0,
"mainUid": "1d0e-117"
"mainUid": "0c68-117"
},
"1d0e-120": {
"0c68-120": {
"renderedLength": 1102,
"gzipLength": 461,
"brotliLength": 0,
"mainUid": "1d0e-119"
"mainUid": "0c68-119"
},
"1d0e-122": {
"0c68-122": {
"renderedLength": 1330,
"gzipLength": 454,
"brotliLength": 0,
"mainUid": "1d0e-121"
"mainUid": "0c68-121"
},
"1d0e-124": {
"0c68-124": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "1d0e-123"
"mainUid": "0c68-123"
}
},
"nodeMetas": {
"1d0e-63": {
"0c68-63": {
"id": "/packages/table-core/src/utils.ts",
"moduleParts": {
"index.production.js": "1d0e-64"
"index.production.js": "0c68-64"
},

@@ -362,86 +362,86 @@ "imported": [],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
},
{
"uid": "1d0e-65"
"uid": "0c68-65"
},
{
"uid": "1d0e-67"
"uid": "0c68-67"
},
{
"uid": "1d0e-99"
"uid": "0c68-99"
},
{
"uid": "1d0e-97"
"uid": "0c68-97"
},
{
"uid": "1d0e-69"
"uid": "0c68-69"
},
{
"uid": "1d0e-71"
"uid": "0c68-71"
},
{
"uid": "1d0e-75"
"uid": "0c68-75"
},
{
"uid": "1d0e-79"
"uid": "0c68-79"
},
{
"uid": "1d0e-81"
"uid": "0c68-81"
},
{
"uid": "1d0e-83"
"uid": "0c68-83"
},
{
"uid": "1d0e-85"
"uid": "0c68-85"
},
{
"uid": "1d0e-87"
"uid": "0c68-87"
},
{
"uid": "1d0e-91"
"uid": "0c68-91"
},
{
"uid": "1d0e-93"
"uid": "0c68-93"
},
{
"uid": "1d0e-103"
"uid": "0c68-103"
},
{
"uid": "1d0e-107"
"uid": "0c68-107"
},
{
"uid": "1d0e-109"
"uid": "0c68-109"
},
{
"uid": "1d0e-111"
"uid": "0c68-111"
},
{
"uid": "1d0e-113"
"uid": "0c68-113"
},
{
"uid": "1d0e-115"
"uid": "0c68-115"
},
{
"uid": "1d0e-117"
"uid": "0c68-117"
},
{
"uid": "1d0e-119"
"uid": "0c68-119"
},
{
"uid": "1d0e-121"
"uid": "0c68-121"
}
]
},
"1d0e-65": {
"0c68-65": {
"id": "/packages/table-core/src/core/column.ts",
"moduleParts": {
"index.production.js": "1d0e-66"
"index.production.js": "0c68-66"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -451,17 +451,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-67": {
"0c68-67": {
"id": "/packages/table-core/src/core/headers.ts",
"moduleParts": {
"index.production.js": "1d0e-68"
"index.production.js": "0c68-68"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -471,17 +471,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-69": {
"0c68-69": {
"id": "/packages/table-core/src/features/ColumnSizing.ts",
"moduleParts": {
"index.production.js": "1d0e-70"
"index.production.js": "0c68-70"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -491,17 +491,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-71": {
"0c68-71": {
"id": "/packages/table-core/src/features/Expanding.ts",
"moduleParts": {
"index.production.js": "1d0e-72"
"index.production.js": "0c68-72"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -511,13 +511,13 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-73": {
"0c68-73": {
"id": "/packages/table-core/src/filterFns.ts",
"moduleParts": {
"index.production.js": "1d0e-74"
"index.production.js": "0c68-74"
},

@@ -527,20 +527,20 @@ "imported": [],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-75"
"uid": "0c68-75"
}
]
},
"1d0e-75": {
"0c68-75": {
"id": "/packages/table-core/src/features/Filters.ts",
"moduleParts": {
"index.production.js": "1d0e-76"
"index.production.js": "0c68-76"
},
"imported": [
{
"uid": "1d0e-73"
"uid": "0c68-73"
},
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -550,13 +550,13 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-77": {
"0c68-77": {
"id": "/packages/table-core/src/aggregationFns.ts",
"moduleParts": {
"index.production.js": "1d0e-78"
"index.production.js": "0c68-78"
},

@@ -566,20 +566,20 @@ "imported": [],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-79"
"uid": "0c68-79"
}
]
},
"1d0e-79": {
"0c68-79": {
"id": "/packages/table-core/src/features/Grouping.ts",
"moduleParts": {
"index.production.js": "1d0e-80"
"index.production.js": "0c68-80"
},
"imported": [
{
"uid": "1d0e-77"
"uid": "0c68-77"
},
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -589,23 +589,23 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
},
{
"uid": "1d0e-81"
"uid": "0c68-81"
}
]
},
"1d0e-81": {
"0c68-81": {
"id": "/packages/table-core/src/features/Ordering.ts",
"moduleParts": {
"index.production.js": "1d0e-82"
"index.production.js": "0c68-82"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-79"
"uid": "0c68-79"
}

@@ -615,17 +615,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-83": {
"0c68-83": {
"id": "/packages/table-core/src/features/Pagination.ts",
"moduleParts": {
"index.production.js": "1d0e-84"
"index.production.js": "0c68-84"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -635,17 +635,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-85": {
"0c68-85": {
"id": "/packages/table-core/src/features/Pinning.ts",
"moduleParts": {
"index.production.js": "1d0e-86"
"index.production.js": "0c68-86"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -655,17 +655,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-87": {
"0c68-87": {
"id": "/packages/table-core/src/features/RowSelection.ts",
"moduleParts": {
"index.production.js": "1d0e-88"
"index.production.js": "0c68-88"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -675,13 +675,13 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-89": {
"0c68-89": {
"id": "/packages/table-core/src/sortingFns.ts",
"moduleParts": {
"index.production.js": "1d0e-90"
"index.production.js": "0c68-90"
},

@@ -691,20 +691,20 @@ "imported": [],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-91"
"uid": "0c68-91"
}
]
},
"1d0e-91": {
"0c68-91": {
"id": "/packages/table-core/src/features/Sorting.ts",
"moduleParts": {
"index.production.js": "1d0e-92"
"index.production.js": "0c68-92"
},
"imported": [
{
"uid": "1d0e-89"
"uid": "0c68-89"
},
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -714,17 +714,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-93": {
"0c68-93": {
"id": "/packages/table-core/src/features/Visibility.ts",
"moduleParts": {
"index.production.js": "1d0e-94"
"index.production.js": "0c68-94"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -734,53 +734,53 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-95"
"uid": "0c68-95"
}
]
},
"1d0e-95": {
"0c68-95": {
"id": "/packages/table-core/src/core/table.ts",
"moduleParts": {
"index.production.js": "1d0e-96"
"index.production.js": "0c68-96"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-65"
"uid": "0c68-65"
},
{
"uid": "1d0e-67"
"uid": "0c68-67"
},
{
"uid": "1d0e-69"
"uid": "0c68-69"
},
{
"uid": "1d0e-71"
"uid": "0c68-71"
},
{
"uid": "1d0e-75"
"uid": "0c68-75"
},
{
"uid": "1d0e-79"
"uid": "0c68-79"
},
{
"uid": "1d0e-81"
"uid": "0c68-81"
},
{
"uid": "1d0e-83"
"uid": "0c68-83"
},
{
"uid": "1d0e-85"
"uid": "0c68-85"
},
{
"uid": "1d0e-87"
"uid": "0c68-87"
},
{
"uid": "1d0e-91"
"uid": "0c68-91"
},
{
"uid": "1d0e-93"
"uid": "0c68-93"
}

@@ -790,14 +790,14 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-97": {
"0c68-97": {
"id": "/packages/table-core/src/core/cell.ts",
"moduleParts": {
"index.production.js": "1d0e-98"
"index.production.js": "0c68-98"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -807,20 +807,20 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-99"
"uid": "0c68-99"
}
]
},
"1d0e-99": {
"0c68-99": {
"id": "/packages/table-core/src/core/row.ts",
"moduleParts": {
"index.production.js": "1d0e-100"
"index.production.js": "0c68-100"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-97"
"uid": "0c68-97"
}

@@ -830,19 +830,19 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-103"
"uid": "0c68-103"
},
{
"uid": "1d0e-117"
"uid": "0c68-117"
},
{
"uid": "1d0e-105"
"uid": "0c68-105"
}
]
},
"1d0e-101": {
"0c68-101": {
"id": "/packages/table-core/src/columnHelper.ts",
"moduleParts": {
"index.production.js": "1d0e-102"
"index.production.js": "0c68-102"
},

@@ -852,17 +852,17 @@ "imported": [],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-103": {
"0c68-103": {
"id": "/packages/table-core/src/utils/getCoreRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-104"
"index.production.js": "0c68-104"
},
"imported": [
{
"uid": "1d0e-99"
"uid": "0c68-99"
},
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -872,14 +872,14 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-105": {
"0c68-105": {
"id": "/packages/table-core/src/utils/filterRowsUtils.ts",
"moduleParts": {
"index.production.js": "1d0e-106"
"index.production.js": "0c68-106"
},
"imported": [
{
"uid": "1d0e-99"
"uid": "0c68-99"
}

@@ -889,20 +889,20 @@ ],

{
"uid": "1d0e-107"
"uid": "0c68-107"
},
{
"uid": "1d0e-109"
"uid": "0c68-109"
}
]
},
"1d0e-107": {
"0c68-107": {
"id": "/packages/table-core/src/utils/getFilteredRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-108"
"index.production.js": "0c68-108"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-105"
"uid": "0c68-105"
}

@@ -912,17 +912,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-109": {
"0c68-109": {
"id": "/packages/table-core/src/utils/getFacetedRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-110"
"index.production.js": "0c68-110"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-105"
"uid": "0c68-105"
}

@@ -932,14 +932,14 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-111": {
"0c68-111": {
"id": "/packages/table-core/src/utils/getFacetedUniqueValues.ts",
"moduleParts": {
"index.production.js": "1d0e-112"
"index.production.js": "0c68-112"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -949,14 +949,14 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-113": {
"0c68-113": {
"id": "/packages/table-core/src/utils/getFacetedMinMaxValues.ts",
"moduleParts": {
"index.production.js": "1d0e-114"
"index.production.js": "0c68-114"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -966,14 +966,14 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-115": {
"0c68-115": {
"id": "/packages/table-core/src/utils/getSortedRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-116"
"index.production.js": "0c68-116"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -983,17 +983,17 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-117": {
"0c68-117": {
"id": "/packages/table-core/src/utils/getGroupedRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-118"
"index.production.js": "0c68-118"
},
"imported": [
{
"uid": "1d0e-99"
"uid": "0c68-99"
},
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -1003,14 +1003,14 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-119": {
"0c68-119": {
"id": "/packages/table-core/src/utils/getExpandedRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-120"
"index.production.js": "0c68-120"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
}

@@ -1020,20 +1020,20 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
},
{
"uid": "1d0e-121"
"uid": "0c68-121"
}
]
},
"1d0e-121": {
"0c68-121": {
"id": "/packages/table-core/src/utils/getPaginationRowModel.ts",
"moduleParts": {
"index.production.js": "1d0e-122"
"index.production.js": "0c68-122"
},
"imported": [
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-119"
"uid": "0c68-119"
}

@@ -1043,101 +1043,101 @@ ],

{
"uid": "1d0e-123"
"uid": "0c68-123"
}
]
},
"1d0e-123": {
"0c68-123": {
"id": "/packages/table-core/src/index.ts",
"moduleParts": {
"index.production.js": "1d0e-124"
"index.production.js": "0c68-124"
},
"imported": [
{
"uid": "1d0e-95"
"uid": "0c68-95"
},
{
"uid": "1d0e-125"
"uid": "0c68-125"
},
{
"uid": "1d0e-65"
"uid": "0c68-65"
},
{
"uid": "1d0e-67"
"uid": "0c68-67"
},
{
"uid": "1d0e-99"
"uid": "0c68-99"
},
{
"uid": "1d0e-97"
"uid": "0c68-97"
},
{
"uid": "1d0e-69"
"uid": "0c68-69"
},
{
"uid": "1d0e-71"
"uid": "0c68-71"
},
{
"uid": "1d0e-75"
"uid": "0c68-75"
},
{
"uid": "1d0e-79"
"uid": "0c68-79"
},
{
"uid": "1d0e-81"
"uid": "0c68-81"
},
{
"uid": "1d0e-83"
"uid": "0c68-83"
},
{
"uid": "1d0e-85"
"uid": "0c68-85"
},
{
"uid": "1d0e-87"
"uid": "0c68-87"
},
{
"uid": "1d0e-91"
"uid": "0c68-91"
},
{
"uid": "1d0e-93"
"uid": "0c68-93"
},
{
"uid": "1d0e-73"
"uid": "0c68-73"
},
{
"uid": "1d0e-89"
"uid": "0c68-89"
},
{
"uid": "1d0e-77"
"uid": "0c68-77"
},
{
"uid": "1d0e-101"
"uid": "0c68-101"
},
{
"uid": "1d0e-63"
"uid": "0c68-63"
},
{
"uid": "1d0e-103"
"uid": "0c68-103"
},
{
"uid": "1d0e-107"
"uid": "0c68-107"
},
{
"uid": "1d0e-109"
"uid": "0c68-109"
},
{
"uid": "1d0e-111"
"uid": "0c68-111"
},
{
"uid": "1d0e-113"
"uid": "0c68-113"
},
{
"uid": "1d0e-115"
"uid": "0c68-115"
},
{
"uid": "1d0e-117"
"uid": "0c68-117"
},
{
"uid": "1d0e-119"
"uid": "0c68-119"
},
{
"uid": "1d0e-121"
"uid": "0c68-121"
}

@@ -1148,3 +1148,3 @@ ],

},
"1d0e-125": {
"0c68-125": {
"id": "/packages/table-core/src/types.ts",

@@ -1155,3 +1155,3 @@ "moduleParts": {},

{
"uid": "1d0e-123"
"uid": "0c68-123"
}

@@ -1158,0 +1158,0 @@ ]

@@ -580,3 +580,5 @@ /**

_valuesCache: Record<string, unknown>;
_uniqueValuesCache: Record<string, unknown>;
getValue: <TValue>(columnId: string) => TValue;
getUniqueValues: <TValue>(columnId: string) => TValue[];
renderValue: <TValue>(columnId: string) => TValue;

@@ -661,2 +663,3 @@ subRows: Row<TData>[];

declare type ColumnDefBase<TData extends RowData, TValue = unknown> = {
getUniqueValues?: AccessorFn<TData, unknown[]>;
footer?: ColumnDefTemplate<HeaderContext<TData, TValue>>;

@@ -663,0 +666,0 @@ cell?: ColumnDefTemplate<CellContext<TData, TValue>>;

@@ -11,3 +11,3 @@ /**

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TableCore={})}(this,(function(e){"use strict";function t(e,t){return"function"==typeof e?e(t):e}function n(e,n){return o=>{n.setState((n=>({...n,[e]:t(o,n[e])})))}}function o(e){return e instanceof Function}function l(e,t){const n=[],o=e=>{e.forEach((e=>{n.push(e);const l=t(e);null!=l&&l.length&&o(l)}))};return o(e),n}function i(e,t,n){let o,l=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=e();if(!(r.length!==l.length||r.some(((e,t)=>l[t]!==e))))return o;let a;if(l=r,n.key&&n.debug&&(a=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function r(e,t,n,o){const l={...e._getDefaultColumnDef(),...t},r=l.accessorKey;let a,s=l.id??(r?r.replace(".","_"):void 0)??("string"==typeof l.header?l.header:void 0);if(l.accessorFn?a=l.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const e of r.split("."))t=t[e];return t}:e=>e[l.accessorKey]),!s)throw new Error;let u={id:`${String(s)}`,accessorFn:a,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:i((()=>[!0]),(()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>e.options.debugAll??e.options.debugColumns}),getLeafColumns:i((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[u]}),{key:"column.getLeafColumns",debug:()=>e.options.debugAll??e.options.debugColumns})};return u=e._features.reduce(((t,n)=>Object.assign(t,null==n.createColumn?void 0:n.createColumn(u,e))),u),u}function a(e,t,n){let o={id:n.id??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 e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{Object.assign(o,null==t.createHeader?void 0:t.createHeader(o,e))})),o}const s={createTable:e=>({getHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>{const i=(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],r=(null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[];return u(t,[...i,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),...r],e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>u(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),e,"center")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"left")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"right")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFooterGroups:i((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFooterGroups:i((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFooterGroups:i((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFooterGroups:i((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFlatHeaders:i((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFlatHeaders:i((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFlatHeaders:i((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFlatHeaders:i((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterLeafHeaders:i((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftLeafHeaders:i((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightLeafHeaders:i((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeafHeaders:i((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,l,i;return[...(null==(o=e[0])?void 0:o.headers)??[],...(null==(l=t[0])?void 0:l.headers)??[],...(null==(i=n[0])?void 0:i.headers)??[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders})})};function u(e,t,n,o){var l;let i=0;const r=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)}),0)};r(e);let s=[];const u=(e,t)=>{const l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let s,u=!1;if(e.column.depth===l.depth&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),r&&(null==r?void 0:r.column)===s)r.subHeaders.push(e);else{const l=a(n,s,{id:[o,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter((e=>e.column===s)).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l})),s.push(l),t>0&&u(i,t-1)},g=t.map(((e,t)=>a(n,e,{depth:i,index:t})));u(g,i-1),s.reverse();const d=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],d(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return d((null==(l=s[0])?void 0:l.headers)??[]),s}const g={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},d={getDefaultColumnDef:()=>g,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{const n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??g.minSize,n??e.columnDef.size??g.size),e.columnDef.maxSize??g.maxSize)},getStart:n=>{const o=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),l=o.findIndex((t=>t.id===e.id));if(l>0){const e=o[l-1];return e.getStart(n)+e.getSize()}return 0},resetSize:()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}))},getCanResize:()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let t=0;const n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},getStart:()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),o=n.getCanResize();return l=>{if(!o)return;if(null==l.persist||l.persist(),f(l)&&l.touches&&l.touches.length>1)return;const i=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],a=f(l)?Math.round(l.touches[0].clientX):l.clientX,s=(e,n)=>{if("number"!=typeof n)return;let o={};t.setColumnSizingInfo((e=>{const t=n-((null==e?void 0:e.startOffset)??0),l=Math.max(t/((null==e?void 0:e.startSize)??0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;o[t]=Math.round(100*Math.max(n+n*l,0))/100})),{...e,deltaOffset:t,deltaPercentage:l}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...o})))},u=e=>s("move",e),g=e=>{s("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},d={moveHandler:e=>u(e.clientX),upHandler:e=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),g(e.clientX)}},c={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),u(e.touches[0].clientX),!1),upHandler:e=>{var t;document.removeEventListener("touchmove",c.moveHandler),document.removeEventListener("touchend",c.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!p()&&{passive:!1};f(l)?(document.addEventListener("touchmove",c.moveHandler,m),document.addEventListener("touchend",c.upHandler,m)):(document.addEventListener("mousemove",d.moveHandler,m),document.addEventListener("mouseup",d.upHandler,m)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id})))}}}),createTable:e=>({setColumnSizing:t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},resetHeaderSizeInfo:t=>{e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:e.initialState.columnSizingInfo??{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},getTotalSize:()=>{var t;return(null==(t=e.getHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getLeftTotalSize:()=>{var t;return(null==(t=e.getLeftHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getCenterTotalSize:()=>{var t;return(null==(t=e.getCenterHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getRightTotalSize:()=>{var t;return(null==(t=e.getRightHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0}})};let c=null;function p(){if("boolean"==typeof c)return c;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return c=e,c}function f(e){return"touchstart"===e.type}const m={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{if(t){if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},setExpanded:t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),toggleAllRowsExpanded:t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:t=>{var n;e.setExpanded(t?{}:(null==(n=e.initialState)?void 0:n.expanded)??{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some((e=>e.getCanExpand())),getToggleAllRowsExpandedHandler:()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},getIsAllRowsExpanded:()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},getExpandedDepth:()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded((o=>{const l=!0===o||!(null==o||!o[e.id]);let i={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=o,n=n??!l,!l&&n)return{...i,[e.id]:!0};if(l&&!n){const{[e.id]:t,...n}=i;return n}return o}))},getIsExpanded:()=>{const n=t.getState().expanded;return!!((null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))??(!0===n||null!=n&&n[e.id]))},getCanExpand:()=>{var n;return(null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!(null==(n=e.subRows)||!n.length))},getToggleExpandedHandler:()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}})},b=(e,t,n)=>{var o;const l=n.toLowerCase();return null==(o=e.getValue(t))?void 0:o.toLowerCase().includes(l)};b.autoRemove=e=>y(e);const w=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};w.autoRemove=e=>y(e);const S=(e,t,n)=>{var o;return(null==(o=e.getValue(t))?void 0:o.toLowerCase())===n.toLowerCase()};S.autoRemove=e=>y(e);const h=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};h.autoRemove=e=>y(e)||!(null!=e&&e.length);const C=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));C.autoRemove=e=>y(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));R.autoRemove=e=>y(e)||!(null!=e&&e.length);const v=(e,t,n)=>e.getValue(t)===n;v.autoRemove=e=>y(e);const F=(e,t,n)=>e.getValue(t)==n;F.autoRemove=e=>y(e);const M=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};M.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,r=null===n||Number.isNaN(l)?1/0:l;if(i>r){const e=i;i=r,r=e}return[i,r]},M.autoRemove=e=>y(e)||y(e[0])&&y(e[1]);const V={includesString:b,includesStringSensitive:w,equalsString:S,arrIncludes:h,arrIncludesAll:C,arrIncludesSome:R,equals:v,weakEquals:F,inNumberRange:M};function y(e){return null==e||""===e}const I={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,o;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(o=n._getAllCellsByColumnId()[t.id])?void 0:o.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>({getAutoFilterFn:()=>{const t=n.getCoreRowModel().flatRows[0],o=null==t?void 0:t.getValue(e.id);return"string"==typeof o?V.includesString:"number"==typeof o?V.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?V.equals:Array.isArray(o)?V.arrIncludes:V.weakEquals},getFilterFn:()=>{var t;return o(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():(null==(t=n.options.filterFns)?void 0:t[e.columnDef.filterFn])??V[e.columnDef.filterFn]},getCanFilter:()=>(e.columnDef.enableColumnFilter??!0)&&(n.options.enableColumnFilters??!0)&&(n.options.enableFilters??!0)&&!!e.accessorFn,getCanGlobalFilter:()=>(e.columnDef.enableGlobalFilter??!0)&&(n.options.enableGlobalFilter??!0)&&(n.options.enableFilters??!0)&&((null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn,getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var t,o;return null==(t=n.getState().columnFilters)||null==(o=t.find((t=>t.id===e.id)))?void 0:o.value},getFilterIndex:()=>{var t;return(null==(t=n.getState().columnFilters)?void 0:t.findIndex((t=>t.id===e.id)))??-1},setFilterValue:o=>{n.setColumnFilters((n=>{const l=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(o,i?i.value:void 0);if(x(l,r,e))return(null==n?void 0:n.filter((t=>t.id!==e.id)))??[];const a={id:e.id,value:r};return i?(null==n?void 0:n.map((t=>t.id===e.id?a:t)))??[]:null!=n&&n.length?[...n,a]:[a]}))},_getFacetedRowModel:n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),_getFacetedUniqueValues:n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>V.includesString,getGlobalFilterFn:()=>{var t;const{globalFilterFn:n}=e.options;return o(n)?n:"auto"===n?e.getGlobalAutoFilterFn():(null==(t=e.options.filterFns)?void 0:t[n])??V[n]},setColumnFilters:n=>{const o=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var l;return null==(l=t(n,e))?void 0:l.filter((e=>{const t=o.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},setGlobalFilter:t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n;e.setColumnFilters(t?[]:(null==(n=e.initialState)?void 0:n.columnFilters)??[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function x(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const _={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))})),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)})),n)return o/n},median:(e,t)=>{if(!t.length)return;let n=0,o=0;return t.forEach((t=>{let l=t.getValue(e);"number"==typeof l&&(n=Math.min(n,l),o=Math.max(o,l))})),(n+o)/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},A={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return(null==(t=e.getValue())||null==t.toString?void 0:t.toString())??null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...t??[],e.id]))},getCanGroup:()=>e.columnDef.enableGrouping??!0??t.options.enableGrouping??!0??!!e.accessorFn,getIsGrouped:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?_.sum:"[object Date]"===Object.prototype.toString.call(o)?_.extent:void 0},getAggregationFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():(null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])??_[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n;e.setGrouping(t?[]:(null==(n=e.initialState)?void 0:n.grouping)??[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,o)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}})};function P(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));if("remove"===n)return o;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}const E={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},_getOrderColumnsFn:i((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return P(l,t,n)}),{key:!1})})},G={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:n("pagination",e)}),createTable:e=>{let n=!1,o=!1;return{_autoResetPageIndex:()=>{if(n){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(o)return;o=!0,e._queue((()=>{e.resetPageIndex(),o=!1}))}}else e._queue((()=>{n=!0}))},setPagination:n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),resetPagination:t=>{e.setPagination(t?{pageIndex:0,pageSize:10}:e.initialState.pagination??{pageIndex:0,pageSize:10})},setPageIndex:n=>{e.setPagination((o=>{let l=t(n,o.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.min(Math.max(0,l),i),{...o,pageIndex:l}}))},resetPageIndex:t=>{var n,o;e.setPageIndex(t?0:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageIndex)??0)},resetPageSize:t=>{var n,o;e.setPageSize(t?10:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageSize)??10)},setPageSize:n=>{e.setPagination((e=>{const o=Math.max(1,t(n,e.pageSize)),l=e.pageSize*e.pageIndex,i=Math.floor(l/o);return{...e,pageIndex:i,pageSize:o}}))},setPageCount:n=>e.setPagination((o=>{let l=t(n,e.options.pageCount??-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...o,pageCount:l}})),getPageOptions:i((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},previousPage:()=>e.setPageIndex((e=>e-1)),nextPage:()=>e.setPageIndex((e=>e+1)),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>e.options.pageCount??Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},H={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>"right"===n?{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}))},getCanPin:()=>e.getLeafColumns().some((e=>(e.columnDef.enablePinning??!0)&&(t.options.enablePinning??!0))),getIsPinned:()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:l}=t.getState().columnPinning,i=n.some((e=>null==o?void 0:o.includes(e))),r=n.some((e=>null==l?void 0:l.includes(e)));return i?"left":!!r&&"right"},getPinnedIndex:()=>{var n,o;const l=e.getIsPinned();return l?(null==(n=t.getState().columnPinning)||null==(o=n[l])?void 0:o.indexOf(e.id))??-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.column.id)))}),{key:"row.getCenterVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getLeftVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),{key:"row.getLeftVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getRightVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),{key:"row.getRightVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>({setColumnPinning:t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n;return e.setColumnPinning(t?{left:[],right:[]}:(null==(n=e.initialState)?void 0:n.columnPinning)??{left:[],right:[]})},getIsSomeColumnsPinned:t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},getLeftLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getRightLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getCenterLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.id)))}),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns})})},z={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),toggleAllRowsSelected:t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):l.forEach((e=>{delete o[e.id]})),o}))},toggleAllPageRowsSelected:t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach((t=>{L(l,t.id,o,e)})),l})),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:i((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getFilteredSelectedRowModel:i((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getGroupedSelectedRowModel:i((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},getIsSomeRowsSelected:()=>{const t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},getIsSomePageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.some((e=>e.getIsSelected()||e.getIsSomeSelected()))},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const o=e.getIsSelected();t.setRowSelection((l=>{if(o===(n=void 0!==n?n:!o))return l;const i={...l};return L(i,e.id,n,t),i}))},getIsSelected:()=>{const{rowSelection:n}=t.getState();return k(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return"some"===O(e,n)},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return"all"===O(e,n)},getCanSelect:()=>"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,getCanSelectSubRows:()=>"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,getCanMultiSelect:()=>"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,getToggleSelectedHandler:()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}})},L=(e,t,n,o)=>{var l;const i=o.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],null!=(l=i.subRows)&&l.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>L(e,t.id,n,o)))};function D(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map((e=>{var t;const r=k(e,n);if(r&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),r)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function k(e,t){return t[e.id]??!1}function O(e,t,n){if(e.subRows&&e.subRows.length){let n=!0,o=!1;return e.subRows.forEach((e=>{o&&!n||(k(e,t)?o=!0:n=!1)})),n?"all":!!o&&"some"}return!1}const T=/([0-9]+)/gm;function B(e,t){return e===t?0:e>t?1:-1}function j(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function q(e,t){const n=e.split(T).filter(Boolean),o=t.split(T).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),r=[l,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const N={alphanumeric:(e,t,n)=>q(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>q(j(e.getValue(n)),j(t.getValue(n))),text:(e,t,n)=>B(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>B(j(e.getValue(n)),j(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>B(e.getValue(n),t.getValue(n))},U={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return N.datetime;if("string"==typeof n&&(o=!0,n.split(T).length>1))return N.alphanumeric}return o?N.text:N.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},getSortingFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():(null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])??N[e.columnDef.sortingFn]},toggleSorting:(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const a=null==r?void 0:r.find((t=>t.id===e.id)),s=null==r?void 0:r.findIndex((t=>t.id===e.id));let u,g=[],d=i?n:"desc"===l;return u=null!=r&&r.length&&e.getCanMultiSort()&&o?a?"toggle":"add":null!=r&&r.length&&s!==r.length-1?"replace":a?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(t.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):g="toggle"===u?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===u?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}],g}))},getFirstSortDir:()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??"desc"===e.getAutoSortDir()?"desc":"asc",getNextSortingOrder:n=>{const o=e.getFirstSortDir(),l=e.getIsSorted();return l?!(l!==o&&(t.options.enableSortingRemoval??1)&&(!n||(t.options.enableMultiRemove??1)))&&("desc"===l?"asc":"desc"):o},getCanSort:()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,getCanMultiSort:()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,getIsSorted:()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},getSortIndex:()=>{var n;return(null==(n=t.getState().sorting)?void 0:n.findIndex((t=>t.id===e.id)))??-1},clearSorting:()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},getToggleSortingHandler:()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}}),createTable:e=>({setSorting:t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n;e.setSorting(t?[]:(null==(n=e.initialState)?void 0:n.sorting)??[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:n??!e.getIsVisible()})))},getIsVisible:()=>{var n;return(null==(n=t.getState().columnVisibility)?void 0:n[e.id])??!0},getCanHide:()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),getToggleVisibilityHandler:()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:i((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getVisibleCells:i((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>{const t=(t,n)=>i((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>e.options.debugAll??e.options.debugColumns});return{getVisibleFlatColumns:t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),getVisibleLeafColumns:t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),setColumnVisibility:t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),resetColumnVisibility:t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},toggleAllColumnsVisible:t=>{t=t??!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),getToggleAllColumnsVisibilityHandler:()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}}},X=[s,$,E,H,I,U,A,m,G,z,d];function K(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>l.getValue()??e.options.renderFallbackValue,getContext:i((()=>[e,n,t,l]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach((o=>{Object.assign(l,null==o.createCell?void 0:o.createCell(l,n,t,e))}),{}),l}const J=(e,t,n,o,r,a)=>{let s={id:t,index:o,original:n,depth:r,_valuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const n=e.getColumn(t);return n.accessorFn?(s._valuesCache[t]=n.accessorFn(s.original,o),s._valuesCache[t]):void 0},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>l(s.subRows,(e=>e.subRows)),getAllCells:i((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>K(e,s,t,t.id)))),{key:!1,debug:()=>e.options.debugAll??e.options.debugRows}),_getAllCellsByColumnId:i((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>e.options.debugAll??e.options.debugRows})};for(let t=0;t<e._features.length;t++){const n=e._features[t];Object.assign(s,null==n||null==n.createRow?void 0:n.createRow(s,e))}return s};function Q(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){const o=[],l={},i=function(e,o){const r=[];for(let o=0;o<e.length;o++){var a;let s=e[o];if(null!=(a=s.subRows)&&a.length){const e=J(n,s.id,s.original,s.index,s.depth);if(e.columnFilters=s.columnFilters,e.subRows=i(s.subRows),!e.subRows.length)continue;s=e}t(s)&&(r.push(s),l[s.id]=s,l[o]=s)}return r};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n):function(e,t,n){const o=[],l={},i=function(e,r){const a=[];for(let r=0;r<e.length;r++){let u=e[r];if(t(u)){var s;if(null!=(s=u.subRows)&&s.length){const e=J(n,u.id,u.original,u.index,u.depth);e.subRows=i(u.subRows),u=e}a.push(u),o.push(u),l[u.id]=u}}return a};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n)}function W(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=d,e.Expanding=m,e.Filters=I,e.Grouping=A,e.Headers=s,e.Ordering=E,e.Pagination=G,e.Pinning=H,e.RowSelection=z,e.Sorting=U,e.Visibility=$,e.aggregationFns=_,e.buildHeaderGroups=u,e.createCell=K,e.createColumn=r,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=J,e.createTable=function(e){(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:X};const o=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let l={...e.initialState??{}};n._features.forEach((e=>{l=(null==e.getInitialState?void 0:e.getInitialState(l))??l}));const a=[];let s=!1;const u={_features:X,options:{...o,...e},initialState:l,_queue:e=>{a.push(e),s||(s=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();s=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const l=t(e,n.options);n.options=(e=>n.options.mergeOptions?n.options.mergeOptions(o,e):{...o,...e})(l)},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,o)=>(null==n.options.getRowId?void 0:n.options.getRowId(e,t,o))??`${o?[o.id,t].join("."):t}`,getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:e=>{const t=n.getRowModel().rowsById[e];if(!t)throw new Error;return t},_getDefaultColumnDef:i((()=>[n.options.defaultColumn]),(e=>(e=e??{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return(null==(t=e.renderValue())||null==t.toString?void 0:t.toString())??null},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e})),{debug:()=>n.options.debugAll??n.options.debugColumns,key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:i((()=>[n._getColumnDefs()]),(e=>{const t=function(e,o,l){return void 0===l&&(l=0),e.map((e=>{const i=r(n,e,l,o),a=e;return i.columns=a.columns?t(a.columns,i,l+1):[],i}))};return t(e)}),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllFlatColumns:i((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),_getAllFlatColumnsById:i((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllLeafColumns:i((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getColumn:e=>{const t=n._getAllFlatColumnsById()[e];if(!t)throw new Error;return t}};return Object.assign(n,u),n._features.forEach((e=>Object.assign(n,null==e.createTable?void 0:e.createTable(n)))),n},e.defaultColumnSizing=g,e.expandRows=W,e.filterFns=V,e.flattenBy=l,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>i((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const r=[];for(let s=0;s<t.length;s++){const u=J(e,e._getRowId(t[s],s,i),t[s],s,l);var a;if(n.flatRows.push(u),n.rowsById[u.id]=u,r.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,l+1,u))}return r};return n.rows=o(t),n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getExpandedRowModel=function(){return e=>i((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(e??{}).length?t:n?W(t):t),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getFacetedMinMaxValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{var n;const o=null==(n=e.flatRows[0])?void 0:n.getValue(t);if(void 0===o)return;let l=[o,o];for(let n=0;n<e.flatRows.length;n++){const o=e.flatRows[n].getValue(t);o<l[0]?l[0]=o:o>l[1]&&(l[1]=o)}return l}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedRowModel=function(){return(e,t)=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,o,l)=>{if(!n.rows.length||(null==o||!o.length)&&!l)return n;const i=[...o.map((e=>e.id)).filter((e=>e!==t)),l?"__global__":void 0].filter(Boolean);return Q(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedUniqueValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{let n=new Map;for(let l=0;l<e.flatRows.length;l++){var o;const i=null==(o=e.flatRows[l])?void 0:o.getValue(t);n.has(i)?n.set(i,(n.get(i)??0)+1):n.set(i,1)}return n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFilteredRowModel=function(){return e=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(n??[]).forEach((t=>{const n=e.getColumn(t.id).getFilterFn();n&&l.push({id:t.id,filterFn:n,resolvedValue:(null==n.resolveFilterValue?void 0:n.resolveFilterValue(t.value))??t.value})}));const r=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,g;o&&a&&s.length&&(r.push("__global__"),s.forEach((e=>{i.push({id:e.id,filterFn:a,resolvedValue:(null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))??o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){g=i[e];const t=g.id;if(g.filterFn(n,t,g.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Q(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getGroupedRowModel=function(){return e=>i((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const o=t.filter((t=>e.getColumn(t))),i=[],r={},a=function(t,n,s){if(void 0===n&&(n=0),n>=o.length)return t.map((e=>(e.depth=n,i.push(e),r[e.id]=e,e.subRows&&(e.subRows=a(e.subRows,n+1)),e)));const u=o[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const o=`${n.getValue(t)}`,l=e.get(o);return l?e.set(o,[...l,n]):e.set(o,[n]),e}),n)}(t,u),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${u}:${d}`;p=s?`${s}>${p}`:p;const f=a(c,n+1,p),m=n?l(c,(e=>e.subRows)):c,b=J(e,p,m[0].original,g,n);return Object.assign(b,{groupingColumnId:u,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(o.includes(t))return b._valuesCache.hasOwnProperty(t)||c[0]&&(b._valuesCache[t]=c[0].getValue(t)??void 0),b._valuesCache[t];if(b._groupingValuesCache.hasOwnProperty(t))return b._groupingValuesCache[t];const n=e.getColumn(t).getAggregationFn();return n?(b._groupingValuesCache[t]=n(t,m,c),b._groupingValuesCache[t]):void 0}}),f.forEach((e=>{i.push(e),r[e.id]=e})),b}));return d},s=a(n.rows,0,"");return s.forEach((e=>{i.push(e),r[e.id]=e})),{rows:s,flatRows:i,rowsById:r}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))}})},e.getPaginationRowModel=function(e){return e=>i((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:r,rowsById:a}=n;const s=o*l,u=s+o;let g;i=i.slice(s,u),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:a}:W({rows:i,flatRows:r,rowsById:a}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getSortedRowModel=function(){return e=>i((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter((t=>e.getColumn(t.id).getCanSort())),r={};i.forEach((t=>{const n=e.getColumn(t.id);r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()}}));const a=e=>{const t=e.slice();return t.sort(((e,t)=>{for(let n=0;n<i.length;n+=1){const o=i[n],l=r[o.id],a=(null==o?void 0:o.desc)??!1;if(l.sortUndefined){const n=void 0===e.getValue(o.id),i=void 0===t.getValue(o.id);if(n||i)return n&&i?0:n?l.sortUndefined:-l.sortUndefined}let s=l.sortingFn(e,t,o.id);if(0!==s)return a&&(s*=-1),l.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{l.push(e),!e.subRows||e.subRows.length<=1||(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:l,rowsById:n.rowsById}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.isFunction=o,e.isRowSelected=k,e.isSubRowSelected=O,e.makeStateUpdater=n,e.memo=i,e.noop=function(){},e.orderColumns=P,e.passiveEventSupported=p,e.reSplitAlphaNumeric=T,e.selectRowsFn=D,e.shouldAutoRemoveFilter=x,e.sortingFns=N,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TableCore={})}(this,(function(e){"use strict";function t(e,t){return"function"==typeof e?e(t):e}function n(e,n){return o=>{n.setState((n=>({...n,[e]:t(o,n[e])})))}}function o(e){return e instanceof Function}function l(e,t){const n=[],o=e=>{e.forEach((e=>{n.push(e);const l=t(e);null!=l&&l.length&&o(l)}))};return o(e),n}function i(e,t,n){let o,l=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=e();if(!(r.length!==l.length||r.some(((e,t)=>l[t]!==e))))return o;let a;if(l=r,n.key&&n.debug&&(a=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function r(e,t,n,o){const l={...e._getDefaultColumnDef(),...t},r=l.accessorKey;let a,s=l.id??(r?r.replace(".","_"):void 0)??("string"==typeof l.header?l.header:void 0);if(l.accessorFn?a=l.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const e of r.split("."))t=t[e];return t}:e=>e[l.accessorKey]),!s)throw new Error;let u={id:`${String(s)}`,accessorFn:a,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:i((()=>[!0]),(()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>e.options.debugAll??e.options.debugColumns}),getLeafColumns:i((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[u]}),{key:"column.getLeafColumns",debug:()=>e.options.debugAll??e.options.debugColumns})};return u=e._features.reduce(((t,n)=>Object.assign(t,null==n.createColumn?void 0:n.createColumn(u,e))),u),u}function a(e,t,n){let o={id:n.id??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 e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{Object.assign(o,null==t.createHeader?void 0:t.createHeader(o,e))})),o}const s={createTable:e=>({getHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>{const i=(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],r=(null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[];return u(t,[...i,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),...r],e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>u(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),e,"center")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"left")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightHeaderGroups:i((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>u(t,(null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))??[],e,"right")),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFooterGroups:i((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFooterGroups:i((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFooterGroups:i((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFooterGroups:i((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getFlatHeaders:i((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftFlatHeaders:i((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterFlatHeaders:i((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightFlatHeaders:i((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getCenterLeafHeaders:i((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeftLeafHeaders:i((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getRightLeafHeaders:i((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders}),getLeafHeaders:i((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,l,i;return[...(null==(o=e[0])?void 0:o.headers)??[],...(null==(l=t[0])?void 0:l.headers)??[],...(null==(i=n[0])?void 0:i.headers)??[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>e.options.debugAll??e.options.debugHeaders})})};function u(e,t,n,o){var l;let i=0;const r=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)}),0)};r(e);let s=[];const u=(e,t)=>{const l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let s,u=!1;if(e.column.depth===l.depth&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),r&&(null==r?void 0:r.column)===s)r.subHeaders.push(e);else{const l=a(n,s,{id:[o,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter((e=>e.column===s)).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l})),s.push(l),t>0&&u(i,t-1)},g=t.map(((e,t)=>a(n,e,{depth:i,index:t})));u(g,i-1),s.reverse();const d=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],d(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return d((null==(l=s[0])?void 0:l.headers)??[]),s}const g={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},d={getDefaultColumnDef:()=>g,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{const n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??g.minSize,n??e.columnDef.size??g.size),e.columnDef.maxSize??g.maxSize)},getStart:n=>{const o=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),l=o.findIndex((t=>t.id===e.id));if(l>0){const e=o[l-1];return e.getStart(n)+e.getSize()}return 0},resetSize:()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}))},getCanResize:()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let t=0;const n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},getStart:()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),o=n.getCanResize();return l=>{if(!o)return;if(null==l.persist||l.persist(),f(l)&&l.touches&&l.touches.length>1)return;const i=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],a=f(l)?Math.round(l.touches[0].clientX):l.clientX,s=(e,n)=>{if("number"!=typeof n)return;let o={};t.setColumnSizingInfo((e=>{const t=n-((null==e?void 0:e.startOffset)??0),l=Math.max(t/((null==e?void 0:e.startSize)??0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;o[t]=Math.round(100*Math.max(n+n*l,0))/100})),{...e,deltaOffset:t,deltaPercentage:l}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...o})))},u=e=>s("move",e),g=e=>{s("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},d={moveHandler:e=>u(e.clientX),upHandler:e=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),g(e.clientX)}},c={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),u(e.touches[0].clientX),!1),upHandler:e=>{var t;document.removeEventListener("touchmove",c.moveHandler),document.removeEventListener("touchend",c.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!p()&&{passive:!1};f(l)?(document.addEventListener("touchmove",c.moveHandler,m),document.addEventListener("touchend",c.upHandler,m)):(document.addEventListener("mousemove",d.moveHandler,m),document.addEventListener("mouseup",d.upHandler,m)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id})))}}}),createTable:e=>({setColumnSizing:t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},resetHeaderSizeInfo:t=>{e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:e.initialState.columnSizingInfo??{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},getTotalSize:()=>{var t;return(null==(t=e.getHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getLeftTotalSize:()=>{var t;return(null==(t=e.getLeftHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getCenterTotalSize:()=>{var t;return(null==(t=e.getCenterHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0},getRightTotalSize:()=>{var t;return(null==(t=e.getRightHeaderGroups()[0])?void 0:t.headers.reduce(((e,t)=>e+t.getSize()),0))??0}})};let c=null;function p(){if("boolean"==typeof c)return c;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return c=e,c}function f(e){return"touchstart"===e.type}const m={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{if(t){if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},setExpanded:t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),toggleAllRowsExpanded:t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:t=>{var n;e.setExpanded(t?{}:(null==(n=e.initialState)?void 0:n.expanded)??{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some((e=>e.getCanExpand())),getToggleAllRowsExpandedHandler:()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},getIsAllRowsExpanded:()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},getExpandedDepth:()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded((o=>{const l=!0===o||!(null==o||!o[e.id]);let i={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=o,n=n??!l,!l&&n)return{...i,[e.id]:!0};if(l&&!n){const{[e.id]:t,...n}=i;return n}return o}))},getIsExpanded:()=>{const n=t.getState().expanded;return!!((null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))??(!0===n||null!=n&&n[e.id]))},getCanExpand:()=>{var n;return(null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!(null==(n=e.subRows)||!n.length))},getToggleExpandedHandler:()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}})},b=(e,t,n)=>{var o;const l=n.toLowerCase();return null==(o=e.getValue(t))?void 0:o.toLowerCase().includes(l)};b.autoRemove=e=>y(e);const w=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};w.autoRemove=e=>y(e);const h=(e,t,n)=>{var o;return(null==(o=e.getValue(t))?void 0:o.toLowerCase())===n.toLowerCase()};h.autoRemove=e=>y(e);const C=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};C.autoRemove=e=>y(e)||!(null!=e&&e.length);const S=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));S.autoRemove=e=>y(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));R.autoRemove=e=>y(e)||!(null!=e&&e.length);const v=(e,t,n)=>e.getValue(t)===n;v.autoRemove=e=>y(e);const F=(e,t,n)=>e.getValue(t)==n;F.autoRemove=e=>y(e);const M=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};M.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,r=null===n||Number.isNaN(l)?1/0:l;if(i>r){const e=i;i=r,r=e}return[i,r]},M.autoRemove=e=>y(e)||y(e[0])&&y(e[1]);const V={includesString:b,includesStringSensitive:w,equalsString:h,arrIncludes:C,arrIncludesAll:S,arrIncludesSome:R,equals:v,weakEquals:F,inNumberRange:M};function y(e){return null==e||""===e}const I={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,o;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(o=n._getAllCellsByColumnId()[t.id])?void 0:o.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>({getAutoFilterFn:()=>{const t=n.getCoreRowModel().flatRows[0],o=null==t?void 0:t.getValue(e.id);return"string"==typeof o?V.includesString:"number"==typeof o?V.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?V.equals:Array.isArray(o)?V.arrIncludes:V.weakEquals},getFilterFn:()=>{var t;return o(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():(null==(t=n.options.filterFns)?void 0:t[e.columnDef.filterFn])??V[e.columnDef.filterFn]},getCanFilter:()=>(e.columnDef.enableColumnFilter??!0)&&(n.options.enableColumnFilters??!0)&&(n.options.enableFilters??!0)&&!!e.accessorFn,getCanGlobalFilter:()=>(e.columnDef.enableGlobalFilter??!0)&&(n.options.enableGlobalFilter??!0)&&(n.options.enableFilters??!0)&&((null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn,getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var t,o;return null==(t=n.getState().columnFilters)||null==(o=t.find((t=>t.id===e.id)))?void 0:o.value},getFilterIndex:()=>{var t;return(null==(t=n.getState().columnFilters)?void 0:t.findIndex((t=>t.id===e.id)))??-1},setFilterValue:o=>{n.setColumnFilters((n=>{const l=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(o,i?i.value:void 0);if(x(l,r,e))return(null==n?void 0:n.filter((t=>t.id!==e.id)))??[];const a={id:e.id,value:r};return i?(null==n?void 0:n.map((t=>t.id===e.id?a:t)))??[]:null!=n&&n.length?[...n,a]:[a]}))},_getFacetedRowModel:n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),_getFacetedUniqueValues:n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>V.includesString,getGlobalFilterFn:()=>{var t;const{globalFilterFn:n}=e.options;return o(n)?n:"auto"===n?e.getGlobalAutoFilterFn():(null==(t=e.options.filterFns)?void 0:t[n])??V[n]},setColumnFilters:n=>{const o=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var l;return null==(l=t(n,e))?void 0:l.filter((e=>{const t=o.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},setGlobalFilter:t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n;e.setColumnFilters(t?[]:(null==(n=e.initialState)?void 0:n.columnFilters)??[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function x(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const _={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))})),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)})),n)return o/n},median:(e,t)=>{if(!t.length)return;let n=0,o=0;return t.forEach((t=>{let l=t.getValue(e);"number"==typeof l&&(n=Math.min(n,l),o=Math.max(o,l))})),(n+o)/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},A={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return(null==(t=e.getValue())||null==t.toString?void 0:t.toString())??null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...t??[],e.id]))},getCanGroup:()=>e.columnDef.enableGrouping??!0??t.options.enableGrouping??!0??!!e.accessorFn,getIsGrouped:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?_.sum:"[object Date]"===Object.prototype.toString.call(o)?_.extent:void 0},getAggregationFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():(null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])??_[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n;e.setGrouping(t?[]:(null==(n=e.initialState)?void 0:n.grouping)??[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,o)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}})};function P(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));if("remove"===n)return o;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}const E={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},_getOrderColumnsFn:i((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return P(l,t,n)}),{key:!1})})},G={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:n("pagination",e)}),createTable:e=>{let n=!1,o=!1;return{_autoResetPageIndex:()=>{if(n){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(o)return;o=!0,e._queue((()=>{e.resetPageIndex(),o=!1}))}}else e._queue((()=>{n=!0}))},setPagination:n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),resetPagination:t=>{e.setPagination(t?{pageIndex:0,pageSize:10}:e.initialState.pagination??{pageIndex:0,pageSize:10})},setPageIndex:n=>{e.setPagination((o=>{let l=t(n,o.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.min(Math.max(0,l),i),{...o,pageIndex:l}}))},resetPageIndex:t=>{var n,o;e.setPageIndex(t?0:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageIndex)??0)},resetPageSize:t=>{var n,o;e.setPageSize(t?10:(null==(n=e.initialState)||null==(o=n.pagination)?void 0:o.pageSize)??10)},setPageSize:n=>{e.setPagination((e=>{const o=Math.max(1,t(n,e.pageSize)),l=e.pageSize*e.pageIndex,i=Math.floor(l/o);return{...e,pageIndex:i,pageSize:o}}))},setPageCount:n=>e.setPagination((o=>{let l=t(n,e.options.pageCount??-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...o,pageCount:l}})),getPageOptions:i((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},previousPage:()=>e.setPageIndex((e=>e-1)),nextPage:()=>e.setPageIndex((e=>e+1)),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>e.options.pageCount??Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},H={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>"right"===n?{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:((null==e?void 0:e.left)??[]).filter((e=>!(null!=o&&o.includes(e)))),right:((null==e?void 0:e.right)??[]).filter((e=>!(null!=o&&o.includes(e))))}))},getCanPin:()=>e.getLeafColumns().some((e=>(e.columnDef.enablePinning??!0)&&(t.options.enablePinning??!0))),getIsPinned:()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:l}=t.getState().columnPinning,i=n.some((e=>null==o?void 0:o.includes(e))),r=n.some((e=>null==l?void 0:l.includes(e)));return i?"left":!!r&&"right"},getPinnedIndex:()=>{var n,o;const l=e.getIsPinned();return l?(null==(n=t.getState().columnPinning)||null==(o=n[l])?void 0:o.indexOf(e.id))??-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.column.id)))}),{key:"row.getCenterVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getLeftVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),{key:"row.getLeftVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getRightVisibleCells:i((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),{key:"row.getRightVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>({setColumnPinning:t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n;return e.setColumnPinning(t?{left:[],right:[]}:(null==(n=e.initialState)?void 0:n.columnPinning)??{left:[],right:[]})},getIsSomeColumnsPinned:t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},getLeftLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getRightLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(t??[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns}),getCenterLeafColumns:i((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...t??[],...n??[]];return e.filter((e=>!o.includes(e.id)))}),{key:!1,debug:()=>e.options.debugAll??e.options.debugColumns})})},z={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),toggleAllRowsSelected:t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):l.forEach((e=>{delete o[e.id]})),o}))},toggleAllPageRowsSelected:t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach((t=>{L(l,t.id,o,e)})),l})),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:i((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable}),getFilteredSelectedRowModel:i((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getGroupedSelectedRowModel:i((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?D(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>e.options.debugAll??e.options.debugTable}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},getIsSomeRowsSelected:()=>{const t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},getIsSomePageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.some((e=>e.getIsSelected()||e.getIsSomeSelected()))},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const o=e.getIsSelected();t.setRowSelection((l=>{if(o===(n=void 0!==n?n:!o))return l;const i={...l};return L(i,e.id,n,t),i}))},getIsSelected:()=>{const{rowSelection:n}=t.getState();return k(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return"some"===O(e,n)},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return"all"===O(e,n)},getCanSelect:()=>"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,getCanSelectSubRows:()=>"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,getCanMultiSelect:()=>"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,getToggleSelectedHandler:()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}})},L=(e,t,n,o)=>{var l;const i=o.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],null!=(l=i.subRows)&&l.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>L(e,t.id,n,o)))};function D(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map((e=>{var t;const r=k(e,n);if(r&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),r)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function k(e,t){return t[e.id]??!1}function O(e,t,n){if(e.subRows&&e.subRows.length){let n=!0,o=!1;return e.subRows.forEach((e=>{o&&!n||(k(e,t)?o=!0:n=!1)})),n?"all":!!o&&"some"}return!1}const T=/([0-9]+)/gm;function B(e,t){return e===t?0:e>t?1:-1}function q(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function j(e,t){const n=e.split(T).filter(Boolean),o=t.split(T).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),r=[l,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const N={alphanumeric:(e,t,n)=>j(q(e.getValue(n)).toLowerCase(),q(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>j(q(e.getValue(n)),q(t.getValue(n))),text:(e,t,n)=>B(q(e.getValue(n)).toLowerCase(),q(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>B(q(e.getValue(n)),q(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>B(e.getValue(n),t.getValue(n))},U={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return N.datetime;if("string"==typeof n&&(o=!0,n.split(T).length>1))return N.alphanumeric}return o?N.text:N.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},getSortingFn:()=>{var n;if(!e)throw new Error;return o(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():(null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])??N[e.columnDef.sortingFn]},toggleSorting:(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const a=null==r?void 0:r.find((t=>t.id===e.id)),s=null==r?void 0:r.findIndex((t=>t.id===e.id));let u,g=[],d=i?n:"desc"===l;return u=null!=r&&r.length&&e.getCanMultiSort()&&o?a?"toggle":"add":null!=r&&r.length&&s!==r.length-1?"replace":a?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(t.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):g="toggle"===u?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===u?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}],g}))},getFirstSortDir:()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??"desc"===e.getAutoSortDir()?"desc":"asc",getNextSortingOrder:n=>{const o=e.getFirstSortDir(),l=e.getIsSorted();return l?!(l!==o&&(t.options.enableSortingRemoval??1)&&(!n||(t.options.enableMultiRemove??1)))&&("desc"===l?"asc":"desc"):o},getCanSort:()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,getCanMultiSort:()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,getIsSorted:()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},getSortIndex:()=>{var n;return(null==(n=t.getState().sorting)?void 0:n.findIndex((t=>t.id===e.id)))??-1},clearSorting:()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},getToggleSortingHandler:()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}}),createTable:e=>({setSorting:t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n;e.setSorting(t?[]:(null==(n=e.initialState)?void 0:n.sorting)??[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:n??!e.getIsVisible()})))},getIsVisible:()=>{var n;return(null==(n=t.getState().columnVisibility)?void 0:n[e.id])??!0},getCanHide:()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),getToggleVisibilityHandler:()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:i((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>t.options.debugAll??t.options.debugRows}),getVisibleCells:i((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>t.options.debugAll??t.options.debugRows})}),createTable:e=>{const t=(t,n)=>i((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>e.options.debugAll??e.options.debugColumns});return{getVisibleFlatColumns:t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),getVisibleLeafColumns:t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),setColumnVisibility:t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),resetColumnVisibility:t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},toggleAllColumnsVisible:t=>{t=t??!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),getToggleAllColumnsVisibilityHandler:()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}}},X=[s,$,E,H,I,U,A,m,G,z,d];function K(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>l.getValue()??e.options.renderFallbackValue,getContext:i((()=>[e,n,t,l]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach((o=>{Object.assign(l,null==o.createCell?void 0:o.createCell(l,n,t,e))}),{}),l}const J=(e,t,n,o,r,a)=>{let s={id:t,index:o,original:n,depth:r,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const n=e.getColumn(t);return n.accessorFn?(s._valuesCache[t]=n.accessorFn(s.original,o),s._valuesCache[t]):void 0},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];const n=e.getColumn(t);return n.accessorFn?n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,o),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>l(s.subRows,(e=>e.subRows)),getAllCells:i((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>K(e,s,t,t.id)))),{key:!1,debug:()=>e.options.debugAll??e.options.debugRows}),_getAllCellsByColumnId:i((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>e.options.debugAll??e.options.debugRows})};for(let t=0;t<e._features.length;t++){const n=e._features[t];Object.assign(s,null==n||null==n.createRow?void 0:n.createRow(s,e))}return s};function Q(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){const o=[],l={},i=function(e,o){const r=[];for(let o=0;o<e.length;o++){var a;let s=e[o];if(null!=(a=s.subRows)&&a.length){const e=J(n,s.id,s.original,s.index,s.depth);if(e.columnFilters=s.columnFilters,e.subRows=i(s.subRows),!e.subRows.length)continue;s=e}t(s)&&(r.push(s),l[s.id]=s,l[o]=s)}return r};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n):function(e,t,n){const o=[],l={},i=function(e,r){const a=[];for(let r=0;r<e.length;r++){let u=e[r];if(t(u)){var s;if(null!=(s=u.subRows)&&s.length){const e=J(n,u.id,u.original,u.index,u.depth);e.subRows=i(u.subRows),u=e}a.push(u),o.push(u),l[u.id]=u}}return a};return{rows:i(e),flatRows:o,rowsById:l}}(e,t,n)}function W(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=d,e.Expanding=m,e.Filters=I,e.Grouping=A,e.Headers=s,e.Ordering=E,e.Pagination=G,e.Pinning=H,e.RowSelection=z,e.Sorting=U,e.Visibility=$,e.aggregationFns=_,e.buildHeaderGroups=u,e.createCell=K,e.createColumn=r,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=J,e.createTable=function(e){(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:X};const o=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let l={...e.initialState??{}};n._features.forEach((e=>{l=(null==e.getInitialState?void 0:e.getInitialState(l))??l}));const a=[];let s=!1;const u={_features:X,options:{...o,...e},initialState:l,_queue:e=>{a.push(e),s||(s=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();s=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const l=t(e,n.options);n.options=(e=>n.options.mergeOptions?n.options.mergeOptions(o,e):{...o,...e})(l)},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,o)=>(null==n.options.getRowId?void 0:n.options.getRowId(e,t,o))??`${o?[o.id,t].join("."):t}`,getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:e=>{const t=n.getRowModel().rowsById[e];if(!t)throw new Error;return t},_getDefaultColumnDef:i((()=>[n.options.defaultColumn]),(e=>(e=e??{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return(null==(t=e.renderValue())||null==t.toString?void 0:t.toString())??null},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e})),{debug:()=>n.options.debugAll??n.options.debugColumns,key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:i((()=>[n._getColumnDefs()]),(e=>{const t=function(e,o,l){return void 0===l&&(l=0),e.map((e=>{const i=r(n,e,l,o),a=e;return i.columns=a.columns?t(a.columns,i,l+1):[],i}))};return t(e)}),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllFlatColumns:i((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),_getAllFlatColumnsById:i((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getAllLeafColumns:i((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>n.options.debugAll??n.options.debugColumns}),getColumn:e=>{const t=n._getAllFlatColumnsById()[e];if(!t)throw new Error;return t}};return Object.assign(n,u),n._features.forEach((e=>Object.assign(n,null==e.createTable?void 0:e.createTable(n)))),n},e.defaultColumnSizing=g,e.expandRows=W,e.filterFns=V,e.flattenBy=l,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>i((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const r=[];for(let s=0;s<t.length;s++){const u=J(e,e._getRowId(t[s],s,i),t[s],s,l);var a;if(n.flatRows.push(u),n.rowsById[u.id]=u,r.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,l+1,u))}return r};return n.rows=o(t),n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getExpandedRowModel=function(){return e=>i((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(e??{}).length?t:n?W(t):t),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getFacetedMinMaxValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{var n;const o=null==(n=e.flatRows[0])?void 0:n.getUniqueValues(t);if(void 0===o)return;let l=[o,o];for(let n=0;n<e.flatRows.length;n++){const o=e.flatRows[n].getUniqueValues(t);for(let e=0;e<o.length;e++){const t=o[e];t<l[0]?l[0]=t:t>l[1]&&(l[1]=t)}}return l}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedRowModel=function(){return(e,t)=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,o,l)=>{if(!n.rows.length||(null==o||!o.length)&&!l)return n;const i=[...o.map((e=>e.id)).filter((e=>e!==t)),l?"__global__":void 0].filter(Boolean);return Q(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFacetedUniqueValues=function(){return(e,t)=>i((()=>[e.getColumn(t).getFacetedRowModel()]),(e=>{let n=new Map;for(let o=0;o<e.flatRows.length;o++){const l=e.flatRows[o].getUniqueValues(t);for(let e=0;e<l.length;e++){const t=l[e];n.has(t)?n.set(t,(n.get(t)??0)+1):n.set(t,1)}}return n}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{}})},e.getFilteredRowModel=function(){return e=>i((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(n??[]).forEach((t=>{const n=e.getColumn(t.id).getFilterFn();n&&l.push({id:t.id,filterFn:n,resolvedValue:(null==n.resolveFilterValue?void 0:n.resolveFilterValue(t.value))??t.value})}));const r=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,g;o&&a&&s.length&&(r.push("__global__"),s.forEach((e=>{i.push({id:e.id,filterFn:a,resolvedValue:(null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))??o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){g=i[e];const t=g.id;if(g.filterFn(n,t,g.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Q(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.getGroupedRowModel=function(){return e=>i((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const o=t.filter((t=>e.getColumn(t))),i=[],r={},a=function(t,n,s){if(void 0===n&&(n=0),n>=o.length)return t.map((e=>(e.depth=n,i.push(e),r[e.id]=e,e.subRows&&(e.subRows=a(e.subRows,n+1)),e)));const u=o[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const o=`${n.getValue(t)}`,l=e.get(o);return l?e.set(o,[...l,n]):e.set(o,[n]),e}),n)}(t,u),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${u}:${d}`;p=s?`${s}>${p}`:p;const f=a(c,n+1,p),m=n?l(c,(e=>e.subRows)):c,b=J(e,p,m[0].original,g,n);return Object.assign(b,{groupingColumnId:u,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(o.includes(t))return b._valuesCache.hasOwnProperty(t)||c[0]&&(b._valuesCache[t]=c[0].getValue(t)??void 0),b._valuesCache[t];if(b._groupingValuesCache.hasOwnProperty(t))return b._groupingValuesCache[t];const n=e.getColumn(t).getAggregationFn();return n?(b._groupingValuesCache[t]=n(t,m,c),b._groupingValuesCache[t]):void 0}}),f.forEach((e=>{i.push(e),r[e.id]=e})),b}));return d},s=a(n.rows,0,"");return s.forEach((e=>{i.push(e),r[e.id]=e})),{rows:s,flatRows:i,rowsById:r}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))}})},e.getPaginationRowModel=function(e){return e=>i((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:r,rowsById:a}=n;const s=o*l,u=s+o;let g;i=i.slice(s,u),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:a}:W({rows:i,flatRows:r,rowsById:a}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable})},e.getSortedRowModel=function(){return e=>i((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter((t=>e.getColumn(t.id).getCanSort())),r={};i.forEach((t=>{const n=e.getColumn(t.id);r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()}}));const a=e=>{const t=e.slice();return t.sort(((e,t)=>{for(let n=0;n<i.length;n+=1){const o=i[n],l=r[o.id],a=(null==o?void 0:o.desc)??!1;if(l.sortUndefined){const n=void 0===e.getValue(o.id),i=void 0===t.getValue(o.id);if(n||i)return n&&i?0:n?l.sortUndefined:-l.sortUndefined}let s=l.sortingFn(e,t,o.id);if(0!==s)return a&&(s*=-1),l.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{l.push(e),!e.subRows||e.subRows.length<=1||(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:l,rowsById:n.rowsById}}),{key:!1,debug:()=>e.options.debugAll??e.options.debugTable,onChange:()=>{e._autoResetPageIndex()}})},e.isFunction=o,e.isRowSelected=k,e.isSubRowSelected=O,e.makeStateUpdater=n,e.memo=i,e.noop=function(){},e.orderColumns=P,e.passiveEventSupported=p,e.reSplitAlphaNumeric=T,e.selectRowsFn=D,e.shouldAutoRemoveFilter=x,e.sortingFns=N,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/table-core",
"author": "Tanner Linsley",
"version": "8.5.17",
"version": "8.5.18",
"description": "Headless UI for building powerful tables & datagrids for TS/JS.",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -11,3 +11,5 @@ import { RowData, Cell, Row, Table } from '../types'

_valuesCache: Record<string, unknown>
_uniqueValuesCache: Record<string, unknown>
getValue: <TValue>(columnId: string) => TValue
getUniqueValues: <TValue>(columnId: string) => TValue[]
renderValue: <TValue>(columnId: string) => TValue

@@ -35,2 +37,3 @@ subRows: Row<TData>[]

_valuesCache: {},
_uniqueValuesCache: {},
getValue: columnId => {

@@ -54,2 +57,25 @@ if (row._valuesCache.hasOwnProperty(columnId)) {

},
getUniqueValues: columnId => {
if (row._uniqueValuesCache.hasOwnProperty(columnId)) {
return row._uniqueValuesCache[columnId]
}
const column = table.getColumn(columnId)
if (!column.accessorFn) {
return undefined
}
if (!column.columnDef.getUniqueValues) {
row._uniqueValuesCache[columnId] = [row.getValue(columnId)]
return row._uniqueValuesCache[columnId]
}
row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(
row.original as TData,
rowIndex
)
return row._uniqueValuesCache[columnId] as any
},
renderValue: columnId =>

@@ -56,0 +82,0 @@ row.getValue(columnId) ?? table.options.renderFallbackValue,

@@ -200,2 +200,3 @@ import { CoreOptions, CoreTableState, CoreInstance } from './core/table'

export type ColumnDefBase<TData extends RowData, TValue = unknown> = {
getUniqueValues?: AccessorFn<TData, unknown[]>
footer?: ColumnDefTemplate<HeaderContext<TData, TValue>>

@@ -202,0 +203,0 @@ cell?: ColumnDefTemplate<CellContext<TData, TValue>>

@@ -12,3 +12,4 @@ import { Table, RowData } from '../types'

facetedRowModel => {
const firstValue = facetedRowModel.flatRows[0]?.getValue(columnId)
const firstValue =
facetedRowModel.flatRows[0]?.getUniqueValues(columnId)

@@ -22,8 +23,13 @@ if (typeof firstValue === 'undefined') {

for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
const value = facetedRowModel.flatRows[i]!.getValue<number>(columnId)
const values =
facetedRowModel.flatRows[i]!.getUniqueValues<number>(columnId)
if (value < facetedMinMaxValues[0]) {
facetedMinMaxValues[0] = value
} else if (value > facetedMinMaxValues[1]) {
facetedMinMaxValues[1] = value
for (let j = 0; j < values.length; j++) {
const value = values[j]!
if (value < facetedMinMaxValues[0]) {
facetedMinMaxValues[0] = value
} else if (value > facetedMinMaxValues[1]) {
facetedMinMaxValues[1] = value
}
}

@@ -30,0 +36,0 @@ }

@@ -15,11 +15,16 @@ import { Table, RowData } from '../types'

for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
const value = facetedRowModel.flatRows[i]?.getValue(columnId)
const values =
facetedRowModel.flatRows[i]!.getUniqueValues<number>(columnId)
if (facetedUniqueValues.has(value)) {
facetedUniqueValues.set(
value,
(facetedUniqueValues.get(value) ?? 0) + 1
)
} else {
facetedUniqueValues.set(value, 1)
for (let j = 0; j < values.length; j++) {
const value = values[j]!
if (facetedUniqueValues.has(value)) {
facetedUniqueValues.set(
value,
(facetedUniqueValues.get(value) ?? 0) + 1
)
} else {
facetedUniqueValues.set(value, 1)
}
}

@@ -26,0 +31,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc