@alfadocs/ui-kit 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/_chunks/actions-cell-renderer-yy03OgRL.js +137 -0
  2. package/dist/_chunks/{balance-badge-cell--iQ_gtmi.js → balance-badge-cell-CgkxYO96.js} +7 -6
  3. package/dist/_chunks/{calendar-B4Gnyu1C.js → calendar-CHT9Rm3M.js} +2 -2
  4. package/dist/_chunks/{calendar-event-card-Bjdbik8G.js → calendar-event-card-BjdHZaqz.js} +18 -14
  5. package/dist/_chunks/calendar-plus-BFrIRE4r.js +19 -0
  6. package/dist/_chunks/calendar-workspace-DI49_t6t.js +7429 -0
  7. package/dist/_chunks/clipboard-list-rSzfIYZB.js +25 -0
  8. package/dist/_chunks/{color-picker-oZ6zYks8.js → color-picker-CU303VjY.js} +4 -2
  9. package/dist/_chunks/data-table-DC5rO3Ty.js +1817 -0
  10. package/dist/_chunks/{field-value-DG8zaZvo.js → field-value-D-vkX9uL.js} +120 -140
  11. package/dist/_chunks/{file-manager-UsD8e_AB.js → file-manager-DJMeB3V8.js} +138 -153
  12. package/dist/_chunks/folder-plus-CutOs4DP.js +22 -0
  13. package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
  14. package/dist/_chunks/{notes-panel-CymneXtl.js → notes-panel-DYAtlq_i.js} +2 -2
  15. package/dist/_chunks/{patient-details-BQaUzPqp.js → patient-details-BfzvFnxQ.js} +73 -92
  16. package/dist/_chunks/{patient-summary-card-CvDxhbBR.js → patient-summary-card-D5Vfa321.js} +2 -2
  17. package/dist/_chunks/{practice-results-D7ygCj_W.js → practice-results-DL_ExLYE.js} +159 -172
  18. package/dist/_chunks/{rich-text-editor-BDfFtK4H.js → rich-text-editor-DtbcA6s1.js} +2 -2
  19. package/dist/_chunks/signature-CpFNpsVK.js +21 -0
  20. package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-CEiPe-vX.js} +19 -34
  21. package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
  22. package/dist/_chunks/{toast.agent-D1tdg6DS.js → toast-YZz2sBzB.js} +160 -212
  23. package/dist/_chunks/toast.agent-DNQ0JYGv.js +56 -0
  24. package/dist/_chunks/{workflow-map-wcw3t6g4.js → workflow-map-dNzJjBWG.js} +103 -112
  25. package/dist/agent-catalog.json +867 -1
  26. package/dist/agent-i18n/en.json +27 -0
  27. package/dist/components/calendar/index.js +1 -1
  28. package/dist/components/calendar-event-card/index.js +1 -1
  29. package/dist/components/color-picker/index.js +1 -1
  30. package/dist/components/data-table/index.js +39 -38
  31. package/dist/components/file-manager/index.js +1 -1
  32. package/dist/components/index.d.ts +1 -0
  33. package/dist/components/notes-panel/index.js +1 -1
  34. package/dist/components/patient-details/index.js +1 -1
  35. package/dist/components/patient-summary-card/index.js +1 -1
  36. package/dist/components/patient-table/index.js +1 -1
  37. package/dist/components/practice-results/index.js +1 -1
  38. package/dist/components/rich-text-editor/index.js +1 -1
  39. package/dist/components/signature-field/index.js +1 -1
  40. package/dist/components/toast/index.js +7 -6
  41. package/dist/components/workflow/index.js +1 -1
  42. package/dist/i18n/locales/ar.d.ts +680 -0
  43. package/dist/i18n/locales/ar.js +680 -0
  44. package/dist/i18n/locales/de.d.ts +680 -0
  45. package/dist/i18n/locales/de.js +680 -0
  46. package/dist/i18n/locales/el.d.ts +680 -0
  47. package/dist/i18n/locales/el.js +680 -0
  48. package/dist/i18n/locales/en.d.ts +680 -0
  49. package/dist/i18n/locales/en.js +680 -0
  50. package/dist/i18n/locales/es.d.ts +680 -0
  51. package/dist/i18n/locales/es.js +680 -0
  52. package/dist/i18n/locales/fr.d.ts +680 -0
  53. package/dist/i18n/locales/fr.js +680 -0
  54. package/dist/i18n/locales/hi.d.ts +680 -0
  55. package/dist/i18n/locales/hi.js +680 -0
  56. package/dist/i18n/locales/it.d.ts +680 -0
  57. package/dist/i18n/locales/it.js +680 -0
  58. package/dist/i18n/locales/ja.d.ts +680 -0
  59. package/dist/i18n/locales/ja.js +680 -0
  60. package/dist/i18n/locales/nl.d.ts +680 -0
  61. package/dist/i18n/locales/nl.js +680 -0
  62. package/dist/i18n/locales/pl.d.ts +680 -0
  63. package/dist/i18n/locales/pl.js +680 -0
  64. package/dist/i18n/locales/pt.d.ts +680 -0
  65. package/dist/i18n/locales/pt.js +680 -0
  66. package/dist/i18n/locales/ro.d.ts +680 -0
  67. package/dist/i18n/locales/ro.js +680 -0
  68. package/dist/i18n/locales/ru.d.ts +680 -0
  69. package/dist/i18n/locales/ru.js +680 -0
  70. package/dist/i18n/locales/sq.d.ts +680 -0
  71. package/dist/i18n/locales/sq.js +680 -0
  72. package/dist/i18n/locales/sv.d.ts +680 -0
  73. package/dist/i18n/locales/sv.js +680 -0
  74. package/dist/i18n/locales/tr.d.ts +680 -0
  75. package/dist/i18n/locales/tr.js +680 -0
  76. package/dist/i18n/locales/zh.d.ts +680 -0
  77. package/dist/i18n/locales/zh.js +680 -0
  78. package/dist/index.js +821 -803
  79. package/dist/locales/ar.json +680 -0
  80. package/dist/locales/de.json +680 -0
  81. package/dist/locales/el.json +680 -0
  82. package/dist/locales/en.json +680 -0
  83. package/dist/locales/es.json +680 -0
  84. package/dist/locales/fr.json +680 -0
  85. package/dist/locales/hi.json +680 -0
  86. package/dist/locales/it.json +680 -0
  87. package/dist/locales/ja.json +680 -0
  88. package/dist/locales/nl.json +680 -0
  89. package/dist/locales/pl.json +680 -0
  90. package/dist/locales/pt.json +680 -0
  91. package/dist/locales/ro.json +680 -0
  92. package/dist/locales/ru.json +680 -0
  93. package/dist/locales/sq.json +680 -0
  94. package/dist/locales/sv.json +680 -0
  95. package/dist/locales/tr.json +680 -0
  96. package/dist/locales/zh.json +680 -0
  97. package/dist/patterns/calendar/calendar-workspace.d.ts +62 -0
  98. package/dist/patterns/calendar/calendar-workspace.model.d.ts +358 -0
  99. package/dist/patterns/calendar/calendar.data.d.ts +122 -0
  100. package/dist/patterns/calendar/calendar.host.d.ts +10 -0
  101. package/dist/patterns/calendar/calendar.journey.d.ts +119 -0
  102. package/dist/patterns/calendar/calendar.model.d.ts +684 -0
  103. package/dist/patterns/calendar/calendar.preferences.d.ts +74 -0
  104. package/dist/patterns/calendar/calendar.sheets.d.ts +398 -0
  105. package/dist/patterns/calendar/calendar.surface.d.ts +77 -0
  106. package/dist/patterns/calendar/calendar.types.d.ts +413 -0
  107. package/dist/patterns/calendar/index.d.ts +13 -0
  108. package/dist/patterns/calendar/index.js +19 -0
  109. package/package.json +5 -1
  110. package/dist/_chunks/actions-cell-renderer-ReurEy5i.js +0 -1945
@@ -0,0 +1,1817 @@
1
+ import { jsx as s, jsxs as L } from "react/jsx-runtime";
2
+ import { useMemo as j, forwardRef as $, useState as G, useCallback as D, useEffect as K, useRef as B, createContext as Ce, useContext as Re, isValidElement as At, cloneElement as Pt, useImperativeHandle as Ot } from "react";
3
+ import { S as Mt } from "./skeleton-CZbwyJAA.js";
4
+ import { E as zt } from "./empty-state-X0sVPfVo.js";
5
+ import { c as Gt } from "./index-D2ZczOXr.js";
6
+ import { useTranslation as A } from "react-i18next";
7
+ import { useGridFilter as _t, AgGridReact as jt } from "ag-grid-react";
8
+ import { ModuleRegistry as Lt, AllCommunityModule as qt } from "ag-grid-community";
9
+ import { I as Wt } from "./icon-button-group-VCCod3Hz.js";
10
+ import { B as de } from "./button-nJaPh_HC.js";
11
+ import { I as oe } from "./icon-button-DA2CAGHZ.js";
12
+ import { P as me } from "./popover-Cqcjx-Ny.js";
13
+ import { C as Bt } from "./checkbox-BuZ1u__2.js";
14
+ import { T as Se } from "./text-input-CUvCb6ST.js";
15
+ import { T as We } from "./tag-3wgkwwDB.js";
16
+ import { D as he } from "./dropdown-menu-DU-Hrf33.js";
17
+ import { X as $e } from "./x-B5YnXwCz.js";
18
+ import { R as $t } from "./refresh-cw-DnI0cLFC.js";
19
+ import { S as Ie } from "./search-QbWPlY5f.js";
20
+ import { c as Kt } from "./createLucideIcon-DhHxpK9K.js";
21
+ import { G as Ht } from "./grip-vertical-onSb1JXO.js";
22
+ import { P as Vt } from "./printer-rkK0T1gi.js";
23
+ import { F as Ke } from "./file-text-5yv6r2ls.js";
24
+ import { D as ye } from "./download-CfYKJO_j.js";
25
+ import { F as Ut } from "./file-spreadsheet-DmwyfV4O.js";
26
+ import Xt from "i18next";
27
+ import { S as Qt } from "./select-Bi8zril7.js";
28
+ import { u as Jt } from "./registry-DvAUVLHh.js";
29
+ import { u as Zt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
30
+ import { u as Yt } from "./use-theme-CAuo6EYT.js";
31
+ /**
32
+ * @license lucide-react v1.22.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */
37
+ const er = [
38
+ ["path", { d: "M10.5 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.5", key: "1g2yzs" }],
39
+ ["path", { d: "m14.3 19.6 1-.4", key: "11sv9r" }],
40
+ ["path", { d: "M15 3v7.5", key: "7lm50a" }],
41
+ ["path", { d: "m15.2 16.9-.9-.3", key: "1t7mvx" }],
42
+ ["path", { d: "m16.6 21.7.3-.9", key: "1j67ps" }],
43
+ ["path", { d: "m16.8 15.3-.4-1", key: "1ei7r6" }],
44
+ ["path", { d: "m19.1 15.2.3-.9", key: "18r7jp" }],
45
+ ["path", { d: "m19.6 21.7-.4-1", key: "z2vh2" }],
46
+ ["path", { d: "m20.7 16.8 1-.4", key: "19m87a" }],
47
+ ["path", { d: "m21.7 19.4-.9-.3", key: "1qgwi9" }],
48
+ ["path", { d: "M9 3v18", key: "fh3hqa" }],
49
+ ["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }]
50
+ ], tr = Kt("columns-3-cog", er);
51
+ function rr(e) {
52
+ if (!At(e)) return e;
53
+ const t = e, n = t.props.className ?? "", a = /\bsize-|\bw-|\bh-/.test(n) ? n : `${n} ds:size-4`.trim();
54
+ return Pt(t, { className: a, size: t.props.size ?? 16 });
55
+ }
56
+ const He = Ce(null);
57
+ function V(e) {
58
+ const t = Re(He);
59
+ if (!t)
60
+ throw new Error(
61
+ `${e} must be rendered inside <DataTable.Toolbar> as a descendant of <DataTable>.`
62
+ );
63
+ return t;
64
+ }
65
+ function ar({
66
+ getApi: e,
67
+ selectionCount: t,
68
+ onPrint: n,
69
+ markColumnsUserTouched: a,
70
+ children: i
71
+ }) {
72
+ const d = j(
73
+ () => ({ getApi: e, selectionCount: t, onPrint: n, markColumnsUserTouched: a }),
74
+ [e, t, n, a]
75
+ );
76
+ return /* @__PURE__ */ s(He.Provider, { value: d, children: i });
77
+ }
78
+ const nr = [
79
+ "data-table-toolbar",
80
+ // Mobile (<sm) keeps `flex-wrap` so a wide QuickSearch can flow above the
81
+ // Actions cluster on narrow screens. From `sm` (≥640px) we switch to
82
+ // `flex-nowrap` + `min-w-0` so the row stays single-line at every common
83
+ // desktop width (1024 / 1280 / 1440) — the QuickSearch slot shrinks via
84
+ // its own `min-w-0` instead of pushing the trailing Actions to a new row.
85
+ "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
86
+ "ds:sm:flex-nowrap ds:min-w-0"
87
+ // No card surface: the toolbar sits directly on the page background,
88
+ // matching the header-tools layout the Patients / Care Plan List
89
+ // patterns established (the old bg-card + border + shadow bar is gone).
90
+ ].join(" "), Ve = $(
91
+ ({ className: e, children: t, ...n }, a) => /* @__PURE__ */ s(
92
+ "div",
93
+ {
94
+ ref: a,
95
+ role: "toolbar",
96
+ className: [nr, e ?? ""].join(" ").trim(),
97
+ ...n,
98
+ children: t
99
+ }
100
+ )
101
+ );
102
+ Ve.displayName = "DataTable.Toolbar";
103
+ const Ue = $(
104
+ ({ className: e, children: t, ...n }, a) => /* @__PURE__ */ s(
105
+ "div",
106
+ {
107
+ ref: a,
108
+ className: [
109
+ "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
110
+ // `grow` lets FilterBar absorb the free space; `min-w-0` lets the
111
+ // QuickSearch slot inside shrink below its intrinsic width when the
112
+ // toolbar runs `flex-nowrap` at `sm` and above, so the trailing
113
+ // Actions cluster stays pinned on a single row.
114
+ "ds:grow ds:min-w-0",
115
+ e ?? ""
116
+ ].join(" ").trim(),
117
+ ...n,
118
+ children: t
119
+ }
120
+ )
121
+ );
122
+ Ue.displayName = "DataTable.Toolbar.FilterBar";
123
+ const Xe = $(
124
+ ({ className: e, children: t, ...n }, a) => /* @__PURE__ */ s(
125
+ "div",
126
+ {
127
+ ref: a,
128
+ className: [
129
+ "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
130
+ "ds:ms-auto",
131
+ e ?? ""
132
+ ].join(" ").trim(),
133
+ ...n,
134
+ children: t
135
+ }
136
+ )
137
+ );
138
+ Xe.displayName = "DataTable.Toolbar.Actions";
139
+ const Ee = $(
140
+ ({ label: e, onExport: t, intent: n = "outline", ...a }, i) => {
141
+ const { t: d } = A(), { getApi: m } = V("DataTable.Toolbar.ExportCsv"), g = D(() => {
142
+ const p = m();
143
+ p && (t ? t(p) : p.exportDataAsCsv());
144
+ }, [m, t]);
145
+ return /* @__PURE__ */ s(
146
+ oe,
147
+ {
148
+ ref: i,
149
+ type: "button",
150
+ intent: n,
151
+ icon: /* @__PURE__ */ s(ye, { "aria-hidden": !0 }),
152
+ tooltip: e ?? d("dataTable.exportCsv"),
153
+ onClick: g,
154
+ ...a
155
+ }
156
+ );
157
+ }
158
+ );
159
+ Ee.displayName = "DataTable.Toolbar.ExportCsv";
160
+ function ae(e, t = [30, 30, 30]) {
161
+ if (typeof document > "u") return t;
162
+ const n = document.createElement("span");
163
+ n.style.color = `hsl(var(${e}))`, n.style.position = "absolute", n.style.visibility = "hidden", document.body.appendChild(n);
164
+ const a = getComputedStyle(n).color;
165
+ document.body.removeChild(n);
166
+ const i = a.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
167
+ return i ? [Number(i[1]), Number(i[2]), Number(i[3])] : t;
168
+ }
169
+ async function Qe(e, t) {
170
+ if (!e) return;
171
+ const [{ jsPDF: n }, { default: a }] = await Promise.all([
172
+ import("./jspdf.es.min-DaapWjR1.js").then((C) => C.j),
173
+ import("./jspdf.plugin.autotable-CSiDNyPn.js")
174
+ ]), d = (e.getColumns() ?? []).filter((C) => C.isVisible()), m = [
175
+ d.map((C) => e.getDisplayNameForColumn(C, null) ?? "")
176
+ ], g = [];
177
+ e.forEachNodeAfterFilterAndSort((C) => {
178
+ if (!C.data) return;
179
+ const c = d.map((f) => {
180
+ const w = e.getCellValue({
181
+ rowNode: C,
182
+ colKey: f,
183
+ useFormatter: !0
184
+ });
185
+ return w == null ? "" : String(w);
186
+ });
187
+ g.push(c);
188
+ });
189
+ const p = ae("--muted", [240, 240, 240]), h = ae("--foreground", [30, 30, 30]), u = ae("--card-foreground", [30, 30, 30]), b = ae("--card", [250, 250, 250]), S = new n({ orientation: "landscape" });
190
+ a(S, {
191
+ head: m,
192
+ body: g,
193
+ headStyles: { fillColor: p, textColor: h },
194
+ bodyStyles: { textColor: u },
195
+ alternateRowStyles: { fillColor: b },
196
+ styles: {
197
+ font: "helvetica",
198
+ fontSize: 10,
199
+ cellPadding: 4
200
+ }
201
+ }), S.save(t.fileName);
202
+ }
203
+ const De = $(
204
+ ({ label: e, onClick: t, fileName: n, intent: a = "outline", ...i }, d) => {
205
+ const { t: m } = A(), { getApi: g } = V("DataTable.Toolbar.ExportPdf"), p = D(() => {
206
+ const h = g();
207
+ if (t) {
208
+ t(h);
209
+ return;
210
+ }
211
+ Qe(h, {
212
+ fileName: n ?? "data-table-export.pdf"
213
+ });
214
+ }, [g, t, n]);
215
+ return /* @__PURE__ */ s(
216
+ oe,
217
+ {
218
+ ref: d,
219
+ type: "button",
220
+ intent: a,
221
+ icon: /* @__PURE__ */ s(Ke, { "aria-hidden": !0 }),
222
+ tooltip: e ?? m("dataTable.exportPdf"),
223
+ onClick: p,
224
+ ...i
225
+ }
226
+ );
227
+ }
228
+ );
229
+ De.displayName = "DataTable.Toolbar.ExportPdf";
230
+ const Ne = $(
231
+ ({ label: e, intent: t = "outline", ...n }, a) => {
232
+ const { t: i } = A(), { onPrint: d } = V("DataTable.Toolbar.Print");
233
+ return /* @__PURE__ */ s(
234
+ oe,
235
+ {
236
+ ref: a,
237
+ type: "button",
238
+ intent: t,
239
+ icon: /* @__PURE__ */ s(Vt, { "aria-hidden": !0 }),
240
+ tooltip: e ?? i("dataTable.print"),
241
+ onClick: d,
242
+ ...n
243
+ }
244
+ );
245
+ }
246
+ );
247
+ Ne.displayName = "DataTable.Toolbar.Print";
248
+ const Je = ({ placeholder: e, debounceMs: t = 150 }) => {
249
+ const { t: n } = A(), { getApi: a } = V("DataTable.Toolbar.QuickSearch"), [i, d] = G(""), m = B(void 0);
250
+ return K(() => (m.current && window.clearTimeout(m.current), m.current = window.setTimeout(() => {
251
+ const g = a();
252
+ g && g.setGridOption("quickFilterText", i);
253
+ }, t), () => {
254
+ m.current && window.clearTimeout(m.current);
255
+ }), [i, t, a]), // Slot wrapper caps the search at a sensible legible width on desktop —
256
+ // without this, TextInput's `w-full` lets the QuickSearch absorb the
257
+ // entire FilterBar row and push trailing Actions onto a second line at
258
+ // 1024 / 1280 / 1440. `min-w-0` lets the slot shrink below `24rem` when
259
+ // the toolbar is squeezed on narrow viewports. There is no
260
+ // `--toolbar-search-max` token in the kit yet — see this component's
261
+ // summary for a follow-up note recommending we add one.
262
+ /* @__PURE__ */ s("div", { className: "ds:w-full ds:max-w-[24rem] ds:min-w-0", children: /* @__PURE__ */ s(
263
+ Se,
264
+ {
265
+ type: "search",
266
+ size: "sm",
267
+ value: i,
268
+ onChange: (g) => d(g.target.value),
269
+ placeholder: e ?? n("dataTable.quickSearch.placeholder", "Search…"),
270
+ startAdornment: /* @__PURE__ */ s(Ie, { "aria-hidden": !0, className: "ds:size-4" }),
271
+ clearable: !0,
272
+ onClear: () => d(""),
273
+ "aria-label": n("dataTable.quickSearch.label", "Quick search")
274
+ }
275
+ ) });
276
+ };
277
+ Je.displayName = "DataTable.Toolbar.QuickSearch";
278
+ const Fe = $(
279
+ ({ onRefresh: e, label: t, intent: n = "outline", ...a }, i) => {
280
+ const { t: d } = A();
281
+ return /* @__PURE__ */ s(
282
+ oe,
283
+ {
284
+ ref: i,
285
+ type: "button",
286
+ intent: n,
287
+ icon: /* @__PURE__ */ s($t, { "aria-hidden": !0 }),
288
+ tooltip: t ?? d("dataTable.refresh", "Refresh"),
289
+ onClick: e,
290
+ ...a
291
+ }
292
+ );
293
+ }
294
+ );
295
+ Fe.displayName = "DataTable.Toolbar.Refresh";
296
+ function or(e, t) {
297
+ if (!e || typeof e != "object") return "";
298
+ const n = e;
299
+ if (typeof n.filter == "string" || typeof n.filter == "number") {
300
+ const a = typeof n.type == "string" ? n.type : "", i = typeof n.filterTo == "string" || typeof n.filterTo == "number" ? String(n.filterTo) : "";
301
+ return a === "inRange" && i ? `${n.filter} – ${i}` : a ? `${t(`dataTable.agGrid.${a}`, a)} ${n.filter}` : String(n.filter);
302
+ }
303
+ return typeof n.dateFrom == "string" ? typeof n.dateTo == "string" && n.dateTo ? `${n.dateFrom} – ${n.dateTo}` : String(n.dateFrom) : Array.isArray(n.values) ? n.values.map(String).join(", ") : "";
304
+ }
305
+ const Ze = () => {
306
+ const { t: e } = A(), { getApi: t } = V("DataTable.Toolbar.FilterChips"), [n, a] = G([]), [i, d] = G(""), m = D(() => {
307
+ const u = t();
308
+ if (!u) {
309
+ a([]), d("");
310
+ return;
311
+ }
312
+ const b = u.getFilterModel() ?? {}, S = u.getColumns() ?? [], C = [];
313
+ for (const f of Object.keys(b)) {
314
+ const w = S.find((R) => R.getColId() === f), T = u.getDisplayNameForColumn(w, null) ?? f;
315
+ C.push({
316
+ colId: f,
317
+ headerName: T,
318
+ text: or(b[f], e)
319
+ });
320
+ }
321
+ a(C);
322
+ const c = u.getGridOption("quickFilterText");
323
+ d(typeof c == "string" ? c : "");
324
+ }, [t, e]);
325
+ if (K(() => {
326
+ let u;
327
+ const b = (c) => m(), S = (c) => {
328
+ c.addEventListener("filterChanged", b), m(), u = () => c.removeEventListener("filterChanged", b);
329
+ }, C = t();
330
+ if (C)
331
+ S(C);
332
+ else {
333
+ const c = window.setInterval(() => {
334
+ const f = t();
335
+ f && (window.clearInterval(c), S(f));
336
+ }, 50);
337
+ u = () => window.clearInterval(c);
338
+ }
339
+ return () => u == null ? void 0 : u();
340
+ }, [t, m]), n.length + (i ? 1 : 0) === 0) return null;
341
+ function p(u) {
342
+ const b = t();
343
+ b && b.destroyFilter(u);
344
+ }
345
+ function h() {
346
+ const u = t();
347
+ u && (u.setFilterModel(null), u.setGridOption("quickFilterText", ""), d(""));
348
+ }
349
+ return /* @__PURE__ */ L(
350
+ "div",
351
+ {
352
+ role: "group",
353
+ "aria-label": e("dataTable.filterChips.label", "Active filters"),
354
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
355
+ children: [
356
+ i && /* @__PURE__ */ s(
357
+ We,
358
+ {
359
+ label: `${e("dataTable.quickSearch.label", "Quick search")}: ${i}`,
360
+ size: "sm",
361
+ fill: "outline",
362
+ onRemove: () => {
363
+ const u = t();
364
+ u == null || u.setGridOption("quickFilterText", ""), d("");
365
+ }
366
+ }
367
+ ),
368
+ n.map((u) => /* @__PURE__ */ s(
369
+ We,
370
+ {
371
+ label: u.text ? `${u.headerName}: ${u.text}` : u.headerName,
372
+ size: "sm",
373
+ fill: "outline",
374
+ onRemove: () => p(u.colId)
375
+ },
376
+ u.colId
377
+ )),
378
+ /* @__PURE__ */ s(
379
+ de,
380
+ {
381
+ type: "button",
382
+ intent: "ghost",
383
+ size: "sm",
384
+ onClick: h,
385
+ startIcon: /* @__PURE__ */ s($e, { "aria-hidden": !0, className: "ds:size-4" }),
386
+ children: e("dataTable.filterChips.clearAll", "Clear all")
387
+ }
388
+ )
389
+ ]
390
+ }
391
+ );
392
+ };
393
+ Ze.displayName = "DataTable.Toolbar.FilterChips";
394
+ const Ye = ({
395
+ field: e,
396
+ options: t,
397
+ label: n
398
+ }) => {
399
+ const { t: a } = A(), { getApi: i } = V("DataTable.Toolbar.FacetFilter"), [d, m] = G(null);
400
+ function g(p) {
401
+ m(p);
402
+ const h = i();
403
+ if (h) {
404
+ if (p === null) {
405
+ h.destroyFilter(e);
406
+ return;
407
+ }
408
+ h.setColumnFilterModel(e, {
409
+ type: "equals",
410
+ filter: p
411
+ }), h.onFilterChanged();
412
+ }
413
+ }
414
+ return /* @__PURE__ */ s(
415
+ "div",
416
+ {
417
+ role: "group",
418
+ "aria-label": n ?? a("dataTable.facetFilter.label", "Filter"),
419
+ className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
420
+ children: t.map((p) => {
421
+ const h = d === p.value;
422
+ return /* @__PURE__ */ s(
423
+ de,
424
+ {
425
+ type: "button",
426
+ size: "sm",
427
+ intent: h ? "primary" : "secondary",
428
+ "aria-pressed": h,
429
+ onClick: () => g(p.value),
430
+ children: p.label
431
+ },
432
+ String(p.value)
433
+ );
434
+ })
435
+ }
436
+ );
437
+ };
438
+ Ye.displayName = "DataTable.Toolbar.FacetFilter";
439
+ const ir = ["csv", "xlsx", "pdf"];
440
+ async function sr(e, t) {
441
+ if (!e) return;
442
+ const n = await import("./exceljs.min-D2MHbJsF.js").then((f) => f.e), a = new n.Workbook(), i = a.addWorksheet("Sheet1"), m = (e.getColumns() ?? []).filter((f) => f.isVisible());
443
+ i.addRow(
444
+ m.map(
445
+ (f) => e.getDisplayNameForColumn(f, null) ?? f.getColId()
446
+ )
447
+ ), e.forEachNodeAfterFilterAndSort((f) => {
448
+ f.data && i.addRow(
449
+ m.map((w) => {
450
+ const T = e.getCellValue({
451
+ rowNode: f,
452
+ colKey: w,
453
+ useFormatter: !0
454
+ });
455
+ return T ?? "";
456
+ })
457
+ );
458
+ });
459
+ const g = ae("--muted", [240, 240, 240]), p = ae("--foreground", [30, 30, 30]), h = i.getRow(1), u = ([f, w, T]) => `${f.toString(16).padStart(2, "0")}${w.toString(16).padStart(2, "0")}${T.toString(16).padStart(2, "0")}`.toUpperCase();
460
+ h.eachCell((f) => {
461
+ f.font = { bold: !0, color: { argb: `FF${u(p)}` } }, f.fill = {
462
+ type: "pattern",
463
+ pattern: "solid",
464
+ fgColor: { argb: `FF${u(g)}` }
465
+ };
466
+ });
467
+ const b = await a.xlsx.writeBuffer(), S = new Blob([b], {
468
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
469
+ }), C = URL.createObjectURL(S), c = document.createElement("a");
470
+ c.href = C, c.download = t.fileName, document.body.appendChild(c), c.click(), document.body.removeChild(c), URL.revokeObjectURL(C);
471
+ }
472
+ const et = Ce(null);
473
+ function lr() {
474
+ const e = Re(et);
475
+ if (!e)
476
+ throw new Error(
477
+ "DataTable.Toolbar.ExportMenu.Item must be rendered inside DataTable.Toolbar.ExportMenu."
478
+ );
479
+ return e;
480
+ }
481
+ const ke = $(
482
+ ({ children: e, label: t, intent: n = "outline", ...a }, i) => {
483
+ const { t: d } = A(), { getApi: m } = V("DataTable.Toolbar.ExportMenu"), g = j(() => ({ getApi: m }), [m]), p = e ?? ir.map((h) => /* @__PURE__ */ s(Ae, { format: h }, h));
484
+ return /* @__PURE__ */ s(et.Provider, { value: g, children: /* @__PURE__ */ L(he.Root, { children: [
485
+ /* @__PURE__ */ s(he.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
486
+ oe,
487
+ {
488
+ ref: i,
489
+ type: "button",
490
+ intent: n,
491
+ icon: /* @__PURE__ */ s(ye, { "aria-hidden": !0 }),
492
+ tooltip: t ?? d("dataTable.export.menu", "Export"),
493
+ "aria-label": t ?? d("dataTable.export.menu", "Export"),
494
+ "aria-haspopup": "menu",
495
+ ...a
496
+ }
497
+ ) }),
498
+ /* @__PURE__ */ s(he.Content, { align: "end", sideOffset: 4, children: p })
499
+ ] }) });
500
+ }
501
+ );
502
+ ke.displayName = "DataTable.Toolbar.ExportMenu";
503
+ function dr(e, t) {
504
+ return t === "csv" ? e("dataTable.export.csv", "Export CSV") : t === "xlsx" ? e("dataTable.export.xlsx", "Export Excel") : t === "pdf" ? e("dataTable.export.pdf", "Export PDF") : e("dataTable.export.custom", "Export");
505
+ }
506
+ function cr(e) {
507
+ return e === "csv" ? /* @__PURE__ */ s(ye, { "aria-hidden": !0, className: "ds:size-4" }) : e === "xlsx" ? /* @__PURE__ */ s(Ut, { "aria-hidden": !0, className: "ds:size-4" }) : e === "pdf" ? /* @__PURE__ */ s(Ke, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ s(ye, { "aria-hidden": !0, className: "ds:size-4" });
508
+ }
509
+ const Ae = ({
510
+ format: e,
511
+ label: t,
512
+ onClick: n,
513
+ fileName: a
514
+ }) => {
515
+ const { t: i } = A(), { getApi: d } = lr(), m = D(() => {
516
+ const g = d();
517
+ if (e === "csv") {
518
+ g == null || g.exportDataAsCsv();
519
+ return;
520
+ }
521
+ if (e === "pdf") {
522
+ Qe(g, {
523
+ fileName: a ?? "data-table-export.pdf"
524
+ });
525
+ return;
526
+ }
527
+ if (e === "xlsx") {
528
+ sr(g, {
529
+ fileName: a ?? "data-table-export.xlsx"
530
+ });
531
+ return;
532
+ }
533
+ n == null || n(g);
534
+ }, [e, a, n, d]);
535
+ return /* @__PURE__ */ s(he.Item, { onSelect: m, children: /* @__PURE__ */ L("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
536
+ cr(e),
537
+ /* @__PURE__ */ s("span", { children: t ?? dr(i, e) })
538
+ ] }) });
539
+ };
540
+ Ae.displayName = "DataTable.Toolbar.ExportMenu.Item";
541
+ function ur(e) {
542
+ if (!e) return [];
543
+ const t = (a) => a.getPinned() === "left" ? 0 : a.getPinned() === "right" ? 2 : 1;
544
+ return [...e.getAllGridColumns() ?? []].sort(
545
+ (a, i) => t(a) - t(i)
546
+ ).map((a) => a.getColDef().hide === void 0 && a.getColId().startsWith("ag-Grid-") ? null : {
547
+ colId: a.getColId(),
548
+ displayName: e.getDisplayNameForColumn(a, null) || a.getColId(),
549
+ visible: a.isVisible()
550
+ }).filter((a) => a !== null);
551
+ }
552
+ const Pe = $(
553
+ function({ label: t, icon: n, footer: a, header: i, intent: d = "outline", ...m }, g) {
554
+ const { t: p } = A(), { getApi: h, markColumnsUserTouched: u } = V(
555
+ "DataTable.Toolbar.ColumnToggle"
556
+ ), [b, S] = G(!1), [C, c] = G([]), [f, w] = G(null), [T, R] = G(null);
557
+ K(() => {
558
+ b && c(ur(h()));
559
+ }, [b, h]);
560
+ const I = D(
561
+ (v, O) => {
562
+ const M = h();
563
+ M && (M.setColumnsVisible([v], O), u == null || u([v]), c(
564
+ (F) => F.map(
565
+ (N) => N.colId === v ? { ...N, visible: O } : N
566
+ )
567
+ ));
568
+ },
569
+ [h, u]
570
+ ), ee = D(
571
+ (v, O) => {
572
+ if (v === O) return;
573
+ const M = h();
574
+ if (!M) return;
575
+ c((z) => {
576
+ const E = z.findIndex((Q) => Q.colId === v), ie = z.findIndex((Q) => Q.colId === O);
577
+ if (E < 0 || ie < 0) return z;
578
+ const X = [...z], [xe] = X.splice(E, 1);
579
+ return X.splice(ie, 0, xe), X;
580
+ });
581
+ const F = M.getAllGridColumns(), N = F.find((z) => z.getColId() === v), q = F.find((z) => z.getColId() === O);
582
+ if (!N || !q) return;
583
+ N.getPinned() !== q.getPinned() && M.setColumnsPinned([v], q.getPinned() ?? null);
584
+ const U = M.getAllGridColumns().findIndex((z) => z.getColId() === O);
585
+ U >= 0 && M.moveColumns([v], U);
586
+ },
587
+ [h]
588
+ ), _ = t ?? p("dataTable.columnToggle");
589
+ return /* @__PURE__ */ L(me.Root, { open: b, onOpenChange: S, children: [
590
+ /* @__PURE__ */ s(me.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
591
+ oe,
592
+ {
593
+ ref: g,
594
+ type: "button",
595
+ intent: d,
596
+ icon: n ?? /* @__PURE__ */ s(tr, { "aria-hidden": !0 }),
597
+ tooltip: _,
598
+ "aria-label": _,
599
+ "aria-haspopup": "dialog",
600
+ ...m
601
+ }
602
+ ) }),
603
+ /* @__PURE__ */ L(
604
+ me.Content,
605
+ {
606
+ size: "sm",
607
+ align: "end",
608
+ className: "ds:flex ds:max-h-[var(--radix-popover-content-available-height)] ds:flex-col",
609
+ children: [
610
+ /* @__PURE__ */ s(me.Heading, { children: _ }),
611
+ i ? /* @__PURE__ */ s("div", { className: "ds:mb-[var(--spacing-xs)] ds:border-b ds:border-[color:var(--border)] ds:pb-[var(--spacing-sm)]", children: i }) : null,
612
+ /* @__PURE__ */ s(
613
+ "ul",
614
+ {
615
+ className: "ds:flex ds:min-h-0 ds:flex-col ds:gap-[var(--spacing-xs)] ds:overflow-y-auto",
616
+ "aria-label": _,
617
+ children: C.map((v) => {
618
+ const O = f === v.colId, M = T === v.colId && f !== v.colId;
619
+ return /* @__PURE__ */ L(
620
+ "li",
621
+ {
622
+ draggable: !0,
623
+ onDragStart: (F) => {
624
+ w(v.colId), F.dataTransfer.effectAllowed = "move", F.dataTransfer.setData("text/plain", v.colId);
625
+ },
626
+ onDragOver: (F) => {
627
+ F.preventDefault(), F.dataTransfer.dropEffect = "move", R(v.colId);
628
+ },
629
+ onDragLeave: () => {
630
+ R(
631
+ (F) => F === v.colId ? null : F
632
+ );
633
+ },
634
+ onDrop: (F) => {
635
+ F.preventDefault();
636
+ const N = F.dataTransfer.getData("text/plain");
637
+ N && ee(N, v.colId), w(null), R(null);
638
+ },
639
+ onDragEnd: () => {
640
+ w(null), R(null);
641
+ },
642
+ className: [
643
+ "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-xs)] ds:py-[var(--spacing-2xs,var(--spacing-xs))] ds:transition-colors",
644
+ O ? "ds:opacity-50" : "",
645
+ M ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
646
+ ].filter(Boolean).join(" "),
647
+ children: [
648
+ /* @__PURE__ */ s(
649
+ "span",
650
+ {
651
+ "aria-hidden": "true",
652
+ className: "ds:cursor-grab ds:text-[color:var(--muted-foreground)] ds:active:cursor-grabbing",
653
+ children: /* @__PURE__ */ s(Ht, { className: "ds:size-4" })
654
+ }
655
+ ),
656
+ /* @__PURE__ */ s(
657
+ Bt,
658
+ {
659
+ label: v.displayName,
660
+ checked: v.visible,
661
+ onCheckedChange: (F) => I(v.colId, F === !0)
662
+ }
663
+ )
664
+ ]
665
+ },
666
+ v.colId
667
+ );
668
+ })
669
+ }
670
+ ),
671
+ a ? /* @__PURE__ */ s("div", { className: "ds:mt-[var(--spacing-xs)] ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-sm)]", children: a }) : null
672
+ ]
673
+ }
674
+ )
675
+ ] });
676
+ }
677
+ );
678
+ Pe.displayName = "DataTable.Toolbar.ColumnToggle";
679
+ const tt = $(
680
+ ({ label: e, icon: t, onClick: n, variant: a = "default", size: i = "sm", ...d }, m) => {
681
+ const { t: g } = A(), { getApi: p, selectionCount: h } = V(
682
+ "DataTable.Toolbar.BulkAction"
683
+ );
684
+ return h === 0 ? null : /* @__PURE__ */ L(
685
+ de,
686
+ {
687
+ ref: m,
688
+ type: "button",
689
+ intent: a === "destructive" ? "destructive" : "secondary",
690
+ size: i,
691
+ startIcon: rr(t),
692
+ onClick: () => n(p()),
693
+ "aria-label": `${e} (${g("dataTable.bulkAction", { count: h })})`,
694
+ ...d,
695
+ children: [
696
+ /* @__PURE__ */ s("span", { children: e }),
697
+ /* @__PURE__ */ s(
698
+ "span",
699
+ {
700
+ "aria-hidden": "true",
701
+ className: "ds:ms-[var(--spacing-xs)] ds:opacity-80",
702
+ children: g("dataTable.bulkAction", { count: h })
703
+ }
704
+ )
705
+ ]
706
+ }
707
+ );
708
+ }
709
+ );
710
+ tt.displayName = "DataTable.Toolbar.BulkAction";
711
+ for (const e of [
712
+ Ee,
713
+ De,
714
+ Ne,
715
+ Fe,
716
+ ke,
717
+ Pe
718
+ ])
719
+ e.rendersIconButton = !0;
720
+ const pr = Object.assign(ke, {
721
+ Item: Ae
722
+ }), be = Object.assign(Ve, {
723
+ FilterBar: Ue,
724
+ Actions: Xe,
725
+ /** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
726
+ ExportCsv: Ee,
727
+ /** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
728
+ ExportPdf: De,
729
+ Print: Ne,
730
+ ColumnToggle: Pe,
731
+ BulkAction: tt,
732
+ QuickSearch: Je,
733
+ Refresh: Fe,
734
+ FilterChips: Ze,
735
+ FacetFilter: Ye,
736
+ ExportMenu: pr
737
+ }), fr = [
738
+ "contains",
739
+ "equals",
740
+ "startsWith",
741
+ "endsWith",
742
+ "notContains"
743
+ ];
744
+ function mr(e) {
745
+ const t = new Intl.Collator(e, {
746
+ sensitivity: "base",
747
+ usage: "search"
748
+ });
749
+ function n(a, i) {
750
+ if (i.length === 0) return 0;
751
+ if (i.length > a.length) return -1;
752
+ for (let d = 0; d <= a.length - i.length; d += 1)
753
+ if (t.compare(a.slice(d, d + i.length), i) === 0)
754
+ return d;
755
+ return -1;
756
+ }
757
+ return {
758
+ equals: (a, i) => t.compare(a, i) === 0,
759
+ contains: (a, i) => n(a, i) !== -1,
760
+ startsWith: (a, i) => i.length <= a.length && t.compare(a.slice(0, i.length), i) === 0,
761
+ endsWith: (a, i) => i.length <= a.length && t.compare(
762
+ a.slice(a.length - i.length),
763
+ i
764
+ ) === 0
765
+ };
766
+ }
767
+ function gr(e) {
768
+ return e == null ? null : typeof e == "string" ? e : String(e);
769
+ }
770
+ function hr(e) {
771
+ const { model: t, onModelChange: n, getValue: a, placeholder: i, defaultOperator: d } = e, { t: m } = A("ui"), g = (t == null ? void 0 : t.type) ?? d ?? "contains", [p, h] = G(g), [u, b] = G((t == null ? void 0 : t.filter) ?? "");
772
+ K(() => {
773
+ h((t == null ? void 0 : t.type) ?? d ?? "contains"), b((t == null ? void 0 : t.filter) ?? "");
774
+ }, [t, d]);
775
+ const S = j(() => mr(Xt.language), []);
776
+ _t({
777
+ doesFilterPass: (T) => {
778
+ const R = t;
779
+ if (!R || R.filter === "") return !0;
780
+ const I = gr(a(T.node));
781
+ if (I === null) return !1;
782
+ switch (R.type) {
783
+ case "equals":
784
+ return S.equals(I, R.filter);
785
+ case "contains":
786
+ return S.contains(I, R.filter);
787
+ case "startsWith":
788
+ return S.startsWith(I, R.filter);
789
+ case "endsWith":
790
+ return S.endsWith(I, R.filter);
791
+ case "notContains":
792
+ return !S.contains(I, R.filter);
793
+ default:
794
+ return !0;
795
+ }
796
+ }
797
+ });
798
+ function C() {
799
+ if (u.trim() === "") {
800
+ n(null);
801
+ return;
802
+ }
803
+ n({ type: p, filter: u });
804
+ }
805
+ function c() {
806
+ b(""), h(d ?? "contains"), n(null);
807
+ }
808
+ const f = fr.map(
809
+ (T) => ({
810
+ value: T,
811
+ label: m(`dataTable.textFilter.operators.${T}`)
812
+ })
813
+ ), w = i ?? m("dataTable.textFilter.placeholder");
814
+ return /* @__PURE__ */ L(
815
+ "div",
816
+ {
817
+ "data-component": "text-filter",
818
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
819
+ children: [
820
+ /* @__PURE__ */ s(
821
+ Qt,
822
+ {
823
+ size: "sm",
824
+ options: f,
825
+ value: p,
826
+ onValueChange: (T) => {
827
+ T !== "" && h(T);
828
+ },
829
+ "aria-label": m("dataTable.textFilter.operators.contains")
830
+ }
831
+ ),
832
+ /* @__PURE__ */ s(
833
+ Se,
834
+ {
835
+ size: "sm",
836
+ value: u,
837
+ onChange: (T) => b(T.target.value),
838
+ onKeyDown: (T) => {
839
+ T.key === "Enter" && (T.preventDefault(), C());
840
+ },
841
+ placeholder: w,
842
+ "aria-label": w,
843
+ startAdornment: /* @__PURE__ */ s(Ie, { "aria-hidden": "true", className: "ds:size-4" })
844
+ }
845
+ ),
846
+ /* @__PURE__ */ L("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: [
847
+ /* @__PURE__ */ s(de, { intent: "ghost", size: "sm", onClick: c, type: "button", children: m("dataTable.textFilter.clear") }),
848
+ /* @__PURE__ */ s(de, { intent: "primary", size: "sm", onClick: C, type: "button", children: m("dataTable.textFilter.apply") })
849
+ ] })
850
+ ]
851
+ }
852
+ );
853
+ }
854
+ function br(e) {
855
+ var b, S;
856
+ const { model: t, onModelChange: n, column: a } = e, { t: i } = A("ui"), d = ((S = (b = a == null ? void 0 : a.getColDef) == null ? void 0 : b.call(a)) == null ? void 0 : S.filterParams) ?? {}, m = d.defaultOperator ?? "contains", g = d.placeholder ?? i("dataTable.textFilter.placeholder"), [p, h] = G((t == null ? void 0 : t.filter) ?? "");
857
+ K(() => {
858
+ h((t == null ? void 0 : t.filter) ?? "");
859
+ }, [t == null ? void 0 : t.filter]), K(() => {
860
+ if (p === ((t == null ? void 0 : t.filter) ?? "")) return;
861
+ const C = setTimeout(() => {
862
+ if (p === "") {
863
+ t && n(null);
864
+ return;
865
+ }
866
+ n({ type: m, filter: p });
867
+ }, 200);
868
+ return () => clearTimeout(C);
869
+ }, [p, m, t, n]);
870
+ function u() {
871
+ h(""), t && n(null);
872
+ }
873
+ return /* @__PURE__ */ s("div", { "data-component": "text-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
874
+ Se,
875
+ {
876
+ size: "sm",
877
+ value: p,
878
+ onChange: (C) => h(C.target.value),
879
+ placeholder: g,
880
+ "aria-label": g,
881
+ startAdornment: /* @__PURE__ */ s(Ie, { "aria-hidden": "true", className: "ds:size-4" }),
882
+ endAdornment: p.length > 0 ? /* @__PURE__ */ s(
883
+ "button",
884
+ {
885
+ type: "button",
886
+ "aria-label": i("dataTable.textFilter.clear"),
887
+ onClick: u,
888
+ className: "ds:pointer-events-auto ds:flex ds:items-center ds:text-[var(--muted-foreground)] ds:hover:text-[var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
889
+ children: /* @__PURE__ */ s($e, { "aria-hidden": "true", className: "ds:size-4" })
890
+ }
891
+ ) : void 0
892
+ }
893
+ ) });
894
+ }
895
+ const yr = /* @__PURE__ */ new Set(["presentation", "none"]), Be = '[role="presentation"][aria-hidden], [role="none"][aria-hidden]';
896
+ function ge(e) {
897
+ const t = e.getAttribute("role");
898
+ t === null || !yr.has(t) || e.getAttribute("aria-hidden") === "false" && e.removeAttribute("aria-hidden");
899
+ }
900
+ function xr(e, t = !0) {
901
+ K(() => {
902
+ const n = e.current;
903
+ if (!t || !n || typeof MutationObserver > "u") return;
904
+ (() => {
905
+ for (const d of n.querySelectorAll(Be)) ge(d);
906
+ })();
907
+ const i = new MutationObserver((d) => {
908
+ for (const m of d)
909
+ if (m.type === "attributes")
910
+ ge(m.target);
911
+ else
912
+ for (const g of m.addedNodes)
913
+ if (g instanceof Element) {
914
+ ge(g);
915
+ for (const p of g.querySelectorAll(Be))
916
+ ge(p);
917
+ }
918
+ });
919
+ return i.observe(n, {
920
+ subtree: !0,
921
+ childList: !0,
922
+ attributes: !0,
923
+ attributeFilter: ["aria-hidden"]
924
+ }), () => i.disconnect();
925
+ }, [e, t]);
926
+ }
927
+ const ne = "__dsDetailOf", wr = "ds-data-table-expanded-row", rt = "::detail", Tr = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
928
+ function W(e) {
929
+ return typeof e == "object" && e !== null && typeof e[ne] == "string";
930
+ }
931
+ function vr(e) {
932
+ return `${e}${rt}`;
933
+ }
934
+ function fa(e) {
935
+ return e.endsWith(rt);
936
+ }
937
+ function Cr(e, t) {
938
+ return { ...e, [ne]: t };
939
+ }
940
+ const at = Ce(
941
+ null
942
+ );
943
+ function Rr(e) {
944
+ var c;
945
+ const t = Re(
946
+ at
947
+ ), { t: n } = A(), a = B(null), { data: i, node: d, api: m } = e, g = W(i), p = t == null ? void 0 : t.heights, h = d.id, u = B(t);
948
+ if (u.current = t, K(() => {
949
+ const f = a.current;
950
+ if (!f || !g || !p || h == null) return;
951
+ let w = p.get(h) ?? 0;
952
+ const T = () => {
953
+ const I = Math.ceil(f.getBoundingClientRect().height);
954
+ I <= 0 || I === w || (w = I, p.set(h, I), d.setRowHeight(I), m.onRowHeightChanged());
955
+ };
956
+ T();
957
+ const R = new ResizeObserver(T);
958
+ return R.observe(f), () => R.disconnect();
959
+ }, [m, h, p, g, d]), K(() => {
960
+ const f = a.current, w = f == null ? void 0 : f.parentElement;
961
+ if (!f || !w || !g) return;
962
+ const T = (R) => {
963
+ var I, ee;
964
+ R.target !== w || R.defaultPrevented || (R.key === "Escape" ? (R.stopPropagation(), (ee = (I = u.current) == null ? void 0 : I.onExpandedRowChange) == null || ee.call(I, null)) : R.key === "Enter" && (R.preventDefault(), (f.querySelector(Tr) ?? f).focus()));
965
+ };
966
+ return w.addEventListener("keydown", T), () => w.removeEventListener("keydown", T);
967
+ }, [g]), !g) {
968
+ const f = t == null ? void 0 : t.fallbackRenderer;
969
+ return f ? /* @__PURE__ */ s(f, { ...e }) : null;
970
+ }
971
+ const b = i[ne];
972
+ let S;
973
+ if (t != null && t.expanded && t.expanded.id === b)
974
+ S = t.expanded.row;
975
+ else {
976
+ const { [ne]: f, ...w } = i;
977
+ S = w;
978
+ }
979
+ return /* @__PURE__ */ L(
980
+ "div",
981
+ {
982
+ ref: a,
983
+ role: "gridcell",
984
+ tabIndex: -1,
985
+ "data-component": "data-table-expanded-row",
986
+ "data-expanded-row-of": b,
987
+ className: "ds-data-table-expanded-row-surface",
988
+ onKeyDown: (f) => {
989
+ var w;
990
+ f.key !== "Escape" || f.defaultPrevented || (f.stopPropagation(), (w = t == null ? void 0 : t.onExpandedRowChange) == null || w.call(t, null));
991
+ },
992
+ children: [
993
+ /* @__PURE__ */ s("span", { className: "ds:sr-only", children: n("dataTable.expandedRow") }),
994
+ (c = t == null ? void 0 : t.renderExpandedRow) == null ? void 0 : c.call(t, S)
995
+ ]
996
+ }
997
+ );
998
+ }
999
+ const Sr = {
1000
+ id: "data-table",
1001
+ capabilities: [
1002
+ "select_single",
1003
+ "select_multiple",
1004
+ "range_pick",
1005
+ "filter",
1006
+ "sort",
1007
+ "paginate"
1008
+ ],
1009
+ state: {
1010
+ selection: {
1011
+ type: "string[]",
1012
+ descriptionKey: "ui.agent.dataTable.state.selection",
1013
+ description: "Row ids of currently-selected rows.",
1014
+ read: (e) => e.getSelection()
1015
+ },
1016
+ filter: {
1017
+ type: "object",
1018
+ descriptionKey: "ui.agent.dataTable.state.filter",
1019
+ description: "Current ag-grid filter model, keyed by column id.",
1020
+ read: (e) => e.getFilter()
1021
+ },
1022
+ sort: {
1023
+ type: "Array<{ colId, sort }>",
1024
+ descriptionKey: "ui.agent.dataTable.state.sort",
1025
+ description: "Active sort, in priority order.",
1026
+ read: (e) => e.getSort()
1027
+ },
1028
+ currentPage: {
1029
+ type: "number",
1030
+ descriptionKey: "ui.agent.dataTable.state.currentPage",
1031
+ description: "Zero-indexed page number.",
1032
+ read: (e) => e.getCurrentPage()
1033
+ },
1034
+ expandedRowId: {
1035
+ type: "string | null",
1036
+ descriptionKey: "ui.agent.dataTable.state.expandedRowId",
1037
+ description: "Id of the row whose inline detail is open (expandable row), or null.",
1038
+ read: (e) => e.getExpandedRowId()
1039
+ }
1040
+ },
1041
+ actions: {
1042
+ select_rows: {
1043
+ // Transient grid selection (data-table convention) — stays read.
1044
+ safety: "read",
1045
+ argsType: "{ ids: string[] }",
1046
+ argsSchema: {
1047
+ type: "object",
1048
+ properties: {
1049
+ ids: {
1050
+ type: "array",
1051
+ items: { type: "string" },
1052
+ description: "Row ids to select (replaces the current selection)."
1053
+ }
1054
+ },
1055
+ required: ["ids"]
1056
+ },
1057
+ idempotent: !0,
1058
+ descriptionKey: "ui.agent.dataTable.actions.selectRows",
1059
+ description: "Replace the current selection with the given row ids.",
1060
+ examples: [
1061
+ { args: { ids: ["r-1", "r-2"] }, note: "Select the first two rows." }
1062
+ ],
1063
+ invoke: (e, t) => {
1064
+ e.setSelection(t.ids);
1065
+ }
1066
+ },
1067
+ select_range: {
1068
+ safety: "read",
1069
+ argsType: "{ fromId: string, toId: string }",
1070
+ argsSchema: {
1071
+ type: "object",
1072
+ properties: {
1073
+ fromId: { type: "string", description: "Start row id (inclusive)." },
1074
+ toId: { type: "string", description: "End row id (inclusive)." }
1075
+ },
1076
+ required: ["fromId", "toId"]
1077
+ },
1078
+ idempotent: !0,
1079
+ descriptionKey: "ui.agent.dataTable.actions.selectRange",
1080
+ description: "Select every row between fromId and toId, inclusive, in current sort order.",
1081
+ invoke: (e, t) => {
1082
+ e.selectRange(t.fromId, t.toId);
1083
+ }
1084
+ },
1085
+ clear_selection: {
1086
+ safety: "read",
1087
+ idempotent: !0,
1088
+ descriptionKey: "ui.agent.dataTable.actions.clearSelection",
1089
+ description: "Deselect all rows.",
1090
+ invoke: (e) => {
1091
+ e.clearSelection();
1092
+ }
1093
+ },
1094
+ get_selection: {
1095
+ safety: "read",
1096
+ returns: "string[]",
1097
+ returnsSchema: { type: "array", items: { type: "string" } },
1098
+ idempotent: !0,
1099
+ descriptionKey: "ui.agent.dataTable.actions.getSelection",
1100
+ description: "Return the row ids of the currently-selected rows.",
1101
+ invoke: (e) => e.getSelection()
1102
+ },
1103
+ apply_filter: {
1104
+ safety: "read",
1105
+ argsType: "{ model: Record<string, unknown> }",
1106
+ argsSchema: {
1107
+ type: "object",
1108
+ properties: {
1109
+ model: {
1110
+ type: "object",
1111
+ description: "ag-grid filter model keyed by column id. Opaque per-column filter shapes; replaces the current model.",
1112
+ additionalProperties: !0
1113
+ }
1114
+ },
1115
+ required: ["model"]
1116
+ },
1117
+ idempotent: !0,
1118
+ descriptionKey: "ui.agent.dataTable.actions.applyFilter",
1119
+ description: "Replace the filter model with the given object.",
1120
+ invoke: (e, t) => {
1121
+ e.setFilter(t.model);
1122
+ }
1123
+ },
1124
+ sort_by: {
1125
+ safety: "read",
1126
+ argsType: "{ model: DataTableSortEntry[] }",
1127
+ argsSchema: {
1128
+ type: "object",
1129
+ properties: {
1130
+ model: {
1131
+ type: "array",
1132
+ description: "Sort entries in priority order.",
1133
+ items: {
1134
+ type: "object",
1135
+ properties: {
1136
+ colId: { type: "string", description: "Column id to sort by." },
1137
+ sort: { enum: ["asc", "desc"], description: "Sort direction." }
1138
+ },
1139
+ required: ["colId", "sort"]
1140
+ }
1141
+ }
1142
+ },
1143
+ required: ["model"]
1144
+ },
1145
+ idempotent: !0,
1146
+ descriptionKey: "ui.agent.dataTable.actions.sortBy",
1147
+ description: "Replace the active sort with the given list (priority order).",
1148
+ examples: [
1149
+ {
1150
+ args: { model: [{ colId: "name", sort: "asc" }] },
1151
+ note: "Sort by name ascending."
1152
+ }
1153
+ ],
1154
+ invoke: (e, t) => {
1155
+ e.setSort(t.model);
1156
+ }
1157
+ },
1158
+ go_to_page: {
1159
+ safety: "read",
1160
+ argsType: "{ page: number }",
1161
+ argsSchema: {
1162
+ type: "object",
1163
+ properties: {
1164
+ page: {
1165
+ type: "integer",
1166
+ minimum: 0,
1167
+ description: "Zero-indexed page number."
1168
+ }
1169
+ },
1170
+ required: ["page"]
1171
+ },
1172
+ idempotent: !0,
1173
+ descriptionKey: "ui.agent.dataTable.actions.goToPage",
1174
+ description: "Navigate to the given zero-indexed page.",
1175
+ invoke: (e, t) => {
1176
+ e.goToPage(t.page);
1177
+ }
1178
+ }
1179
+ },
1180
+ domHooks: {
1181
+ root: {
1182
+ attr: "data-component",
1183
+ value: "data-table",
1184
+ description: "Marks the DataTable wrapper."
1185
+ },
1186
+ instanceId: {
1187
+ attr: "data-component-id",
1188
+ sourceProp: "gridId",
1189
+ description: "Sourced from the gridId prop. Required to address a specific table from the agent."
1190
+ },
1191
+ item: {
1192
+ attr: "row-id",
1193
+ description: 'Native ag-grid row-id attribute on each rendered record row. When an expandable row is open, one extra full-width row with row-id `<parentId>::detail` is the accordion detail, not a record — its cell carries data-component="data-table-expanded-row" and data-expanded-row-of="<parentId>"; skip it when enumerating rows (isExpandedRowDetailId). Selection is performed via the curated handle, not by DOM mutation.'
1194
+ }
1195
+ }
1196
+ };
1197
+ Lt.registerModules([qt]);
1198
+ const Ir = Gt("ag-theme-alfadocs ds:w-full", {
1199
+ variants: {
1200
+ density: {
1201
+ default: "",
1202
+ compact: "data-table-compact",
1203
+ expanded: "data-table-expanded"
1204
+ },
1205
+ bordered: {
1206
+ true: "",
1207
+ false: "ds:[--ag-borders:none]"
1208
+ }
1209
+ },
1210
+ defaultVariants: {
1211
+ density: "default",
1212
+ bordered: !0
1213
+ }
1214
+ });
1215
+ function Er() {
1216
+ const { t: e } = A();
1217
+ return j(
1218
+ () => ({
1219
+ // Filter strings
1220
+ contains: e("dataTable.agGrid.contains"),
1221
+ notContains: e("dataTable.agGrid.notContains"),
1222
+ equals: e("dataTable.agGrid.equals"),
1223
+ notEqual: e("dataTable.agGrid.notEqual"),
1224
+ startsWith: e("dataTable.agGrid.startsWith"),
1225
+ endsWith: e("dataTable.agGrid.endsWith"),
1226
+ lessThan: e("dataTable.agGrid.lessThan"),
1227
+ greaterThan: e("dataTable.agGrid.greaterThan"),
1228
+ inRange: e("dataTable.agGrid.inRange"),
1229
+ blank: e("dataTable.agGrid.blank"),
1230
+ notBlank: e("dataTable.agGrid.notBlank"),
1231
+ filterOoo: e("dataTable.agGrid.filterOoo"),
1232
+ applyFilter: e("dataTable.agGrid.applyFilter"),
1233
+ resetFilter: e("dataTable.agGrid.resetFilter"),
1234
+ noRowsToShow: e("dataTable.agGrid.noRowsToShow"),
1235
+ selectAll: e("dataTable.agGrid.selectAll"),
1236
+ // Pagination
1237
+ page: e("dataTable.page"),
1238
+ of: e("dataTable.of"),
1239
+ to: e("dataTable.to"),
1240
+ nextPage: e("dataTable.nextPage"),
1241
+ previousPage: e("dataTable.previousPage"),
1242
+ firstPage: e("dataTable.firstPage"),
1243
+ lastPage: e("dataTable.lastPage"),
1244
+ pageSize: e("dataTable.pageSize")
1245
+ }),
1246
+ [e]
1247
+ );
1248
+ }
1249
+ function Dr() {
1250
+ return /* @__PURE__ */ s(
1251
+ "div",
1252
+ {
1253
+ role: "status",
1254
+ "aria-live": "polite",
1255
+ className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
1256
+ children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ s(
1257
+ Mt,
1258
+ {
1259
+ variant: "rectangular",
1260
+ className: "ds:h-[var(--min-target-size)] ds:w-full"
1261
+ },
1262
+ t
1263
+ ))
1264
+ }
1265
+ );
1266
+ }
1267
+ function Nr() {
1268
+ const { t: e } = A();
1269
+ return /* @__PURE__ */ s(
1270
+ zt,
1271
+ {
1272
+ variant: "no-results",
1273
+ size: "sm",
1274
+ title: e("dataTable.noRows"),
1275
+ description: e("dataTable.noRowsDescription")
1276
+ }
1277
+ );
1278
+ }
1279
+ function Fr(e) {
1280
+ return e.map(({ pinned: t, ...n }) => n);
1281
+ }
1282
+ function kr(e) {
1283
+ return e.map(({ hide: t, pinned: n, ...a }) => a);
1284
+ }
1285
+ function Ar(e, t) {
1286
+ try {
1287
+ const n = localStorage.getItem(`data-table-col-state:${e}`);
1288
+ if (!n) return null;
1289
+ const a = JSON.parse(n);
1290
+ if (Array.isArray(a))
1291
+ return {
1292
+ state: kr(a),
1293
+ touched: []
1294
+ };
1295
+ if (typeof a != "object" || a === null) return null;
1296
+ const i = a;
1297
+ return i.v !== 2 || !Array.isArray(i.state) ? null : {
1298
+ state: i.dir === t ? i.state : Fr(i.state),
1299
+ touched: Array.isArray(i.touched) ? i.touched.filter((d) => typeof d == "string") : []
1300
+ };
1301
+ } catch {
1302
+ return null;
1303
+ }
1304
+ }
1305
+ function Pr(e, t, n, a) {
1306
+ try {
1307
+ const i = {
1308
+ v: 2,
1309
+ dir: n,
1310
+ state: t.getColumnState(),
1311
+ touched: [...a]
1312
+ };
1313
+ localStorage.setItem(
1314
+ `data-table-col-state:${e}`,
1315
+ JSON.stringify(i)
1316
+ );
1317
+ } catch {
1318
+ }
1319
+ }
1320
+ const Or = /* @__PURE__ */ new Set([
1321
+ "api",
1322
+ "flex",
1323
+ "gridInitializing",
1324
+ "gridOptionsChanged",
1325
+ "autosizeColumns",
1326
+ "sizeColumnsToFit"
1327
+ ]);
1328
+ function Mr(e, t) {
1329
+ const {
1330
+ columnDefs: n,
1331
+ rowData: a,
1332
+ rowSelection: i,
1333
+ pagination: d = !1,
1334
+ paginationPageSize: m = 25,
1335
+ paginationPageSizeSelector: g = [10, 25, 50, 100],
1336
+ gridId: p,
1337
+ onSelectionChanged: h,
1338
+ onSortChanged: u,
1339
+ onFilterChanged: b,
1340
+ noRowsOverlay: S,
1341
+ loadingOverlay: C,
1342
+ gridOptions: c,
1343
+ density: f,
1344
+ bordered: w,
1345
+ heightClass: T = "ds:h-[500px]",
1346
+ className: R,
1347
+ getRowClass: I,
1348
+ pinnedBottomRowData: ee,
1349
+ printMode: _ = !1,
1350
+ expandedRowId: v,
1351
+ renderExpandedRow: O,
1352
+ onExpandedRowChange: M,
1353
+ children: F
1354
+ } = e, N = v !== void 0 || O !== void 0, q = c == null ? void 0 : c.getRowId;
1355
+ if (N && !q)
1356
+ throw new Error(
1357
+ "DataTable: `expandedRowId` / `renderExpandedRow` require `gridOptions.getRowId` — the expanded row is addressed by row id, not by index."
1358
+ );
1359
+ const { t: U, i18n: z } = A(), E = B(null), ie = B(null);
1360
+ xr(ie);
1361
+ const [X, xe] = G(0), [Q, we] = G(""), ot = Er(), Oe = B(v);
1362
+ Oe.current = v;
1363
+ const Te = j(
1364
+ () => ({
1365
+ getSelection: () => {
1366
+ var l;
1367
+ const r = (l = E.current) == null ? void 0 : l.api;
1368
+ if (!r) return [];
1369
+ const o = [];
1370
+ for (const y of r.getSelectedNodes())
1371
+ y.id != null && !W(y.data) && o.push(y.id);
1372
+ return o;
1373
+ },
1374
+ setSelection: (r) => {
1375
+ var y;
1376
+ const o = (y = E.current) == null ? void 0 : y.api;
1377
+ if (!o) return;
1378
+ const l = new Set(r);
1379
+ o.forEachNode((x) => {
1380
+ x.id != null && x.setSelected(l.has(x.id));
1381
+ });
1382
+ },
1383
+ selectRange: (r, o) => {
1384
+ var qe;
1385
+ const l = (qe = E.current) == null ? void 0 : qe.api;
1386
+ if (!l) return;
1387
+ const y = [];
1388
+ l.forEachNodeAfterFilterAndSort((Y) => {
1389
+ Y.id != null && !W(Y.data) && y.push(Y.id);
1390
+ });
1391
+ const x = y.indexOf(r), k = y.indexOf(o);
1392
+ if (x < 0 || k < 0) return;
1393
+ const [P, re] = x <= k ? [x, k] : [k, x], Z = new Set(y.slice(P, re + 1));
1394
+ l.forEachNode((Y) => {
1395
+ Y.id != null && Y.setSelected(Z.has(Y.id));
1396
+ });
1397
+ },
1398
+ clearSelection: () => {
1399
+ var r, o;
1400
+ (o = (r = E.current) == null ? void 0 : r.api) == null || o.deselectAll();
1401
+ },
1402
+ getFilter: () => {
1403
+ var r, o;
1404
+ return ((o = (r = E.current) == null ? void 0 : r.api) == null ? void 0 : o.getFilterModel()) ?? {};
1405
+ },
1406
+ setFilter: (r) => {
1407
+ var o, l;
1408
+ (l = (o = E.current) == null ? void 0 : o.api) == null || l.setFilterModel(r);
1409
+ },
1410
+ getSort: () => {
1411
+ var o;
1412
+ const r = (o = E.current) == null ? void 0 : o.api;
1413
+ return r ? r.getColumnState().filter((l) => l.sort === "asc" || l.sort === "desc").map((l) => ({ colId: l.colId, sort: l.sort })) : [];
1414
+ },
1415
+ setSort: (r) => {
1416
+ var y;
1417
+ const o = (y = E.current) == null ? void 0 : y.api;
1418
+ if (!o) return;
1419
+ const l = o.getColumnState().map((x) => {
1420
+ const k = r.find((P) => P.colId === x.colId);
1421
+ return { ...x, sort: k ? k.sort : null };
1422
+ });
1423
+ o.applyColumnState({ state: l, defaultState: { sort: null } });
1424
+ },
1425
+ getCurrentPage: () => {
1426
+ var r, o;
1427
+ return ((o = (r = E.current) == null ? void 0 : r.api) == null ? void 0 : o.paginationGetCurrentPage()) ?? 0;
1428
+ },
1429
+ goToPage: (r) => {
1430
+ var o, l;
1431
+ (l = (o = E.current) == null ? void 0 : o.api) == null || l.paginationGoToPage(r);
1432
+ },
1433
+ getExpandedRowId: () => Oe.current ?? null,
1434
+ getUserTouchedColumns: () => [...te.current],
1435
+ markColumnsUserTouched: (r) => Me.current(r),
1436
+ getRawApi: () => {
1437
+ var r;
1438
+ return (r = E.current) == null ? void 0 : r.api;
1439
+ }
1440
+ }),
1441
+ []
1442
+ ), ce = B(/* @__PURE__ */ new Map()), te = B(/* @__PURE__ */ new Set()), Me = B(
1443
+ () => {
1444
+ }
1445
+ );
1446
+ Ot(t, () => Te, [Te]), Jt(Sr, Te, p);
1447
+ const ze = z.dir() === "rtl", it = a === void 0, st = Zt(), { resolvedTheme: Ge } = Yt(), lt = (Ge === "light-accessible" || Ge === "dark-accessible") && f === "compact" ? "default" : f, dt = j(() => {
1448
+ if (!i) return;
1449
+ const r = (o) => !W(o.data);
1450
+ return i === "single" ? { mode: "singleRow", isRowSelectable: r } : {
1451
+ mode: "multiRow",
1452
+ headerCheckbox: !0,
1453
+ checkboxes: !0,
1454
+ isRowSelectable: r
1455
+ };
1456
+ }, [i]), ue = ze ? "rtl" : "ltr", H = D(
1457
+ (r, o, l) => {
1458
+ const y = new Set(o);
1459
+ for (const x of r.getColumnState()) {
1460
+ if (!y.has(x.colId)) continue;
1461
+ const k = ce.current.get(x.colId) ?? {};
1462
+ for (const P of l) k[P] = x[P];
1463
+ ce.current.set(x.colId, k);
1464
+ }
1465
+ },
1466
+ []
1467
+ ), se = D(
1468
+ (r) => {
1469
+ p && Pr(p, r, ue, te.current);
1470
+ },
1471
+ [p, ue]
1472
+ ), _e = D(
1473
+ (r) => {
1474
+ var l;
1475
+ for (const y of r) te.current.add(y);
1476
+ const o = (l = E.current) == null ? void 0 : l.api;
1477
+ o && (H(o, r, ["hide"]), se(o));
1478
+ },
1479
+ [se, H]
1480
+ );
1481
+ Me.current = _e;
1482
+ const ct = D(() => {
1483
+ var l;
1484
+ if (!((l = E.current) != null && l.api)) return;
1485
+ const r = E.current.api, o = p ? Ar(p, ue) : null;
1486
+ if (o) {
1487
+ for (const y of o.touched) te.current.add(y);
1488
+ r.applyColumnState({
1489
+ state: o.state,
1490
+ applyOrder: !0
1491
+ }), H(r, o.touched, ["hide"]);
1492
+ }
1493
+ }, [p, ue, H]), ut = D(
1494
+ (r) => {
1495
+ var l;
1496
+ if (r.source !== "gridOptionsChanged") return;
1497
+ const o = (l = E.current) == null ? void 0 : l.api;
1498
+ !o || ce.current.size === 0 || o.applyColumnState({
1499
+ state: [...ce.current].map(([y, x]) => ({
1500
+ colId: y,
1501
+ ...x
1502
+ }))
1503
+ });
1504
+ },
1505
+ []
1506
+ ), pe = D(
1507
+ (r) => {
1508
+ var y;
1509
+ const o = (y = E.current) == null ? void 0 : y.api;
1510
+ if (!o) return;
1511
+ const l = (r.columns ?? (r.column ? [r.column] : [])).map((x) => x.getColId());
1512
+ if (r.source && Or.has(r.source)) {
1513
+ if (r.source === "api" && "visible" in r) {
1514
+ const x = l.filter(
1515
+ (k) => te.current.has(k)
1516
+ );
1517
+ x.length > 0 && (H(o, x, ["hide"]), se(o));
1518
+ }
1519
+ return;
1520
+ }
1521
+ if ("visible" in r) {
1522
+ for (const x of l) te.current.add(x);
1523
+ H(o, l, ["hide"]);
1524
+ } else "pinned" in r ? H(o, l, ["pinned"]) : "flexColumns" in r && H(o, l, ["width", "flex"]);
1525
+ se(o);
1526
+ },
1527
+ [se, H]
1528
+ ), pt = j(() => {
1529
+ if (!c) return;
1530
+ const r = { ...c };
1531
+ return delete r.defaultColDef, N && (delete r.getRowId, delete r.isFullWidthRow, delete r.fullWidthCellRenderer, delete r.getRowHeight, delete r.postSortRows, delete r.getRowClass, delete r.defaultCsvExportParams, delete r.defaultExcelExportParams), r;
1532
+ }, [N, c]), je = B(/* @__PURE__ */ new Map()), le = B(c);
1533
+ le.current = c;
1534
+ const Le = D(
1535
+ (r) => {
1536
+ var o;
1537
+ return q == null ? void 0 : q({
1538
+ data: r,
1539
+ level: 0,
1540
+ api: (o = E.current) == null ? void 0 : o.api,
1541
+ context: c == null ? void 0 : c.context
1542
+ });
1543
+ },
1544
+ [q, c == null ? void 0 : c.context]
1545
+ ), J = j(() => {
1546
+ if (!N || v == null || !a) return null;
1547
+ const r = a.find((o) => Le(o) === v);
1548
+ return r === void 0 ? null : { id: v, row: r };
1549
+ }, [N, v, Le, a]), ft = j(() => {
1550
+ if (!J || !a) return a;
1551
+ const r = a.indexOf(J.row), o = Cr(J.row, J.id);
1552
+ return [
1553
+ ...a.slice(0, r + 1),
1554
+ o,
1555
+ ...a.slice(r + 1)
1556
+ ];
1557
+ }, [J, a]), mt = D(
1558
+ (r) => W(r.data) ? vr(r.data[ne]) : q(r),
1559
+ [q]
1560
+ ), gt = D(
1561
+ (r) => {
1562
+ var o, l;
1563
+ return W(r.rowNode.data) || (((l = (o = le.current) == null ? void 0 : o.isFullWidthRow) == null ? void 0 : l.call(o, r)) ?? !1);
1564
+ },
1565
+ []
1566
+ ), ht = D(
1567
+ (r) => {
1568
+ var o, l;
1569
+ return W(r.data) ? je.current.get(r.node.id ?? "") : (l = (o = le.current) == null ? void 0 : o.getRowHeight) == null ? void 0 : l.call(o, r);
1570
+ },
1571
+ []
1572
+ ), bt = D(
1573
+ (r) => {
1574
+ var P, re;
1575
+ (re = (P = le.current) == null ? void 0 : P.postSortRows) == null || re.call(P, r);
1576
+ const { nodes: o } = r, l = o.findIndex((Z) => W(Z.data));
1577
+ if (l < 0) return;
1578
+ const [y] = o.splice(l, 1), x = y.data[ne], k = o.findIndex((Z) => Z.id === x);
1579
+ o.splice(k < 0 ? o.length : k + 1, 0, y);
1580
+ },
1581
+ []
1582
+ ), yt = D(
1583
+ (r) => {
1584
+ var o, l;
1585
+ return W(r.data) ? wr : ((l = (o = le.current) == null ? void 0 : o.getRowClass) == null ? void 0 : l.call(o, r)) ?? (I == null ? void 0 : I(r));
1586
+ },
1587
+ [I]
1588
+ ), fe = D(
1589
+ (r) => W(r.node.data),
1590
+ []
1591
+ ), xt = j(() => {
1592
+ if (!N) return;
1593
+ const r = c == null ? void 0 : c.defaultCsvExportParams;
1594
+ return {
1595
+ ...r,
1596
+ shouldRowBeSkipped: (o) => {
1597
+ var l;
1598
+ return fe(o) || (((l = r == null ? void 0 : r.shouldRowBeSkipped) == null ? void 0 : l.call(r, o)) ?? !1);
1599
+ }
1600
+ };
1601
+ }, [N, c == null ? void 0 : c.defaultCsvExportParams, fe]), wt = j(() => {
1602
+ if (!N) return;
1603
+ const r = c == null ? void 0 : c.defaultExcelExportParams;
1604
+ return {
1605
+ ...r,
1606
+ shouldRowBeSkipped: (o) => {
1607
+ var l;
1608
+ return fe(o) || (((l = r == null ? void 0 : r.shouldRowBeSkipped) == null ? void 0 : l.call(r, o)) ?? !1);
1609
+ }
1610
+ };
1611
+ }, [N, c == null ? void 0 : c.defaultExcelExportParams, fe]), ve = c == null ? void 0 : c.fullWidthCellRenderer, Tt = j(
1612
+ () => ({
1613
+ renderExpandedRow: O,
1614
+ onExpandedRowChange: M,
1615
+ expanded: J,
1616
+ heights: je.current,
1617
+ fallbackRenderer: typeof ve == "function" ? ve : void 0
1618
+ }),
1619
+ [
1620
+ ve,
1621
+ J,
1622
+ M,
1623
+ O
1624
+ ]
1625
+ ), vt = D(() => {
1626
+ var l;
1627
+ const r = (l = E.current) == null ? void 0 : l.api;
1628
+ if (!r) return;
1629
+ const o = r.getSelectedRows().filter((y) => !W(y));
1630
+ xe(o.length), h == null || h(o);
1631
+ }, [h]), Ct = D(
1632
+ (r) => {
1633
+ var l;
1634
+ const o = (l = E.current) == null ? void 0 : l.api;
1635
+ if (o) {
1636
+ const x = o.getColumnState().find((k) => k.sort);
1637
+ if (x) {
1638
+ const k = x.colId, P = o.getColumnDef(k), re = (P == null ? void 0 : P.headerName) ?? k, Z = x.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
1639
+ we(
1640
+ U("dataTable.sortAnnounce", {
1641
+ column: re,
1642
+ direction: U(Z)
1643
+ })
1644
+ );
1645
+ } else
1646
+ we("");
1647
+ }
1648
+ u == null || u(r);
1649
+ },
1650
+ [u, U]
1651
+ ), Rt = D(
1652
+ (r) => {
1653
+ b == null || b(r);
1654
+ },
1655
+ [b]
1656
+ );
1657
+ K(() => {
1658
+ if (!Q) return;
1659
+ const r = setTimeout(() => we(""), 3e3);
1660
+ return () => clearTimeout(r);
1661
+ }, [Q]);
1662
+ const St = S ?? Nr, It = C ?? Dr, Et = D(
1663
+ () => {
1664
+ var r;
1665
+ return (r = E.current) == null ? void 0 : r.api;
1666
+ },
1667
+ []
1668
+ ), Dt = D(() => {
1669
+ typeof window < "u" && window.print();
1670
+ }, []), Nt = Ir({
1671
+ density: lt,
1672
+ bordered: w,
1673
+ className: R
1674
+ }), Ft = F ?? /* @__PURE__ */ s("div", { className: "data-table-toolbar ds:flex ds:justify-end", children: /* @__PURE__ */ L(
1675
+ Wt,
1676
+ {
1677
+ role: "toolbar",
1678
+ "aria-label": U("dataTable.tableActions"),
1679
+ className: "ds:bg-[var(--background)]",
1680
+ children: [
1681
+ /* @__PURE__ */ s(be.ExportMenu, {}),
1682
+ /* @__PURE__ */ s(be.Print, {}),
1683
+ /* @__PURE__ */ s(be.ColumnToggle, {})
1684
+ ]
1685
+ }
1686
+ ) }), kt = _ ? !1 : d;
1687
+ return /* @__PURE__ */ L(
1688
+ "div",
1689
+ {
1690
+ className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]",
1691
+ "aria-busy": it ? "true" : void 0,
1692
+ "data-component": "data-table",
1693
+ "data-component-id": p,
1694
+ "data-print-mode": _ ? "true" : void 0,
1695
+ children: [
1696
+ !_ && /* @__PURE__ */ s(
1697
+ ar,
1698
+ {
1699
+ getApi: Et,
1700
+ selectionCount: X,
1701
+ onPrint: Dt,
1702
+ markColumnsUserTouched: _e,
1703
+ children: Ft
1704
+ }
1705
+ ),
1706
+ /* @__PURE__ */ s(
1707
+ "div",
1708
+ {
1709
+ ref: ie,
1710
+ className: [Nt, _ ? "" : T].join(" ").trim(),
1711
+ children: /* @__PURE__ */ s(
1712
+ at.Provider,
1713
+ {
1714
+ value: Tt,
1715
+ children: /* @__PURE__ */ s(
1716
+ jt,
1717
+ {
1718
+ ref: E,
1719
+ theme: "legacy",
1720
+ columnDefs: n,
1721
+ rowData: ft,
1722
+ defaultColDef: {
1723
+ sortable: !0,
1724
+ // Default filter = DS-styled text filter so untyped columns
1725
+ // (no explicit `filter:` override) inherit the kit's form
1726
+ // language instead of AG Grid's stock browser-skinned input.
1727
+ // Number / date / select columns opt into their dedicated
1728
+ // wrapper per-column.
1729
+ filter: hr,
1730
+ floatingFilterComponent: br,
1731
+ resizable: !0,
1732
+ floatingFilter: !0,
1733
+ // §13d — faint sort icon advertises which columns are
1734
+ // sortable. v33+ moved this from grid-level to defaultColDef.
1735
+ unSortIcon: !0,
1736
+ ...c == null ? void 0 : c.defaultColDef
1737
+ },
1738
+ rowSelection: dt,
1739
+ pagination: kt,
1740
+ paginationPageSize: m,
1741
+ paginationPageSizeSelector: g,
1742
+ paginationNumberFormatter: (r) => new Intl.NumberFormat(z.language).format(r.value),
1743
+ animateRows: !st,
1744
+ enableRtl: ze,
1745
+ ensureDomOrder: !0,
1746
+ enableCellSpan: !0,
1747
+ enableCellTextSelection: !0,
1748
+ copyHeadersToClipboard: !0,
1749
+ accentedSort: !0,
1750
+ multiSortKey: "ctrl",
1751
+ suppressDragLeaveHidesColumns: !0,
1752
+ suppressRowClickSelection: i ? !0 : void 0,
1753
+ tooltipShowDelay: 500,
1754
+ tooltipHideDelay: 5e3,
1755
+ tooltipInteraction: !0,
1756
+ stopEditingWhenCellsLoseFocus: !0,
1757
+ maintainColumnOrder: !0,
1758
+ undoRedoCellEditing: !0,
1759
+ undoRedoCellEditingLimit: 20,
1760
+ suppressCellFocus: !1,
1761
+ rowBuffer: 10,
1762
+ localeText: ot,
1763
+ noRowsOverlayComponent: St,
1764
+ loadingOverlayComponent: It,
1765
+ getRowClass: N ? yt : I,
1766
+ pinnedBottomRowData: ee,
1767
+ domLayout: _ ? "autoHeight" : void 0,
1768
+ onGridReady: ct,
1769
+ onNewColumnsLoaded: ut,
1770
+ onColumnMoved: pe,
1771
+ onColumnResized: pe,
1772
+ onColumnPinned: pe,
1773
+ onColumnVisible: pe,
1774
+ onSortChanged: Ct,
1775
+ onFilterChanged: Rt,
1776
+ onSelectionChanged: vt,
1777
+ ...pt,
1778
+ ...N ? {
1779
+ getRowId: mt,
1780
+ isFullWidthRow: gt,
1781
+ fullWidthCellRenderer: Rr,
1782
+ getRowHeight: ht,
1783
+ postSortRows: bt,
1784
+ defaultCsvExportParams: xt,
1785
+ defaultExcelExportParams: wt
1786
+ } : {}
1787
+ }
1788
+ )
1789
+ }
1790
+ )
1791
+ }
1792
+ ),
1793
+ !_ && /* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: X > 0 ? /* @__PURE__ */ s("span", { children: U("dataTable.selected", { count: X }) }) : /* @__PURE__ */ s("span", {}) }),
1794
+ /* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: Q })
1795
+ ]
1796
+ }
1797
+ );
1798
+ }
1799
+ const nt = $(Mr);
1800
+ nt.displayName = "DataTable";
1801
+ const ma = Object.assign(nt, {
1802
+ Toolbar: be
1803
+ });
1804
+ export {
1805
+ ma as D,
1806
+ wr as E,
1807
+ hr as T,
1808
+ br as a,
1809
+ be as b,
1810
+ ar as c,
1811
+ Sr as d,
1812
+ Qe as e,
1813
+ vr as f,
1814
+ fa as g,
1815
+ W as i
1816
+ };
1817
+ //# sourceMappingURL=data-table-DC5rO3Ty.js.map