@leaflink/stash 53.4.5 → 53.4.6

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.
@@ -0,0 +1,2400 @@
1
+ import { defineComponent as Ve, h as Q, isRef as Ke, shallowRef as We, watch as Ee, ref as L, watchEffect as Je, unref as E, inject as Ye, computed as M, toValue as T, useCssModule as Qe, useSlots as Ze, createElementBlock as B, openBlock as I, Fragment as k, createVNode as we, createBlock as O, createCommentVNode as Re, mergeProps as be, createSlots as he, withCtx as A, renderList as U, normalizeStyle as ve, normalizeClass as _e, renderSlot as Fe } from "vue";
2
+ import { D as xe } from "../DataView.keys-aSOnA4AD.js";
3
+ import { t as X } from "../locale.js";
4
+ import $e from "../Checkbox.js";
5
+ import { _ as et } from "../ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js";
6
+ import tt from "../Paginate.js";
7
+ import nt from "../Table.js";
8
+ import ot from "../TableCell.js";
9
+ import rt from "../TableHeaderCell.js";
10
+ import lt from "../TableHeaderRow.js";
11
+ import it from "../TableRow.js";
12
+ import { _ as st } from "../_plugin-vue_export-helper-CHgC5LLL.js";
13
+ /**
14
+ * table-core
15
+ *
16
+ * Copyright (c) TanStack
17
+ *
18
+ * This source code is licensed under the MIT license found in the
19
+ * LICENSE.md file in the root directory of this source tree.
20
+ *
21
+ * @license MIT
22
+ */
23
+ function vn() {
24
+ return {
25
+ accessor: (e, o) => typeof e == "function" ? {
26
+ ...o,
27
+ accessorFn: e
28
+ } : {
29
+ ...o,
30
+ accessorKey: e
31
+ },
32
+ display: (e) => e,
33
+ group: (e) => e
34
+ };
35
+ }
36
+ function H(e, o) {
37
+ return typeof e == "function" ? e(o) : e;
38
+ }
39
+ function P(e, o) {
40
+ return (t) => {
41
+ o.setState((n) => ({
42
+ ...n,
43
+ [e]: H(t, n[e])
44
+ }));
45
+ };
46
+ }
47
+ function Z(e) {
48
+ return e instanceof Function;
49
+ }
50
+ function ut(e) {
51
+ return Array.isArray(e) && e.every((o) => typeof o == "number");
52
+ }
53
+ function at(e, o) {
54
+ const t = [], n = (r) => {
55
+ r.forEach((l) => {
56
+ t.push(l);
57
+ const i = o(l);
58
+ i != null && i.length && n(i);
59
+ });
60
+ };
61
+ return n(e), t;
62
+ }
63
+ function C(e, o, t) {
64
+ let n = [], r;
65
+ return (l) => {
66
+ let i;
67
+ t.key && t.debug && (i = Date.now());
68
+ const u = e(l);
69
+ if (!(u.length !== n.length || u.some((f, m) => n[m] !== f)))
70
+ return r;
71
+ n = u;
72
+ let g;
73
+ 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()) {
74
+ const f = Math.round((Date.now() - i) * 100) / 100, m = Math.round((Date.now() - g) * 100) / 100, d = m / 16, s = (c, p) => {
75
+ for (c = String(c); c.length < p; )
76
+ c = " " + c;
77
+ return c;
78
+ };
79
+ console.info(`%c⏱ ${s(m, 5)} /${s(f, 5)} ms`, `
80
+ font-size: .6rem;
81
+ font-weight: bold;
82
+ color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
83
+ }
84
+ return r;
85
+ };
86
+ }
87
+ function w(e, o, t, n) {
88
+ return {
89
+ debug: () => {
90
+ var r;
91
+ return (r = e == null ? void 0 : e.debugAll) != null ? r : e[o];
92
+ },
93
+ key: process.env.NODE_ENV === "development" && t,
94
+ onChange: n
95
+ };
96
+ }
97
+ function gt(e, o, t, n) {
98
+ const r = () => {
99
+ var i;
100
+ return (i = l.getValue()) != null ? i : e.options.renderFallbackValue;
101
+ }, l = {
102
+ id: `${o.id}_${t.id}`,
103
+ row: o,
104
+ column: t,
105
+ getValue: () => o.getValue(n),
106
+ renderValue: r,
107
+ getContext: C(() => [e, t, o, l], (i, u, a, g) => ({
108
+ table: i,
109
+ column: u,
110
+ row: a,
111
+ cell: g,
112
+ getValue: g.getValue,
113
+ renderValue: g.renderValue
114
+ }), w(e.options, "debugCells", "cell.getContext"))
115
+ };
116
+ return e._features.forEach((i) => {
117
+ i.createCell == null || i.createCell(l, t, o, e);
118
+ }, {}), l;
119
+ }
120
+ function dt(e, o, t, n) {
121
+ var r, l;
122
+ const u = {
123
+ ...e._getDefaultColumnDef(),
124
+ ...o
125
+ }, a = u.accessorKey;
126
+ let g = (r = (l = u.id) != null ? l : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? r : typeof u.header == "string" ? u.header : void 0, f;
127
+ if (u.accessorFn ? f = u.accessorFn : a && (a.includes(".") ? f = (d) => {
128
+ let s = d;
129
+ for (const p of a.split(".")) {
130
+ var c;
131
+ 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.`);
132
+ }
133
+ return s;
134
+ } : f = (d) => d[u.accessorKey]), !g)
135
+ 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();
136
+ let m = {
137
+ id: `${String(g)}`,
138
+ accessorFn: f,
139
+ parent: n,
140
+ depth: t,
141
+ columnDef: u,
142
+ columns: [],
143
+ getFlatColumns: C(() => [!0], () => {
144
+ var d;
145
+ return [m, ...(d = m.columns) == null ? void 0 : d.flatMap((s) => s.getFlatColumns())];
146
+ }, w(e.options, "debugColumns", "column.getFlatColumns")),
147
+ getLeafColumns: C(() => [e._getOrderColumnsFn()], (d) => {
148
+ var s;
149
+ if ((s = m.columns) != null && s.length) {
150
+ let c = m.columns.flatMap((p) => p.getLeafColumns());
151
+ return d(c);
152
+ }
153
+ return [m];
154
+ }, w(e.options, "debugColumns", "column.getLeafColumns"))
155
+ };
156
+ for (const d of e._features)
157
+ d.createColumn == null || d.createColumn(m, e);
158
+ return m;
159
+ }
160
+ const $ = "debugHeaders";
161
+ function Pe(e, o, t) {
162
+ var n;
163
+ let l = {
164
+ id: (n = t.id) != null ? n : o.id,
165
+ column: o,
166
+ index: t.index,
167
+ isPlaceholder: !!t.isPlaceholder,
168
+ placeholderId: t.placeholderId,
169
+ depth: t.depth,
170
+ subHeaders: [],
171
+ colSpan: 0,
172
+ rowSpan: 0,
173
+ headerGroup: null,
174
+ getLeafHeaders: () => {
175
+ const i = [], u = (a) => {
176
+ a.subHeaders && a.subHeaders.length && a.subHeaders.map(u), i.push(a);
177
+ };
178
+ return u(l), i;
179
+ },
180
+ getContext: () => ({
181
+ table: e,
182
+ header: l,
183
+ column: o
184
+ })
185
+ };
186
+ return e._features.forEach((i) => {
187
+ i.createHeader == null || i.createHeader(l, e);
188
+ }), l;
189
+ }
190
+ const ct = {
191
+ createTable: (e) => {
192
+ e.getHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
193
+ var l, i;
194
+ const u = (l = n == null ? void 0 : n.map((m) => t.find((d) => d.id === m)).filter(Boolean)) != null ? l : [], a = (i = r == null ? void 0 : r.map((m) => t.find((d) => d.id === m)).filter(Boolean)) != null ? i : [], g = t.filter((m) => !(n != null && n.includes(m.id)) && !(r != null && r.includes(m.id)));
195
+ return K(o, [...u, ...g, ...a], e);
196
+ }, w(e.options, $, "getHeaderGroups")), e.getCenterHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(r != null && r.includes(l.id))), K(o, t, e, "center")), w(e.options, $, "getCenterHeaderGroups")), e.getLeftHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
197
+ var r;
198
+ const l = (r = n == null ? void 0 : n.map((i) => t.find((u) => u.id === i)).filter(Boolean)) != null ? r : [];
199
+ return K(o, l, e, "left");
200
+ }, w(e.options, $, "getLeftHeaderGroups")), e.getRightHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
201
+ var r;
202
+ const l = (r = n == null ? void 0 : n.map((i) => t.find((u) => u.id === i)).filter(Boolean)) != null ? r : [];
203
+ return K(o, l, e, "right");
204
+ }, w(e.options, $, "getRightHeaderGroups")), e.getFooterGroups = C(() => [e.getHeaderGroups()], (o) => [...o].reverse(), w(e.options, $, "getFooterGroups")), e.getLeftFooterGroups = C(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), w(e.options, $, "getLeftFooterGroups")), e.getCenterFooterGroups = C(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), w(e.options, $, "getCenterFooterGroups")), e.getRightFooterGroups = C(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), w(e.options, $, "getRightFooterGroups")), e.getFlatHeaders = C(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, $, "getFlatHeaders")), e.getLeftFlatHeaders = C(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, $, "getLeftFlatHeaders")), e.getCenterFlatHeaders = C(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, $, "getCenterFlatHeaders")), e.getRightFlatHeaders = C(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), w(e.options, $, "getRightFlatHeaders")), e.getCenterLeafHeaders = C(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
205
+ var n;
206
+ return !((n = t.subHeaders) != null && n.length);
207
+ }), w(e.options, $, "getCenterLeafHeaders")), e.getLeftLeafHeaders = C(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
208
+ var n;
209
+ return !((n = t.subHeaders) != null && n.length);
210
+ }), w(e.options, $, "getLeftLeafHeaders")), e.getRightLeafHeaders = C(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
211
+ var n;
212
+ return !((n = t.subHeaders) != null && n.length);
213
+ }), w(e.options, $, "getRightLeafHeaders")), e.getLeafHeaders = C(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
214
+ var r, l, i, u, a, g;
215
+ return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (u = t[0]) == null ? void 0 : u.headers) != null ? i : [], ...(a = (g = n[0]) == null ? void 0 : g.headers) != null ? a : []].map((f) => f.getLeafHeaders()).flat();
216
+ }, w(e.options, $, "getLeafHeaders"));
217
+ }
218
+ };
219
+ function K(e, o, t, n) {
220
+ var r, l;
221
+ let i = 0;
222
+ const u = function(d, s) {
223
+ s === void 0 && (s = 1), i = Math.max(i, s), d.filter((c) => c.getIsVisible()).forEach((c) => {
224
+ var p;
225
+ (p = c.columns) != null && p.length && u(c.columns, s + 1);
226
+ }, 0);
227
+ };
228
+ u(e);
229
+ let a = [];
230
+ const g = (d, s) => {
231
+ const c = {
232
+ depth: s,
233
+ id: [n, `${s}`].filter(Boolean).join("_"),
234
+ headers: []
235
+ }, p = [];
236
+ d.forEach((R) => {
237
+ const h = [...p].reverse()[0], v = R.column.depth === c.depth;
238
+ let S, F = !1;
239
+ if (v && R.column.parent ? S = R.column.parent : (S = R.column, F = !0), h && (h == null ? void 0 : h.column) === S)
240
+ h.subHeaders.push(R);
241
+ else {
242
+ const _ = Pe(t, S, {
243
+ id: [n, s, S.id, R == null ? void 0 : R.id].filter(Boolean).join("_"),
244
+ isPlaceholder: F,
245
+ placeholderId: F ? `${p.filter((x) => x.column === S).length}` : void 0,
246
+ depth: s,
247
+ index: p.length
248
+ });
249
+ _.subHeaders.push(R), p.push(_);
250
+ }
251
+ c.headers.push(R), R.headerGroup = c;
252
+ }), a.push(c), s > 0 && g(p, s - 1);
253
+ }, f = o.map((d, s) => Pe(t, d, {
254
+ depth: i,
255
+ index: s
256
+ }));
257
+ g(f, i - 1), a.reverse();
258
+ const m = (d) => d.filter((c) => c.column.getIsVisible()).map((c) => {
259
+ let p = 0, R = 0, h = [0];
260
+ c.subHeaders && c.subHeaders.length ? (h = [], m(c.subHeaders).forEach((S) => {
261
+ let {
262
+ colSpan: F,
263
+ rowSpan: _
264
+ } = S;
265
+ p += F, h.push(_);
266
+ })) : p = 1;
267
+ const v = Math.min(...h);
268
+ return R = R + v, c.colSpan = p, c.rowSpan = R, {
269
+ colSpan: p,
270
+ rowSpan: R
271
+ };
272
+ });
273
+ return m((r = (l = a[0]) == null ? void 0 : l.headers) != null ? r : []), a;
274
+ }
275
+ const ce = (e, o, t, n, r, l, i) => {
276
+ let u = {
277
+ id: o,
278
+ index: n,
279
+ original: t,
280
+ depth: r,
281
+ parentId: i,
282
+ _valuesCache: {},
283
+ _uniqueValuesCache: {},
284
+ getValue: (a) => {
285
+ if (u._valuesCache.hasOwnProperty(a))
286
+ return u._valuesCache[a];
287
+ const g = e.getColumn(a);
288
+ if (g != null && g.accessorFn)
289
+ return u._valuesCache[a] = g.accessorFn(u.original, n), u._valuesCache[a];
290
+ },
291
+ getUniqueValues: (a) => {
292
+ if (u._uniqueValuesCache.hasOwnProperty(a))
293
+ return u._uniqueValuesCache[a];
294
+ const g = e.getColumn(a);
295
+ if (g != null && g.accessorFn)
296
+ 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]);
297
+ },
298
+ renderValue: (a) => {
299
+ var g;
300
+ return (g = u.getValue(a)) != null ? g : e.options.renderFallbackValue;
301
+ },
302
+ subRows: [],
303
+ getLeafRows: () => at(u.subRows, (a) => a.subRows),
304
+ getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
305
+ getParentRows: () => {
306
+ let a = [], g = u;
307
+ for (; ; ) {
308
+ const f = g.getParentRow();
309
+ if (!f) break;
310
+ a.push(f), g = f;
311
+ }
312
+ return a.reverse();
313
+ },
314
+ getAllCells: C(() => [e.getAllLeafColumns()], (a) => a.map((g) => gt(e, u, g, g.id)), w(e.options, "debugRows", "getAllCells")),
315
+ _getAllCellsByColumnId: C(() => [u.getAllCells()], (a) => a.reduce((g, f) => (g[f.column.id] = f, g), {}), w(e.options, "debugRows", "getAllCellsByColumnId"))
316
+ };
317
+ for (let a = 0; a < e._features.length; a++) {
318
+ const g = e._features[a];
319
+ g == null || g.createRow == null || g.createRow(u, e);
320
+ }
321
+ return u;
322
+ }, ft = {
323
+ createColumn: (e, o) => {
324
+ 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 = () => {
325
+ if (e._getFacetedMinMaxValues)
326
+ return e._getFacetedMinMaxValues();
327
+ };
328
+ }
329
+ }, De = (e, o, t) => {
330
+ var n, r;
331
+ const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
332
+ return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
333
+ };
334
+ De.autoRemove = (e) => y(e);
335
+ const Ae = (e, o, t) => {
336
+ var n;
337
+ return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
338
+ };
339
+ Ae.autoRemove = (e) => y(e);
340
+ const He = (e, o, t) => {
341
+ var n;
342
+ return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
343
+ };
344
+ He.autoRemove = (e) => y(e);
345
+ const ze = (e, o, t) => {
346
+ var n;
347
+ return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
348
+ };
349
+ ze.autoRemove = (e) => y(e);
350
+ const Ge = (e, o, t) => !t.some((n) => {
351
+ var r;
352
+ return !((r = e.getValue(o)) != null && r.includes(n));
353
+ });
354
+ Ge.autoRemove = (e) => y(e) || !(e != null && e.length);
355
+ const Le = (e, o, t) => t.some((n) => {
356
+ var r;
357
+ return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
358
+ });
359
+ Le.autoRemove = (e) => y(e) || !(e != null && e.length);
360
+ const Oe = (e, o, t) => e.getValue(o) === t;
361
+ Oe.autoRemove = (e) => y(e);
362
+ const Te = (e, o, t) => e.getValue(o) == t;
363
+ Te.autoRemove = (e) => y(e);
364
+ const fe = (e, o, t) => {
365
+ let [n, r] = t;
366
+ const l = e.getValue(o);
367
+ return l >= n && l <= r;
368
+ };
369
+ fe.resolveFilterValue = (e) => {
370
+ let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, l = o === null || Number.isNaN(n) ? -1 / 0 : n, i = t === null || Number.isNaN(r) ? 1 / 0 : r;
371
+ if (l > i) {
372
+ const u = l;
373
+ l = i, i = u;
374
+ }
375
+ return [l, i];
376
+ };
377
+ fe.autoRemove = (e) => y(e) || y(e[0]) && y(e[1]);
378
+ const D = {
379
+ includesString: De,
380
+ includesStringSensitive: Ae,
381
+ equalsString: He,
382
+ arrIncludes: ze,
383
+ arrIncludesAll: Ge,
384
+ arrIncludesSome: Le,
385
+ equals: Oe,
386
+ weakEquals: Te,
387
+ inNumberRange: fe
388
+ };
389
+ function y(e) {
390
+ return e == null || e === "";
391
+ }
392
+ const pt = {
393
+ getDefaultColumnDef: () => ({
394
+ filterFn: "auto"
395
+ }),
396
+ getInitialState: (e) => ({
397
+ columnFilters: [],
398
+ ...e
399
+ }),
400
+ getDefaultOptions: (e) => ({
401
+ onColumnFiltersChange: P("columnFilters", e),
402
+ filterFromLeafRows: !1,
403
+ maxLeafRowFilterDepth: 100
404
+ }),
405
+ createColumn: (e, o) => {
406
+ e.getAutoFilterFn = () => {
407
+ const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
408
+ return typeof n == "string" ? D.includesString : typeof n == "number" ? D.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? D.equals : Array.isArray(n) ? D.arrIncludes : D.weakEquals;
409
+ }, e.getFilterFn = () => {
410
+ var t, n;
411
+ return Z(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
412
+ // @ts-ignore
413
+ (t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : D[e.columnDef.filterFn]
414
+ );
415
+ }, e.getCanFilter = () => {
416
+ var t, n, r;
417
+ return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && !!e.accessorFn;
418
+ }, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
419
+ var t;
420
+ return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
421
+ }, e.getFilterIndex = () => {
422
+ var t, n;
423
+ return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
424
+ }, e.setFilterValue = (t) => {
425
+ o.setColumnFilters((n) => {
426
+ const r = e.getFilterFn(), l = n == null ? void 0 : n.find((f) => f.id === e.id), i = H(t, l ? l.value : void 0);
427
+ if (Ie(r, i, e)) {
428
+ var u;
429
+ return (u = n == null ? void 0 : n.filter((f) => f.id !== e.id)) != null ? u : [];
430
+ }
431
+ const a = {
432
+ id: e.id,
433
+ value: i
434
+ };
435
+ if (l) {
436
+ var g;
437
+ return (g = n == null ? void 0 : n.map((f) => f.id === e.id ? a : f)) != null ? g : [];
438
+ }
439
+ return n != null && n.length ? [...n, a] : [a];
440
+ });
441
+ };
442
+ },
443
+ createRow: (e, o) => {
444
+ e.columnFilters = {}, e.columnFiltersMeta = {};
445
+ },
446
+ createTable: (e) => {
447
+ e.setColumnFilters = (o) => {
448
+ const t = e.getAllLeafColumns(), n = (r) => {
449
+ var l;
450
+ return (l = H(o, r)) == null ? void 0 : l.filter((i) => {
451
+ const u = t.find((a) => a.id === i.id);
452
+ if (u) {
453
+ const a = u.getFilterFn();
454
+ if (Ie(a, i.value, u))
455
+ return !1;
456
+ }
457
+ return !0;
458
+ });
459
+ };
460
+ e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
461
+ }, e.resetColumnFilters = (o) => {
462
+ var t, n;
463
+ e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
464
+ }, 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());
465
+ }
466
+ };
467
+ function Ie(e, o, t) {
468
+ return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
469
+ }
470
+ const mt = (e, o, t) => t.reduce((n, r) => {
471
+ const l = r.getValue(e);
472
+ return n + (typeof l == "number" ? l : 0);
473
+ }, 0), St = (e, o, t) => {
474
+ let n;
475
+ return t.forEach((r) => {
476
+ const l = r.getValue(e);
477
+ l != null && (n > l || n === void 0 && l >= l) && (n = l);
478
+ }), n;
479
+ }, Ct = (e, o, t) => {
480
+ let n;
481
+ return t.forEach((r) => {
482
+ const l = r.getValue(e);
483
+ l != null && (n < l || n === void 0 && l >= l) && (n = l);
484
+ }), n;
485
+ }, wt = (e, o, t) => {
486
+ let n, r;
487
+ return t.forEach((l) => {
488
+ const i = l.getValue(e);
489
+ i != null && (n === void 0 ? i >= i && (n = r = i) : (n > i && (n = i), r < i && (r = i)));
490
+ }), [n, r];
491
+ }, Rt = (e, o) => {
492
+ let t = 0, n = 0;
493
+ if (o.forEach((r) => {
494
+ let l = r.getValue(e);
495
+ l != null && (l = +l) >= l && (++t, n += l);
496
+ }), t) return n / t;
497
+ }, ht = (e, o) => {
498
+ if (!o.length)
499
+ return;
500
+ const t = o.map((l) => l.getValue(e));
501
+ if (!ut(t))
502
+ return;
503
+ if (t.length === 1)
504
+ return t[0];
505
+ const n = Math.floor(t.length / 2), r = t.sort((l, i) => l - i);
506
+ return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
507
+ }, vt = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), _t = (e, o) => new Set(o.map((t) => t.getValue(e))).size, Ft = (e, o) => o.length, b = {
508
+ sum: mt,
509
+ min: St,
510
+ max: Ct,
511
+ extent: wt,
512
+ mean: Rt,
513
+ median: ht,
514
+ unique: vt,
515
+ uniqueCount: _t,
516
+ count: Ft
517
+ }, xt = {
518
+ getDefaultColumnDef: () => ({
519
+ aggregatedCell: (e) => {
520
+ var o, t;
521
+ return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
522
+ },
523
+ aggregationFn: "auto"
524
+ }),
525
+ getInitialState: (e) => ({
526
+ grouping: [],
527
+ ...e
528
+ }),
529
+ getDefaultOptions: (e) => ({
530
+ onGroupingChange: P("grouping", e),
531
+ groupedColumnMode: "reorder"
532
+ }),
533
+ createColumn: (e, o) => {
534
+ e.toggleGrouping = () => {
535
+ o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
536
+ }, e.getCanGroup = () => {
537
+ var t, n;
538
+ return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
539
+ }, e.getIsGrouped = () => {
540
+ var t;
541
+ return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
542
+ }, e.getGroupedIndex = () => {
543
+ var t;
544
+ return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
545
+ }, e.getToggleGroupingHandler = () => {
546
+ const t = e.getCanGroup();
547
+ return () => {
548
+ t && e.toggleGrouping();
549
+ };
550
+ }, e.getAutoAggregationFn = () => {
551
+ const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
552
+ if (typeof n == "number")
553
+ return b.sum;
554
+ if (Object.prototype.toString.call(n) === "[object Date]")
555
+ return b.extent;
556
+ }, e.getAggregationFn = () => {
557
+ var t, n;
558
+ if (!e)
559
+ throw new Error();
560
+ return Z(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 : b[e.columnDef.aggregationFn];
561
+ };
562
+ },
563
+ createTable: (e) => {
564
+ e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
565
+ var t, n;
566
+ e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
567
+ }, 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());
568
+ },
569
+ createRow: (e, o) => {
570
+ e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
571
+ if (e._groupingValuesCache.hasOwnProperty(t))
572
+ return e._groupingValuesCache[t];
573
+ const n = o.getColumn(t);
574
+ return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
575
+ }, e._groupingValuesCache = {};
576
+ },
577
+ createCell: (e, o, t, n) => {
578
+ e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
579
+ var r;
580
+ return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((r = t.subRows) != null && r.length);
581
+ };
582
+ }
583
+ };
584
+ function $t(e, o, t) {
585
+ if (!(o != null && o.length) || !t)
586
+ return e;
587
+ const n = e.filter((l) => !o.includes(l.id));
588
+ return t === "remove" ? n : [...o.map((l) => e.find((i) => i.id === l)).filter(Boolean), ...n];
589
+ }
590
+ const Pt = {
591
+ getInitialState: (e) => ({
592
+ columnOrder: [],
593
+ ...e
594
+ }),
595
+ getDefaultOptions: (e) => ({
596
+ onColumnOrderChange: P("columnOrder", e)
597
+ }),
598
+ createColumn: (e, o) => {
599
+ e.getIndex = C((t) => [j(o, t)], (t) => t.findIndex((n) => n.id === e.id), w(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
600
+ var n;
601
+ return ((n = j(o, t)[0]) == null ? void 0 : n.id) === e.id;
602
+ }, e.getIsLastColumn = (t) => {
603
+ var n;
604
+ const r = j(o, t);
605
+ return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
606
+ };
607
+ },
608
+ createTable: (e) => {
609
+ e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
610
+ var t;
611
+ e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
612
+ }, e._getOrderColumnsFn = C(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
613
+ let l = [];
614
+ if (!(o != null && o.length))
615
+ l = r;
616
+ else {
617
+ const i = [...o], u = [...r];
618
+ for (; u.length && i.length; ) {
619
+ const a = i.shift(), g = u.findIndex((f) => f.id === a);
620
+ g > -1 && l.push(u.splice(g, 1)[0]);
621
+ }
622
+ l = [...l, ...u];
623
+ }
624
+ return $t(l, t, n);
625
+ }, w(e.options, "debugTable", "_getOrderColumnsFn"));
626
+ }
627
+ }, ee = () => ({
628
+ left: [],
629
+ right: []
630
+ }), It = {
631
+ getInitialState: (e) => ({
632
+ columnPinning: ee(),
633
+ ...e
634
+ }),
635
+ getDefaultOptions: (e) => ({
636
+ onColumnPinningChange: P("columnPinning", e)
637
+ }),
638
+ createColumn: (e, o) => {
639
+ e.pin = (t) => {
640
+ const n = e.getLeafColumns().map((r) => r.id).filter(Boolean);
641
+ o.setColumnPinning((r) => {
642
+ var l, i;
643
+ if (t === "right") {
644
+ var u, a;
645
+ return {
646
+ left: ((u = r == null ? void 0 : r.left) != null ? u : []).filter((m) => !(n != null && n.includes(m))),
647
+ right: [...((a = r == null ? void 0 : r.right) != null ? a : []).filter((m) => !(n != null && n.includes(m))), ...n]
648
+ };
649
+ }
650
+ if (t === "left") {
651
+ var g, f;
652
+ return {
653
+ left: [...((g = r == null ? void 0 : r.left) != null ? g : []).filter((m) => !(n != null && n.includes(m))), ...n],
654
+ right: ((f = r == null ? void 0 : r.right) != null ? f : []).filter((m) => !(n != null && n.includes(m)))
655
+ };
656
+ }
657
+ return {
658
+ left: ((l = r == null ? void 0 : r.left) != null ? l : []).filter((m) => !(n != null && n.includes(m))),
659
+ right: ((i = r == null ? void 0 : r.right) != null ? i : []).filter((m) => !(n != null && n.includes(m)))
660
+ };
661
+ });
662
+ }, e.getCanPin = () => e.getLeafColumns().some((n) => {
663
+ var r, l, i;
664
+ return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((l = (i = o.options.enableColumnPinning) != null ? i : o.options.enablePinning) != null ? l : !0);
665
+ }), e.getIsPinned = () => {
666
+ const t = e.getLeafColumns().map((u) => u.id), {
667
+ left: n,
668
+ right: r
669
+ } = o.getState().columnPinning, l = t.some((u) => n == null ? void 0 : n.includes(u)), i = t.some((u) => r == null ? void 0 : r.includes(u));
670
+ return l ? "left" : i ? "right" : !1;
671
+ }, e.getPinnedIndex = () => {
672
+ var t, n;
673
+ const r = e.getIsPinned();
674
+ return r ? (t = (n = o.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
675
+ };
676
+ },
677
+ createRow: (e, o) => {
678
+ e.getCenterVisibleCells = C(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
679
+ const l = [...n ?? [], ...r ?? []];
680
+ return t.filter((i) => !l.includes(i.column.id));
681
+ }, w(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = C(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
682
+ ...l,
683
+ position: "left"
684
+ })), w(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = C(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
685
+ ...l,
686
+ position: "right"
687
+ })), w(o.options, "debugRows", "getRightVisibleCells"));
688
+ },
689
+ createTable: (e) => {
690
+ e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
691
+ var t, n;
692
+ return e.setColumnPinning(o ? ee() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : ee());
693
+ }, e.getIsSomeColumnsPinned = (o) => {
694
+ var t;
695
+ const n = e.getState().columnPinning;
696
+ if (!o) {
697
+ var r, l;
698
+ return !!((r = n.left) != null && r.length || (l = n.right) != null && l.length);
699
+ }
700
+ return !!((t = n[o]) != null && t.length);
701
+ }, e.getLeftLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), w(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), w(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
702
+ const r = [...t ?? [], ...n ?? []];
703
+ return o.filter((l) => !r.includes(l.id));
704
+ }, w(e.options, "debugColumns", "getCenterLeafColumns"));
705
+ }
706
+ };
707
+ function Mt(e) {
708
+ return e || (typeof document < "u" ? document : null);
709
+ }
710
+ const W = {
711
+ size: 150,
712
+ minSize: 20,
713
+ maxSize: Number.MAX_SAFE_INTEGER
714
+ }, te = () => ({
715
+ startOffset: null,
716
+ startSize: null,
717
+ deltaOffset: null,
718
+ deltaPercentage: null,
719
+ isResizingColumn: !1,
720
+ columnSizingStart: []
721
+ }), yt = {
722
+ getDefaultColumnDef: () => W,
723
+ getInitialState: (e) => ({
724
+ columnSizing: {},
725
+ columnSizingInfo: te(),
726
+ ...e
727
+ }),
728
+ getDefaultOptions: (e) => ({
729
+ columnResizeMode: "onEnd",
730
+ columnResizeDirection: "ltr",
731
+ onColumnSizingChange: P("columnSizing", e),
732
+ onColumnSizingInfoChange: P("columnSizingInfo", e)
733
+ }),
734
+ createColumn: (e, o) => {
735
+ e.getSize = () => {
736
+ var t, n, r;
737
+ const l = o.getState().columnSizing[e.id];
738
+ return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : W.minSize, (n = l ?? e.columnDef.size) != null ? n : W.size), (r = e.columnDef.maxSize) != null ? r : W.maxSize);
739
+ }, e.getStart = C((t) => [t, j(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), w(o.options, "debugColumns", "getStart")), e.getAfter = C((t) => [t, j(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), w(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
740
+ o.setColumnSizing((t) => {
741
+ let {
742
+ [e.id]: n,
743
+ ...r
744
+ } = t;
745
+ return r;
746
+ });
747
+ }, e.getCanResize = () => {
748
+ var t, n;
749
+ return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
750
+ }, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
751
+ },
752
+ createHeader: (e, o) => {
753
+ e.getSize = () => {
754
+ let t = 0;
755
+ const n = (r) => {
756
+ if (r.subHeaders.length)
757
+ r.subHeaders.forEach(n);
758
+ else {
759
+ var l;
760
+ t += (l = r.column.getSize()) != null ? l : 0;
761
+ }
762
+ };
763
+ return n(e), t;
764
+ }, e.getStart = () => {
765
+ if (e.index > 0) {
766
+ const t = e.headerGroup.headers[e.index - 1];
767
+ return t.getStart() + t.getSize();
768
+ }
769
+ return 0;
770
+ }, e.getResizeHandler = (t) => {
771
+ const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
772
+ return (l) => {
773
+ if (!n || !r || (l.persist == null || l.persist(), ne(l) && l.touches && l.touches.length > 1))
774
+ return;
775
+ const i = e.getSize(), u = e ? e.getLeafHeaders().map((h) => [h.column.id, h.column.getSize()]) : [[n.id, n.getSize()]], a = ne(l) ? Math.round(l.touches[0].clientX) : l.clientX, g = {}, f = (h, v) => {
776
+ typeof v == "number" && (o.setColumnSizingInfo((S) => {
777
+ var F, _;
778
+ const x = o.options.columnResizeDirection === "rtl" ? -1 : 1, V = (v - ((F = S == null ? void 0 : S.startOffset) != null ? F : 0)) * x, Se = Math.max(V / ((_ = S == null ? void 0 : S.startSize) != null ? _ : 0), -0.999999);
779
+ return S.columnSizingStart.forEach((Ue) => {
780
+ let [Xe, Ce] = Ue;
781
+ g[Xe] = Math.round(Math.max(Ce + Ce * Se, 0) * 100) / 100;
782
+ }), {
783
+ ...S,
784
+ deltaOffset: V,
785
+ deltaPercentage: Se
786
+ };
787
+ }), (o.options.columnResizeMode === "onChange" || h === "end") && o.setColumnSizing((S) => ({
788
+ ...S,
789
+ ...g
790
+ })));
791
+ }, m = (h) => f("move", h), d = (h) => {
792
+ f("end", h), o.setColumnSizingInfo((v) => ({
793
+ ...v,
794
+ isResizingColumn: !1,
795
+ startOffset: null,
796
+ startSize: null,
797
+ deltaOffset: null,
798
+ deltaPercentage: null,
799
+ columnSizingStart: []
800
+ }));
801
+ }, s = Mt(t), c = {
802
+ moveHandler: (h) => m(h.clientX),
803
+ upHandler: (h) => {
804
+ s == null || s.removeEventListener("mousemove", c.moveHandler), s == null || s.removeEventListener("mouseup", c.upHandler), d(h.clientX);
805
+ }
806
+ }, p = {
807
+ moveHandler: (h) => (h.cancelable && (h.preventDefault(), h.stopPropagation()), m(h.touches[0].clientX), !1),
808
+ upHandler: (h) => {
809
+ var v;
810
+ s == null || s.removeEventListener("touchmove", p.moveHandler), s == null || s.removeEventListener("touchend", p.upHandler), h.cancelable && (h.preventDefault(), h.stopPropagation()), d((v = h.touches[0]) == null ? void 0 : v.clientX);
811
+ }
812
+ }, R = Vt() ? {
813
+ passive: !1
814
+ } : !1;
815
+ ne(l) ? (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((h) => ({
816
+ ...h,
817
+ startOffset: a,
818
+ startSize: i,
819
+ deltaOffset: 0,
820
+ deltaPercentage: 0,
821
+ columnSizingStart: u,
822
+ isResizingColumn: n.id
823
+ }));
824
+ };
825
+ };
826
+ },
827
+ createTable: (e) => {
828
+ 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) => {
829
+ var t;
830
+ e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
831
+ }, e.resetHeaderSizeInfo = (o) => {
832
+ var t;
833
+ e.setColumnSizingInfo(o ? te() : (t = e.initialState.columnSizingInfo) != null ? t : te());
834
+ }, e.getTotalSize = () => {
835
+ var o, t;
836
+ return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
837
+ }, e.getLeftTotalSize = () => {
838
+ var o, t;
839
+ return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
840
+ }, e.getCenterTotalSize = () => {
841
+ var o, t;
842
+ return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
843
+ }, e.getRightTotalSize = () => {
844
+ var o, t;
845
+ return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
846
+ };
847
+ }
848
+ };
849
+ let J = null;
850
+ function Vt() {
851
+ if (typeof J == "boolean") return J;
852
+ let e = !1;
853
+ try {
854
+ const o = {
855
+ get passive() {
856
+ return e = !0, !1;
857
+ }
858
+ }, t = () => {
859
+ };
860
+ window.addEventListener("test", t, o), window.removeEventListener("test", t);
861
+ } catch {
862
+ e = !1;
863
+ }
864
+ return J = e, J;
865
+ }
866
+ function ne(e) {
867
+ return e.type === "touchstart";
868
+ }
869
+ const Et = {
870
+ getInitialState: (e) => ({
871
+ columnVisibility: {},
872
+ ...e
873
+ }),
874
+ getDefaultOptions: (e) => ({
875
+ onColumnVisibilityChange: P("columnVisibility", e)
876
+ }),
877
+ createColumn: (e, o) => {
878
+ e.toggleVisibility = (t) => {
879
+ e.getCanHide() && o.setColumnVisibility((n) => ({
880
+ ...n,
881
+ [e.id]: t ?? !e.getIsVisible()
882
+ }));
883
+ }, e.getIsVisible = () => {
884
+ var t, n;
885
+ const r = e.columns;
886
+ return (t = r.length ? r.some((l) => l.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
887
+ }, e.getCanHide = () => {
888
+ var t, n;
889
+ return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
890
+ }, e.getToggleVisibilityHandler = () => (t) => {
891
+ e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
892
+ };
893
+ },
894
+ createRow: (e, o) => {
895
+ e._getAllVisibleCells = C(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), w(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = C(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], w(o.options, "debugRows", "getVisibleCells"));
896
+ },
897
+ createTable: (e) => {
898
+ const o = (t, n) => C(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), w(e.options, "debugColumns", t));
899
+ 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) => {
900
+ var n;
901
+ e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
902
+ }, e.toggleAllColumnsVisible = (t) => {
903
+ var n;
904
+ t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((r, l) => ({
905
+ ...r,
906
+ [l.id]: t || !(l.getCanHide != null && l.getCanHide())
907
+ }), {}));
908
+ }, 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) => {
909
+ var n;
910
+ e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
911
+ };
912
+ }
913
+ };
914
+ function j(e, o) {
915
+ return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
916
+ }
917
+ const Dt = {
918
+ createTable: (e) => {
919
+ 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 = () => {
920
+ if (e._getGlobalFacetedMinMaxValues)
921
+ return e._getGlobalFacetedMinMaxValues();
922
+ };
923
+ }
924
+ }, At = {
925
+ getInitialState: (e) => ({
926
+ globalFilter: void 0,
927
+ ...e
928
+ }),
929
+ getDefaultOptions: (e) => ({
930
+ onGlobalFilterChange: P("globalFilter", e),
931
+ globalFilterFn: "auto",
932
+ getColumnCanGlobalFilter: (o) => {
933
+ var t;
934
+ const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
935
+ return typeof n == "string" || typeof n == "number";
936
+ }
937
+ }),
938
+ createColumn: (e, o) => {
939
+ e.getCanGlobalFilter = () => {
940
+ var t, n, r, l;
941
+ return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && ((l = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? l : !0) && !!e.accessorFn;
942
+ };
943
+ },
944
+ createTable: (e) => {
945
+ e.getGlobalAutoFilterFn = () => D.includesString, e.getGlobalFilterFn = () => {
946
+ var o, t;
947
+ const {
948
+ globalFilterFn: n
949
+ } = e.options;
950
+ return Z(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : D[n];
951
+ }, e.setGlobalFilter = (o) => {
952
+ e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
953
+ }, e.resetGlobalFilter = (o) => {
954
+ e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
955
+ };
956
+ }
957
+ }, Ht = {
958
+ getInitialState: (e) => ({
959
+ expanded: {},
960
+ ...e
961
+ }),
962
+ getDefaultOptions: (e) => ({
963
+ onExpandedChange: P("expanded", e),
964
+ paginateExpandedRows: !0
965
+ }),
966
+ createTable: (e) => {
967
+ let o = !1, t = !1;
968
+ e._autoResetExpanded = () => {
969
+ var n, r;
970
+ if (!o) {
971
+ e._queue(() => {
972
+ o = !0;
973
+ });
974
+ return;
975
+ }
976
+ if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
977
+ if (t) return;
978
+ t = !0, e._queue(() => {
979
+ e.resetExpanded(), t = !1;
980
+ });
981
+ }
982
+ }, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
983
+ n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
984
+ }, e.resetExpanded = (n) => {
985
+ var r, l;
986
+ e.setExpanded(n ? {} : (r = (l = e.initialState) == null ? void 0 : l.expanded) != null ? r : {});
987
+ }, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
988
+ n.persist == null || n.persist(), e.toggleAllRowsExpanded();
989
+ }, e.getIsSomeRowsExpanded = () => {
990
+ const n = e.getState().expanded;
991
+ return n === !0 || Object.values(n).some(Boolean);
992
+ }, e.getIsAllRowsExpanded = () => {
993
+ const n = e.getState().expanded;
994
+ return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((r) => !r.getIsExpanded()));
995
+ }, e.getExpandedDepth = () => {
996
+ let n = 0;
997
+ return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((l) => {
998
+ const i = l.split(".");
999
+ n = Math.max(n, i.length);
1000
+ }), n;
1001
+ }, 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());
1002
+ },
1003
+ createRow: (e, o) => {
1004
+ e.toggleExpanded = (t) => {
1005
+ o.setExpanded((n) => {
1006
+ var r;
1007
+ const l = n === !0 ? !0 : !!(n != null && n[e.id]);
1008
+ let i = {};
1009
+ if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((u) => {
1010
+ i[u] = !0;
1011
+ }) : i = n, t = (r = t) != null ? r : !l, !l && t)
1012
+ return {
1013
+ ...i,
1014
+ [e.id]: !0
1015
+ };
1016
+ if (l && !t) {
1017
+ const {
1018
+ [e.id]: u,
1019
+ ...a
1020
+ } = i;
1021
+ return a;
1022
+ }
1023
+ return n;
1024
+ });
1025
+ }, e.getIsExpanded = () => {
1026
+ var t;
1027
+ const n = o.getState().expanded;
1028
+ return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
1029
+ }, e.getCanExpand = () => {
1030
+ var t, n, r;
1031
+ 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);
1032
+ }, e.getIsAllParentsExpanded = () => {
1033
+ let t = !0, n = e;
1034
+ for (; t && n.parentId; )
1035
+ n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
1036
+ return t;
1037
+ }, e.getToggleExpandedHandler = () => {
1038
+ const t = e.getCanExpand();
1039
+ return () => {
1040
+ t && e.toggleExpanded();
1041
+ };
1042
+ };
1043
+ }
1044
+ }, se = 0, ue = 10, oe = () => ({
1045
+ pageIndex: se,
1046
+ pageSize: ue
1047
+ }), zt = {
1048
+ getInitialState: (e) => ({
1049
+ ...e,
1050
+ pagination: {
1051
+ ...oe(),
1052
+ ...e == null ? void 0 : e.pagination
1053
+ }
1054
+ }),
1055
+ getDefaultOptions: (e) => ({
1056
+ onPaginationChange: P("pagination", e)
1057
+ }),
1058
+ createTable: (e) => {
1059
+ let o = !1, t = !1;
1060
+ e._autoResetPageIndex = () => {
1061
+ var n, r;
1062
+ if (!o) {
1063
+ e._queue(() => {
1064
+ o = !0;
1065
+ });
1066
+ return;
1067
+ }
1068
+ if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
1069
+ if (t) return;
1070
+ t = !0, e._queue(() => {
1071
+ e.resetPageIndex(), t = !1;
1072
+ });
1073
+ }
1074
+ }, e.setPagination = (n) => {
1075
+ const r = (l) => H(n, l);
1076
+ return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
1077
+ }, e.resetPagination = (n) => {
1078
+ var r;
1079
+ e.setPagination(n ? oe() : (r = e.initialState.pagination) != null ? r : oe());
1080
+ }, e.setPageIndex = (n) => {
1081
+ e.setPagination((r) => {
1082
+ let l = H(n, r.pageIndex);
1083
+ const i = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1084
+ return l = Math.max(0, Math.min(l, i)), {
1085
+ ...r,
1086
+ pageIndex: l
1087
+ };
1088
+ });
1089
+ }, e.resetPageIndex = (n) => {
1090
+ var r, l;
1091
+ e.setPageIndex(n ? se : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : se);
1092
+ }, e.resetPageSize = (n) => {
1093
+ var r, l;
1094
+ e.setPageSize(n ? ue : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : ue);
1095
+ }, e.setPageSize = (n) => {
1096
+ e.setPagination((r) => {
1097
+ const l = Math.max(1, H(n, r.pageSize)), i = r.pageSize * r.pageIndex, u = Math.floor(i / l);
1098
+ return {
1099
+ ...r,
1100
+ pageIndex: u,
1101
+ pageSize: l
1102
+ };
1103
+ });
1104
+ }, e.setPageCount = (n) => e.setPagination((r) => {
1105
+ var l;
1106
+ let i = H(n, (l = e.options.pageCount) != null ? l : -1);
1107
+ return typeof i == "number" && (i = Math.max(-1, i)), {
1108
+ ...r,
1109
+ pageCount: i
1110
+ };
1111
+ }), e.getPageOptions = C(() => [e.getPageCount()], (n) => {
1112
+ let r = [];
1113
+ return n && n > 0 && (r = [...new Array(n)].fill(null).map((l, i) => i)), r;
1114
+ }, w(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1115
+ const {
1116
+ pageIndex: n
1117
+ } = e.getState().pagination, r = e.getPageCount();
1118
+ return r === -1 ? !0 : r === 0 ? !1 : n < r - 1;
1119
+ }, 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 = () => {
1120
+ var n;
1121
+ return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
1122
+ }, e.getRowCount = () => {
1123
+ var n;
1124
+ return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
1125
+ };
1126
+ }
1127
+ }, re = () => ({
1128
+ top: [],
1129
+ bottom: []
1130
+ }), Gt = {
1131
+ getInitialState: (e) => ({
1132
+ rowPinning: re(),
1133
+ ...e
1134
+ }),
1135
+ getDefaultOptions: (e) => ({
1136
+ onRowPinningChange: P("rowPinning", e)
1137
+ }),
1138
+ createRow: (e, o) => {
1139
+ e.pin = (t, n, r) => {
1140
+ const l = n ? e.getLeafRows().map((a) => {
1141
+ let {
1142
+ id: g
1143
+ } = a;
1144
+ return g;
1145
+ }) : [], i = r ? e.getParentRows().map((a) => {
1146
+ let {
1147
+ id: g
1148
+ } = a;
1149
+ return g;
1150
+ }) : [], u = /* @__PURE__ */ new Set([...i, e.id, ...l]);
1151
+ o.setRowPinning((a) => {
1152
+ var g, f;
1153
+ if (t === "bottom") {
1154
+ var m, d;
1155
+ return {
1156
+ top: ((m = a == null ? void 0 : a.top) != null ? m : []).filter((p) => !(u != null && u.has(p))),
1157
+ bottom: [...((d = a == null ? void 0 : a.bottom) != null ? d : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)]
1158
+ };
1159
+ }
1160
+ if (t === "top") {
1161
+ var s, c;
1162
+ return {
1163
+ top: [...((s = a == null ? void 0 : a.top) != null ? s : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)],
1164
+ bottom: ((c = a == null ? void 0 : a.bottom) != null ? c : []).filter((p) => !(u != null && u.has(p)))
1165
+ };
1166
+ }
1167
+ return {
1168
+ top: ((g = a == null ? void 0 : a.top) != null ? g : []).filter((p) => !(u != null && u.has(p))),
1169
+ bottom: ((f = a == null ? void 0 : a.bottom) != null ? f : []).filter((p) => !(u != null && u.has(p)))
1170
+ };
1171
+ });
1172
+ }, e.getCanPin = () => {
1173
+ var t;
1174
+ const {
1175
+ enableRowPinning: n,
1176
+ enablePinning: r
1177
+ } = o.options;
1178
+ return typeof n == "function" ? n(e) : (t = n ?? r) != null ? t : !0;
1179
+ }, e.getIsPinned = () => {
1180
+ const t = [e.id], {
1181
+ top: n,
1182
+ bottom: r
1183
+ } = o.getState().rowPinning, l = t.some((u) => n == null ? void 0 : n.includes(u)), i = t.some((u) => r == null ? void 0 : r.includes(u));
1184
+ return l ? "top" : i ? "bottom" : !1;
1185
+ }, e.getPinnedIndex = () => {
1186
+ var t, n;
1187
+ const r = e.getIsPinned();
1188
+ if (!r) return -1;
1189
+ const l = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((i) => {
1190
+ let {
1191
+ id: u
1192
+ } = i;
1193
+ return u;
1194
+ });
1195
+ return (n = l == null ? void 0 : l.indexOf(e.id)) != null ? n : -1;
1196
+ };
1197
+ },
1198
+ createTable: (e) => {
1199
+ e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
1200
+ var t, n;
1201
+ return e.setRowPinning(o ? re() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : re());
1202
+ }, e.getIsSomeRowsPinned = (o) => {
1203
+ var t;
1204
+ const n = e.getState().rowPinning;
1205
+ if (!o) {
1206
+ var r, l;
1207
+ return !!((r = n.top) != null && r.length || (l = n.bottom) != null && l.length);
1208
+ }
1209
+ return !!((t = n[o]) != null && t.length);
1210
+ }, e._getPinnedRows = (o, t, n) => {
1211
+ var r;
1212
+ return ((r = e.options.keepPinnedRows) == null || r ? (
1213
+ //get all rows that are pinned even if they would not be otherwise visible
1214
+ //account for expanded parent rows, but not pagination or filtering
1215
+ (t ?? []).map((i) => {
1216
+ const u = e.getRow(i, !0);
1217
+ return u.getIsAllParentsExpanded() ? u : null;
1218
+ })
1219
+ ) : (
1220
+ //else get only visible rows that are pinned
1221
+ (t ?? []).map((i) => o.find((u) => u.id === i))
1222
+ )).filter(Boolean).map((i) => ({
1223
+ ...i,
1224
+ position: n
1225
+ }));
1226
+ }, e.getTopRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), w(e.options, "debugRows", "getTopRows")), e.getBottomRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), w(e.options, "debugRows", "getBottomRows")), e.getCenterRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
1227
+ const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1228
+ return o.filter((l) => !r.has(l.id));
1229
+ }, w(e.options, "debugRows", "getCenterRows"));
1230
+ }
1231
+ }, Lt = {
1232
+ getInitialState: (e) => ({
1233
+ rowSelection: {},
1234
+ ...e
1235
+ }),
1236
+ getDefaultOptions: (e) => ({
1237
+ onRowSelectionChange: P("rowSelection", e),
1238
+ enableRowSelection: !0,
1239
+ enableMultiRowSelection: !0,
1240
+ enableSubRowSelection: !0
1241
+ // enableGroupingRowSelection: false,
1242
+ // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
1243
+ // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
1244
+ }),
1245
+ createTable: (e) => {
1246
+ e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
1247
+ var t;
1248
+ return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
1249
+ }, e.toggleAllRowsSelected = (o) => {
1250
+ e.setRowSelection((t) => {
1251
+ o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
1252
+ const n = {
1253
+ ...t
1254
+ }, r = e.getPreGroupedRowModel().flatRows;
1255
+ return o ? r.forEach((l) => {
1256
+ l.getCanSelect() && (n[l.id] = !0);
1257
+ }) : r.forEach((l) => {
1258
+ delete n[l.id];
1259
+ }), n;
1260
+ });
1261
+ }, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
1262
+ const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), r = {
1263
+ ...t
1264
+ };
1265
+ return e.getRowModel().rows.forEach((l) => {
1266
+ ae(r, l.id, n, !0, e);
1267
+ }), r;
1268
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? le(e, t) : {
1269
+ rows: [],
1270
+ flatRows: [],
1271
+ rowsById: {}
1272
+ }, w(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? le(e, t) : {
1273
+ rows: [],
1274
+ flatRows: [],
1275
+ rowsById: {}
1276
+ }, w(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? le(e, t) : {
1277
+ rows: [],
1278
+ flatRows: [],
1279
+ rowsById: {}
1280
+ }, w(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
1281
+ const o = e.getFilteredRowModel().flatRows, {
1282
+ rowSelection: t
1283
+ } = e.getState();
1284
+ let n = !!(o.length && Object.keys(t).length);
1285
+ return n && o.some((r) => r.getCanSelect() && !t[r.id]) && (n = !1), n;
1286
+ }, e.getIsAllPageRowsSelected = () => {
1287
+ const o = e.getPaginationRowModel().flatRows.filter((r) => r.getCanSelect()), {
1288
+ rowSelection: t
1289
+ } = e.getState();
1290
+ let n = !!o.length;
1291
+ return n && o.some((r) => !t[r.id]) && (n = !1), n;
1292
+ }, e.getIsSomeRowsSelected = () => {
1293
+ var o;
1294
+ const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
1295
+ return t > 0 && t < e.getFilteredRowModel().flatRows.length;
1296
+ }, e.getIsSomePageRowsSelected = () => {
1297
+ const o = e.getPaginationRowModel().flatRows;
1298
+ return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
1299
+ }, e.getToggleAllRowsSelectedHandler = () => (o) => {
1300
+ e.toggleAllRowsSelected(o.target.checked);
1301
+ }, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
1302
+ e.toggleAllPageRowsSelected(o.target.checked);
1303
+ };
1304
+ },
1305
+ createRow: (e, o) => {
1306
+ e.toggleSelected = (t, n) => {
1307
+ const r = e.getIsSelected();
1308
+ o.setRowSelection((l) => {
1309
+ var i;
1310
+ if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
1311
+ return l;
1312
+ const u = {
1313
+ ...l
1314
+ };
1315
+ return ae(u, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), u;
1316
+ });
1317
+ }, e.getIsSelected = () => {
1318
+ const {
1319
+ rowSelection: t
1320
+ } = o.getState();
1321
+ return pe(e, t);
1322
+ }, e.getIsSomeSelected = () => {
1323
+ const {
1324
+ rowSelection: t
1325
+ } = o.getState();
1326
+ return ge(e, t) === "some";
1327
+ }, e.getIsAllSubRowsSelected = () => {
1328
+ const {
1329
+ rowSelection: t
1330
+ } = o.getState();
1331
+ return ge(e, t) === "all";
1332
+ }, e.getCanSelect = () => {
1333
+ var t;
1334
+ return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
1335
+ }, e.getCanSelectSubRows = () => {
1336
+ var t;
1337
+ return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
1338
+ }, e.getCanMultiSelect = () => {
1339
+ var t;
1340
+ return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
1341
+ }, e.getToggleSelectedHandler = () => {
1342
+ const t = e.getCanSelect();
1343
+ return (n) => {
1344
+ var r;
1345
+ t && e.toggleSelected((r = n.target) == null ? void 0 : r.checked);
1346
+ };
1347
+ };
1348
+ }
1349
+ }, ae = (e, o, t, n, r) => {
1350
+ var l;
1351
+ const i = r.getRow(o, !0);
1352
+ t ? (i.getCanMultiSelect() || Object.keys(e).forEach((u) => delete e[u]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((u) => ae(e, u.id, t, n, r));
1353
+ };
1354
+ function le(e, o) {
1355
+ const t = e.getState().rowSelection, n = [], r = {}, l = function(i, u) {
1356
+ return i.map((a) => {
1357
+ var g;
1358
+ const f = pe(a, t);
1359
+ if (f && (n.push(a), r[a.id] = a), (g = a.subRows) != null && g.length && (a = {
1360
+ ...a,
1361
+ subRows: l(a.subRows)
1362
+ }), f)
1363
+ return a;
1364
+ }).filter(Boolean);
1365
+ };
1366
+ return {
1367
+ rows: l(o.rows),
1368
+ flatRows: n,
1369
+ rowsById: r
1370
+ };
1371
+ }
1372
+ function pe(e, o) {
1373
+ var t;
1374
+ return (t = o[e.id]) != null ? t : !1;
1375
+ }
1376
+ function ge(e, o, t) {
1377
+ var n;
1378
+ if (!((n = e.subRows) != null && n.length)) return !1;
1379
+ let r = !0, l = !1;
1380
+ return e.subRows.forEach((i) => {
1381
+ if (!(l && !r) && (i.getCanSelect() && (pe(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
1382
+ const u = ge(i, o);
1383
+ u === "all" ? l = !0 : (u === "some" && (l = !0), r = !1);
1384
+ }
1385
+ }), r ? "all" : l ? "some" : !1;
1386
+ }
1387
+ const de = /([0-9]+)/gm, Ot = (e, o, t) => Be(G(e.getValue(t)).toLowerCase(), G(o.getValue(t)).toLowerCase()), Tt = (e, o, t) => Be(G(e.getValue(t)), G(o.getValue(t))), Bt = (e, o, t) => me(G(e.getValue(t)).toLowerCase(), G(o.getValue(t)).toLowerCase()), kt = (e, o, t) => me(G(e.getValue(t)), G(o.getValue(t))), Nt = (e, o, t) => {
1388
+ const n = e.getValue(t), r = o.getValue(t);
1389
+ return n > r ? 1 : n < r ? -1 : 0;
1390
+ }, qt = (e, o, t) => me(e.getValue(t), o.getValue(t));
1391
+ function me(e, o) {
1392
+ return e === o ? 0 : e > o ? 1 : -1;
1393
+ }
1394
+ function G(e) {
1395
+ return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
1396
+ }
1397
+ function Be(e, o) {
1398
+ const t = e.split(de).filter(Boolean), n = o.split(de).filter(Boolean);
1399
+ for (; t.length && n.length; ) {
1400
+ const r = t.shift(), l = n.shift(), i = parseInt(r, 10), u = parseInt(l, 10), a = [i, u].sort();
1401
+ if (isNaN(a[0])) {
1402
+ if (r > l)
1403
+ return 1;
1404
+ if (l > r)
1405
+ return -1;
1406
+ continue;
1407
+ }
1408
+ if (isNaN(a[1]))
1409
+ return isNaN(i) ? -1 : 1;
1410
+ if (i > u)
1411
+ return 1;
1412
+ if (u > i)
1413
+ return -1;
1414
+ }
1415
+ return t.length - n.length;
1416
+ }
1417
+ const N = {
1418
+ alphanumeric: Ot,
1419
+ alphanumericCaseSensitive: Tt,
1420
+ text: Bt,
1421
+ textCaseSensitive: kt,
1422
+ datetime: Nt,
1423
+ basic: qt
1424
+ }, jt = {
1425
+ getInitialState: (e) => ({
1426
+ sorting: [],
1427
+ ...e
1428
+ }),
1429
+ getDefaultColumnDef: () => ({
1430
+ sortingFn: "auto",
1431
+ sortUndefined: 1
1432
+ }),
1433
+ getDefaultOptions: (e) => ({
1434
+ onSortingChange: P("sorting", e),
1435
+ isMultiSortEvent: (o) => o.shiftKey
1436
+ }),
1437
+ createColumn: (e, o) => {
1438
+ e.getAutoSortingFn = () => {
1439
+ const t = o.getFilteredRowModel().flatRows.slice(10);
1440
+ let n = !1;
1441
+ for (const r of t) {
1442
+ const l = r == null ? void 0 : r.getValue(e.id);
1443
+ if (Object.prototype.toString.call(l) === "[object Date]")
1444
+ return N.datetime;
1445
+ if (typeof l == "string" && (n = !0, l.split(de).length > 1))
1446
+ return N.alphanumeric;
1447
+ }
1448
+ return n ? N.text : N.basic;
1449
+ }, e.getAutoSortDir = () => {
1450
+ const t = o.getFilteredRowModel().flatRows[0];
1451
+ return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
1452
+ }, e.getSortingFn = () => {
1453
+ var t, n;
1454
+ if (!e)
1455
+ throw new Error();
1456
+ return Z(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 : N[e.columnDef.sortingFn];
1457
+ }, e.toggleSorting = (t, n) => {
1458
+ const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
1459
+ o.setSorting((i) => {
1460
+ const u = i == null ? void 0 : i.find((s) => s.id === e.id), a = i == null ? void 0 : i.findIndex((s) => s.id === e.id);
1461
+ let g = [], f, m = l ? t : r === "desc";
1462
+ if (i != null && i.length && e.getCanMultiSort() && n ? u ? f = "toggle" : f = "add" : i != null && i.length && a !== i.length - 1 ? f = "replace" : u ? f = "toggle" : f = "replace", f === "toggle" && (l || r || (f = "remove")), f === "add") {
1463
+ var d;
1464
+ g = [...i, {
1465
+ id: e.id,
1466
+ desc: m
1467
+ }], g.splice(0, g.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
1468
+ } else f === "toggle" ? g = i.map((s) => s.id === e.id ? {
1469
+ ...s,
1470
+ desc: m
1471
+ } : s) : f === "remove" ? g = i.filter((s) => s.id !== e.id) : g = [{
1472
+ id: e.id,
1473
+ desc: m
1474
+ }];
1475
+ return g;
1476
+ });
1477
+ }, e.getFirstSortDir = () => {
1478
+ var t, n;
1479
+ return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
1480
+ }, e.getNextSortingOrder = (t) => {
1481
+ var n, r;
1482
+ const l = e.getFirstSortDir(), i = e.getIsSorted();
1483
+ return i ? i !== l && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
1484
+ (!(t && (r = o.options.enableMultiRemove) != null) || r) ? !1 : i === "desc" ? "asc" : "desc" : l;
1485
+ }, e.getCanSort = () => {
1486
+ var t, n;
1487
+ return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
1488
+ }, e.getCanMultiSort = () => {
1489
+ var t, n;
1490
+ return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
1491
+ }, e.getIsSorted = () => {
1492
+ var t;
1493
+ const n = (t = o.getState().sorting) == null ? void 0 : t.find((r) => r.id === e.id);
1494
+ return n ? n.desc ? "desc" : "asc" : !1;
1495
+ }, e.getSortIndex = () => {
1496
+ var t, n;
1497
+ return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
1498
+ }, e.clearSorting = () => {
1499
+ o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
1500
+ }, e.getToggleSortingHandler = () => {
1501
+ const t = e.getCanSort();
1502
+ return (n) => {
1503
+ 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));
1504
+ };
1505
+ };
1506
+ },
1507
+ createTable: (e) => {
1508
+ e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
1509
+ var t, n;
1510
+ e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
1511
+ }, 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());
1512
+ }
1513
+ }, Ut = [
1514
+ ct,
1515
+ Et,
1516
+ Pt,
1517
+ It,
1518
+ ft,
1519
+ pt,
1520
+ Dt,
1521
+ //depends on ColumnFaceting
1522
+ At,
1523
+ //depends on ColumnFiltering
1524
+ jt,
1525
+ xt,
1526
+ //depends on RowSorting
1527
+ Ht,
1528
+ zt,
1529
+ Gt,
1530
+ Lt,
1531
+ yt
1532
+ ];
1533
+ function Xt(e) {
1534
+ var o, t;
1535
+ process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
1536
+ const n = [...Ut, ...(o = e._features) != null ? o : []];
1537
+ let r = {
1538
+ _features: n
1539
+ };
1540
+ const l = r._features.reduce((d, s) => Object.assign(d, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
1541
+ ...l,
1542
+ ...d
1543
+ };
1544
+ let a = {
1545
+ ...{},
1546
+ ...(t = e.initialState) != null ? t : {}
1547
+ };
1548
+ r._features.forEach((d) => {
1549
+ var s;
1550
+ a = (s = d.getInitialState == null ? void 0 : d.getInitialState(a)) != null ? s : a;
1551
+ });
1552
+ const g = [];
1553
+ let f = !1;
1554
+ const m = {
1555
+ _features: n,
1556
+ options: {
1557
+ ...l,
1558
+ ...e
1559
+ },
1560
+ initialState: a,
1561
+ _queue: (d) => {
1562
+ g.push(d), f || (f = !0, Promise.resolve().then(() => {
1563
+ for (; g.length; )
1564
+ g.shift()();
1565
+ f = !1;
1566
+ }).catch((s) => setTimeout(() => {
1567
+ throw s;
1568
+ })));
1569
+ },
1570
+ reset: () => {
1571
+ r.setState(r.initialState);
1572
+ },
1573
+ setOptions: (d) => {
1574
+ const s = H(d, r.options);
1575
+ r.options = i(s);
1576
+ },
1577
+ getState: () => r.options.state,
1578
+ setState: (d) => {
1579
+ r.options.onStateChange == null || r.options.onStateChange(d);
1580
+ },
1581
+ _getRowId: (d, s, c) => {
1582
+ var p;
1583
+ return (p = r.options.getRowId == null ? void 0 : r.options.getRowId(d, s, c)) != null ? p : `${c ? [c.id, s].join(".") : s}`;
1584
+ },
1585
+ getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
1586
+ // The final calls start at the bottom of the model,
1587
+ // expanded rows, which then work their way up
1588
+ getRowModel: () => r.getPaginationRowModel(),
1589
+ //in next version, we should just pass in the row model as the optional 2nd arg
1590
+ getRow: (d, s) => {
1591
+ let c = (s ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
1592
+ if (!c && (c = r.getCoreRowModel().rowsById[d], !c))
1593
+ throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
1594
+ return c;
1595
+ },
1596
+ _getDefaultColumnDef: C(() => [r.options.defaultColumn], (d) => {
1597
+ var s;
1598
+ return d = (s = d) != null ? s : {}, {
1599
+ header: (c) => {
1600
+ const p = c.header.column.columnDef;
1601
+ return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
1602
+ },
1603
+ // footer: props => props.header.column.id,
1604
+ cell: (c) => {
1605
+ var p, R;
1606
+ return (p = (R = c.renderValue()) == null || R.toString == null ? void 0 : R.toString()) != null ? p : null;
1607
+ },
1608
+ ...r._features.reduce((c, p) => Object.assign(c, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
1609
+ ...d
1610
+ };
1611
+ }, w(e, "debugColumns", "_getDefaultColumnDef")),
1612
+ _getColumnDefs: () => r.options.columns,
1613
+ getAllColumns: C(() => [r._getColumnDefs()], (d) => {
1614
+ const s = function(c, p, R) {
1615
+ return R === void 0 && (R = 0), c.map((h) => {
1616
+ const v = dt(r, h, R, p), S = h;
1617
+ return v.columns = S.columns ? s(S.columns, v, R + 1) : [], v;
1618
+ });
1619
+ };
1620
+ return s(d);
1621
+ }, w(e, "debugColumns", "getAllColumns")),
1622
+ getAllFlatColumns: C(() => [r.getAllColumns()], (d) => d.flatMap((s) => s.getFlatColumns()), w(e, "debugColumns", "getAllFlatColumns")),
1623
+ _getAllFlatColumnsById: C(() => [r.getAllFlatColumns()], (d) => d.reduce((s, c) => (s[c.id] = c, s), {}), w(e, "debugColumns", "getAllFlatColumnsById")),
1624
+ getAllLeafColumns: C(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, s) => {
1625
+ let c = d.flatMap((p) => p.getLeafColumns());
1626
+ return s(c);
1627
+ }, w(e, "debugColumns", "getAllLeafColumns")),
1628
+ getColumn: (d) => {
1629
+ const s = r._getAllFlatColumnsById()[d];
1630
+ return process.env.NODE_ENV !== "production" && !s && console.error(`[Table] Column with id '${d}' does not exist.`), s;
1631
+ }
1632
+ };
1633
+ Object.assign(r, m);
1634
+ for (let d = 0; d < r._features.length; d++) {
1635
+ const s = r._features[d];
1636
+ s == null || s.createTable == null || s.createTable(r);
1637
+ }
1638
+ return r;
1639
+ }
1640
+ function ke() {
1641
+ return (e) => C(() => [e.options.data], (o) => {
1642
+ const t = {
1643
+ rows: [],
1644
+ flatRows: [],
1645
+ rowsById: {}
1646
+ }, n = function(r, l, i) {
1647
+ l === void 0 && (l = 0);
1648
+ const u = [];
1649
+ for (let g = 0; g < r.length; g++) {
1650
+ const f = ce(e, e._getRowId(r[g], g, i), r[g], g, l, void 0, i == null ? void 0 : i.id);
1651
+ if (t.flatRows.push(f), t.rowsById[f.id] = f, u.push(f), e.options.getSubRows) {
1652
+ var a;
1653
+ f.originalSubRows = e.options.getSubRows(r[g], g), (a = f.originalSubRows) != null && a.length && (f.subRows = n(f.originalSubRows, l + 1, f));
1654
+ }
1655
+ }
1656
+ return u;
1657
+ };
1658
+ return t.rows = n(o), t;
1659
+ }, w(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
1660
+ }
1661
+ function Ne() {
1662
+ return (e) => C(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (o, t, n) => !t.rows.length || o !== !0 && !Object.keys(o ?? {}).length || !n ? t : qe(t), w(e.options, "debugTable", "getExpandedRowModel"));
1663
+ }
1664
+ function qe(e) {
1665
+ const o = [], t = (n) => {
1666
+ var r;
1667
+ o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
1668
+ };
1669
+ return e.rows.forEach(t), {
1670
+ rows: o,
1671
+ flatRows: e.flatRows,
1672
+ rowsById: e.rowsById
1673
+ };
1674
+ }
1675
+ function Kt(e, o, t) {
1676
+ return t.options.filterFromLeafRows ? Wt(e, o, t) : Jt(e, o, t);
1677
+ }
1678
+ function Wt(e, o, t) {
1679
+ var n;
1680
+ const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(a, g) {
1681
+ g === void 0 && (g = 0);
1682
+ const f = [];
1683
+ for (let d = 0; d < a.length; d++) {
1684
+ var m;
1685
+ let s = a[d];
1686
+ const c = ce(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
1687
+ if (c.columnFilters = s.columnFilters, (m = s.subRows) != null && m.length && g < i) {
1688
+ if (c.subRows = u(s.subRows, g + 1), s = c, o(s) && !c.subRows.length) {
1689
+ f.push(s), l[s.id] = s, r.push(s);
1690
+ continue;
1691
+ }
1692
+ if (o(s) || c.subRows.length) {
1693
+ f.push(s), l[s.id] = s, r.push(s);
1694
+ continue;
1695
+ }
1696
+ } else
1697
+ s = c, o(s) && (f.push(s), l[s.id] = s, r.push(s));
1698
+ }
1699
+ return f;
1700
+ };
1701
+ return {
1702
+ rows: u(e),
1703
+ flatRows: r,
1704
+ rowsById: l
1705
+ };
1706
+ }
1707
+ function Jt(e, o, t) {
1708
+ var n;
1709
+ const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(a, g) {
1710
+ g === void 0 && (g = 0);
1711
+ const f = [];
1712
+ for (let d = 0; d < a.length; d++) {
1713
+ let s = a[d];
1714
+ if (o(s)) {
1715
+ var m;
1716
+ if ((m = s.subRows) != null && m.length && g < i) {
1717
+ const p = ce(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
1718
+ p.subRows = u(s.subRows, g + 1), s = p;
1719
+ }
1720
+ f.push(s), r.push(s), l[s.id] = s;
1721
+ }
1722
+ }
1723
+ return f;
1724
+ };
1725
+ return {
1726
+ rows: u(e),
1727
+ flatRows: r,
1728
+ rowsById: l
1729
+ };
1730
+ }
1731
+ function Yt() {
1732
+ return (e) => C(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
1733
+ if (!o.rows.length || !(t != null && t.length) && !n) {
1734
+ for (let d = 0; d < o.flatRows.length; d++)
1735
+ o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
1736
+ return o;
1737
+ }
1738
+ const r = [], l = [];
1739
+ (t ?? []).forEach((d) => {
1740
+ var s;
1741
+ const c = e.getColumn(d.id);
1742
+ if (!c)
1743
+ return;
1744
+ const p = c.getFilterFn();
1745
+ if (!p) {
1746
+ process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${c.id}.`);
1747
+ return;
1748
+ }
1749
+ r.push({
1750
+ id: d.id,
1751
+ filterFn: p,
1752
+ resolvedValue: (s = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(d.value)) != null ? s : d.value
1753
+ });
1754
+ });
1755
+ const i = (t ?? []).map((d) => d.id), u = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
1756
+ n && u && a.length && (i.push("__global__"), a.forEach((d) => {
1757
+ var s;
1758
+ l.push({
1759
+ id: d.id,
1760
+ filterFn: u,
1761
+ resolvedValue: (s = u.resolveFilterValue == null ? void 0 : u.resolveFilterValue(n)) != null ? s : n
1762
+ });
1763
+ }));
1764
+ let g, f;
1765
+ for (let d = 0; d < o.flatRows.length; d++) {
1766
+ const s = o.flatRows[d];
1767
+ if (s.columnFilters = {}, r.length)
1768
+ for (let c = 0; c < r.length; c++) {
1769
+ g = r[c];
1770
+ const p = g.id;
1771
+ s.columnFilters[p] = g.filterFn(s, p, g.resolvedValue, (R) => {
1772
+ s.columnFiltersMeta[p] = R;
1773
+ });
1774
+ }
1775
+ if (l.length) {
1776
+ for (let c = 0; c < l.length; c++) {
1777
+ f = l[c];
1778
+ const p = f.id;
1779
+ if (f.filterFn(s, p, f.resolvedValue, (R) => {
1780
+ s.columnFiltersMeta[p] = R;
1781
+ })) {
1782
+ s.columnFilters.__global__ = !0;
1783
+ break;
1784
+ }
1785
+ }
1786
+ s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
1787
+ }
1788
+ }
1789
+ const m = (d) => {
1790
+ for (let s = 0; s < i.length; s++)
1791
+ if (d.columnFilters[i[s]] === !1)
1792
+ return !1;
1793
+ return !0;
1794
+ };
1795
+ return Kt(o.rows, m, e);
1796
+ }, w(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
1797
+ }
1798
+ function Qt(e) {
1799
+ return (o) => C(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
1800
+ if (!n.rows.length)
1801
+ return n;
1802
+ const {
1803
+ pageSize: r,
1804
+ pageIndex: l
1805
+ } = t;
1806
+ let {
1807
+ rows: i,
1808
+ flatRows: u,
1809
+ rowsById: a
1810
+ } = n;
1811
+ const g = r * l, f = g + r;
1812
+ i = i.slice(g, f);
1813
+ let m;
1814
+ o.options.paginateExpandedRows ? m = {
1815
+ rows: i,
1816
+ flatRows: u,
1817
+ rowsById: a
1818
+ } : m = qe({
1819
+ rows: i,
1820
+ flatRows: u,
1821
+ rowsById: a
1822
+ }), m.flatRows = [];
1823
+ const d = (s) => {
1824
+ m.flatRows.push(s), s.subRows.length && s.subRows.forEach(d);
1825
+ };
1826
+ return m.rows.forEach(d), m;
1827
+ }, w(o.options, "debugTable", "getPaginationRowModel"));
1828
+ }
1829
+ function Zt() {
1830
+ return (e) => C(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
1831
+ if (!t.rows.length || !(o != null && o.length))
1832
+ return t;
1833
+ const n = e.getState().sorting, r = [], l = n.filter((a) => {
1834
+ var g;
1835
+ return (g = e.getColumn(a.id)) == null ? void 0 : g.getCanSort();
1836
+ }), i = {};
1837
+ l.forEach((a) => {
1838
+ const g = e.getColumn(a.id);
1839
+ g && (i[a.id] = {
1840
+ sortUndefined: g.columnDef.sortUndefined,
1841
+ invertSorting: g.columnDef.invertSorting,
1842
+ sortingFn: g.getSortingFn()
1843
+ });
1844
+ });
1845
+ const u = (a) => {
1846
+ const g = a.map((f) => ({
1847
+ ...f
1848
+ }));
1849
+ return g.sort((f, m) => {
1850
+ for (let s = 0; s < l.length; s += 1) {
1851
+ var d;
1852
+ const c = l[s], p = i[c.id], R = p.sortUndefined, h = (d = c == null ? void 0 : c.desc) != null ? d : !1;
1853
+ let v = 0;
1854
+ if (R) {
1855
+ const S = f.getValue(c.id), F = m.getValue(c.id), _ = S === void 0, x = F === void 0;
1856
+ if (_ || x) {
1857
+ if (R === "first") return _ ? -1 : 1;
1858
+ if (R === "last") return _ ? 1 : -1;
1859
+ v = _ && x ? 0 : _ ? R : -R;
1860
+ }
1861
+ }
1862
+ if (v === 0 && (v = p.sortingFn(f, m, c.id)), v !== 0)
1863
+ return h && (v *= -1), p.invertSorting && (v *= -1), v;
1864
+ }
1865
+ return f.index - m.index;
1866
+ }), g.forEach((f) => {
1867
+ var m;
1868
+ r.push(f), (m = f.subRows) != null && m.length && (f.subRows = u(f.subRows));
1869
+ }), g;
1870
+ };
1871
+ return {
1872
+ rows: u(t.rows),
1873
+ flatRows: r,
1874
+ rowsById: t.rowsById
1875
+ };
1876
+ }, w(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
1877
+ }
1878
+ /**
1879
+ * vue-table
1880
+ *
1881
+ * Copyright (c) TanStack
1882
+ *
1883
+ * This source code is licensed under the MIT license found in the
1884
+ * LICENSE.md file in the root directory of this source tree.
1885
+ *
1886
+ * @license MIT
1887
+ */
1888
+ function Y() {
1889
+ return !0;
1890
+ }
1891
+ const bt = Symbol("merge-proxy"), en = {
1892
+ get(e, o, t) {
1893
+ return o === bt ? t : e.get(o);
1894
+ },
1895
+ has(e, o) {
1896
+ return e.has(o);
1897
+ },
1898
+ set: Y,
1899
+ deleteProperty: Y,
1900
+ getOwnPropertyDescriptor(e, o) {
1901
+ return {
1902
+ configurable: !0,
1903
+ enumerable: !0,
1904
+ get() {
1905
+ return e.get(o);
1906
+ },
1907
+ set: Y,
1908
+ deleteProperty: Y
1909
+ };
1910
+ },
1911
+ ownKeys(e) {
1912
+ return e.keys();
1913
+ }
1914
+ };
1915
+ function ie(e) {
1916
+ return "value" in e ? e.value : e;
1917
+ }
1918
+ function q() {
1919
+ for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
1920
+ o[t] = arguments[t];
1921
+ return new Proxy({
1922
+ get(n) {
1923
+ for (let r = o.length - 1; r >= 0; r--) {
1924
+ const l = ie(o[r])[n];
1925
+ if (l !== void 0) return l;
1926
+ }
1927
+ },
1928
+ has(n) {
1929
+ for (let r = o.length - 1; r >= 0; r--)
1930
+ if (n in ie(o[r])) return !0;
1931
+ return !1;
1932
+ },
1933
+ keys() {
1934
+ const n = [];
1935
+ for (let r = 0; r < o.length; r++) n.push(...Object.keys(ie(o[r])));
1936
+ return [...Array.from(new Set(n))];
1937
+ }
1938
+ }, en);
1939
+ }
1940
+ const Me = Ve({
1941
+ props: ["render", "props"],
1942
+ setup: (e) => () => typeof e.render == "function" || typeof e.render == "object" ? Q(e.render, e.props) : e.render
1943
+ });
1944
+ function ye(e) {
1945
+ return q(e, {
1946
+ data: E(e.data)
1947
+ });
1948
+ }
1949
+ function je(e) {
1950
+ const o = Ke(e.data), t = q({
1951
+ state: {},
1952
+ // Dummy state
1953
+ onStateChange: () => {
1954
+ },
1955
+ // noop
1956
+ renderFallbackValue: null,
1957
+ mergeOptions(l, i) {
1958
+ return o ? {
1959
+ ...l,
1960
+ ...i
1961
+ } : q(l, i);
1962
+ }
1963
+ }, o ? ye(e) : e), n = Xt(t);
1964
+ if (o) {
1965
+ const l = We(e.data);
1966
+ Ee(l, () => {
1967
+ n.setState((i) => ({
1968
+ ...i,
1969
+ data: l.value
1970
+ }));
1971
+ }, {
1972
+ immediate: !0
1973
+ });
1974
+ }
1975
+ const r = L(n.initialState);
1976
+ return Je(() => {
1977
+ n.setOptions((l) => {
1978
+ var i;
1979
+ const u = new Proxy({}, {
1980
+ get: (a, g) => r.value[g]
1981
+ });
1982
+ return q(l, o ? ye(e) : e, {
1983
+ // merge the initialState and `options.state`
1984
+ // create a new proxy on each `setOptions` call
1985
+ // and get the value from state on each property access
1986
+ state: q(u, (i = e.state) != null ? i : {}),
1987
+ // Similarly, we'll maintain both our internal state and any user-provided
1988
+ // state.
1989
+ onStateChange: (a) => {
1990
+ a instanceof Function ? r.value = a(r.value) : r.value = a, e.onStateChange == null || e.onStateChange(a);
1991
+ }
1992
+ });
1993
+ });
1994
+ }), n;
1995
+ }
1996
+ function tn(e) {
1997
+ return typeof e == "function";
1998
+ }
1999
+ function z(e, o) {
2000
+ return tn(e) ? e(o) : e;
2001
+ }
2002
+ function nn({
2003
+ columns: e,
2004
+ data: o,
2005
+ initialState: t,
2006
+ enableSorting: n = !0,
2007
+ enableFiltering: r = !0,
2008
+ enablePagination: l = !0,
2009
+ pageSize: i = 10,
2010
+ getSubRows: u,
2011
+ getRowCanExpand: a,
2012
+ getRowId: g,
2013
+ enableRowSelection: f
2014
+ }) {
2015
+ var s;
2016
+ const m = Ye(xe.key, xe.defaults);
2017
+ return ((s = m.variant) == null ? void 0 : s.value) === "table" ? on({
2018
+ columns: e,
2019
+ data: o,
2020
+ initialState: t,
2021
+ enableSorting: n,
2022
+ dataView: m,
2023
+ getSubRows: u,
2024
+ getRowCanExpand: a,
2025
+ getRowId: g,
2026
+ enableRowSelection: f
2027
+ }) : rn({
2028
+ columns: e,
2029
+ data: o,
2030
+ initialState: t,
2031
+ enableSorting: n,
2032
+ enableFiltering: r,
2033
+ enablePagination: l,
2034
+ pageSize: i,
2035
+ getSubRows: u,
2036
+ getRowCanExpand: a,
2037
+ getRowId: g,
2038
+ enableRowSelection: f
2039
+ });
2040
+ }
2041
+ function on({
2042
+ columns: e,
2043
+ data: o,
2044
+ initialState: t,
2045
+ enableSorting: n,
2046
+ dataView: r,
2047
+ getSubRows: l,
2048
+ getRowCanExpand: i,
2049
+ getRowId: u,
2050
+ enableRowSelection: a
2051
+ }) {
2052
+ const g = M(() => {
2053
+ const c = r.currentSortId.value, p = r.currentSortOrder.value;
2054
+ return c ? [{ id: c, desc: p === "desc" }] : [];
2055
+ }), f = M(() => ({
2056
+ pageIndex: r.currentPage.value - 1,
2057
+ pageSize: r.pageSize.value
2058
+ })), m = L((t == null ? void 0 : t.rowSelection) ?? {}), d = L((t == null ? void 0 : t.expanded) ?? {});
2059
+ return { table: je({
2060
+ get columns() {
2061
+ return T(e);
2062
+ },
2063
+ get data() {
2064
+ return T(o);
2065
+ },
2066
+ initialState: t,
2067
+ getCoreRowModel: ke(),
2068
+ getExpandedRowModel: Ne(),
2069
+ paginateExpandedRows: !1,
2070
+ manualSorting: !0,
2071
+ manualPagination: !0,
2072
+ manualFiltering: !0,
2073
+ enableSorting: n,
2074
+ getSubRows: l,
2075
+ getRowCanExpand: i,
2076
+ ...u != null ? { getRowId: u } : {},
2077
+ ...a != null ? { enableRowSelection: a } : {},
2078
+ // Even though we are handling these things manually, vue-table still needs to know this information in its own state
2079
+ state: {
2080
+ get sorting() {
2081
+ return g.value;
2082
+ },
2083
+ get pagination() {
2084
+ return f.value;
2085
+ },
2086
+ get rowSelection() {
2087
+ return m.value;
2088
+ },
2089
+ get expanded() {
2090
+ return d.value;
2091
+ }
2092
+ },
2093
+ get rowCount() {
2094
+ const c = r.totalDataCount.value;
2095
+ return c === 1 / 0 ? -1 : c;
2096
+ },
2097
+ onSortingChange(c) {
2098
+ const R = z(c, g.value)[0];
2099
+ R ? r.updateCurrentSort(R.id, {
2100
+ sortOrder: R.desc ? "desc" : "asc",
2101
+ shouldEmit: !0
2102
+ }) : r.updateCurrentSort(void 0, { shouldEmit: !0 });
2103
+ },
2104
+ onPaginationChange(c) {
2105
+ const p = z(c, f.value);
2106
+ r.setPage(p.pageIndex + 1, { shouldEmit: !0 });
2107
+ },
2108
+ onRowSelectionChange(c) {
2109
+ m.value = z(c, m.value);
2110
+ },
2111
+ onExpandedChange(c) {
2112
+ d.value = z(c, d.value);
2113
+ }
2114
+ }), isServerMode: !0 };
2115
+ }
2116
+ function rn({
2117
+ columns: e,
2118
+ data: o,
2119
+ initialState: t,
2120
+ enableSorting: n,
2121
+ enableFiltering: r,
2122
+ enablePagination: l,
2123
+ pageSize: i,
2124
+ getSubRows: u,
2125
+ getRowCanExpand: a,
2126
+ getRowId: g,
2127
+ enableRowSelection: f
2128
+ }) {
2129
+ var R, h;
2130
+ const m = L((t == null ? void 0 : t.sorting) || []), d = L({
2131
+ pageIndex: ((R = t == null ? void 0 : t.pagination) == null ? void 0 : R.pageIndex) || 0,
2132
+ pageSize: ((h = t == null ? void 0 : t.pagination) == null ? void 0 : h.pageSize) || i
2133
+ }), s = L((t == null ? void 0 : t.rowSelection) || {}), c = L((t == null ? void 0 : t.expanded) ?? {}), p = je({
2134
+ get columns() {
2135
+ return T(e);
2136
+ },
2137
+ get data() {
2138
+ return T(o);
2139
+ },
2140
+ initialState: t,
2141
+ getCoreRowModel: ke(),
2142
+ getExpandedRowModel: Ne(),
2143
+ paginateExpandedRows: !1,
2144
+ ...n ? { getSortedRowModel: Zt() } : {},
2145
+ ...r ? { getFilteredRowModel: Yt() } : {},
2146
+ ...l ? { getPaginationRowModel: Qt() } : {},
2147
+ enableSorting: n,
2148
+ getSubRows: u,
2149
+ getRowCanExpand: a,
2150
+ ...g != null ? { getRowId: g } : {},
2151
+ ...f != null ? { enableRowSelection: f } : {},
2152
+ state: {
2153
+ get sorting() {
2154
+ return m.value;
2155
+ },
2156
+ get pagination() {
2157
+ return d.value;
2158
+ },
2159
+ get rowSelection() {
2160
+ return s.value;
2161
+ },
2162
+ get expanded() {
2163
+ return c.value;
2164
+ }
2165
+ },
2166
+ onSortingChange(v) {
2167
+ m.value = z(v, m.value);
2168
+ },
2169
+ onPaginationChange(v) {
2170
+ d.value = z(v, d.value);
2171
+ },
2172
+ onRowSelectionChange(v) {
2173
+ s.value = z(v, s.value);
2174
+ },
2175
+ onExpandedChange(v) {
2176
+ c.value = z(v, c.value);
2177
+ }
2178
+ });
2179
+ return Ee(
2180
+ () => T(o),
2181
+ () => {
2182
+ if (l && d.value.pageIndex > 0) {
2183
+ const v = Math.max(0, Math.ceil(T(o).length / d.value.pageSize) - 1);
2184
+ d.value.pageIndex > v && (d.value = { ...d.value, pageIndex: 0 });
2185
+ }
2186
+ }
2187
+ ), { table: p, isServerMode: !1 };
2188
+ }
2189
+ const ln = /* @__PURE__ */ Ve({
2190
+ inheritAttrs: !1,
2191
+ __name: "DataTable",
2192
+ props: {
2193
+ columns: {},
2194
+ data: {},
2195
+ isSelectable: { type: Boolean, default: !1 },
2196
+ getRowId: { type: Function, default: void 0 },
2197
+ getRowCanSelect: { type: Function, default: void 0 },
2198
+ getRowAccentColor: { type: Function, default: void 0 },
2199
+ getSubRows: { type: Function, default: void 0 },
2200
+ getRowCanExpand: { type: Function, default: void 0 },
2201
+ hideExpansionDivider: { type: Boolean, default: !1 },
2202
+ density: { default: void 0 },
2203
+ emptyStateText: { default: "" },
2204
+ hasActions: { type: Boolean, default: !1 },
2205
+ hasCustomExpandToggle: { type: Boolean, default: !1 },
2206
+ isEmpty: { type: Boolean, default: !1 },
2207
+ isLoading: { type: Boolean, default: !1 },
2208
+ isExpandable: { type: Boolean, default: !1 },
2209
+ radius: { default: "rounded" },
2210
+ stickyHeader: { default: void 0 }
2211
+ },
2212
+ setup(e, { expose: o }) {
2213
+ const t = e, n = Qe(), r = Ze(), l = M(() => ({
2214
+ id: "expand",
2215
+ size: 48,
2216
+ minSize: 48,
2217
+ maxSize: 48,
2218
+ meta: {
2219
+ class: `${n["row-control-cell"]} stash-table-cell__is-expansion-cell px-0!`
2220
+ },
2221
+ header: () => null,
2222
+ cell: ({ row: S }) => S.getCanExpand() ? Q(et, {
2223
+ "aria-label": S.getIsExpanded() ? X("ll.table.collapseRow") : X("ll.table.expandRow"),
2224
+ direction: S.getIsExpanded() ? "up" : "down",
2225
+ onClick: () => S.toggleExpanded()
2226
+ }) : null
2227
+ })), i = M(() => ({
2228
+ id: "select",
2229
+ size: 48,
2230
+ minSize: 48,
2231
+ maxSize: 48,
2232
+ meta: {
2233
+ class: `${n["row-control-cell"]} stash-table-cell__is-selection-cell lg:pl-3`
2234
+ },
2235
+ header: ({ table: S }) => Q($e, {
2236
+ checked: S.getIsAllPageRowsSelected(),
2237
+ indeterminate: S.getIsSomePageRowsSelected() && !S.getIsAllPageRowsSelected(),
2238
+ title: X("ll.selectAll"),
2239
+ class: n["row-selection-checkbox"],
2240
+ "onUpdate:checked": () => S.toggleAllPageRowsSelected()
2241
+ }),
2242
+ cell: ({ row: S }) => Q($e, {
2243
+ checked: S.getIsSelected(),
2244
+ disabled: !S.getCanSelect(),
2245
+ title: X("ll.select.self"),
2246
+ class: n["row-selection-checkbox"],
2247
+ "onUpdate:checked": () => S.toggleSelected()
2248
+ })
2249
+ })), u = M(() => {
2250
+ const S = [...t.columns];
2251
+ return t.isExpandable && !t.hasCustomExpandToggle && S.unshift(l.value), t.isSelectable && S.unshift(i.value), S;
2252
+ }), a = nn({
2253
+ columns: u,
2254
+ data: M(() => t.data),
2255
+ getSubRows: t.getSubRows,
2256
+ getRowCanExpand: t.getRowCanExpand,
2257
+ getRowId: t.getRowId,
2258
+ ...t.isSelectable ? {
2259
+ enableRowSelection: t.getRowCanSelect ? (S) => t.getRowCanSelect(S) : void 0
2260
+ } : {}
2261
+ }), g = M(() => a.isServerMode ? !1 : a.table.getPageCount() > 1);
2262
+ function f(S) {
2263
+ const F = S.minSize, _ = S.maxSize, x = {};
2264
+ return F != null && F > 0 && (x.minWidth = `${F}px`), _ != null && _ < Number.MAX_SAFE_INTEGER && (x.maxWidth = `${_}px`), Object.keys(x).length ? x : void 0;
2265
+ }
2266
+ function m(S) {
2267
+ return f(S.column.columnDef);
2268
+ }
2269
+ function d(S) {
2270
+ const F = S.column.columnDef.meta, _ = (F == null ? void 0 : F.headerClass) ?? (F == null ? void 0 : F.class) ?? "";
2271
+ return S.column.id === "select" ? `stash-table-header-row__selection-cell min-w-12 ${n["row-control-cell"]} ${_}`.trim() : S.column.id === "expand" ? `${n["row-control-cell"]} ${_}`.trim() : _;
2272
+ }
2273
+ function s(S) {
2274
+ return f(S.column.columnDef);
2275
+ }
2276
+ function c(S) {
2277
+ const F = S.column.columnDef.meta;
2278
+ return (F == null ? void 0 : F.cellClass) ?? (F == null ? void 0 : F.class) ?? "";
2279
+ }
2280
+ const p = M(() => a.table.getSelectedRowModel().rows), R = M(() => p.value.map((S) => S.original)), h = M(() => a.table.getIsAllPageRowsSelected()), v = M(() => a.table.getIsSomePageRowsSelected());
2281
+ return o({
2282
+ table: a.table,
2283
+ selectedRows: p,
2284
+ selectedItems: R,
2285
+ allPageRowsSelected: h,
2286
+ somePageRowsSelected: v
2287
+ }), (S, F) => (I(), B(k, null, [
2288
+ we(nt, be(S.$attrs, {
2289
+ "is-schema-driven": "",
2290
+ layout: "scroll",
2291
+ density: t.density,
2292
+ "empty-state-text": t.emptyStateText,
2293
+ "has-actions": t.hasActions,
2294
+ "has-custom-expand-toggle": t.isExpandable || t.hasCustomExpandToggle,
2295
+ "is-empty": t.isEmpty,
2296
+ "is-loading": t.isLoading,
2297
+ "is-expandable": t.isExpandable,
2298
+ "is-selectable": t.isSelectable,
2299
+ radius: t.radius,
2300
+ "sticky-header": t.stickyHeader
2301
+ }), he({
2302
+ head: A(() => [
2303
+ (I(!0), B(k, null, U(E(a).table.getHeaderGroups(), (_) => (I(), O(lt, {
2304
+ key: _.id
2305
+ }, {
2306
+ default: A(() => [
2307
+ (I(!0), B(k, null, U(_.headers, (x) => (I(), O(rt, {
2308
+ key: x.id,
2309
+ "schema-driven-header": x,
2310
+ class: _e(d(x)),
2311
+ style: ve(m(x))
2312
+ }, {
2313
+ default: A(() => [
2314
+ x.isPlaceholder ? Re("", !0) : (I(), O(E(Me), {
2315
+ key: 0,
2316
+ render: x.column.columnDef.header,
2317
+ props: x.getContext()
2318
+ }, null, 8, ["render", "props"]))
2319
+ ]),
2320
+ _: 2
2321
+ }, 1032, ["schema-driven-header", "class", "style"]))), 128))
2322
+ ]),
2323
+ _: 2
2324
+ }, 1024))), 128))
2325
+ ]),
2326
+ body: A(() => [
2327
+ (I(!0), B(k, null, U(E(a).table.getRowModel().rows, (_) => {
2328
+ var x;
2329
+ return I(), O(it, {
2330
+ key: _.id,
2331
+ "accent-color": (x = t.getRowAccentColor) == null ? void 0 : x.call(t, _.original),
2332
+ "is-expanded": _.getIsExpanded(),
2333
+ "hide-expansion-divider": t.hideExpansionDivider
2334
+ }, he({
2335
+ default: A(() => [
2336
+ (I(!0), B(k, null, U(_.getVisibleCells(), (V) => (I(), O(ot, {
2337
+ key: V.id,
2338
+ "is-control": V.column.id === "select" || V.column.id === "expand",
2339
+ class: _e(c(V)),
2340
+ style: ve(s(V))
2341
+ }, {
2342
+ default: A(() => [
2343
+ we(E(Me), {
2344
+ render: V.column.columnDef.cell,
2345
+ props: V.getContext()
2346
+ }, null, 8, ["render", "props"])
2347
+ ]),
2348
+ _: 2
2349
+ }, 1032, ["is-control", "class", "style"]))), 128))
2350
+ ]),
2351
+ _: 2
2352
+ }, [
2353
+ r.expansion ? {
2354
+ name: "expansion",
2355
+ fn: A(() => [
2356
+ Fe(S.$slots, "expansion", { row: _ })
2357
+ ]),
2358
+ key: "0"
2359
+ } : void 0
2360
+ ]), 1032, ["accent-color", "is-expanded", "hide-expansion-divider"]);
2361
+ }), 128))
2362
+ ]),
2363
+ _: 2
2364
+ }, [
2365
+ S.$slots.empty ? {
2366
+ name: "empty",
2367
+ fn: A(() => [
2368
+ Fe(S.$slots, "empty")
2369
+ ]),
2370
+ key: "0"
2371
+ } : void 0
2372
+ ]), 1040, ["density", "empty-state-text", "has-actions", "has-custom-expand-toggle", "is-empty", "is-loading", "is-expandable", "is-selectable", "radius", "sticky-header"]),
2373
+ g.value ? (I(), O(tt, {
2374
+ key: 0,
2375
+ class: "mt-6",
2376
+ "current-page": E(a).table.getState().pagination.pageIndex + 1,
2377
+ "list-length": E(a).table.getFilteredRowModel().rows.length,
2378
+ "page-size": E(a).table.getState().pagination.pageSize,
2379
+ onSetPage: F[0] || (F[0] = (_) => E(a).table.setPageIndex(_ - 1))
2380
+ }, null, 8, ["current-page", "list-length", "page-size"])) : Re("", !0)
2381
+ ], 64));
2382
+ }
2383
+ }), sn = {
2384
+ "row-selection-checkbox": "_row-selection-checkbox_102yd_5",
2385
+ "row-control-cell": "_row-control-cell_102yd_11"
2386
+ }, un = {
2387
+ $style: sn
2388
+ }, _n = /* @__PURE__ */ st(ln, [["__cssModules", un]]);
2389
+ export {
2390
+ _n as DataTable,
2391
+ vn as createColumnHelper,
2392
+ Me as flexRender,
2393
+ ke as getCoreRowModel,
2394
+ Ne as getExpandedRowModel,
2395
+ Yt as getFilteredRowModel,
2396
+ Qt as getPaginationRowModel,
2397
+ Zt as getSortedRowModel,
2398
+ nn as useDataTable
2399
+ };
2400
+ //# sourceMappingURL=index.js.map