mimir-ui-kit 1.38.43 → 1.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/assets/stories.css +1 -0
  2. package/dist/assets/styles2.css +1 -0
  3. package/dist/combobox-Dv6-ANkb.js +508 -0
  4. package/dist/components/Dropdown/Dropdown.js +176 -176
  5. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
  6. package/dist/components/SelectSearch/SelectSearch.js +1 -1
  7. package/dist/components/Table/ColumnOrderSettings.d.ts +18 -0
  8. package/dist/components/Table/ColumnOrderSettings.js +177 -0
  9. package/dist/components/Table/Table.d.ts +3 -0
  10. package/dist/components/Table/Table.js +204 -0
  11. package/dist/components/Table/TableBody.d.ts +5 -0
  12. package/dist/components/Table/TableBody.js +109 -0
  13. package/dist/components/Table/TableCard.d.ts +5 -0
  14. package/dist/components/Table/TableCard.js +45 -0
  15. package/dist/components/Table/TableCardsView.d.ts +5 -0
  16. package/dist/components/Table/TableCardsView.js +84 -0
  17. package/dist/components/Table/TableFilters.d.ts +12 -0
  18. package/dist/components/Table/TableFilters.js +165 -0
  19. package/dist/components/Table/TableHeader.d.ts +3 -0
  20. package/dist/components/Table/TableHeader.js +70 -0
  21. package/dist/components/Table/TableRow.d.ts +5 -0
  22. package/dist/components/Table/TableRow.js +76 -0
  23. package/dist/components/Table/TableScrollButtons.d.ts +11 -0
  24. package/dist/components/Table/TableScrollButtons.js +35 -0
  25. package/dist/components/Table/constants.d.ts +128 -0
  26. package/dist/components/Table/constants.js +434 -0
  27. package/dist/components/Table/hooks/index.d.ts +4 -0
  28. package/dist/components/Table/hooks/index.js +10 -0
  29. package/dist/components/Table/hooks/useTableInstance.d.ts +3 -0
  30. package/dist/components/Table/hooks/useTableInstance.js +68 -0
  31. package/dist/components/Table/hooks/useTableScroll.d.ts +8 -0
  32. package/dist/components/Table/hooks/useTableScroll.js +54 -0
  33. package/dist/components/Table/hooks/useTableState.d.ts +13 -0
  34. package/dist/components/Table/hooks/useTableState.js +56 -0
  35. package/dist/components/Table/hooks/useTableVirtualization.d.ts +13 -0
  36. package/dist/components/Table/hooks/useTableVirtualization.js +97 -0
  37. package/dist/components/Table/index.d.ts +3 -0
  38. package/dist/components/Table/index.js +10 -0
  39. package/dist/components/Table/types.d.ts +150 -0
  40. package/dist/components/Table/utils.d.ts +4 -0
  41. package/dist/components/Table/utils.js +25 -0
  42. package/dist/components/index.d.ts +2 -0
  43. package/dist/components/index.js +72 -64
  44. package/dist/index-CVk4sixt.js +1862 -0
  45. package/dist/index-D5H8gPPn.js +546 -0
  46. package/dist/index.js +106 -98
  47. package/dist/{portal-D3A00sie.js → portal-C_u5auU1.js} +179 -183
  48. package/dist/stories.module-fud786VB.js +29 -0
  49. package/dist/styles.module--QBQYoA9.js +36 -0
  50. package/package.json +3 -1
  51. package/dist/combobox-BD-GHvMy.js +0 -980
@@ -0,0 +1,1862 @@
1
+ import * as j from "react";
2
+ /**
3
+ * table-core
4
+ *
5
+ * Copyright (c) TanStack
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE.md file in the root directory of this source tree.
9
+ *
10
+ * @license MIT
11
+ */
12
+ function I(e, o) {
13
+ return typeof e == "function" ? e(o) : e;
14
+ }
15
+ function $(e, o) {
16
+ return (t) => {
17
+ o.setState((n) => ({
18
+ ...n,
19
+ [e]: I(t, n[e])
20
+ }));
21
+ };
22
+ }
23
+ function A(e) {
24
+ return e instanceof Function;
25
+ }
26
+ function me(e) {
27
+ return Array.isArray(e) && e.every((o) => typeof o == "number");
28
+ }
29
+ function Ce(e, o) {
30
+ const t = [], n = (r) => {
31
+ r.forEach((i) => {
32
+ t.push(i);
33
+ const l = o(i);
34
+ l != null && l.length && n(l);
35
+ });
36
+ };
37
+ return n(e), t;
38
+ }
39
+ function m(e, o, t) {
40
+ let n = [], r;
41
+ return (i) => {
42
+ let l;
43
+ t.key && t.debug && (l = Date.now());
44
+ const u = e(i);
45
+ if (!(u.length !== n.length || u.some((f, S) => n[S] !== f)))
46
+ return r;
47
+ n = u;
48
+ let g;
49
+ if (t.key && t.debug && (g = Date.now()), r = o(...u), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
50
+ const f = Math.round((Date.now() - l) * 100) / 100, S = Math.round((Date.now() - g) * 100) / 100, d = S / 16, s = (c, p) => {
51
+ for (c = String(c); c.length < p; )
52
+ c = " " + c;
53
+ return c;
54
+ };
55
+ console.info(`%c⏱ ${s(S, 5)} /${s(f, 5)} ms`, `
56
+ font-size: .6rem;
57
+ font-weight: bold;
58
+ color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
59
+ }
60
+ return r;
61
+ };
62
+ }
63
+ function C(e, o, t, n) {
64
+ return {
65
+ debug: () => {
66
+ var r;
67
+ return (r = e == null ? void 0 : e.debugAll) != null ? r : e[o];
68
+ },
69
+ key: process.env.NODE_ENV === "development" && t,
70
+ onChange: n
71
+ };
72
+ }
73
+ function Re(e, o, t, n) {
74
+ const r = () => {
75
+ var l;
76
+ return (l = i.getValue()) != null ? l : e.options.renderFallbackValue;
77
+ }, i = {
78
+ id: `${o.id}_${t.id}`,
79
+ row: o,
80
+ column: t,
81
+ getValue: () => o.getValue(n),
82
+ renderValue: r,
83
+ getContext: m(() => [e, t, o, i], (l, u, a, g) => ({
84
+ table: l,
85
+ column: u,
86
+ row: a,
87
+ cell: g,
88
+ getValue: g.getValue,
89
+ renderValue: g.renderValue
90
+ }), C(e.options, "debugCells", "cell.getContext"))
91
+ };
92
+ return e._features.forEach((l) => {
93
+ l.createCell == null || l.createCell(i, t, o, e);
94
+ }, {}), i;
95
+ }
96
+ function we(e, o, t, n) {
97
+ var r, i;
98
+ const u = {
99
+ ...e._getDefaultColumnDef(),
100
+ ...o
101
+ }, a = u.accessorKey;
102
+ let g = (r = (i = u.id) != null ? i : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? r : typeof u.header == "string" ? u.header : void 0, f;
103
+ if (u.accessorFn ? f = u.accessorFn : a && (a.includes(".") ? f = (d) => {
104
+ let s = d;
105
+ for (const p of a.split(".")) {
106
+ var c;
107
+ s = (c = s) == null ? void 0 : c[p], process.env.NODE_ENV !== "production" && s === void 0 && console.warn(`"${p}" in deeply nested key "${a}" returned undefined.`);
108
+ }
109
+ return s;
110
+ } : f = (d) => d[u.accessorKey]), !g)
111
+ throw process.env.NODE_ENV !== "production" ? new Error(u.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
112
+ let S = {
113
+ id: `${String(g)}`,
114
+ accessorFn: f,
115
+ parent: n,
116
+ depth: t,
117
+ columnDef: u,
118
+ columns: [],
119
+ getFlatColumns: m(() => [!0], () => {
120
+ var d;
121
+ return [S, ...(d = S.columns) == null ? void 0 : d.flatMap((s) => s.getFlatColumns())];
122
+ }, C(e.options, "debugColumns", "column.getFlatColumns")),
123
+ getLeafColumns: m(() => [e._getOrderColumnsFn()], (d) => {
124
+ var s;
125
+ if ((s = S.columns) != null && s.length) {
126
+ let c = S.columns.flatMap((p) => p.getLeafColumns());
127
+ return d(c);
128
+ }
129
+ return [S];
130
+ }, C(e.options, "debugColumns", "column.getLeafColumns"))
131
+ };
132
+ for (const d of e._features)
133
+ d.createColumn == null || d.createColumn(S, e);
134
+ return S;
135
+ }
136
+ const _ = "debugHeaders";
137
+ function oe(e, o, t) {
138
+ var n;
139
+ let i = {
140
+ id: (n = t.id) != null ? n : o.id,
141
+ column: o,
142
+ index: t.index,
143
+ isPlaceholder: !!t.isPlaceholder,
144
+ placeholderId: t.placeholderId,
145
+ depth: t.depth,
146
+ subHeaders: [],
147
+ colSpan: 0,
148
+ rowSpan: 0,
149
+ headerGroup: null,
150
+ getLeafHeaders: () => {
151
+ const l = [], u = (a) => {
152
+ a.subHeaders && a.subHeaders.length && a.subHeaders.map(u), l.push(a);
153
+ };
154
+ return u(i), l;
155
+ },
156
+ getContext: () => ({
157
+ table: e,
158
+ header: i,
159
+ column: o
160
+ })
161
+ };
162
+ return e._features.forEach((l) => {
163
+ l.createHeader == null || l.createHeader(i, e);
164
+ }), i;
165
+ }
166
+ const he = {
167
+ createTable: (e) => {
168
+ e.getHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
169
+ var i, l;
170
+ const u = (i = n == null ? void 0 : n.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? i : [], a = (l = r == null ? void 0 : r.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? l : [], g = t.filter((S) => !(n != null && n.includes(S.id)) && !(r != null && r.includes(S.id)));
171
+ return G(o, [...u, ...g, ...a], e);
172
+ }, C(e.options, _, "getHeaderGroups")), e.getCenterHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((i) => !(n != null && n.includes(i.id)) && !(r != null && r.includes(i.id))), G(o, t, e, "center")), C(e.options, _, "getCenterHeaderGroups")), e.getLeftHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
173
+ var r;
174
+ const i = (r = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
175
+ return G(o, i, e, "left");
176
+ }, C(e.options, _, "getLeftHeaderGroups")), e.getRightHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
177
+ var r;
178
+ const i = (r = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
179
+ return G(o, i, e, "right");
180
+ }, C(e.options, _, "getRightHeaderGroups")), e.getFooterGroups = m(() => [e.getHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getFooterGroups")), e.getLeftFooterGroups = m(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getLeftFooterGroups")), e.getCenterFooterGroups = m(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getCenterFooterGroups")), e.getRightFooterGroups = m(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getRightFooterGroups")), e.getFlatHeaders = m(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getFlatHeaders")), e.getLeftFlatHeaders = m(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getLeftFlatHeaders")), e.getCenterFlatHeaders = m(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getCenterFlatHeaders")), e.getRightFlatHeaders = m(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getRightFlatHeaders")), e.getCenterLeafHeaders = m(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
181
+ var n;
182
+ return !((n = t.subHeaders) != null && n.length);
183
+ }), C(e.options, _, "getCenterLeafHeaders")), e.getLeftLeafHeaders = m(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
184
+ var n;
185
+ return !((n = t.subHeaders) != null && n.length);
186
+ }), C(e.options, _, "getLeftLeafHeaders")), e.getRightLeafHeaders = m(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
187
+ var n;
188
+ return !((n = t.subHeaders) != null && n.length);
189
+ }), C(e.options, _, "getRightLeafHeaders")), e.getLeafHeaders = m(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
190
+ var r, i, l, u, a, g;
191
+ return [...(r = (i = o[0]) == null ? void 0 : i.headers) != null ? r : [], ...(l = (u = t[0]) == null ? void 0 : u.headers) != null ? l : [], ...(a = (g = n[0]) == null ? void 0 : g.headers) != null ? a : []].map((f) => f.getLeafHeaders()).flat();
192
+ }, C(e.options, _, "getLeafHeaders"));
193
+ }
194
+ };
195
+ function G(e, o, t, n) {
196
+ var r, i;
197
+ let l = 0;
198
+ const u = function(d, s) {
199
+ s === void 0 && (s = 1), l = Math.max(l, s), d.filter((c) => c.getIsVisible()).forEach((c) => {
200
+ var p;
201
+ (p = c.columns) != null && p.length && u(c.columns, s + 1);
202
+ }, 0);
203
+ };
204
+ u(e);
205
+ let a = [];
206
+ const g = (d, s) => {
207
+ const c = {
208
+ depth: s,
209
+ id: [n, `${s}`].filter(Boolean).join("_"),
210
+ headers: []
211
+ }, p = [];
212
+ d.forEach((R) => {
213
+ const w = [...p].reverse()[0], h = R.column.depth === c.depth;
214
+ let v, M = !1;
215
+ if (h && R.column.parent ? v = R.column.parent : (v = R.column, M = !0), w && (w == null ? void 0 : w.column) === v)
216
+ w.subHeaders.push(R);
217
+ else {
218
+ const F = oe(t, v, {
219
+ id: [n, s, v.id, R == null ? void 0 : R.id].filter(Boolean).join("_"),
220
+ isPlaceholder: M,
221
+ placeholderId: M ? `${p.filter((y) => y.column === v).length}` : void 0,
222
+ depth: s,
223
+ index: p.length
224
+ });
225
+ F.subHeaders.push(R), p.push(F);
226
+ }
227
+ c.headers.push(R), R.headerGroup = c;
228
+ }), a.push(c), s > 0 && g(p, s - 1);
229
+ }, f = o.map((d, s) => oe(t, d, {
230
+ depth: l,
231
+ index: s
232
+ }));
233
+ g(f, l - 1), a.reverse();
234
+ const S = (d) => d.filter((c) => c.column.getIsVisible()).map((c) => {
235
+ let p = 0, R = 0, w = [0];
236
+ c.subHeaders && c.subHeaders.length ? (w = [], S(c.subHeaders).forEach((v) => {
237
+ let {
238
+ colSpan: M,
239
+ rowSpan: F
240
+ } = v;
241
+ p += M, w.push(F);
242
+ })) : p = 1;
243
+ const h = Math.min(...w);
244
+ return R = R + h, c.colSpan = p, c.rowSpan = R, {
245
+ colSpan: p,
246
+ rowSpan: R
247
+ };
248
+ });
249
+ return S((r = (i = a[0]) == null ? void 0 : i.headers) != null ? r : []), a;
250
+ }
251
+ const W = (e, o, t, n, r, i, l) => {
252
+ let u = {
253
+ id: o,
254
+ index: n,
255
+ original: t,
256
+ depth: r,
257
+ parentId: l,
258
+ _valuesCache: {},
259
+ _uniqueValuesCache: {},
260
+ getValue: (a) => {
261
+ if (u._valuesCache.hasOwnProperty(a))
262
+ return u._valuesCache[a];
263
+ const g = e.getColumn(a);
264
+ if (g != null && g.accessorFn)
265
+ return u._valuesCache[a] = g.accessorFn(u.original, n), u._valuesCache[a];
266
+ },
267
+ getUniqueValues: (a) => {
268
+ if (u._uniqueValuesCache.hasOwnProperty(a))
269
+ return u._uniqueValuesCache[a];
270
+ const g = e.getColumn(a);
271
+ if (g != null && g.accessorFn)
272
+ return g.columnDef.getUniqueValues ? (u._uniqueValuesCache[a] = g.columnDef.getUniqueValues(u.original, n), u._uniqueValuesCache[a]) : (u._uniqueValuesCache[a] = [u.getValue(a)], u._uniqueValuesCache[a]);
273
+ },
274
+ renderValue: (a) => {
275
+ var g;
276
+ return (g = u.getValue(a)) != null ? g : e.options.renderFallbackValue;
277
+ },
278
+ subRows: [],
279
+ getLeafRows: () => Ce(u.subRows, (a) => a.subRows),
280
+ getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
281
+ getParentRows: () => {
282
+ let a = [], g = u;
283
+ for (; ; ) {
284
+ const f = g.getParentRow();
285
+ if (!f) break;
286
+ a.push(f), g = f;
287
+ }
288
+ return a.reverse();
289
+ },
290
+ getAllCells: m(() => [e.getAllLeafColumns()], (a) => a.map((g) => Re(e, u, g, g.id)), C(e.options, "debugRows", "getAllCells")),
291
+ _getAllCellsByColumnId: m(() => [u.getAllCells()], (a) => a.reduce((g, f) => (g[f.column.id] = f, g), {}), C(e.options, "debugRows", "getAllCellsByColumnId"))
292
+ };
293
+ for (let a = 0; a < e._features.length; a++) {
294
+ const g = e._features[a];
295
+ g == null || g.createRow == null || g.createRow(u, e);
296
+ }
297
+ return u;
298
+ }, ve = {
299
+ createColumn: (e, o) => {
300
+ e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
301
+ if (e._getFacetedMinMaxValues)
302
+ return e._getFacetedMinMaxValues();
303
+ };
304
+ }
305
+ }, ie = (e, o, t) => {
306
+ var n, r;
307
+ const i = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
308
+ return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(i));
309
+ };
310
+ ie.autoRemove = (e) => V(e);
311
+ const le = (e, o, t) => {
312
+ var n;
313
+ return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
314
+ };
315
+ le.autoRemove = (e) => V(e);
316
+ const se = (e, o, t) => {
317
+ var n;
318
+ return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
319
+ };
320
+ se.autoRemove = (e) => V(e);
321
+ const ue = (e, o, t) => {
322
+ var n;
323
+ return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
324
+ };
325
+ ue.autoRemove = (e) => V(e);
326
+ const ae = (e, o, t) => !t.some((n) => {
327
+ var r;
328
+ return !((r = e.getValue(o)) != null && r.includes(n));
329
+ });
330
+ ae.autoRemove = (e) => V(e) || !(e != null && e.length);
331
+ const ge = (e, o, t) => t.some((n) => {
332
+ var r;
333
+ return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
334
+ });
335
+ ge.autoRemove = (e) => V(e) || !(e != null && e.length);
336
+ const de = (e, o, t) => e.getValue(o) === t;
337
+ de.autoRemove = (e) => V(e);
338
+ const fe = (e, o, t) => e.getValue(o) == t;
339
+ fe.autoRemove = (e) => V(e);
340
+ const Y = (e, o, t) => {
341
+ let [n, r] = t;
342
+ const i = e.getValue(o);
343
+ return i >= n && i <= r;
344
+ };
345
+ Y.resolveFilterValue = (e) => {
346
+ let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, i = o === null || Number.isNaN(n) ? -1 / 0 : n, l = t === null || Number.isNaN(r) ? 1 / 0 : r;
347
+ if (i > l) {
348
+ const u = i;
349
+ i = l, l = u;
350
+ }
351
+ return [i, l];
352
+ };
353
+ Y.autoRemove = (e) => V(e) || V(e[0]) && V(e[1]);
354
+ const P = {
355
+ includesString: ie,
356
+ includesStringSensitive: le,
357
+ equalsString: se,
358
+ arrIncludes: ue,
359
+ arrIncludesAll: ae,
360
+ arrIncludesSome: ge,
361
+ equals: de,
362
+ weakEquals: fe,
363
+ inNumberRange: Y
364
+ };
365
+ function V(e) {
366
+ return e == null || e === "";
367
+ }
368
+ const _e = {
369
+ getDefaultColumnDef: () => ({
370
+ filterFn: "auto"
371
+ }),
372
+ getInitialState: (e) => ({
373
+ columnFilters: [],
374
+ ...e
375
+ }),
376
+ getDefaultOptions: (e) => ({
377
+ onColumnFiltersChange: $("columnFilters", e),
378
+ filterFromLeafRows: !1,
379
+ maxLeafRowFilterDepth: 100
380
+ }),
381
+ createColumn: (e, o) => {
382
+ e.getAutoFilterFn = () => {
383
+ const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
384
+ return typeof n == "string" ? P.includesString : typeof n == "number" ? P.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? P.equals : Array.isArray(n) ? P.arrIncludes : P.weakEquals;
385
+ }, e.getFilterFn = () => {
386
+ var t, n;
387
+ return A(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
388
+ // @ts-ignore
389
+ (t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : P[e.columnDef.filterFn]
390
+ );
391
+ }, e.getCanFilter = () => {
392
+ var t, n, r;
393
+ return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && !!e.accessorFn;
394
+ }, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
395
+ var t;
396
+ return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
397
+ }, e.getFilterIndex = () => {
398
+ var t, n;
399
+ return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
400
+ }, e.setFilterValue = (t) => {
401
+ o.setColumnFilters((n) => {
402
+ const r = e.getFilterFn(), i = n == null ? void 0 : n.find((f) => f.id === e.id), l = I(t, i ? i.value : void 0);
403
+ if (re(r, l, e)) {
404
+ var u;
405
+ return (u = n == null ? void 0 : n.filter((f) => f.id !== e.id)) != null ? u : [];
406
+ }
407
+ const a = {
408
+ id: e.id,
409
+ value: l
410
+ };
411
+ if (i) {
412
+ var g;
413
+ return (g = n == null ? void 0 : n.map((f) => f.id === e.id ? a : f)) != null ? g : [];
414
+ }
415
+ return n != null && n.length ? [...n, a] : [a];
416
+ });
417
+ };
418
+ },
419
+ createRow: (e, o) => {
420
+ e.columnFilters = {}, e.columnFiltersMeta = {};
421
+ },
422
+ createTable: (e) => {
423
+ e.setColumnFilters = (o) => {
424
+ const t = e.getAllLeafColumns(), n = (r) => {
425
+ var i;
426
+ return (i = I(o, r)) == null ? void 0 : i.filter((l) => {
427
+ const u = t.find((a) => a.id === l.id);
428
+ if (u) {
429
+ const a = u.getFilterFn();
430
+ if (re(a, l.value, u))
431
+ return !1;
432
+ }
433
+ return !0;
434
+ });
435
+ };
436
+ e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
437
+ }, e.resetColumnFilters = (o) => {
438
+ var t, n;
439
+ e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
440
+ }, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
441
+ }
442
+ };
443
+ function re(e, o, t) {
444
+ return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
445
+ }
446
+ const Fe = (e, o, t) => t.reduce((n, r) => {
447
+ const i = r.getValue(e);
448
+ return n + (typeof i == "number" ? i : 0);
449
+ }, 0), $e = (e, o, t) => {
450
+ let n;
451
+ return t.forEach((r) => {
452
+ const i = r.getValue(e);
453
+ i != null && (n > i || n === void 0 && i >= i) && (n = i);
454
+ }), n;
455
+ }, Ve = (e, o, t) => {
456
+ let n;
457
+ return t.forEach((r) => {
458
+ const i = r.getValue(e);
459
+ i != null && (n < i || n === void 0 && i >= i) && (n = i);
460
+ }), n;
461
+ }, Me = (e, o, t) => {
462
+ let n, r;
463
+ return t.forEach((i) => {
464
+ const l = i.getValue(e);
465
+ l != null && (n === void 0 ? l >= l && (n = r = l) : (n > l && (n = l), r < l && (r = l)));
466
+ }), [n, r];
467
+ }, Pe = (e, o) => {
468
+ let t = 0, n = 0;
469
+ if (o.forEach((r) => {
470
+ let i = r.getValue(e);
471
+ i != null && (i = +i) >= i && (++t, n += i);
472
+ }), t) return n / t;
473
+ }, Ie = (e, o) => {
474
+ if (!o.length)
475
+ return;
476
+ const t = o.map((i) => i.getValue(e));
477
+ if (!me(t))
478
+ return;
479
+ if (t.length === 1)
480
+ return t[0];
481
+ const n = Math.floor(t.length / 2), r = t.sort((i, l) => i - l);
482
+ return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
483
+ }, xe = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), ye = (e, o) => new Set(o.map((t) => t.getValue(e))).size, De = (e, o) => o.length, z = {
484
+ sum: Fe,
485
+ min: $e,
486
+ max: Ve,
487
+ extent: Me,
488
+ mean: Pe,
489
+ median: Ie,
490
+ unique: xe,
491
+ uniqueCount: ye,
492
+ count: De
493
+ }, Ee = {
494
+ getDefaultColumnDef: () => ({
495
+ aggregatedCell: (e) => {
496
+ var o, t;
497
+ return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
498
+ },
499
+ aggregationFn: "auto"
500
+ }),
501
+ getInitialState: (e) => ({
502
+ grouping: [],
503
+ ...e
504
+ }),
505
+ getDefaultOptions: (e) => ({
506
+ onGroupingChange: $("grouping", e),
507
+ groupedColumnMode: "reorder"
508
+ }),
509
+ createColumn: (e, o) => {
510
+ e.toggleGrouping = () => {
511
+ o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
512
+ }, e.getCanGroup = () => {
513
+ var t, n;
514
+ return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
515
+ }, e.getIsGrouped = () => {
516
+ var t;
517
+ return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
518
+ }, e.getGroupedIndex = () => {
519
+ var t;
520
+ return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
521
+ }, e.getToggleGroupingHandler = () => {
522
+ const t = e.getCanGroup();
523
+ return () => {
524
+ t && e.toggleGrouping();
525
+ };
526
+ }, e.getAutoAggregationFn = () => {
527
+ const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
528
+ if (typeof n == "number")
529
+ return z.sum;
530
+ if (Object.prototype.toString.call(n) === "[object Date]")
531
+ return z.extent;
532
+ }, e.getAggregationFn = () => {
533
+ var t, n;
534
+ if (!e)
535
+ throw new Error();
536
+ return A(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : z[e.columnDef.aggregationFn];
537
+ };
538
+ },
539
+ createTable: (e) => {
540
+ e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
541
+ var t, n;
542
+ e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
543
+ }, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
544
+ },
545
+ createRow: (e, o) => {
546
+ e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
547
+ if (e._groupingValuesCache.hasOwnProperty(t))
548
+ return e._groupingValuesCache[t];
549
+ const n = o.getColumn(t);
550
+ return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
551
+ }, e._groupingValuesCache = {};
552
+ },
553
+ createCell: (e, o, t, n) => {
554
+ e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
555
+ var r;
556
+ return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((r = t.subRows) != null && r.length);
557
+ };
558
+ }
559
+ };
560
+ function Ge(e, o, t) {
561
+ if (!(o != null && o.length) || !t)
562
+ return e;
563
+ const n = e.filter((i) => !o.includes(i.id));
564
+ return t === "remove" ? n : [...o.map((i) => e.find((l) => l.id === i)).filter(Boolean), ...n];
565
+ }
566
+ const He = {
567
+ getInitialState: (e) => ({
568
+ columnOrder: [],
569
+ ...e
570
+ }),
571
+ getDefaultOptions: (e) => ({
572
+ onColumnOrderChange: $("columnOrder", e)
573
+ }),
574
+ createColumn: (e, o) => {
575
+ e.getIndex = m((t) => [E(o, t)], (t) => t.findIndex((n) => n.id === e.id), C(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
576
+ var n;
577
+ return ((n = E(o, t)[0]) == null ? void 0 : n.id) === e.id;
578
+ }, e.getIsLastColumn = (t) => {
579
+ var n;
580
+ const r = E(o, t);
581
+ return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
582
+ };
583
+ },
584
+ createTable: (e) => {
585
+ e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
586
+ var t;
587
+ e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
588
+ }, e._getOrderColumnsFn = m(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
589
+ let i = [];
590
+ if (!(o != null && o.length))
591
+ i = r;
592
+ else {
593
+ const l = [...o], u = [...r];
594
+ for (; u.length && l.length; ) {
595
+ const a = l.shift(), g = u.findIndex((f) => f.id === a);
596
+ g > -1 && i.push(u.splice(g, 1)[0]);
597
+ }
598
+ i = [...i, ...u];
599
+ }
600
+ return Ge(i, t, n);
601
+ }, C(e.options, "debugTable", "_getOrderColumnsFn"));
602
+ }
603
+ }, O = () => ({
604
+ left: [],
605
+ right: []
606
+ }), Le = {
607
+ getInitialState: (e) => ({
608
+ columnPinning: O(),
609
+ ...e
610
+ }),
611
+ getDefaultOptions: (e) => ({
612
+ onColumnPinningChange: $("columnPinning", e)
613
+ }),
614
+ createColumn: (e, o) => {
615
+ e.pin = (t) => {
616
+ const n = e.getLeafColumns().map((r) => r.id).filter(Boolean);
617
+ o.setColumnPinning((r) => {
618
+ var i, l;
619
+ if (t === "right") {
620
+ var u, a;
621
+ return {
622
+ left: ((u = r == null ? void 0 : r.left) != null ? u : []).filter((S) => !(n != null && n.includes(S))),
623
+ right: [...((a = r == null ? void 0 : r.right) != null ? a : []).filter((S) => !(n != null && n.includes(S))), ...n]
624
+ };
625
+ }
626
+ if (t === "left") {
627
+ var g, f;
628
+ return {
629
+ left: [...((g = r == null ? void 0 : r.left) != null ? g : []).filter((S) => !(n != null && n.includes(S))), ...n],
630
+ right: ((f = r == null ? void 0 : r.right) != null ? f : []).filter((S) => !(n != null && n.includes(S)))
631
+ };
632
+ }
633
+ return {
634
+ left: ((i = r == null ? void 0 : r.left) != null ? i : []).filter((S) => !(n != null && n.includes(S))),
635
+ right: ((l = r == null ? void 0 : r.right) != null ? l : []).filter((S) => !(n != null && n.includes(S)))
636
+ };
637
+ });
638
+ }, e.getCanPin = () => e.getLeafColumns().some((n) => {
639
+ var r, i, l;
640
+ return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((i = (l = o.options.enableColumnPinning) != null ? l : o.options.enablePinning) != null ? i : !0);
641
+ }), e.getIsPinned = () => {
642
+ const t = e.getLeafColumns().map((u) => u.id), {
643
+ left: n,
644
+ right: r
645
+ } = o.getState().columnPinning, i = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => r == null ? void 0 : r.includes(u));
646
+ return i ? "left" : l ? "right" : !1;
647
+ }, e.getPinnedIndex = () => {
648
+ var t, n;
649
+ const r = e.getIsPinned();
650
+ return r ? (t = (n = o.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
651
+ };
652
+ },
653
+ createRow: (e, o) => {
654
+ e.getCenterVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
655
+ const i = [...n ?? [], ...r ?? []];
656
+ return t.filter((l) => !i.includes(l.column.id));
657
+ }, C(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((i) => t.find((l) => l.column.id === i)).filter(Boolean).map((i) => ({
658
+ ...i,
659
+ position: "left"
660
+ })), C(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((i) => t.find((l) => l.column.id === i)).filter(Boolean).map((i) => ({
661
+ ...i,
662
+ position: "right"
663
+ })), C(o.options, "debugRows", "getRightVisibleCells"));
664
+ },
665
+ createTable: (e) => {
666
+ e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
667
+ var t, n;
668
+ return e.setColumnPinning(o ? O() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : O());
669
+ }, e.getIsSomeColumnsPinned = (o) => {
670
+ var t;
671
+ const n = e.getState().columnPinning;
672
+ if (!o) {
673
+ var r, i;
674
+ return !!((r = n.left) != null && r.length || (i = n.right) != null && i.length);
675
+ }
676
+ return !!((t = n[o]) != null && t.length);
677
+ }, e.getLeftLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), C(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), C(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
678
+ const r = [...t ?? [], ...n ?? []];
679
+ return o.filter((i) => !r.includes(i.id));
680
+ }, C(e.options, "debugColumns", "getCenterLeafColumns"));
681
+ }
682
+ }, H = {
683
+ size: 150,
684
+ minSize: 20,
685
+ maxSize: Number.MAX_SAFE_INTEGER
686
+ }, B = () => ({
687
+ startOffset: null,
688
+ startSize: null,
689
+ deltaOffset: null,
690
+ deltaPercentage: null,
691
+ isResizingColumn: !1,
692
+ columnSizingStart: []
693
+ }), Ae = {
694
+ getDefaultColumnDef: () => H,
695
+ getInitialState: (e) => ({
696
+ columnSizing: {},
697
+ columnSizingInfo: B(),
698
+ ...e
699
+ }),
700
+ getDefaultOptions: (e) => ({
701
+ columnResizeMode: "onEnd",
702
+ columnResizeDirection: "ltr",
703
+ onColumnSizingChange: $("columnSizing", e),
704
+ onColumnSizingInfoChange: $("columnSizingInfo", e)
705
+ }),
706
+ createColumn: (e, o) => {
707
+ e.getSize = () => {
708
+ var t, n, r;
709
+ const i = o.getState().columnSizing[e.id];
710
+ return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : H.minSize, (n = i ?? e.columnDef.size) != null ? n : H.size), (r = e.columnDef.maxSize) != null ? r : H.maxSize);
711
+ }, e.getStart = m((t) => [t, E(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, i) => r + i.getSize(), 0), C(o.options, "debugColumns", "getStart")), e.getAfter = m((t) => [t, E(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, i) => r + i.getSize(), 0), C(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
712
+ o.setColumnSizing((t) => {
713
+ let {
714
+ [e.id]: n,
715
+ ...r
716
+ } = t;
717
+ return r;
718
+ });
719
+ }, e.getCanResize = () => {
720
+ var t, n;
721
+ return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
722
+ }, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
723
+ },
724
+ createHeader: (e, o) => {
725
+ e.getSize = () => {
726
+ let t = 0;
727
+ const n = (r) => {
728
+ if (r.subHeaders.length)
729
+ r.subHeaders.forEach(n);
730
+ else {
731
+ var i;
732
+ t += (i = r.column.getSize()) != null ? i : 0;
733
+ }
734
+ };
735
+ return n(e), t;
736
+ }, e.getStart = () => {
737
+ if (e.index > 0) {
738
+ const t = e.headerGroup.headers[e.index - 1];
739
+ return t.getStart() + t.getSize();
740
+ }
741
+ return 0;
742
+ }, e.getResizeHandler = (t) => {
743
+ const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
744
+ return (i) => {
745
+ if (!n || !r || (i.persist == null || i.persist(), T(i) && i.touches && i.touches.length > 1))
746
+ return;
747
+ const l = e.getSize(), u = e ? e.getLeafHeaders().map((w) => [w.column.id, w.column.getSize()]) : [[n.id, n.getSize()]], a = T(i) ? Math.round(i.touches[0].clientX) : i.clientX, g = {}, f = (w, h) => {
748
+ typeof h == "number" && (o.setColumnSizingInfo((v) => {
749
+ var M, F;
750
+ const y = o.options.columnResizeDirection === "rtl" ? -1 : 1, ee = (h - ((M = v == null ? void 0 : v.startOffset) != null ? M : 0)) * y, te = Math.max(ee / ((F = v == null ? void 0 : v.startSize) != null ? F : 0), -0.999999);
751
+ return v.columnSizingStart.forEach((pe) => {
752
+ let [Se, ne] = pe;
753
+ g[Se] = Math.round(Math.max(ne + ne * te, 0) * 100) / 100;
754
+ }), {
755
+ ...v,
756
+ deltaOffset: ee,
757
+ deltaPercentage: te
758
+ };
759
+ }), (o.options.columnResizeMode === "onChange" || w === "end") && o.setColumnSizing((v) => ({
760
+ ...v,
761
+ ...g
762
+ })));
763
+ }, S = (w) => f("move", w), d = (w) => {
764
+ f("end", w), o.setColumnSizingInfo((h) => ({
765
+ ...h,
766
+ isResizingColumn: !1,
767
+ startOffset: null,
768
+ startSize: null,
769
+ deltaOffset: null,
770
+ deltaPercentage: null,
771
+ columnSizingStart: []
772
+ }));
773
+ }, s = t || typeof document < "u" ? document : null, c = {
774
+ moveHandler: (w) => S(w.clientX),
775
+ upHandler: (w) => {
776
+ s == null || s.removeEventListener("mousemove", c.moveHandler), s == null || s.removeEventListener("mouseup", c.upHandler), d(w.clientX);
777
+ }
778
+ }, p = {
779
+ moveHandler: (w) => (w.cancelable && (w.preventDefault(), w.stopPropagation()), S(w.touches[0].clientX), !1),
780
+ upHandler: (w) => {
781
+ var h;
782
+ s == null || s.removeEventListener("touchmove", p.moveHandler), s == null || s.removeEventListener("touchend", p.upHandler), w.cancelable && (w.preventDefault(), w.stopPropagation()), d((h = w.touches[0]) == null ? void 0 : h.clientX);
783
+ }
784
+ }, R = ze() ? {
785
+ passive: !1
786
+ } : !1;
787
+ T(i) ? (s == null || s.addEventListener("touchmove", p.moveHandler, R), s == null || s.addEventListener("touchend", p.upHandler, R)) : (s == null || s.addEventListener("mousemove", c.moveHandler, R), s == null || s.addEventListener("mouseup", c.upHandler, R)), o.setColumnSizingInfo((w) => ({
788
+ ...w,
789
+ startOffset: a,
790
+ startSize: l,
791
+ deltaOffset: 0,
792
+ deltaPercentage: 0,
793
+ columnSizingStart: u,
794
+ isResizingColumn: n.id
795
+ }));
796
+ };
797
+ };
798
+ },
799
+ createTable: (e) => {
800
+ e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
801
+ var t;
802
+ e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
803
+ }, e.resetHeaderSizeInfo = (o) => {
804
+ var t;
805
+ e.setColumnSizingInfo(o ? B() : (t = e.initialState.columnSizingInfo) != null ? t : B());
806
+ }, e.getTotalSize = () => {
807
+ var o, t;
808
+ return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
809
+ }, e.getLeftTotalSize = () => {
810
+ var o, t;
811
+ return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
812
+ }, e.getCenterTotalSize = () => {
813
+ var o, t;
814
+ return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
815
+ }, e.getRightTotalSize = () => {
816
+ var o, t;
817
+ return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
818
+ };
819
+ }
820
+ };
821
+ let L = null;
822
+ function ze() {
823
+ if (typeof L == "boolean") return L;
824
+ let e = !1;
825
+ try {
826
+ const o = {
827
+ get passive() {
828
+ return e = !0, !1;
829
+ }
830
+ }, t = () => {
831
+ };
832
+ window.addEventListener("test", t, o), window.removeEventListener("test", t);
833
+ } catch {
834
+ e = !1;
835
+ }
836
+ return L = e, L;
837
+ }
838
+ function T(e) {
839
+ return e.type === "touchstart";
840
+ }
841
+ const Oe = {
842
+ getInitialState: (e) => ({
843
+ columnVisibility: {},
844
+ ...e
845
+ }),
846
+ getDefaultOptions: (e) => ({
847
+ onColumnVisibilityChange: $("columnVisibility", e)
848
+ }),
849
+ createColumn: (e, o) => {
850
+ e.toggleVisibility = (t) => {
851
+ e.getCanHide() && o.setColumnVisibility((n) => ({
852
+ ...n,
853
+ [e.id]: t ?? !e.getIsVisible()
854
+ }));
855
+ }, e.getIsVisible = () => {
856
+ var t, n;
857
+ const r = e.columns;
858
+ return (t = r.length ? r.some((i) => i.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
859
+ }, e.getCanHide = () => {
860
+ var t, n;
861
+ return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
862
+ }, e.getToggleVisibilityHandler = () => (t) => {
863
+ e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
864
+ };
865
+ },
866
+ createRow: (e, o) => {
867
+ e._getAllVisibleCells = m(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), C(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = m(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], C(o.options, "debugRows", "getVisibleCells"));
868
+ },
869
+ createTable: (e) => {
870
+ const o = (t, n) => m(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((i) => i.getIsVisible == null ? void 0 : i.getIsVisible()), C(e.options, "debugColumns", t));
871
+ e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
872
+ var n;
873
+ e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
874
+ }, e.toggleAllColumnsVisible = (t) => {
875
+ var n;
876
+ t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((r, i) => ({
877
+ ...r,
878
+ [i.id]: t || !(i.getCanHide != null && i.getCanHide())
879
+ }), {}));
880
+ }, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((t) => !(t.getIsVisible != null && t.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((t) => t.getIsVisible == null ? void 0 : t.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
881
+ var n;
882
+ e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
883
+ };
884
+ }
885
+ };
886
+ function E(e, o) {
887
+ return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
888
+ }
889
+ const Be = {
890
+ createTable: (e) => {
891
+ e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
892
+ if (e._getGlobalFacetedMinMaxValues)
893
+ return e._getGlobalFacetedMinMaxValues();
894
+ };
895
+ }
896
+ }, Te = {
897
+ getInitialState: (e) => ({
898
+ globalFilter: void 0,
899
+ ...e
900
+ }),
901
+ getDefaultOptions: (e) => ({
902
+ onGlobalFilterChange: $("globalFilter", e),
903
+ globalFilterFn: "auto",
904
+ getColumnCanGlobalFilter: (o) => {
905
+ var t;
906
+ const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
907
+ return typeof n == "string" || typeof n == "number";
908
+ }
909
+ }),
910
+ createColumn: (e, o) => {
911
+ e.getCanGlobalFilter = () => {
912
+ var t, n, r, i;
913
+ return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && ((i = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? i : !0) && !!e.accessorFn;
914
+ };
915
+ },
916
+ createTable: (e) => {
917
+ e.getGlobalAutoFilterFn = () => P.includesString, e.getGlobalFilterFn = () => {
918
+ var o, t;
919
+ const {
920
+ globalFilterFn: n
921
+ } = e.options;
922
+ return A(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : P[n];
923
+ }, e.setGlobalFilter = (o) => {
924
+ e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
925
+ }, e.resetGlobalFilter = (o) => {
926
+ e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
927
+ };
928
+ }
929
+ }, qe = {
930
+ getInitialState: (e) => ({
931
+ expanded: {},
932
+ ...e
933
+ }),
934
+ getDefaultOptions: (e) => ({
935
+ onExpandedChange: $("expanded", e),
936
+ paginateExpandedRows: !0
937
+ }),
938
+ createTable: (e) => {
939
+ let o = !1, t = !1;
940
+ e._autoResetExpanded = () => {
941
+ var n, r;
942
+ if (!o) {
943
+ e._queue(() => {
944
+ o = !0;
945
+ });
946
+ return;
947
+ }
948
+ if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
949
+ if (t) return;
950
+ t = !0, e._queue(() => {
951
+ e.resetExpanded(), t = !1;
952
+ });
953
+ }
954
+ }, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
955
+ n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
956
+ }, e.resetExpanded = (n) => {
957
+ var r, i;
958
+ e.setExpanded(n ? {} : (r = (i = e.initialState) == null ? void 0 : i.expanded) != null ? r : {});
959
+ }, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
960
+ n.persist == null || n.persist(), e.toggleAllRowsExpanded();
961
+ }, e.getIsSomeRowsExpanded = () => {
962
+ const n = e.getState().expanded;
963
+ return n === !0 || Object.values(n).some(Boolean);
964
+ }, e.getIsAllRowsExpanded = () => {
965
+ const n = e.getState().expanded;
966
+ return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((r) => !r.getIsExpanded()));
967
+ }, e.getExpandedDepth = () => {
968
+ let n = 0;
969
+ return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((i) => {
970
+ const l = i.split(".");
971
+ n = Math.max(n, l.length);
972
+ }), n;
973
+ }, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
974
+ },
975
+ createRow: (e, o) => {
976
+ e.toggleExpanded = (t) => {
977
+ o.setExpanded((n) => {
978
+ var r;
979
+ const i = n === !0 ? !0 : !!(n != null && n[e.id]);
980
+ let l = {};
981
+ if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((u) => {
982
+ l[u] = !0;
983
+ }) : l = n, t = (r = t) != null ? r : !i, !i && t)
984
+ return {
985
+ ...l,
986
+ [e.id]: !0
987
+ };
988
+ if (i && !t) {
989
+ const {
990
+ [e.id]: u,
991
+ ...a
992
+ } = l;
993
+ return a;
994
+ }
995
+ return n;
996
+ });
997
+ }, e.getIsExpanded = () => {
998
+ var t;
999
+ const n = o.getState().expanded;
1000
+ return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
1001
+ }, e.getCanExpand = () => {
1002
+ var t, n, r;
1003
+ return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((r = e.subRows) != null && r.length);
1004
+ }, e.getIsAllParentsExpanded = () => {
1005
+ let t = !0, n = e;
1006
+ for (; t && n.parentId; )
1007
+ n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
1008
+ return t;
1009
+ }, e.getToggleExpandedHandler = () => {
1010
+ const t = e.getCanExpand();
1011
+ return () => {
1012
+ t && e.toggleExpanded();
1013
+ };
1014
+ };
1015
+ }
1016
+ }, U = 0, X = 10, q = () => ({
1017
+ pageIndex: U,
1018
+ pageSize: X
1019
+ }), Ne = {
1020
+ getInitialState: (e) => ({
1021
+ ...e,
1022
+ pagination: {
1023
+ ...q(),
1024
+ ...e == null ? void 0 : e.pagination
1025
+ }
1026
+ }),
1027
+ getDefaultOptions: (e) => ({
1028
+ onPaginationChange: $("pagination", e)
1029
+ }),
1030
+ createTable: (e) => {
1031
+ let o = !1, t = !1;
1032
+ e._autoResetPageIndex = () => {
1033
+ var n, r;
1034
+ if (!o) {
1035
+ e._queue(() => {
1036
+ o = !0;
1037
+ });
1038
+ return;
1039
+ }
1040
+ if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
1041
+ if (t) return;
1042
+ t = !0, e._queue(() => {
1043
+ e.resetPageIndex(), t = !1;
1044
+ });
1045
+ }
1046
+ }, e.setPagination = (n) => {
1047
+ const r = (i) => I(n, i);
1048
+ return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
1049
+ }, e.resetPagination = (n) => {
1050
+ var r;
1051
+ e.setPagination(n ? q() : (r = e.initialState.pagination) != null ? r : q());
1052
+ }, e.setPageIndex = (n) => {
1053
+ e.setPagination((r) => {
1054
+ let i = I(n, r.pageIndex);
1055
+ const l = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1056
+ return i = Math.max(0, Math.min(i, l)), {
1057
+ ...r,
1058
+ pageIndex: i
1059
+ };
1060
+ });
1061
+ }, e.resetPageIndex = (n) => {
1062
+ var r, i;
1063
+ e.setPageIndex(n ? U : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageIndex) != null ? r : U);
1064
+ }, e.resetPageSize = (n) => {
1065
+ var r, i;
1066
+ e.setPageSize(n ? X : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageSize) != null ? r : X);
1067
+ }, e.setPageSize = (n) => {
1068
+ e.setPagination((r) => {
1069
+ const i = Math.max(1, I(n, r.pageSize)), l = r.pageSize * r.pageIndex, u = Math.floor(l / i);
1070
+ return {
1071
+ ...r,
1072
+ pageIndex: u,
1073
+ pageSize: i
1074
+ };
1075
+ });
1076
+ }, e.setPageCount = (n) => e.setPagination((r) => {
1077
+ var i;
1078
+ let l = I(n, (i = e.options.pageCount) != null ? i : -1);
1079
+ return typeof l == "number" && (l = Math.max(-1, l)), {
1080
+ ...r,
1081
+ pageCount: l
1082
+ };
1083
+ }), e.getPageOptions = m(() => [e.getPageCount()], (n) => {
1084
+ let r = [];
1085
+ return n && n > 0 && (r = [...new Array(n)].fill(null).map((i, l) => l)), r;
1086
+ }, C(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1087
+ const {
1088
+ pageIndex: n
1089
+ } = e.getState().pagination, r = e.getPageCount();
1090
+ return r === -1 ? !0 : r === 0 ? !1 : n < r - 1;
1091
+ }, e.previousPage = () => e.setPageIndex((n) => n - 1), e.nextPage = () => e.setPageIndex((n) => n + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => {
1092
+ var n;
1093
+ return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
1094
+ }, e.getRowCount = () => {
1095
+ var n;
1096
+ return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
1097
+ };
1098
+ }
1099
+ }, N = () => ({
1100
+ top: [],
1101
+ bottom: []
1102
+ }), ke = {
1103
+ getInitialState: (e) => ({
1104
+ rowPinning: N(),
1105
+ ...e
1106
+ }),
1107
+ getDefaultOptions: (e) => ({
1108
+ onRowPinningChange: $("rowPinning", e)
1109
+ }),
1110
+ createRow: (e, o) => {
1111
+ e.pin = (t, n, r) => {
1112
+ const i = n ? e.getLeafRows().map((a) => {
1113
+ let {
1114
+ id: g
1115
+ } = a;
1116
+ return g;
1117
+ }) : [], l = r ? e.getParentRows().map((a) => {
1118
+ let {
1119
+ id: g
1120
+ } = a;
1121
+ return g;
1122
+ }) : [], u = /* @__PURE__ */ new Set([...l, e.id, ...i]);
1123
+ o.setRowPinning((a) => {
1124
+ var g, f;
1125
+ if (t === "bottom") {
1126
+ var S, d;
1127
+ return {
1128
+ top: ((S = a == null ? void 0 : a.top) != null ? S : []).filter((p) => !(u != null && u.has(p))),
1129
+ bottom: [...((d = a == null ? void 0 : a.bottom) != null ? d : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)]
1130
+ };
1131
+ }
1132
+ if (t === "top") {
1133
+ var s, c;
1134
+ return {
1135
+ top: [...((s = a == null ? void 0 : a.top) != null ? s : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)],
1136
+ bottom: ((c = a == null ? void 0 : a.bottom) != null ? c : []).filter((p) => !(u != null && u.has(p)))
1137
+ };
1138
+ }
1139
+ return {
1140
+ top: ((g = a == null ? void 0 : a.top) != null ? g : []).filter((p) => !(u != null && u.has(p))),
1141
+ bottom: ((f = a == null ? void 0 : a.bottom) != null ? f : []).filter((p) => !(u != null && u.has(p)))
1142
+ };
1143
+ });
1144
+ }, e.getCanPin = () => {
1145
+ var t;
1146
+ const {
1147
+ enableRowPinning: n,
1148
+ enablePinning: r
1149
+ } = o.options;
1150
+ return typeof n == "function" ? n(e) : (t = n ?? r) != null ? t : !0;
1151
+ }, e.getIsPinned = () => {
1152
+ const t = [e.id], {
1153
+ top: n,
1154
+ bottom: r
1155
+ } = o.getState().rowPinning, i = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => r == null ? void 0 : r.includes(u));
1156
+ return i ? "top" : l ? "bottom" : !1;
1157
+ }, e.getPinnedIndex = () => {
1158
+ var t, n;
1159
+ const r = e.getIsPinned();
1160
+ if (!r) return -1;
1161
+ const i = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((l) => {
1162
+ let {
1163
+ id: u
1164
+ } = l;
1165
+ return u;
1166
+ });
1167
+ return (n = i == null ? void 0 : i.indexOf(e.id)) != null ? n : -1;
1168
+ };
1169
+ },
1170
+ createTable: (e) => {
1171
+ e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
1172
+ var t, n;
1173
+ return e.setRowPinning(o ? N() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : N());
1174
+ }, e.getIsSomeRowsPinned = (o) => {
1175
+ var t;
1176
+ const n = e.getState().rowPinning;
1177
+ if (!o) {
1178
+ var r, i;
1179
+ return !!((r = n.top) != null && r.length || (i = n.bottom) != null && i.length);
1180
+ }
1181
+ return !!((t = n[o]) != null && t.length);
1182
+ }, e._getPinnedRows = (o, t, n) => {
1183
+ var r;
1184
+ return ((r = e.options.keepPinnedRows) == null || r ? (
1185
+ //get all rows that are pinned even if they would not be otherwise visible
1186
+ //account for expanded parent rows, but not pagination or filtering
1187
+ (t ?? []).map((l) => {
1188
+ const u = e.getRow(l, !0);
1189
+ return u.getIsAllParentsExpanded() ? u : null;
1190
+ })
1191
+ ) : (
1192
+ //else get only visible rows that are pinned
1193
+ (t ?? []).map((l) => o.find((u) => u.id === l))
1194
+ )).filter(Boolean).map((l) => ({
1195
+ ...l,
1196
+ position: n
1197
+ }));
1198
+ }, e.getTopRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), C(e.options, "debugRows", "getTopRows")), e.getBottomRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), C(e.options, "debugRows", "getBottomRows")), e.getCenterRows = m(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
1199
+ const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1200
+ return o.filter((i) => !r.has(i.id));
1201
+ }, C(e.options, "debugRows", "getCenterRows"));
1202
+ }
1203
+ }, je = {
1204
+ getInitialState: (e) => ({
1205
+ rowSelection: {},
1206
+ ...e
1207
+ }),
1208
+ getDefaultOptions: (e) => ({
1209
+ onRowSelectionChange: $("rowSelection", e),
1210
+ enableRowSelection: !0,
1211
+ enableMultiRowSelection: !0,
1212
+ enableSubRowSelection: !0
1213
+ // enableGroupingRowSelection: false,
1214
+ // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
1215
+ // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
1216
+ }),
1217
+ createTable: (e) => {
1218
+ e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
1219
+ var t;
1220
+ return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
1221
+ }, e.toggleAllRowsSelected = (o) => {
1222
+ e.setRowSelection((t) => {
1223
+ o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
1224
+ const n = {
1225
+ ...t
1226
+ }, r = e.getPreGroupedRowModel().flatRows;
1227
+ return o ? r.forEach((i) => {
1228
+ i.getCanSelect() && (n[i.id] = !0);
1229
+ }) : r.forEach((i) => {
1230
+ delete n[i.id];
1231
+ }), n;
1232
+ });
1233
+ }, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
1234
+ const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), r = {
1235
+ ...t
1236
+ };
1237
+ return e.getRowModel().rows.forEach((i) => {
1238
+ K(r, i.id, n, !0, e);
1239
+ }), r;
1240
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = m(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? k(e, t) : {
1241
+ rows: [],
1242
+ flatRows: [],
1243
+ rowsById: {}
1244
+ }, C(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = m(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? k(e, t) : {
1245
+ rows: [],
1246
+ flatRows: [],
1247
+ rowsById: {}
1248
+ }, C(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = m(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? k(e, t) : {
1249
+ rows: [],
1250
+ flatRows: [],
1251
+ rowsById: {}
1252
+ }, C(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
1253
+ const o = e.getFilteredRowModel().flatRows, {
1254
+ rowSelection: t
1255
+ } = e.getState();
1256
+ let n = !!(o.length && Object.keys(t).length);
1257
+ return n && o.some((r) => r.getCanSelect() && !t[r.id]) && (n = !1), n;
1258
+ }, e.getIsAllPageRowsSelected = () => {
1259
+ const o = e.getPaginationRowModel().flatRows.filter((r) => r.getCanSelect()), {
1260
+ rowSelection: t
1261
+ } = e.getState();
1262
+ let n = !!o.length;
1263
+ return n && o.some((r) => !t[r.id]) && (n = !1), n;
1264
+ }, e.getIsSomeRowsSelected = () => {
1265
+ var o;
1266
+ const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
1267
+ return t > 0 && t < e.getFilteredRowModel().flatRows.length;
1268
+ }, e.getIsSomePageRowsSelected = () => {
1269
+ const o = e.getPaginationRowModel().flatRows;
1270
+ return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
1271
+ }, e.getToggleAllRowsSelectedHandler = () => (o) => {
1272
+ e.toggleAllRowsSelected(o.target.checked);
1273
+ }, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
1274
+ e.toggleAllPageRowsSelected(o.target.checked);
1275
+ };
1276
+ },
1277
+ createRow: (e, o) => {
1278
+ e.toggleSelected = (t, n) => {
1279
+ const r = e.getIsSelected();
1280
+ o.setRowSelection((i) => {
1281
+ var l;
1282
+ if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
1283
+ return i;
1284
+ const u = {
1285
+ ...i
1286
+ };
1287
+ return K(u, e.id, t, (l = n == null ? void 0 : n.selectChildren) != null ? l : !0, o), u;
1288
+ });
1289
+ }, e.getIsSelected = () => {
1290
+ const {
1291
+ rowSelection: t
1292
+ } = o.getState();
1293
+ return Z(e, t);
1294
+ }, e.getIsSomeSelected = () => {
1295
+ const {
1296
+ rowSelection: t
1297
+ } = o.getState();
1298
+ return J(e, t) === "some";
1299
+ }, e.getIsAllSubRowsSelected = () => {
1300
+ const {
1301
+ rowSelection: t
1302
+ } = o.getState();
1303
+ return J(e, t) === "all";
1304
+ }, e.getCanSelect = () => {
1305
+ var t;
1306
+ return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
1307
+ }, e.getCanSelectSubRows = () => {
1308
+ var t;
1309
+ return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
1310
+ }, e.getCanMultiSelect = () => {
1311
+ var t;
1312
+ return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
1313
+ }, e.getToggleSelectedHandler = () => {
1314
+ const t = e.getCanSelect();
1315
+ return (n) => {
1316
+ var r;
1317
+ t && e.toggleSelected((r = n.target) == null ? void 0 : r.checked);
1318
+ };
1319
+ };
1320
+ }
1321
+ }, K = (e, o, t, n, r) => {
1322
+ var i;
1323
+ const l = r.getRow(o, !0);
1324
+ t ? (l.getCanMultiSelect() || Object.keys(e).forEach((u) => delete e[u]), l.getCanSelect() && (e[o] = !0)) : delete e[o], n && (i = l.subRows) != null && i.length && l.getCanSelectSubRows() && l.subRows.forEach((u) => K(e, u.id, t, n, r));
1325
+ };
1326
+ function k(e, o) {
1327
+ const t = e.getState().rowSelection, n = [], r = {}, i = function(l, u) {
1328
+ return l.map((a) => {
1329
+ var g;
1330
+ const f = Z(a, t);
1331
+ if (f && (n.push(a), r[a.id] = a), (g = a.subRows) != null && g.length && (a = {
1332
+ ...a,
1333
+ subRows: i(a.subRows)
1334
+ }), f)
1335
+ return a;
1336
+ }).filter(Boolean);
1337
+ };
1338
+ return {
1339
+ rows: i(o.rows),
1340
+ flatRows: n,
1341
+ rowsById: r
1342
+ };
1343
+ }
1344
+ function Z(e, o) {
1345
+ var t;
1346
+ return (t = o[e.id]) != null ? t : !1;
1347
+ }
1348
+ function J(e, o, t) {
1349
+ var n;
1350
+ if (!((n = e.subRows) != null && n.length)) return !1;
1351
+ let r = !0, i = !1;
1352
+ return e.subRows.forEach((l) => {
1353
+ if (!(i && !r) && (l.getCanSelect() && (Z(l, o) ? i = !0 : r = !1), l.subRows && l.subRows.length)) {
1354
+ const u = J(l, o);
1355
+ u === "all" ? i = !0 : (u === "some" && (i = !0), r = !1);
1356
+ }
1357
+ }), r ? "all" : i ? "some" : !1;
1358
+ }
1359
+ const Q = /([0-9]+)/gm, Ue = (e, o, t) => ce(x(e.getValue(t)).toLowerCase(), x(o.getValue(t)).toLowerCase()), Xe = (e, o, t) => ce(x(e.getValue(t)), x(o.getValue(t))), Ke = (e, o, t) => b(x(e.getValue(t)).toLowerCase(), x(o.getValue(t)).toLowerCase()), Je = (e, o, t) => b(x(e.getValue(t)), x(o.getValue(t))), Qe = (e, o, t) => {
1360
+ const n = e.getValue(t), r = o.getValue(t);
1361
+ return n > r ? 1 : n < r ? -1 : 0;
1362
+ }, We = (e, o, t) => b(e.getValue(t), o.getValue(t));
1363
+ function b(e, o) {
1364
+ return e === o ? 0 : e > o ? 1 : -1;
1365
+ }
1366
+ function x(e) {
1367
+ return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
1368
+ }
1369
+ function ce(e, o) {
1370
+ const t = e.split(Q).filter(Boolean), n = o.split(Q).filter(Boolean);
1371
+ for (; t.length && n.length; ) {
1372
+ const r = t.shift(), i = n.shift(), l = parseInt(r, 10), u = parseInt(i, 10), a = [l, u].sort();
1373
+ if (isNaN(a[0])) {
1374
+ if (r > i)
1375
+ return 1;
1376
+ if (i > r)
1377
+ return -1;
1378
+ continue;
1379
+ }
1380
+ if (isNaN(a[1]))
1381
+ return isNaN(l) ? -1 : 1;
1382
+ if (l > u)
1383
+ return 1;
1384
+ if (u > l)
1385
+ return -1;
1386
+ }
1387
+ return t.length - n.length;
1388
+ }
1389
+ const D = {
1390
+ alphanumeric: Ue,
1391
+ alphanumericCaseSensitive: Xe,
1392
+ text: Ke,
1393
+ textCaseSensitive: Je,
1394
+ datetime: Qe,
1395
+ basic: We
1396
+ }, Ye = {
1397
+ getInitialState: (e) => ({
1398
+ sorting: [],
1399
+ ...e
1400
+ }),
1401
+ getDefaultColumnDef: () => ({
1402
+ sortingFn: "auto",
1403
+ sortUndefined: 1
1404
+ }),
1405
+ getDefaultOptions: (e) => ({
1406
+ onSortingChange: $("sorting", e),
1407
+ isMultiSortEvent: (o) => o.shiftKey
1408
+ }),
1409
+ createColumn: (e, o) => {
1410
+ e.getAutoSortingFn = () => {
1411
+ const t = o.getFilteredRowModel().flatRows.slice(10);
1412
+ let n = !1;
1413
+ for (const r of t) {
1414
+ const i = r == null ? void 0 : r.getValue(e.id);
1415
+ if (Object.prototype.toString.call(i) === "[object Date]")
1416
+ return D.datetime;
1417
+ if (typeof i == "string" && (n = !0, i.split(Q).length > 1))
1418
+ return D.alphanumeric;
1419
+ }
1420
+ return n ? D.text : D.basic;
1421
+ }, e.getAutoSortDir = () => {
1422
+ const t = o.getFilteredRowModel().flatRows[0];
1423
+ return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
1424
+ }, e.getSortingFn = () => {
1425
+ var t, n;
1426
+ if (!e)
1427
+ throw new Error();
1428
+ return A(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : D[e.columnDef.sortingFn];
1429
+ }, e.toggleSorting = (t, n) => {
1430
+ const r = e.getNextSortingOrder(), i = typeof t < "u" && t !== null;
1431
+ o.setSorting((l) => {
1432
+ const u = l == null ? void 0 : l.find((s) => s.id === e.id), a = l == null ? void 0 : l.findIndex((s) => s.id === e.id);
1433
+ let g = [], f, S = i ? t : r === "desc";
1434
+ if (l != null && l.length && e.getCanMultiSort() && n ? u ? f = "toggle" : f = "add" : l != null && l.length && a !== l.length - 1 ? f = "replace" : u ? f = "toggle" : f = "replace", f === "toggle" && (i || r || (f = "remove")), f === "add") {
1435
+ var d;
1436
+ g = [...l, {
1437
+ id: e.id,
1438
+ desc: S
1439
+ }], g.splice(0, g.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
1440
+ } else f === "toggle" ? g = l.map((s) => s.id === e.id ? {
1441
+ ...s,
1442
+ desc: S
1443
+ } : s) : f === "remove" ? g = l.filter((s) => s.id !== e.id) : g = [{
1444
+ id: e.id,
1445
+ desc: S
1446
+ }];
1447
+ return g;
1448
+ });
1449
+ }, e.getFirstSortDir = () => {
1450
+ var t, n;
1451
+ return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
1452
+ }, e.getNextSortingOrder = (t) => {
1453
+ var n, r;
1454
+ const i = e.getFirstSortDir(), l = e.getIsSorted();
1455
+ return l ? l !== i && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
1456
+ (!(t && (r = o.options.enableMultiRemove) != null) || r) ? !1 : l === "desc" ? "asc" : "desc" : i;
1457
+ }, e.getCanSort = () => {
1458
+ var t, n;
1459
+ return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
1460
+ }, e.getCanMultiSort = () => {
1461
+ var t, n;
1462
+ return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
1463
+ }, e.getIsSorted = () => {
1464
+ var t;
1465
+ const n = (t = o.getState().sorting) == null ? void 0 : t.find((r) => r.id === e.id);
1466
+ return n ? n.desc ? "desc" : "asc" : !1;
1467
+ }, e.getSortIndex = () => {
1468
+ var t, n;
1469
+ return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
1470
+ }, e.clearSorting = () => {
1471
+ o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
1472
+ }, e.getToggleSortingHandler = () => {
1473
+ const t = e.getCanSort();
1474
+ return (n) => {
1475
+ t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
1476
+ };
1477
+ };
1478
+ },
1479
+ createTable: (e) => {
1480
+ e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
1481
+ var t, n;
1482
+ e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
1483
+ }, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
1484
+ }
1485
+ }, Ze = [
1486
+ he,
1487
+ Oe,
1488
+ He,
1489
+ Le,
1490
+ ve,
1491
+ _e,
1492
+ Be,
1493
+ //depends on ColumnFaceting
1494
+ Te,
1495
+ //depends on ColumnFiltering
1496
+ Ye,
1497
+ Ee,
1498
+ //depends on RowSorting
1499
+ qe,
1500
+ Ne,
1501
+ ke,
1502
+ je,
1503
+ Ae
1504
+ ];
1505
+ function be(e) {
1506
+ var o, t;
1507
+ process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
1508
+ const n = [...Ze, ...(o = e._features) != null ? o : []];
1509
+ let r = {
1510
+ _features: n
1511
+ };
1512
+ const i = r._features.reduce((d, s) => Object.assign(d, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(r)), {}), l = (d) => r.options.mergeOptions ? r.options.mergeOptions(i, d) : {
1513
+ ...i,
1514
+ ...d
1515
+ };
1516
+ let a = {
1517
+ ...{},
1518
+ ...(t = e.initialState) != null ? t : {}
1519
+ };
1520
+ r._features.forEach((d) => {
1521
+ var s;
1522
+ a = (s = d.getInitialState == null ? void 0 : d.getInitialState(a)) != null ? s : a;
1523
+ });
1524
+ const g = [];
1525
+ let f = !1;
1526
+ const S = {
1527
+ _features: n,
1528
+ options: {
1529
+ ...i,
1530
+ ...e
1531
+ },
1532
+ initialState: a,
1533
+ _queue: (d) => {
1534
+ g.push(d), f || (f = !0, Promise.resolve().then(() => {
1535
+ for (; g.length; )
1536
+ g.shift()();
1537
+ f = !1;
1538
+ }).catch((s) => setTimeout(() => {
1539
+ throw s;
1540
+ })));
1541
+ },
1542
+ reset: () => {
1543
+ r.setState(r.initialState);
1544
+ },
1545
+ setOptions: (d) => {
1546
+ const s = I(d, r.options);
1547
+ r.options = l(s);
1548
+ },
1549
+ getState: () => r.options.state,
1550
+ setState: (d) => {
1551
+ r.options.onStateChange == null || r.options.onStateChange(d);
1552
+ },
1553
+ _getRowId: (d, s, c) => {
1554
+ var p;
1555
+ return (p = r.options.getRowId == null ? void 0 : r.options.getRowId(d, s, c)) != null ? p : `${c ? [c.id, s].join(".") : s}`;
1556
+ },
1557
+ getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
1558
+ // The final calls start at the bottom of the model,
1559
+ // expanded rows, which then work their way up
1560
+ getRowModel: () => r.getPaginationRowModel(),
1561
+ //in next version, we should just pass in the row model as the optional 2nd arg
1562
+ getRow: (d, s) => {
1563
+ let c = (s ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
1564
+ if (!c && (c = r.getCoreRowModel().rowsById[d], !c))
1565
+ throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
1566
+ return c;
1567
+ },
1568
+ _getDefaultColumnDef: m(() => [r.options.defaultColumn], (d) => {
1569
+ var s;
1570
+ return d = (s = d) != null ? s : {}, {
1571
+ header: (c) => {
1572
+ const p = c.header.column.columnDef;
1573
+ return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
1574
+ },
1575
+ // footer: props => props.header.column.id,
1576
+ cell: (c) => {
1577
+ var p, R;
1578
+ return (p = (R = c.renderValue()) == null || R.toString == null ? void 0 : R.toString()) != null ? p : null;
1579
+ },
1580
+ ...r._features.reduce((c, p) => Object.assign(c, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
1581
+ ...d
1582
+ };
1583
+ }, C(e, "debugColumns", "_getDefaultColumnDef")),
1584
+ _getColumnDefs: () => r.options.columns,
1585
+ getAllColumns: m(() => [r._getColumnDefs()], (d) => {
1586
+ const s = function(c, p, R) {
1587
+ return R === void 0 && (R = 0), c.map((w) => {
1588
+ const h = we(r, w, R, p), v = w;
1589
+ return h.columns = v.columns ? s(v.columns, h, R + 1) : [], h;
1590
+ });
1591
+ };
1592
+ return s(d);
1593
+ }, C(e, "debugColumns", "getAllColumns")),
1594
+ getAllFlatColumns: m(() => [r.getAllColumns()], (d) => d.flatMap((s) => s.getFlatColumns()), C(e, "debugColumns", "getAllFlatColumns")),
1595
+ _getAllFlatColumnsById: m(() => [r.getAllFlatColumns()], (d) => d.reduce((s, c) => (s[c.id] = c, s), {}), C(e, "debugColumns", "getAllFlatColumnsById")),
1596
+ getAllLeafColumns: m(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, s) => {
1597
+ let c = d.flatMap((p) => p.getLeafColumns());
1598
+ return s(c);
1599
+ }, C(e, "debugColumns", "getAllLeafColumns")),
1600
+ getColumn: (d) => {
1601
+ const s = r._getAllFlatColumnsById()[d];
1602
+ return process.env.NODE_ENV !== "production" && !s && console.error(`[Table] Column with id '${d}' does not exist.`), s;
1603
+ }
1604
+ };
1605
+ Object.assign(r, S);
1606
+ for (let d = 0; d < r._features.length; d++) {
1607
+ const s = r._features[d];
1608
+ s == null || s.createTable == null || s.createTable(r);
1609
+ }
1610
+ return r;
1611
+ }
1612
+ function lt() {
1613
+ return (e) => m(() => [e.options.data], (o) => {
1614
+ const t = {
1615
+ rows: [],
1616
+ flatRows: [],
1617
+ rowsById: {}
1618
+ }, n = function(r, i, l) {
1619
+ i === void 0 && (i = 0);
1620
+ const u = [];
1621
+ for (let g = 0; g < r.length; g++) {
1622
+ const f = W(e, e._getRowId(r[g], g, l), r[g], g, i, void 0, l == null ? void 0 : l.id);
1623
+ if (t.flatRows.push(f), t.rowsById[f.id] = f, u.push(f), e.options.getSubRows) {
1624
+ var a;
1625
+ f.originalSubRows = e.options.getSubRows(r[g], g), (a = f.originalSubRows) != null && a.length && (f.subRows = n(f.originalSubRows, i + 1, f));
1626
+ }
1627
+ }
1628
+ return u;
1629
+ };
1630
+ return t.rows = n(o), t;
1631
+ }, C(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
1632
+ }
1633
+ function et(e, o, t) {
1634
+ return t.options.filterFromLeafRows ? tt(e, o, t) : nt(e, o, t);
1635
+ }
1636
+ function tt(e, o, t) {
1637
+ var n;
1638
+ const r = [], i = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(a, g) {
1639
+ g === void 0 && (g = 0);
1640
+ const f = [];
1641
+ for (let d = 0; d < a.length; d++) {
1642
+ var S;
1643
+ let s = a[d];
1644
+ const c = W(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
1645
+ if (c.columnFilters = s.columnFilters, (S = s.subRows) != null && S.length && g < l) {
1646
+ if (c.subRows = u(s.subRows, g + 1), s = c, o(s) && !c.subRows.length) {
1647
+ f.push(s), i[s.id] = s, r.push(s);
1648
+ continue;
1649
+ }
1650
+ if (o(s) || c.subRows.length) {
1651
+ f.push(s), i[s.id] = s, r.push(s);
1652
+ continue;
1653
+ }
1654
+ } else
1655
+ s = c, o(s) && (f.push(s), i[s.id] = s, r.push(s));
1656
+ }
1657
+ return f;
1658
+ };
1659
+ return {
1660
+ rows: u(e),
1661
+ flatRows: r,
1662
+ rowsById: i
1663
+ };
1664
+ }
1665
+ function nt(e, o, t) {
1666
+ var n;
1667
+ const r = [], i = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(a, g) {
1668
+ g === void 0 && (g = 0);
1669
+ const f = [];
1670
+ for (let d = 0; d < a.length; d++) {
1671
+ let s = a[d];
1672
+ if (o(s)) {
1673
+ var S;
1674
+ if ((S = s.subRows) != null && S.length && g < l) {
1675
+ const p = W(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
1676
+ p.subRows = u(s.subRows, g + 1), s = p;
1677
+ }
1678
+ f.push(s), r.push(s), i[s.id] = s;
1679
+ }
1680
+ }
1681
+ return f;
1682
+ };
1683
+ return {
1684
+ rows: u(e),
1685
+ flatRows: r,
1686
+ rowsById: i
1687
+ };
1688
+ }
1689
+ function st() {
1690
+ return (e) => m(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
1691
+ if (!o.rows.length || !(t != null && t.length) && !n) {
1692
+ for (let d = 0; d < o.flatRows.length; d++)
1693
+ o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
1694
+ return o;
1695
+ }
1696
+ const r = [], i = [];
1697
+ (t ?? []).forEach((d) => {
1698
+ var s;
1699
+ const c = e.getColumn(d.id);
1700
+ if (!c)
1701
+ return;
1702
+ const p = c.getFilterFn();
1703
+ if (!p) {
1704
+ process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${c.id}.`);
1705
+ return;
1706
+ }
1707
+ r.push({
1708
+ id: d.id,
1709
+ filterFn: p,
1710
+ resolvedValue: (s = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(d.value)) != null ? s : d.value
1711
+ });
1712
+ });
1713
+ const l = (t ?? []).map((d) => d.id), u = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
1714
+ n && u && a.length && (l.push("__global__"), a.forEach((d) => {
1715
+ var s;
1716
+ i.push({
1717
+ id: d.id,
1718
+ filterFn: u,
1719
+ resolvedValue: (s = u.resolveFilterValue == null ? void 0 : u.resolveFilterValue(n)) != null ? s : n
1720
+ });
1721
+ }));
1722
+ let g, f;
1723
+ for (let d = 0; d < o.flatRows.length; d++) {
1724
+ const s = o.flatRows[d];
1725
+ if (s.columnFilters = {}, r.length)
1726
+ for (let c = 0; c < r.length; c++) {
1727
+ g = r[c];
1728
+ const p = g.id;
1729
+ s.columnFilters[p] = g.filterFn(s, p, g.resolvedValue, (R) => {
1730
+ s.columnFiltersMeta[p] = R;
1731
+ });
1732
+ }
1733
+ if (i.length) {
1734
+ for (let c = 0; c < i.length; c++) {
1735
+ f = i[c];
1736
+ const p = f.id;
1737
+ if (f.filterFn(s, p, f.resolvedValue, (R) => {
1738
+ s.columnFiltersMeta[p] = R;
1739
+ })) {
1740
+ s.columnFilters.__global__ = !0;
1741
+ break;
1742
+ }
1743
+ }
1744
+ s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
1745
+ }
1746
+ }
1747
+ const S = (d) => {
1748
+ for (let s = 0; s < l.length; s++)
1749
+ if (d.columnFilters[l[s]] === !1)
1750
+ return !1;
1751
+ return !0;
1752
+ };
1753
+ return et(o.rows, S, e);
1754
+ }, C(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
1755
+ }
1756
+ function ut() {
1757
+ return (e) => m(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
1758
+ if (!t.rows.length || !(o != null && o.length))
1759
+ return t;
1760
+ const n = e.getState().sorting, r = [], i = n.filter((a) => {
1761
+ var g;
1762
+ return (g = e.getColumn(a.id)) == null ? void 0 : g.getCanSort();
1763
+ }), l = {};
1764
+ i.forEach((a) => {
1765
+ const g = e.getColumn(a.id);
1766
+ g && (l[a.id] = {
1767
+ sortUndefined: g.columnDef.sortUndefined,
1768
+ invertSorting: g.columnDef.invertSorting,
1769
+ sortingFn: g.getSortingFn()
1770
+ });
1771
+ });
1772
+ const u = (a) => {
1773
+ const g = a.map((f) => ({
1774
+ ...f
1775
+ }));
1776
+ return g.sort((f, S) => {
1777
+ for (let s = 0; s < i.length; s += 1) {
1778
+ var d;
1779
+ const c = i[s], p = l[c.id], R = p.sortUndefined, w = (d = c == null ? void 0 : c.desc) != null ? d : !1;
1780
+ let h = 0;
1781
+ if (R) {
1782
+ const v = f.getValue(c.id), M = S.getValue(c.id), F = v === void 0, y = M === void 0;
1783
+ if (F || y) {
1784
+ if (R === "first") return F ? -1 : 1;
1785
+ if (R === "last") return F ? 1 : -1;
1786
+ h = F && y ? 0 : F ? R : -R;
1787
+ }
1788
+ }
1789
+ if (h === 0 && (h = p.sortingFn(f, S, c.id)), h !== 0)
1790
+ return w && (h *= -1), p.invertSorting && (h *= -1), h;
1791
+ }
1792
+ return f.index - S.index;
1793
+ }), g.forEach((f) => {
1794
+ var S;
1795
+ r.push(f), (S = f.subRows) != null && S.length && (f.subRows = u(f.subRows));
1796
+ }), g;
1797
+ };
1798
+ return {
1799
+ rows: u(t.rows),
1800
+ flatRows: r,
1801
+ rowsById: t.rowsById
1802
+ };
1803
+ }, C(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
1804
+ }
1805
+ /**
1806
+ * react-table
1807
+ *
1808
+ * Copyright (c) TanStack
1809
+ *
1810
+ * This source code is licensed under the MIT license found in the
1811
+ * LICENSE.md file in the root directory of this source tree.
1812
+ *
1813
+ * @license MIT
1814
+ */
1815
+ function at(e, o) {
1816
+ return e ? ot(e) ? /* @__PURE__ */ j.createElement(e, o) : e : null;
1817
+ }
1818
+ function ot(e) {
1819
+ return rt(e) || typeof e == "function" || it(e);
1820
+ }
1821
+ function rt(e) {
1822
+ return typeof e == "function" && (() => {
1823
+ const o = Object.getPrototypeOf(e);
1824
+ return o.prototype && o.prototype.isReactComponent;
1825
+ })();
1826
+ }
1827
+ function it(e) {
1828
+ return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
1829
+ }
1830
+ function gt(e) {
1831
+ const o = {
1832
+ state: {},
1833
+ // Dummy state
1834
+ onStateChange: () => {
1835
+ },
1836
+ // noop
1837
+ renderFallbackValue: null,
1838
+ ...e
1839
+ }, [t] = j.useState(() => ({
1840
+ current: be(o)
1841
+ })), [n, r] = j.useState(() => t.current.initialState);
1842
+ return t.current.setOptions((i) => ({
1843
+ ...i,
1844
+ ...e,
1845
+ state: {
1846
+ ...n,
1847
+ ...e.state
1848
+ },
1849
+ // Similarly, we'll maintain both our internal state and any user-provided
1850
+ // state.
1851
+ onStateChange: (l) => {
1852
+ r(l), e.onStateChange == null || e.onStateChange(l);
1853
+ }
1854
+ })), t.current;
1855
+ }
1856
+ export {
1857
+ ut as a,
1858
+ st as b,
1859
+ at as f,
1860
+ lt as g,
1861
+ gt as u
1862
+ };