@dmsi/wedgekit-react 2.0.0 → 2.0.1

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 (210) hide show
  1. package/dist/classNames.js +150 -0
  2. package/dist/components/AccessCard.js +63 -0
  3. package/dist/components/AccessCardGroup.js +73 -0
  4. package/dist/components/AccessChangerTabItem.js +51 -0
  5. package/dist/components/Accordion.js +99 -0
  6. package/dist/components/Alert.js +78 -0
  7. package/dist/components/Breadcrumbs.js +111 -0
  8. package/dist/components/Button.js +137 -0
  9. package/dist/components/CalendarRange.js +405 -0
  10. package/dist/components/Caption.js +99 -0
  11. package/dist/components/Card.js +50 -0
  12. package/dist/components/Checkbox.js +108 -0
  13. package/dist/components/CompactImagesPreview.js +120 -0
  14. package/dist/components/ContentTab.js +68 -0
  15. package/dist/components/ContentTabs.js +96 -0
  16. package/dist/components/DMSiLogo.js +54 -0
  17. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +27 -0
  18. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +79 -0
  19. package/dist/components/DataGrid/PinnedColumns.js +165 -0
  20. package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
  21. package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
  22. package/dist/components/DataGrid/SummaryRow/index.js +86 -0
  23. package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
  24. package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
  25. package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
  26. package/dist/components/DataGrid/TableBody/index.js +161 -0
  27. package/dist/components/DataGrid/index.js +696 -0
  28. package/dist/components/DataGrid/utils.js +20 -0
  29. package/dist/components/DataGridCell.js +412 -0
  30. package/dist/components/DataTable.js +700 -0
  31. package/dist/components/DateInput.js +193 -0
  32. package/dist/components/DateRangeInput.js +368 -0
  33. package/dist/components/DebugJson.js +28 -0
  34. package/dist/components/Display.js +46 -0
  35. package/dist/components/EditingContext.js +34 -0
  36. package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
  37. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
  38. package/dist/components/EmblaCarousel/index.js +153 -0
  39. package/dist/components/EmblaCarousel/usePrevNextButtons.js +21 -0
  40. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +15 -0
  41. package/dist/components/EmptyCartIcon.js +25 -0
  42. package/dist/components/FilterGroup.js +198 -0
  43. package/dist/components/FullViewportBox.js +19 -0
  44. package/dist/components/Grid.js +54 -0
  45. package/dist/components/Heading.js +50 -0
  46. package/dist/components/HorizontalDivider.js +20 -0
  47. package/dist/components/Icon.js +73 -0
  48. package/dist/components/ImagePlaceholder.js +22 -0
  49. package/dist/components/Input.js +469 -0
  50. package/dist/components/InputGroup.js +45 -0
  51. package/dist/components/Label.js +37 -0
  52. package/dist/components/Link.js +69 -0
  53. package/dist/components/List.js +12 -0
  54. package/dist/components/ListGroup.js +54 -0
  55. package/dist/components/LiveChatComponent.js +25 -0
  56. package/dist/components/LoadingScrim.js +22 -0
  57. package/dist/components/LogoAgilityTopBar.js +90 -0
  58. package/dist/components/LogoDMSiTopBar.js +54 -0
  59. package/dist/components/LogoMillworkTopBar.js +196 -0
  60. package/dist/components/MainBar.js +58 -0
  61. package/dist/components/MaxViewportBox.js +19 -0
  62. package/dist/components/Menu.js +202 -0
  63. package/dist/components/MenuOption.js +161 -0
  64. package/dist/components/MobileDataGrid/ColumnList.js +85 -0
  65. package/dist/components/MobileDataGrid/ColumnSelector/index.js +100 -0
  66. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
  67. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
  68. package/dist/components/MobileDataGrid/GridContextProvider/index.js +80 -0
  69. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +11 -0
  70. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
  71. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
  72. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
  73. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
  74. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
  75. package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
  76. package/dist/components/MobileDataGrid/index.js +78 -0
  77. package/dist/components/MobileNavMenu.js +173 -0
  78. package/dist/components/Modal.js +201 -0
  79. package/dist/components/ModalButtons.js +57 -0
  80. package/dist/components/ModalContent.js +24 -0
  81. package/dist/components/ModalHeader.js +74 -0
  82. package/dist/components/ModalScrim.js +32 -0
  83. package/dist/components/NavigationTab.js +72 -0
  84. package/dist/components/NavigationTabs.js +45 -0
  85. package/dist/components/NestedMenu.js +119 -0
  86. package/dist/components/Notification.js +91 -0
  87. package/dist/components/OptionPill.js +103 -0
  88. package/dist/components/OrderCheckIcon.js +28 -0
  89. package/dist/components/PDFViewer/DownloadIcon.js +25 -0
  90. package/dist/components/PDFViewer/PDFElement.js +77 -0
  91. package/dist/components/PDFViewer/PDFNavigation.js +64 -0
  92. package/dist/components/PDFViewer/PDFPage.js +28 -0
  93. package/dist/components/PDFViewer/index.js +124 -0
  94. package/dist/components/Pagination.js +117 -0
  95. package/dist/components/Paragraph.js +43 -0
  96. package/dist/components/Password.js +47 -0
  97. package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
  98. package/dist/components/ProductImagePreview/MobileImageCarousel.js +146 -0
  99. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +138 -0
  100. package/dist/components/ProductImagePreview/Thumbnail.js +46 -0
  101. package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
  102. package/dist/components/ProductImagePreview/index.js +189 -0
  103. package/dist/components/ProductImagePreview/useProductImagePreview.js +85 -0
  104. package/dist/components/ProjectBar.js +54 -0
  105. package/dist/components/Radio.js +113 -0
  106. package/dist/components/Search.js +89 -0
  107. package/dist/components/SearchResultImage/index.js +26 -0
  108. package/dist/components/Select.js +122 -0
  109. package/dist/components/SideMenu.js +24 -0
  110. package/dist/components/SideMenuGroup.js +80 -0
  111. package/dist/components/SideMenuItem.js +79 -0
  112. package/dist/components/SimpleTable.js +60 -0
  113. package/dist/components/SkeletonParagraph.js +24 -0
  114. package/dist/components/Spinner.js +30 -0
  115. package/dist/components/Stack.js +174 -0
  116. package/dist/components/StatusPill.js +44 -0
  117. package/dist/components/Stepper.js +138 -0
  118. package/dist/components/Subheader.js +41 -0
  119. package/dist/components/Surface.js +30 -0
  120. package/dist/components/Swatch.js +1498 -0
  121. package/dist/components/Textarea.js +106 -0
  122. package/dist/components/Theme.js +25 -0
  123. package/dist/components/Time.js +225 -0
  124. package/dist/components/Toast.js +170 -0
  125. package/dist/components/Tooltip.js +102 -0
  126. package/dist/components/TopBar.js +119 -0
  127. package/dist/components/Upload.js +107 -0
  128. package/dist/components/WorldpayIframe.js +19 -0
  129. package/dist/hooks/useEditCell.js +23 -0
  130. package/dist/hooks/useInfiniteScroll.js +25 -0
  131. package/dist/hooks/useKeydown.js +20 -0
  132. package/dist/hooks/useMatchesMedia.js +15 -0
  133. package/dist/hooks/useMenuSystem.js +186 -0
  134. package/dist/hooks/useMounted.js +9 -0
  135. package/dist/hooks/useTableLayout/computeColumns.js +59 -0
  136. package/dist/hooks/useTableLayout/storage.js +64 -0
  137. package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
  138. package/dist/index.js +249 -53839
  139. package/dist/lib/loadFonts.js +11 -0
  140. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  141. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
  142. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  143. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
  144. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  145. package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
  146. package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  147. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
  148. package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
  149. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  150. package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
  151. package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  152. package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  153. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  154. package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  155. package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  156. package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  157. package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
  158. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
  159. package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  160. package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  161. package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  162. package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  163. package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
  164. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  165. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  166. package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
  167. package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  168. package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
  169. package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  170. package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  171. package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
  172. package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
  173. package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
  174. package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
  175. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  176. package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
  177. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
  178. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
  179. package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  180. package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
  181. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
  182. package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  183. package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  184. package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  185. package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  186. package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
  187. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  188. package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  189. package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
  190. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
  191. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  192. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
  193. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
  194. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  195. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  196. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
  197. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
  198. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
  199. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
  200. package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
  201. package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
  202. package/dist/static/no-results-image.png.js +4 -0
  203. package/dist/utils/date-patch-dashes.js +28 -0
  204. package/dist/utils/date.js +95 -0
  205. package/dist/utils/formatting.js +22 -0
  206. package/dist/utils/index.js +4 -0
  207. package/dist/utils/mergeObjectArrays.js +18 -0
  208. package/dist/utils.js +20 -0
  209. package/package.json +1 -1
  210. /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
@@ -0,0 +1,1954 @@
1
+ function I(e, o) {
2
+ return typeof e == "function" ? e(o) : e;
3
+ }
4
+ function M(e, o) {
5
+ return (t) => {
6
+ o.setState((n) => ({
7
+ ...n,
8
+ [e]: I(t, n[e])
9
+ }));
10
+ };
11
+ }
12
+ function B(e) {
13
+ return e instanceof Function;
14
+ }
15
+ function Ce(e) {
16
+ return Array.isArray(e) && e.every((o) => typeof o == "number");
17
+ }
18
+ function ie(e, o) {
19
+ const t = [], n = (r) => {
20
+ r.forEach((i) => {
21
+ t.push(i);
22
+ const l = o(i);
23
+ l != null && l.length && n(l);
24
+ });
25
+ };
26
+ return n(e), t;
27
+ }
28
+ function m(e, o, t) {
29
+ let n = [], r;
30
+ return (i) => {
31
+ let l;
32
+ t.key && t.debug && (l = Date.now());
33
+ const u = e(i);
34
+ if (!(u.length !== n.length || u.some((c, S) => n[S] !== c)))
35
+ return r;
36
+ n = u;
37
+ let a;
38
+ if (t.key && t.debug && (a = Date.now()), r = o(...u), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
39
+ const c = Math.round((Date.now() - l) * 100) / 100, S = Math.round((Date.now() - a) * 100) / 100, d = S / 16, s = (f, p) => {
40
+ for (f = String(f); f.length < p; )
41
+ f = " " + f;
42
+ return f;
43
+ };
44
+ console.info(`%c⏱ ${s(S, 5)} /${s(c, 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 r;
50
+ };
51
+ }
52
+ function C(e, o, t, n) {
53
+ return {
54
+ debug: () => {
55
+ var r;
56
+ return (r = e?.debugAll) != null ? r : e[o];
57
+ },
58
+ key: process.env.NODE_ENV === "development" && t,
59
+ onChange: n
60
+ };
61
+ }
62
+ function Re(e, o, t, n) {
63
+ const r = () => {
64
+ var l;
65
+ return (l = i.getValue()) != null ? l : e.options.renderFallbackValue;
66
+ }, i = {
67
+ id: `${o.id}_${t.id}`,
68
+ row: o,
69
+ column: t,
70
+ getValue: () => o.getValue(n),
71
+ renderValue: r,
72
+ getContext: m(() => [e, t, o, i], (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(i, t, o, e);
83
+ }, {}), i;
84
+ }
85
+ function we(e, o, t, n) {
86
+ var r, i;
87
+ const u = {
88
+ ...e._getDefaultColumnDef(),
89
+ ...o
90
+ }, g = u.accessorKey;
91
+ let a = (r = (i = u.id) != null ? i : g ? typeof String.prototype.replaceAll == "function" ? g.replaceAll(".", "_") : g.replace(/\./g, "_") : void 0) != null ? r : typeof u.header == "string" ? u.header : void 0, c;
92
+ if (u.accessorFn ? c = u.accessorFn : g && (g.includes(".") ? c = (d) => {
93
+ let s = d;
94
+ for (const p of g.split(".")) {
95
+ var f;
96
+ s = (f = s) == null ? void 0 : f[p], process.env.NODE_ENV !== "production" && s === void 0 && console.warn(`"${p}" in deeply nested key "${g}" returned undefined.`);
97
+ }
98
+ return s;
99
+ } : c = (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: c,
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 f = S.columns.flatMap((p) => p.getLeafColumns());
116
+ return d(f);
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 oe(e, o, t) {
127
+ var n;
128
+ let i = {
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(i), l;
144
+ },
145
+ getContext: () => ({
146
+ table: e,
147
+ header: i,
148
+ column: o
149
+ })
150
+ };
151
+ return e._features.forEach((l) => {
152
+ l.createHeader == null || l.createHeader(i, e);
153
+ }), i;
154
+ }
155
+ const he = {
156
+ createTable: (e) => {
157
+ e.getHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
158
+ var i, l;
159
+ const u = (i = n?.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? i : [], g = (l = r?.map((S) => t.find((d) => d.id === S)).filter(Boolean)) != null ? l : [], a = t.filter((S) => !(n != null && n.includes(S.id)) && !(r != null && r.includes(S.id)));
160
+ return A(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, r) => (t = t.filter((i) => !(n != null && n.includes(i.id)) && !(r != null && r.includes(i.id))), A(o, t, e, "center")), C(e.options, $, "getCenterHeaderGroups")), e.getLeftHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
162
+ var r;
163
+ const i = (r = n?.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
164
+ return A(o, i, e, "left");
165
+ }, C(e.options, $, "getLeftHeaderGroups")), e.getRightHeaderGroups = m(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
166
+ var r;
167
+ const i = (r = n?.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
168
+ return A(o, i, 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 r, i, l, u, g, a;
180
+ return [...(r = (i = o[0]) == null ? void 0 : i.headers) != null ? r : [], ...(l = (u = t[0]) == null ? void 0 : u.headers) != null ? l : [], ...(g = (a = n[0]) == null ? void 0 : a.headers) != null ? g : []].map((c) => c.getLeafHeaders()).flat();
181
+ }, C(e.options, $, "getLeafHeaders"));
182
+ }
183
+ };
184
+ function A(e, o, t, n) {
185
+ var r, i;
186
+ let l = 0;
187
+ const u = function(d, s) {
188
+ s === void 0 && (s = 1), l = Math.max(l, s), d.filter((f) => f.getIsVisible()).forEach((f) => {
189
+ var p;
190
+ (p = f.columns) != null && p.length && u(f.columns, s + 1);
191
+ }, 0);
192
+ };
193
+ u(e);
194
+ let g = [];
195
+ const a = (d, s) => {
196
+ const f = {
197
+ depth: s,
198
+ id: [n, `${s}`].filter(Boolean).join("_"),
199
+ headers: []
200
+ }, p = [];
201
+ d.forEach((w) => {
202
+ const R = [...p].reverse()[0], h = w.column.depth === f.depth;
203
+ let _, V = !1;
204
+ if (h && w.column.parent ? _ = w.column.parent : (_ = w.column, V = !0), R && R?.column === _)
205
+ R.subHeaders.push(w);
206
+ else {
207
+ const F = oe(t, _, {
208
+ id: [n, s, _.id, w?.id].filter(Boolean).join("_"),
209
+ isPlaceholder: V,
210
+ placeholderId: V ? `${p.filter((v) => v.column === _).length}` : void 0,
211
+ depth: s,
212
+ index: p.length
213
+ });
214
+ F.subHeaders.push(w), p.push(F);
215
+ }
216
+ f.headers.push(w), w.headerGroup = f;
217
+ }), g.push(f), s > 0 && a(p, s - 1);
218
+ }, c = o.map((d, s) => oe(t, d, {
219
+ depth: l,
220
+ index: s
221
+ }));
222
+ a(c, l - 1), g.reverse();
223
+ const S = (d) => d.filter((f) => f.column.getIsVisible()).map((f) => {
224
+ let p = 0, w = 0, R = [0];
225
+ f.subHeaders && f.subHeaders.length ? (R = [], S(f.subHeaders).forEach((_) => {
226
+ let {
227
+ colSpan: V,
228
+ rowSpan: F
229
+ } = _;
230
+ p += V, R.push(F);
231
+ })) : p = 1;
232
+ const h = Math.min(...R);
233
+ return w = w + h, f.colSpan = p, f.rowSpan = w, {
234
+ colSpan: p,
235
+ rowSpan: w
236
+ };
237
+ });
238
+ return S((r = (i = g[0]) == null ? void 0 : i.headers) != null ? r : []), g;
239
+ }
240
+ const T = (e, o, t, n, r, i, l) => {
241
+ let u = {
242
+ id: o,
243
+ index: n,
244
+ original: t,
245
+ depth: r,
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: i ?? [],
268
+ getLeafRows: () => ie(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 c = a.getParentRow();
274
+ if (!c) break;
275
+ g.push(c), a = c;
276
+ }
277
+ return g.reverse();
278
+ },
279
+ getAllCells: m(() => [e.getAllLeafColumns()], (g) => g.map((a) => Re(e, u, a, a.id)), C(e.options, "debugRows", "getAllCells")),
280
+ _getAllCellsByColumnId: m(() => [u.getAllCells()], (g) => g.reduce((a, c) => (a[c.column.id] = c, 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
+ }, ve = {
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
+ }, le = (e, o, t) => {
295
+ var n, r;
296
+ const i = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
297
+ return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(i));
298
+ };
299
+ le.autoRemove = (e) => P(e);
300
+ const se = (e, o, t) => {
301
+ var n;
302
+ return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
303
+ };
304
+ se.autoRemove = (e) => P(e);
305
+ const ue = (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
+ ue.autoRemove = (e) => P(e);
310
+ const ge = (e, o, t) => {
311
+ var n;
312
+ return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
313
+ };
314
+ ge.autoRemove = (e) => P(e);
315
+ const ae = (e, o, t) => !t.some((n) => {
316
+ var r;
317
+ return !((r = e.getValue(o)) != null && r.includes(n));
318
+ });
319
+ ae.autoRemove = (e) => P(e) || !(e != null && e.length);
320
+ const de = (e, o, t) => t.some((n) => {
321
+ var r;
322
+ return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
323
+ });
324
+ de.autoRemove = (e) => P(e) || !(e != null && e.length);
325
+ const fe = (e, o, t) => e.getValue(o) === t;
326
+ fe.autoRemove = (e) => P(e);
327
+ const ce = (e, o, t) => e.getValue(o) == t;
328
+ ce.autoRemove = (e) => P(e);
329
+ const b = (e, o, t) => {
330
+ let [n, r] = t;
331
+ const i = e.getValue(o);
332
+ return i >= n && i <= r;
333
+ };
334
+ b.resolveFilterValue = (e) => {
335
+ let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, i = o === null || Number.isNaN(n) ? -1 / 0 : n, l = t === null || Number.isNaN(r) ? 1 / 0 : r;
336
+ if (i > l) {
337
+ const u = i;
338
+ i = l, l = u;
339
+ }
340
+ return [i, l];
341
+ };
342
+ b.autoRemove = (e) => P(e) || P(e[0]) && P(e[1]);
343
+ const x = {
344
+ includesString: le,
345
+ includesStringSensitive: se,
346
+ equalsString: ue,
347
+ arrIncludes: ge,
348
+ arrIncludesAll: ae,
349
+ arrIncludesSome: de,
350
+ equals: fe,
351
+ weakEquals: ce,
352
+ inNumberRange: b
353
+ };
354
+ function P(e) {
355
+ return e == null || e === "";
356
+ }
357
+ const _e = {
358
+ getDefaultColumnDef: () => ({
359
+ filterFn: "auto"
360
+ }),
361
+ getInitialState: (e) => ({
362
+ columnFilters: [],
363
+ ...e
364
+ }),
365
+ getDefaultOptions: (e) => ({
366
+ onColumnFiltersChange: M("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" ? x.includesString : typeof n == "number" ? x.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? x.equals : Array.isArray(n) ? x.arrIncludes : x.weakEquals;
374
+ }, e.getFilterFn = () => {
375
+ var t, n;
376
+ return B(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 : x[e.columnDef.filterFn]
379
+ );
380
+ }, e.getCanFilter = () => {
381
+ var t, n, r;
382
+ return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !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((r) => r.id === e.id)) != null ? t : -1;
389
+ }, e.setFilterValue = (t) => {
390
+ o.setColumnFilters((n) => {
391
+ const r = e.getFilterFn(), i = n?.find((c) => c.id === e.id), l = I(t, i ? i.value : void 0);
392
+ if (re(r, l, e)) {
393
+ var u;
394
+ return (u = n?.filter((c) => c.id !== e.id)) != null ? u : [];
395
+ }
396
+ const g = {
397
+ id: e.id,
398
+ value: l
399
+ };
400
+ if (i) {
401
+ var a;
402
+ return (a = n?.map((c) => c.id === e.id ? g : c)) != 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 = (r) => {
414
+ var i;
415
+ return (i = I(o, r)) == null ? void 0 : i.filter((l) => {
416
+ const u = t.find((g) => g.id === l.id);
417
+ if (u) {
418
+ const g = u.getFilterFn();
419
+ if (re(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 re(e, o, t) {
433
+ return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
434
+ }
435
+ const Fe = (e, o, t) => t.reduce((n, r) => {
436
+ const i = r.getValue(e);
437
+ return n + (typeof i == "number" ? i : 0);
438
+ }, 0), $e = (e, o, t) => {
439
+ let n;
440
+ return t.forEach((r) => {
441
+ const i = r.getValue(e);
442
+ i != null && (n > i || n === void 0 && i >= i) && (n = i);
443
+ }), n;
444
+ }, Ve = (e, o, t) => {
445
+ let n;
446
+ return t.forEach((r) => {
447
+ const i = r.getValue(e);
448
+ i != null && (n < i || n === void 0 && i >= i) && (n = i);
449
+ }), n;
450
+ }, Me = (e, o, t) => {
451
+ let n, r;
452
+ return t.forEach((i) => {
453
+ const l = i.getValue(e);
454
+ l != null && (n === void 0 ? l >= l && (n = r = l) : (n > l && (n = l), r < l && (r = l)));
455
+ }), [n, r];
456
+ }, Pe = (e, o) => {
457
+ let t = 0, n = 0;
458
+ if (o.forEach((r) => {
459
+ let i = r.getValue(e);
460
+ i != null && (i = +i) >= i && (++t, n += i);
461
+ }), t) return n / t;
462
+ }, xe = (e, o) => {
463
+ if (!o.length)
464
+ return;
465
+ const t = o.map((i) => i.getValue(e));
466
+ if (!Ce(t))
467
+ return;
468
+ if (t.length === 1)
469
+ return t[0];
470
+ const n = Math.floor(t.length / 2), r = t.sort((i, l) => i - l);
471
+ return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
472
+ }, Ie = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), Ee = (e, o) => new Set(o.map((t) => t.getValue(e))).size, ye = (e, o) => o.length, q = {
473
+ sum: Fe,
474
+ min: $e,
475
+ max: Ve,
476
+ extent: Me,
477
+ mean: Pe,
478
+ median: xe,
479
+ unique: Ie,
480
+ uniqueCount: Ee,
481
+ count: ye
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: M("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 q.sum;
519
+ if (Object.prototype.toString.call(n) === "[object Date]")
520
+ return q.extent;
521
+ }, e.getAggregationFn = () => {
522
+ var t, n;
523
+ if (!e)
524
+ throw new Error();
525
+ return B(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : q[e.columnDef.aggregationFn];
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 r;
545
+ return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((r = t.subRows) != null && r.length);
546
+ };
547
+ }
548
+ };
549
+ function Ge(e, o, t) {
550
+ if (!(o != null && o.length) || !t)
551
+ return e;
552
+ const n = e.filter((i) => !o.includes(i.id));
553
+ return t === "remove" ? n : [...o.map((i) => e.find((l) => l.id === i)).filter(Boolean), ...n];
554
+ }
555
+ const He = {
556
+ getInitialState: (e) => ({
557
+ columnOrder: [],
558
+ ...e
559
+ }),
560
+ getDefaultOptions: (e) => ({
561
+ onColumnOrderChange: M("columnOrder", e)
562
+ }),
563
+ createColumn: (e, o) => {
564
+ e.getIndex = m((t) => [H(o, t)], (t) => t.findIndex((n) => n.id === e.id), C(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
565
+ var n;
566
+ return ((n = H(o, t)[0]) == null ? void 0 : n.id) === e.id;
567
+ }, e.getIsLastColumn = (t) => {
568
+ var n;
569
+ const r = H(o, t);
570
+ return ((n = r[r.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) => (r) => {
578
+ let i = [];
579
+ if (!(o != null && o.length))
580
+ i = r;
581
+ else {
582
+ const l = [...o], u = [...r];
583
+ for (; u.length && l.length; ) {
584
+ const g = l.shift(), a = u.findIndex((c) => c.id === g);
585
+ a > -1 && i.push(u.splice(a, 1)[0]);
586
+ }
587
+ i = [...i, ...u];
588
+ }
589
+ return Ge(i, t, n);
590
+ }, C(e.options, "debugTable", "_getOrderColumnsFn"));
591
+ }
592
+ }, N = () => ({
593
+ left: [],
594
+ right: []
595
+ }), Le = {
596
+ getInitialState: (e) => ({
597
+ columnPinning: N(),
598
+ ...e
599
+ }),
600
+ getDefaultOptions: (e) => ({
601
+ onColumnPinningChange: M("columnPinning", e)
602
+ }),
603
+ createColumn: (e, o) => {
604
+ e.pin = (t) => {
605
+ const n = e.getLeafColumns().map((r) => r.id).filter(Boolean);
606
+ o.setColumnPinning((r) => {
607
+ var i, l;
608
+ if (t === "right") {
609
+ var u, g;
610
+ return {
611
+ left: ((u = r?.left) != null ? u : []).filter((S) => !(n != null && n.includes(S))),
612
+ right: [...((g = r?.right) != null ? g : []).filter((S) => !(n != null && n.includes(S))), ...n]
613
+ };
614
+ }
615
+ if (t === "left") {
616
+ var a, c;
617
+ return {
618
+ left: [...((a = r?.left) != null ? a : []).filter((S) => !(n != null && n.includes(S))), ...n],
619
+ right: ((c = r?.right) != null ? c : []).filter((S) => !(n != null && n.includes(S)))
620
+ };
621
+ }
622
+ return {
623
+ left: ((i = r?.left) != null ? i : []).filter((S) => !(n != null && n.includes(S))),
624
+ right: ((l = r?.right) != null ? l : []).filter((S) => !(n != null && n.includes(S)))
625
+ };
626
+ });
627
+ }, e.getCanPin = () => e.getLeafColumns().some((n) => {
628
+ var r, i, l;
629
+ return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((i = (l = o.options.enableColumnPinning) != null ? l : o.options.enablePinning) != null ? i : !0);
630
+ }), e.getIsPinned = () => {
631
+ const t = e.getLeafColumns().map((u) => u.id), {
632
+ left: n,
633
+ right: r
634
+ } = o.getState().columnPinning, i = t.some((u) => n?.includes(u)), l = t.some((u) => r?.includes(u));
635
+ return i ? "left" : l ? "right" : !1;
636
+ }, e.getPinnedIndex = () => {
637
+ var t, n;
638
+ const r = e.getIsPinned();
639
+ return r ? (t = (n = o.getState().columnPinning) == null || (n = n[r]) == 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, r) => {
644
+ const i = [...n ?? [], ...r ?? []];
645
+ return t.filter((l) => !i.includes(l.column.id));
646
+ }, C(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((i) => t.find((l) => l.column.id === i)).filter(Boolean).map((i) => ({
647
+ ...i,
648
+ position: "left"
649
+ })), C(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = m(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((i) => t.find((l) => l.column.id === i)).filter(Boolean).map((i) => ({
650
+ ...i,
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 ? N() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : N());
658
+ }, e.getIsSomeColumnsPinned = (o) => {
659
+ var t;
660
+ const n = e.getState().columnPinning;
661
+ if (!o) {
662
+ var r, i;
663
+ return !!((r = n.left) != null && r.length || (i = n.right) != null && i.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((r) => r.id === n)).filter(Boolean), C(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), C(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = m(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
667
+ const r = [...t ?? [], ...n ?? []];
668
+ return o.filter((i) => !r.includes(i.id));
669
+ }, C(e.options, "debugColumns", "getCenterLeafColumns"));
670
+ }
671
+ };
672
+ function Ae(e) {
673
+ return e || (typeof document < "u" ? document : null);
674
+ }
675
+ const z = {
676
+ size: 150,
677
+ minSize: 20,
678
+ maxSize: Number.MAX_SAFE_INTEGER
679
+ }, k = () => ({
680
+ startOffset: null,
681
+ startSize: null,
682
+ deltaOffset: null,
683
+ deltaPercentage: null,
684
+ isResizingColumn: !1,
685
+ columnSizingStart: []
686
+ }), ze = {
687
+ getDefaultColumnDef: () => z,
688
+ getInitialState: (e) => ({
689
+ columnSizing: {},
690
+ columnSizingInfo: k(),
691
+ ...e
692
+ }),
693
+ getDefaultOptions: (e) => ({
694
+ columnResizeMode: "onEnd",
695
+ columnResizeDirection: "ltr",
696
+ onColumnSizingChange: M("columnSizing", e),
697
+ onColumnSizingInfoChange: M("columnSizingInfo", e)
698
+ }),
699
+ createColumn: (e, o) => {
700
+ e.getSize = () => {
701
+ var t, n, r;
702
+ const i = o.getState().columnSizing[e.id];
703
+ return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : z.minSize, (n = i ?? e.columnDef.size) != null ? n : z.size), (r = e.columnDef.maxSize) != null ? r : z.maxSize);
704
+ }, e.getStart = m((t) => [t, H(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, i) => r + i.getSize(), 0), C(o.options, "debugColumns", "getStart")), e.getAfter = m((t) => [t, H(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, i) => r + i.getSize(), 0), C(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
705
+ o.setColumnSizing((t) => {
706
+ let {
707
+ [e.id]: n,
708
+ ...r
709
+ } = t;
710
+ return r;
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 = (r) => {
721
+ if (r.subHeaders.length)
722
+ r.subHeaders.forEach(n);
723
+ else {
724
+ var i;
725
+ t += (i = r.column.getSize()) != null ? i : 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), r = n?.getCanResize();
737
+ return (i) => {
738
+ if (!n || !r || (i.persist == null || i.persist(), j(i) && i.touches && i.touches.length > 1))
739
+ return;
740
+ const l = e.getSize(), u = e ? e.getLeafHeaders().map((R) => [R.column.id, R.column.getSize()]) : [[n.id, n.getSize()]], g = j(i) ? Math.round(i.touches[0].clientX) : i.clientX, a = {}, c = (R, h) => {
741
+ typeof h == "number" && (o.setColumnSizingInfo((_) => {
742
+ var V, F;
743
+ const v = o.options.columnResizeDirection === "rtl" ? -1 : 1, y = (h - ((V = _?.startOffset) != null ? V : 0)) * v, D = Math.max(y / ((F = _?.startSize) != null ? F : 0), -0.999999);
744
+ return _.columnSizingStart.forEach((L) => {
745
+ let [me, ne] = L;
746
+ a[me] = Math.round(Math.max(ne + ne * D, 0) * 100) / 100;
747
+ }), {
748
+ ..._,
749
+ deltaOffset: y,
750
+ deltaPercentage: D
751
+ };
752
+ }), (o.options.columnResizeMode === "onChange" || R === "end") && o.setColumnSizing((_) => ({
753
+ ..._,
754
+ ...a
755
+ })));
756
+ }, S = (R) => c("move", R), d = (R) => {
757
+ c("end", R), 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 = Ae(t), f = {
767
+ moveHandler: (R) => S(R.clientX),
768
+ upHandler: (R) => {
769
+ s?.removeEventListener("mousemove", f.moveHandler), s?.removeEventListener("mouseup", f.upHandler), d(R.clientX);
770
+ }
771
+ }, p = {
772
+ moveHandler: (R) => (R.cancelable && (R.preventDefault(), R.stopPropagation()), S(R.touches[0].clientX), !1),
773
+ upHandler: (R) => {
774
+ var h;
775
+ s?.removeEventListener("touchmove", p.moveHandler), s?.removeEventListener("touchend", p.upHandler), R.cancelable && (R.preventDefault(), R.stopPropagation()), d((h = R.touches[0]) == null ? void 0 : h.clientX);
776
+ }
777
+ }, w = Oe() ? {
778
+ passive: !1
779
+ } : !1;
780
+ j(i) ? (s?.addEventListener("touchmove", p.moveHandler, w), s?.addEventListener("touchend", p.upHandler, w)) : (s?.addEventListener("mousemove", f.moveHandler, w), s?.addEventListener("mouseup", f.upHandler, w)), o.setColumnSizingInfo((R) => ({
781
+ ...R,
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 ? k() : (t = e.initialState.columnSizingInfo) != null ? t : k());
799
+ }, e.getTotalSize = () => {
800
+ var o, t;
801
+ return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.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, r) => n + r.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, r) => n + r.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, r) => n + r.getSize(), 0)) != null ? o : 0;
811
+ };
812
+ }
813
+ };
814
+ let O = null;
815
+ function Oe() {
816
+ if (typeof O == "boolean") return O;
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 O = e, O;
830
+ }
831
+ function j(e) {
832
+ return e.type === "touchstart";
833
+ }
834
+ const Be = {
835
+ getInitialState: (e) => ({
836
+ columnVisibility: {},
837
+ ...e
838
+ }),
839
+ getDefaultOptions: (e) => ({
840
+ onColumnVisibilityChange: M("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 r = e.columns;
851
+ return (t = r.length ? r.some((i) => i.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, r) => [...t, ...n, ...r], C(o.options, "debugRows", "getVisibleCells"));
861
+ },
862
+ createTable: (e) => {
863
+ const o = (t, n) => m(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((i) => i.getIsVisible == null ? void 0 : i.getIsVisible()), C(e.options, "debugColumns", t));
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((r, i) => ({
870
+ ...r,
871
+ [i.id]: t || !(i.getCanHide != null && i.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 H(e, o) {
880
+ return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
881
+ }
882
+ const Te = {
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
+ }, qe = {
890
+ getInitialState: (e) => ({
891
+ globalFilter: void 0,
892
+ ...e
893
+ }),
894
+ getDefaultOptions: (e) => ({
895
+ onGlobalFilterChange: M("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, r, i;
906
+ return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && ((i = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? i : !0) && !!e.accessorFn;
907
+ };
908
+ },
909
+ createTable: (e) => {
910
+ e.getGlobalAutoFilterFn = () => x.includesString, e.getGlobalFilterFn = () => {
911
+ var o, t;
912
+ const {
913
+ globalFilterFn: n
914
+ } = e.options;
915
+ return B(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : x[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
+ }, Ne = {
923
+ getInitialState: (e) => ({
924
+ expanded: {},
925
+ ...e
926
+ }),
927
+ getDefaultOptions: (e) => ({
928
+ onExpandedChange: M("expanded", e),
929
+ paginateExpandedRows: !0
930
+ }),
931
+ createTable: (e) => {
932
+ let o = !1, t = !1;
933
+ e._autoResetExpanded = () => {
934
+ var n, r;
935
+ if (!o) {
936
+ e._queue(() => {
937
+ o = !0;
938
+ });
939
+ return;
940
+ }
941
+ if ((n = (r = e.options.autoResetAll) != null ? r : 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 r, i;
951
+ e.setExpanded(n ? {} : (r = (i = e.initialState) == null ? void 0 : i.expanded) != null ? r : {});
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((r) => !r.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((i) => {
963
+ const l = i.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 r;
972
+ const i = 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 = (r = t) != null ? r : !i, !i && t)
977
+ return {
978
+ ...l,
979
+ [e.id]: !0
980
+ };
981
+ if (i && !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, r;
996
+ 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);
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
+ }, J = 0, Q = 10, U = () => ({
1010
+ pageIndex: J,
1011
+ pageSize: Q
1012
+ }), ke = {
1013
+ getInitialState: (e) => ({
1014
+ ...e,
1015
+ pagination: {
1016
+ ...U(),
1017
+ ...e?.pagination
1018
+ }
1019
+ }),
1020
+ getDefaultOptions: (e) => ({
1021
+ onPaginationChange: M("pagination", e)
1022
+ }),
1023
+ createTable: (e) => {
1024
+ let o = !1, t = !1;
1025
+ e._autoResetPageIndex = () => {
1026
+ var n, r;
1027
+ if (!o) {
1028
+ e._queue(() => {
1029
+ o = !0;
1030
+ });
1031
+ return;
1032
+ }
1033
+ if ((n = (r = e.options.autoResetAll) != null ? r : 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 r = (i) => I(n, i);
1041
+ return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
1042
+ }, e.resetPagination = (n) => {
1043
+ var r;
1044
+ e.setPagination(n ? U() : (r = e.initialState.pagination) != null ? r : U());
1045
+ }, e.setPageIndex = (n) => {
1046
+ e.setPagination((r) => {
1047
+ let i = I(n, r.pageIndex);
1048
+ const l = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
1049
+ return i = Math.max(0, Math.min(i, l)), {
1050
+ ...r,
1051
+ pageIndex: i
1052
+ };
1053
+ });
1054
+ }, e.resetPageIndex = (n) => {
1055
+ var r, i;
1056
+ e.setPageIndex(n ? J : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageIndex) != null ? r : J);
1057
+ }, e.resetPageSize = (n) => {
1058
+ var r, i;
1059
+ e.setPageSize(n ? Q : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageSize) != null ? r : Q);
1060
+ }, e.setPageSize = (n) => {
1061
+ e.setPagination((r) => {
1062
+ const i = Math.max(1, I(n, r.pageSize)), l = r.pageSize * r.pageIndex, u = Math.floor(l / i);
1063
+ return {
1064
+ ...r,
1065
+ pageIndex: u,
1066
+ pageSize: i
1067
+ };
1068
+ });
1069
+ }, e.setPageCount = (n) => e.setPagination((r) => {
1070
+ var i;
1071
+ let l = I(n, (i = e.options.pageCount) != null ? i : -1);
1072
+ return typeof l == "number" && (l = Math.max(-1, l)), {
1073
+ ...r,
1074
+ pageCount: l
1075
+ };
1076
+ }), e.getPageOptions = m(() => [e.getPageCount()], (n) => {
1077
+ let r = [];
1078
+ return n && n > 0 && (r = [...new Array(n)].fill(null).map((i, l) => l)), r;
1079
+ }, C(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
1080
+ const {
1081
+ pageIndex: n
1082
+ } = e.getState().pagination, r = e.getPageCount();
1083
+ return r === -1 ? !0 : r === 0 ? !1 : n < r - 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
+ }, X = () => ({
1093
+ top: [],
1094
+ bottom: []
1095
+ }), je = {
1096
+ getInitialState: (e) => ({
1097
+ rowPinning: X(),
1098
+ ...e
1099
+ }),
1100
+ getDefaultOptions: (e) => ({
1101
+ onRowPinningChange: M("rowPinning", e)
1102
+ }),
1103
+ createRow: (e, o) => {
1104
+ e.pin = (t, n, r) => {
1105
+ const i = n ? e.getLeafRows().map((g) => {
1106
+ let {
1107
+ id: a
1108
+ } = g;
1109
+ return a;
1110
+ }) : [], l = r ? e.getParentRows().map((g) => {
1111
+ let {
1112
+ id: a
1113
+ } = g;
1114
+ return a;
1115
+ }) : [], u = /* @__PURE__ */ new Set([...l, e.id, ...i]);
1116
+ o.setRowPinning((g) => {
1117
+ var a, c;
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, f;
1127
+ return {
1128
+ top: [...((s = g?.top) != null ? s : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)],
1129
+ bottom: ((f = g?.bottom) != null ? f : []).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: ((c = g?.bottom) != null ? c : []).filter((p) => !(u != null && u.has(p)))
1135
+ };
1136
+ });
1137
+ }, e.getCanPin = () => {
1138
+ var t;
1139
+ const {
1140
+ enableRowPinning: n,
1141
+ enablePinning: r
1142
+ } = o.options;
1143
+ return typeof n == "function" ? n(e) : (t = n ?? r) != null ? t : !0;
1144
+ }, e.getIsPinned = () => {
1145
+ const t = [e.id], {
1146
+ top: n,
1147
+ bottom: r
1148
+ } = o.getState().rowPinning, i = t.some((u) => n?.includes(u)), l = t.some((u) => r?.includes(u));
1149
+ return i ? "top" : l ? "bottom" : !1;
1150
+ }, e.getPinnedIndex = () => {
1151
+ var t, n;
1152
+ const r = e.getIsPinned();
1153
+ if (!r) return -1;
1154
+ const i = (t = r === "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 = i?.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 ? X() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : X());
1167
+ }, e.getIsSomeRowsPinned = (o) => {
1168
+ var t;
1169
+ const n = e.getState().rowPinning;
1170
+ if (!o) {
1171
+ var r, i;
1172
+ return !!((r = n.top) != null && r.length || (i = n.bottom) != null && i.length);
1173
+ }
1174
+ return !!((t = n[o]) != null && t.length);
1175
+ }, e._getPinnedRows = (o, t, n) => {
1176
+ var r;
1177
+ return ((r = e.options.keepPinnedRows) == null || r ? (
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 r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
1193
+ return o.filter((i) => !r.has(i.id));
1194
+ }, C(e.options, "debugRows", "getCenterRows"));
1195
+ }
1196
+ }, Ue = {
1197
+ getInitialState: (e) => ({
1198
+ rowSelection: {},
1199
+ ...e
1200
+ }),
1201
+ getDefaultOptions: (e) => ({
1202
+ onRowSelectionChange: M("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
+ }, r = e.getPreGroupedRowModel().flatRows;
1220
+ return o ? r.forEach((i) => {
1221
+ i.getCanSelect() && (n[i.id] = !0);
1222
+ }) : r.forEach((i) => {
1223
+ delete n[i.id];
1224
+ }), n;
1225
+ });
1226
+ }, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
1227
+ const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), r = {
1228
+ ...t
1229
+ };
1230
+ return e.getRowModel().rows.forEach((i) => {
1231
+ W(r, i.id, n, !0, e);
1232
+ }), r;
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((r) => r.getCanSelect() && !t[r.id]) && (n = !1), n;
1251
+ }, e.getIsAllPageRowsSelected = () => {
1252
+ const o = e.getPaginationRowModel().flatRows.filter((r) => r.getCanSelect()), {
1253
+ rowSelection: t
1254
+ } = e.getState();
1255
+ let n = !!o.length;
1256
+ return n && o.some((r) => !t[r.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 r = e.getIsSelected();
1273
+ o.setRowSelection((i) => {
1274
+ var l;
1275
+ if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
1276
+ return i;
1277
+ const u = {
1278
+ ...i
1279
+ };
1280
+ return W(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 ee(e, t);
1287
+ }, e.getIsSomeSelected = () => {
1288
+ const {
1289
+ rowSelection: t
1290
+ } = o.getState();
1291
+ return Y(e, t) === "some";
1292
+ }, e.getIsAllSubRowsSelected = () => {
1293
+ const {
1294
+ rowSelection: t
1295
+ } = o.getState();
1296
+ return Y(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 r;
1310
+ t && e.toggleSelected((r = n.target) == null ? void 0 : r.checked);
1311
+ };
1312
+ };
1313
+ }
1314
+ }, W = (e, o, t, n, r) => {
1315
+ var i;
1316
+ const l = r.getRow(o, !0);
1317
+ t ? (l.getCanMultiSelect() || Object.keys(e).forEach((u) => delete e[u]), l.getCanSelect() && (e[o] = !0)) : delete e[o], n && (i = l.subRows) != null && i.length && l.getCanSelectSubRows() && l.subRows.forEach((u) => W(e, u.id, t, n, r));
1318
+ };
1319
+ function K(e, o) {
1320
+ const t = e.getState().rowSelection, n = [], r = {}, i = function(l, u) {
1321
+ return l.map((g) => {
1322
+ var a;
1323
+ const c = ee(g, t);
1324
+ if (c && (n.push(g), r[g.id] = g), (a = g.subRows) != null && a.length && (g = {
1325
+ ...g,
1326
+ subRows: i(g.subRows)
1327
+ }), c)
1328
+ return g;
1329
+ }).filter(Boolean);
1330
+ };
1331
+ return {
1332
+ rows: i(o.rows),
1333
+ flatRows: n,
1334
+ rowsById: r
1335
+ };
1336
+ }
1337
+ function ee(e, o) {
1338
+ var t;
1339
+ return (t = o[e.id]) != null ? t : !1;
1340
+ }
1341
+ function Y(e, o, t) {
1342
+ var n;
1343
+ if (!((n = e.subRows) != null && n.length)) return !1;
1344
+ let r = !0, i = !1;
1345
+ return e.subRows.forEach((l) => {
1346
+ if (!(i && !r) && (l.getCanSelect() && (ee(l, o) ? i = !0 : r = !1), l.subRows && l.subRows.length)) {
1347
+ const u = Y(l, o);
1348
+ u === "all" ? i = !0 : (u === "some" && (i = !0), r = !1);
1349
+ }
1350
+ }), r ? "all" : i ? "some" : !1;
1351
+ }
1352
+ const Z = /([0-9]+)/gm, Xe = (e, o, t) => pe(E(e.getValue(t)).toLowerCase(), E(o.getValue(t)).toLowerCase()), Ke = (e, o, t) => pe(E(e.getValue(t)), E(o.getValue(t))), Je = (e, o, t) => te(E(e.getValue(t)).toLowerCase(), E(o.getValue(t)).toLowerCase()), Qe = (e, o, t) => te(E(e.getValue(t)), E(o.getValue(t))), We = (e, o, t) => {
1353
+ const n = e.getValue(t), r = o.getValue(t);
1354
+ return n > r ? 1 : n < r ? -1 : 0;
1355
+ }, Ye = (e, o, t) => te(e.getValue(t), o.getValue(t));
1356
+ function te(e, o) {
1357
+ return e === o ? 0 : e > o ? 1 : -1;
1358
+ }
1359
+ function E(e) {
1360
+ return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
1361
+ }
1362
+ function pe(e, o) {
1363
+ const t = e.split(Z).filter(Boolean), n = o.split(Z).filter(Boolean);
1364
+ for (; t.length && n.length; ) {
1365
+ const r = t.shift(), i = n.shift(), l = parseInt(r, 10), u = parseInt(i, 10), g = [l, u].sort();
1366
+ if (isNaN(g[0])) {
1367
+ if (r > i)
1368
+ return 1;
1369
+ if (i > r)
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 G = {
1383
+ alphanumeric: Xe,
1384
+ alphanumericCaseSensitive: Ke,
1385
+ text: Je,
1386
+ textCaseSensitive: Qe,
1387
+ datetime: We,
1388
+ basic: Ye
1389
+ }, Ze = {
1390
+ getInitialState: (e) => ({
1391
+ sorting: [],
1392
+ ...e
1393
+ }),
1394
+ getDefaultColumnDef: () => ({
1395
+ sortingFn: "auto",
1396
+ sortUndefined: 1
1397
+ }),
1398
+ getDefaultOptions: (e) => ({
1399
+ onSortingChange: M("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 r of t) {
1407
+ const i = r?.getValue(e.id);
1408
+ if (Object.prototype.toString.call(i) === "[object Date]")
1409
+ return G.datetime;
1410
+ if (typeof i == "string" && (n = !0, i.split(Z).length > 1))
1411
+ return G.alphanumeric;
1412
+ }
1413
+ return n ? G.text : G.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 B(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 : G[e.columnDef.sortingFn];
1422
+ }, e.toggleSorting = (t, n) => {
1423
+ const r = e.getNextSortingOrder(), i = 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 = [], c, S = i ? t : r === "desc";
1427
+ if (l != null && l.length && e.getCanMultiSort() && n ? u ? c = "toggle" : c = "add" : l != null && l.length && g !== l.length - 1 ? c = "replace" : u ? c = "toggle" : c = "replace", c === "toggle" && (i || r || (c = "remove")), c === "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 c === "toggle" ? a = l.map((s) => s.id === e.id ? {
1434
+ ...s,
1435
+ desc: S
1436
+ } : s) : c === "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, r;
1447
+ const i = e.getFirstSortDir(), l = e.getIsSorted();
1448
+ return l ? l !== i && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
1449
+ (!(t && (r = o.options.enableMultiRemove) != null) || r) ? !1 : l === "desc" ? "asc" : "desc" : i;
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((r) => r.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((r) => r.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
+ }, be = [
1479
+ he,
1480
+ Be,
1481
+ He,
1482
+ Le,
1483
+ ve,
1484
+ _e,
1485
+ Te,
1486
+ //depends on ColumnFaceting
1487
+ qe,
1488
+ //depends on ColumnFiltering
1489
+ Ze,
1490
+ De,
1491
+ //depends on RowSorting
1492
+ Ne,
1493
+ ke,
1494
+ je,
1495
+ Ue,
1496
+ ze
1497
+ ];
1498
+ function rt(e) {
1499
+ var o, t;
1500
+ process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
1501
+ const n = [...be, ...(o = e._features) != null ? o : []];
1502
+ let r = {
1503
+ _features: n
1504
+ };
1505
+ const i = r._features.reduce((d, s) => Object.assign(d, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(r)), {}), l = (d) => r.options.mergeOptions ? r.options.mergeOptions(i, d) : {
1506
+ ...i,
1507
+ ...d
1508
+ };
1509
+ let g = {
1510
+ ...{},
1511
+ ...(t = e.initialState) != null ? t : {}
1512
+ };
1513
+ r._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 c = !1;
1519
+ const S = {
1520
+ _features: n,
1521
+ options: {
1522
+ ...i,
1523
+ ...e
1524
+ },
1525
+ initialState: g,
1526
+ _queue: (d) => {
1527
+ a.push(d), c || (c = !0, Promise.resolve().then(() => {
1528
+ for (; a.length; )
1529
+ a.shift()();
1530
+ c = !1;
1531
+ }).catch((s) => setTimeout(() => {
1532
+ throw s;
1533
+ })));
1534
+ },
1535
+ reset: () => {
1536
+ r.setState(r.initialState);
1537
+ },
1538
+ setOptions: (d) => {
1539
+ const s = I(d, r.options);
1540
+ r.options = l(s);
1541
+ },
1542
+ getState: () => r.options.state,
1543
+ setState: (d) => {
1544
+ r.options.onStateChange == null || r.options.onStateChange(d);
1545
+ },
1546
+ _getRowId: (d, s, f) => {
1547
+ var p;
1548
+ return (p = r.options.getRowId == null ? void 0 : r.options.getRowId(d, s, f)) != null ? p : `${f ? [f.id, s].join(".") : s}`;
1549
+ },
1550
+ getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
1551
+ // The final calls start at the bottom of the model,
1552
+ // expanded rows, which then work their way up
1553
+ getRowModel: () => r.getPaginationRowModel(),
1554
+ //in next version, we should just pass in the row model as the optional 2nd arg
1555
+ getRow: (d, s) => {
1556
+ let f = (s ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
1557
+ if (!f && (f = r.getCoreRowModel().rowsById[d], !f))
1558
+ throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
1559
+ return f;
1560
+ },
1561
+ _getDefaultColumnDef: m(() => [r.options.defaultColumn], (d) => {
1562
+ var s;
1563
+ return d = (s = d) != null ? s : {}, {
1564
+ header: (f) => {
1565
+ const p = f.header.column.columnDef;
1566
+ return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
1567
+ },
1568
+ // footer: props => props.header.column.id,
1569
+ cell: (f) => {
1570
+ var p, w;
1571
+ return (p = (w = f.renderValue()) == null || w.toString == null ? void 0 : w.toString()) != null ? p : null;
1572
+ },
1573
+ ...r._features.reduce((f, p) => Object.assign(f, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
1574
+ ...d
1575
+ };
1576
+ }, C(e, "debugColumns", "_getDefaultColumnDef")),
1577
+ _getColumnDefs: () => r.options.columns,
1578
+ getAllColumns: m(() => [r._getColumnDefs()], (d) => {
1579
+ const s = function(f, p, w) {
1580
+ return w === void 0 && (w = 0), f.map((R) => {
1581
+ const h = we(r, R, w, p), _ = R;
1582
+ return h.columns = _.columns ? s(_.columns, h, w + 1) : [], h;
1583
+ });
1584
+ };
1585
+ return s(d);
1586
+ }, C(e, "debugColumns", "getAllColumns")),
1587
+ getAllFlatColumns: m(() => [r.getAllColumns()], (d) => d.flatMap((s) => s.getFlatColumns()), C(e, "debugColumns", "getAllFlatColumns")),
1588
+ _getAllFlatColumnsById: m(() => [r.getAllFlatColumns()], (d) => d.reduce((s, f) => (s[f.id] = f, s), {}), C(e, "debugColumns", "getAllFlatColumnsById")),
1589
+ getAllLeafColumns: m(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, s) => {
1590
+ let f = d.flatMap((p) => p.getLeafColumns());
1591
+ return s(f);
1592
+ }, C(e, "debugColumns", "getAllLeafColumns")),
1593
+ getColumn: (d) => {
1594
+ const s = r._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(r, S);
1599
+ for (let d = 0; d < r._features.length; d++) {
1600
+ const s = r._features[d];
1601
+ s == null || s.createTable == null || s.createTable(r);
1602
+ }
1603
+ return r;
1604
+ }
1605
+ function it() {
1606
+ return (e) => m(() => [e.options.data], (o) => {
1607
+ const t = {
1608
+ rows: [],
1609
+ flatRows: [],
1610
+ rowsById: {}
1611
+ }, n = function(r, i, l) {
1612
+ i === void 0 && (i = 0);
1613
+ const u = [];
1614
+ for (let a = 0; a < r.length; a++) {
1615
+ const c = T(e, e._getRowId(r[a], a, l), r[a], a, i, void 0, l?.id);
1616
+ if (t.flatRows.push(c), t.rowsById[c.id] = c, u.push(c), e.options.getSubRows) {
1617
+ var g;
1618
+ c.originalSubRows = e.options.getSubRows(r[a], a), (g = c.originalSubRows) != null && g.length && (c.subRows = n(c.originalSubRows, i + 1, c));
1619
+ }
1620
+ }
1621
+ return u;
1622
+ };
1623
+ return t.rows = n(o), t;
1624
+ }, C(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
1625
+ }
1626
+ function lt() {
1627
+ return (e) => m(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (o, t, n) => !t.rows.length || o !== !0 && !Object.keys(o ?? {}).length || !n ? t : Se(t), C(e.options, "debugTable", "getExpandedRowModel"));
1628
+ }
1629
+ function Se(e) {
1630
+ const o = [], t = (n) => {
1631
+ var r;
1632
+ o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
1633
+ };
1634
+ return e.rows.forEach(t), {
1635
+ rows: o,
1636
+ flatRows: e.flatRows,
1637
+ rowsById: e.rowsById
1638
+ };
1639
+ }
1640
+ function et(e, o, t) {
1641
+ return t.options.filterFromLeafRows ? tt(e, o, t) : nt(e, o, t);
1642
+ }
1643
+ function tt(e, o, t) {
1644
+ var n;
1645
+ const r = [], i = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(g, a) {
1646
+ a === void 0 && (a = 0);
1647
+ const c = [];
1648
+ for (let d = 0; d < g.length; d++) {
1649
+ var S;
1650
+ let s = g[d];
1651
+ const f = T(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
1652
+ if (f.columnFilters = s.columnFilters, (S = s.subRows) != null && S.length && a < l) {
1653
+ if (f.subRows = u(s.subRows, a + 1), s = f, o(s) && !f.subRows.length) {
1654
+ c.push(s), i[s.id] = s, r.push(s);
1655
+ continue;
1656
+ }
1657
+ if (o(s) || f.subRows.length) {
1658
+ c.push(s), i[s.id] = s, r.push(s);
1659
+ continue;
1660
+ }
1661
+ } else
1662
+ s = f, o(s) && (c.push(s), i[s.id] = s, r.push(s));
1663
+ }
1664
+ return c;
1665
+ };
1666
+ return {
1667
+ rows: u(e),
1668
+ flatRows: r,
1669
+ rowsById: i
1670
+ };
1671
+ }
1672
+ function nt(e, o, t) {
1673
+ var n;
1674
+ const r = [], i = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(g, a) {
1675
+ a === void 0 && (a = 0);
1676
+ const c = [];
1677
+ for (let d = 0; d < g.length; d++) {
1678
+ let s = g[d];
1679
+ if (o(s)) {
1680
+ var S;
1681
+ if ((S = s.subRows) != null && S.length && a < l) {
1682
+ const p = T(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
1683
+ p.subRows = u(s.subRows, a + 1), s = p;
1684
+ }
1685
+ c.push(s), r.push(s), i[s.id] = s;
1686
+ }
1687
+ }
1688
+ return c;
1689
+ };
1690
+ return {
1691
+ rows: u(e),
1692
+ flatRows: r,
1693
+ rowsById: i
1694
+ };
1695
+ }
1696
+ function st() {
1697
+ return (e) => m(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
1698
+ if (!o.rows.length || !(t != null && t.length) && !n) {
1699
+ for (let d = 0; d < o.flatRows.length; d++)
1700
+ o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
1701
+ return o;
1702
+ }
1703
+ const r = [], i = [];
1704
+ (t ?? []).forEach((d) => {
1705
+ var s;
1706
+ const f = e.getColumn(d.id);
1707
+ if (!f)
1708
+ return;
1709
+ const p = f.getFilterFn();
1710
+ if (!p) {
1711
+ process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${f.id}.`);
1712
+ return;
1713
+ }
1714
+ r.push({
1715
+ id: d.id,
1716
+ filterFn: p,
1717
+ resolvedValue: (s = p.resolveFilterValue == null ? void 0 : p.resolveFilterValue(d.value)) != null ? s : d.value
1718
+ });
1719
+ });
1720
+ const l = (t ?? []).map((d) => d.id), u = e.getGlobalFilterFn(), g = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
1721
+ n && u && g.length && (l.push("__global__"), g.forEach((d) => {
1722
+ var s;
1723
+ i.push({
1724
+ id: d.id,
1725
+ filterFn: u,
1726
+ resolvedValue: (s = u.resolveFilterValue == null ? void 0 : u.resolveFilterValue(n)) != null ? s : n
1727
+ });
1728
+ }));
1729
+ let a, c;
1730
+ for (let d = 0; d < o.flatRows.length; d++) {
1731
+ const s = o.flatRows[d];
1732
+ if (s.columnFilters = {}, r.length)
1733
+ for (let f = 0; f < r.length; f++) {
1734
+ a = r[f];
1735
+ const p = a.id;
1736
+ s.columnFilters[p] = a.filterFn(s, p, a.resolvedValue, (w) => {
1737
+ s.columnFiltersMeta[p] = w;
1738
+ });
1739
+ }
1740
+ if (i.length) {
1741
+ for (let f = 0; f < i.length; f++) {
1742
+ c = i[f];
1743
+ const p = c.id;
1744
+ if (c.filterFn(s, p, c.resolvedValue, (w) => {
1745
+ s.columnFiltersMeta[p] = w;
1746
+ })) {
1747
+ s.columnFilters.__global__ = !0;
1748
+ break;
1749
+ }
1750
+ }
1751
+ s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
1752
+ }
1753
+ }
1754
+ const S = (d) => {
1755
+ for (let s = 0; s < l.length; s++)
1756
+ if (d.columnFilters[l[s]] === !1)
1757
+ return !1;
1758
+ return !0;
1759
+ };
1760
+ return et(o.rows, S, e);
1761
+ }, C(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
1762
+ }
1763
+ function ut() {
1764
+ return (e) => m(() => [e.getState().grouping, e.getPreGroupedRowModel()], (o, t) => {
1765
+ if (!t.rows.length || !o.length)
1766
+ return t.rows.forEach((g) => {
1767
+ g.depth = 0, g.parentId = void 0;
1768
+ }), t;
1769
+ const n = o.filter((g) => e.getColumn(g)), r = [], i = {}, l = function(g, a, c) {
1770
+ if (a === void 0 && (a = 0), a >= n.length)
1771
+ return g.map((f) => (f.depth = a, r.push(f), i[f.id] = f, f.subRows && (f.subRows = l(f.subRows, a + 1, f.id)), f));
1772
+ const S = n[a], d = ot(g, S);
1773
+ return Array.from(d.entries()).map((f, p) => {
1774
+ let [w, R] = f, h = `${S}:${w}`;
1775
+ h = c ? `${c}>${h}` : h;
1776
+ const _ = l(R, a + 1, h);
1777
+ _.forEach((v) => {
1778
+ v.parentId = h;
1779
+ });
1780
+ const V = a ? ie(R, (v) => v.subRows) : R, F = T(e, h, V[0].original, p, a, void 0, c);
1781
+ return Object.assign(F, {
1782
+ groupingColumnId: S,
1783
+ groupingValue: w,
1784
+ subRows: _,
1785
+ leafRows: V,
1786
+ getValue: (v) => {
1787
+ if (n.includes(v)) {
1788
+ if (F._valuesCache.hasOwnProperty(v))
1789
+ return F._valuesCache[v];
1790
+ if (R[0]) {
1791
+ var y;
1792
+ F._valuesCache[v] = (y = R[0].getValue(v)) != null ? y : void 0;
1793
+ }
1794
+ return F._valuesCache[v];
1795
+ }
1796
+ if (F._groupingValuesCache.hasOwnProperty(v))
1797
+ return F._groupingValuesCache[v];
1798
+ const D = e.getColumn(v), L = D?.getAggregationFn();
1799
+ if (L)
1800
+ return F._groupingValuesCache[v] = L(v, V, R), F._groupingValuesCache[v];
1801
+ }
1802
+ }), _.forEach((v) => {
1803
+ r.push(v), i[v.id] = v;
1804
+ }), F;
1805
+ });
1806
+ }, u = l(t.rows, 0);
1807
+ return u.forEach((g) => {
1808
+ r.push(g), i[g.id] = g;
1809
+ }), {
1810
+ rows: u,
1811
+ flatRows: r,
1812
+ rowsById: i
1813
+ };
1814
+ }, C(e.options, "debugTable", "getGroupedRowModel", () => {
1815
+ e._queue(() => {
1816
+ e._autoResetExpanded(), e._autoResetPageIndex();
1817
+ });
1818
+ }));
1819
+ }
1820
+ function ot(e, o) {
1821
+ const t = /* @__PURE__ */ new Map();
1822
+ return e.reduce((n, r) => {
1823
+ const i = `${r.getGroupingValue(o)}`, l = n.get(i);
1824
+ return l ? l.push(r) : n.set(i, [r]), n;
1825
+ }, t);
1826
+ }
1827
+ function gt(e) {
1828
+ return (o) => m(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
1829
+ if (!n.rows.length)
1830
+ return n;
1831
+ const {
1832
+ pageSize: r,
1833
+ pageIndex: i
1834
+ } = t;
1835
+ let {
1836
+ rows: l,
1837
+ flatRows: u,
1838
+ rowsById: g
1839
+ } = n;
1840
+ const a = r * i, c = a + r;
1841
+ l = l.slice(a, c);
1842
+ let S;
1843
+ o.options.paginateExpandedRows ? S = {
1844
+ rows: l,
1845
+ flatRows: u,
1846
+ rowsById: g
1847
+ } : S = Se({
1848
+ rows: l,
1849
+ flatRows: u,
1850
+ rowsById: g
1851
+ }), S.flatRows = [];
1852
+ const d = (s) => {
1853
+ S.flatRows.push(s), s.subRows.length && s.subRows.forEach(d);
1854
+ };
1855
+ return S.rows.forEach(d), S;
1856
+ }, C(o.options, "debugTable", "getPaginationRowModel"));
1857
+ }
1858
+ function at() {
1859
+ return (e) => m(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
1860
+ if (!t.rows.length || !(o != null && o.length))
1861
+ return t;
1862
+ const n = e.getState().sorting, r = [], i = n.filter((g) => {
1863
+ var a;
1864
+ return (a = e.getColumn(g.id)) == null ? void 0 : a.getCanSort();
1865
+ }), l = {};
1866
+ i.forEach((g) => {
1867
+ const a = e.getColumn(g.id);
1868
+ a && (l[g.id] = {
1869
+ sortUndefined: a.columnDef.sortUndefined,
1870
+ invertSorting: a.columnDef.invertSorting,
1871
+ sortingFn: a.getSortingFn()
1872
+ });
1873
+ });
1874
+ const u = (g) => {
1875
+ const a = g.map((c) => ({
1876
+ ...c
1877
+ }));
1878
+ return a.sort((c, S) => {
1879
+ for (let s = 0; s < i.length; s += 1) {
1880
+ var d;
1881
+ const f = i[s], p = l[f.id], w = p.sortUndefined, R = (d = f?.desc) != null ? d : !1;
1882
+ let h = 0;
1883
+ if (w) {
1884
+ const _ = c.getValue(f.id), V = S.getValue(f.id), F = _ === void 0, v = V === void 0;
1885
+ if (F || v) {
1886
+ if (w === "first") return F ? -1 : 1;
1887
+ if (w === "last") return F ? 1 : -1;
1888
+ h = F && v ? 0 : F ? w : -w;
1889
+ }
1890
+ }
1891
+ if (h === 0 && (h = p.sortingFn(c, S, f.id)), h !== 0)
1892
+ return R && (h *= -1), p.invertSorting && (h *= -1), h;
1893
+ }
1894
+ return c.index - S.index;
1895
+ }), a.forEach((c) => {
1896
+ var S;
1897
+ r.push(c), (S = c.subRows) != null && S.length && (c.subRows = u(c.subRows));
1898
+ }), a;
1899
+ };
1900
+ return {
1901
+ rows: u(t.rows),
1902
+ flatRows: r,
1903
+ rowsById: t.rowsById
1904
+ };
1905
+ }, C(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
1906
+ }
1907
+ export {
1908
+ ve as ColumnFaceting,
1909
+ _e as ColumnFiltering,
1910
+ De as ColumnGrouping,
1911
+ He as ColumnOrdering,
1912
+ Le as ColumnPinning,
1913
+ ze as ColumnSizing,
1914
+ Be as ColumnVisibility,
1915
+ Te as GlobalFaceting,
1916
+ qe as GlobalFiltering,
1917
+ he as Headers,
1918
+ Ne as RowExpanding,
1919
+ ke as RowPagination,
1920
+ je as RowPinning,
1921
+ Ue as RowSelection,
1922
+ Ze as RowSorting,
1923
+ H as _getVisibleLeafColumns,
1924
+ q as aggregationFns,
1925
+ A as buildHeaderGroups,
1926
+ Re as createCell,
1927
+ we as createColumn,
1928
+ T as createRow,
1929
+ rt as createTable,
1930
+ z as defaultColumnSizing,
1931
+ Se as expandRows,
1932
+ x as filterFns,
1933
+ ie as flattenBy,
1934
+ I as functionalUpdate,
1935
+ it as getCoreRowModel,
1936
+ lt as getExpandedRowModel,
1937
+ st as getFilteredRowModel,
1938
+ ut as getGroupedRowModel,
1939
+ C as getMemoOptions,
1940
+ gt as getPaginationRowModel,
1941
+ at as getSortedRowModel,
1942
+ B as isFunction,
1943
+ Ce as isNumberArray,
1944
+ ee as isRowSelected,
1945
+ Y as isSubRowSelected,
1946
+ M as makeStateUpdater,
1947
+ m as memo,
1948
+ Ge as orderColumns,
1949
+ Oe as passiveEventSupported,
1950
+ Z as reSplitAlphaNumeric,
1951
+ K as selectRowsFn,
1952
+ re as shouldAutoRemoveFilter,
1953
+ G as sortingFns
1954
+ };