@gsc-basic/components 1.0.1 → 1.0.2

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