chordia-ui 3.7.2 → 3.7.4

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 (36) hide show
  1. package/dist/CustomFilterChips.cjs.js +1 -1
  2. package/dist/CustomFilterChips.cjs.js.map +1 -1
  3. package/dist/CustomFilterChips.es.js +239 -125
  4. package/dist/CustomFilterChips.es.js.map +1 -1
  5. package/dist/DataTable2.cjs.js +2 -0
  6. package/dist/DataTable2.cjs.js.map +1 -0
  7. package/dist/DataTable2.es.js +1863 -0
  8. package/dist/DataTable2.es.js.map +1 -0
  9. package/dist/components/UpdatedInteractionDetails.cjs.js +2 -2
  10. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  11. package/dist/components/UpdatedInteractionDetails.es.js +14 -13
  12. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  13. package/dist/components/data.cjs.js +1 -1
  14. package/dist/components/data.cjs.js.map +1 -1
  15. package/dist/components/data.es.js +157 -153
  16. package/dist/components/data.es.js.map +1 -1
  17. package/dist/components/performance.cjs.js +1 -1
  18. package/dist/components/performance.cjs.js.map +1 -1
  19. package/dist/components/performance.es.js +1900 -480
  20. package/dist/components/performance.es.js.map +1 -1
  21. package/dist/index.cjs.js +1 -1
  22. package/dist/index.es.js +94 -89
  23. package/dist/index.es.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +13 -13
  26. package/src/components/UpdatedInteractionDetails/UpdatedThreads.jsx +1 -0
  27. package/src/components/common/CustomFilterChips.jsx +5 -1
  28. package/src/components/common/Pagination.jsx +152 -39
  29. package/src/components/data/DataTable2.jsx +2449 -0
  30. package/src/components/data/DataTableFilters2.jsx +186 -0
  31. package/src/components/data/index.js +2 -0
  32. package/src/components/index.js +2 -2
  33. package/src/components/performance/PerformanceDetailsPage.jsx +940 -0
  34. package/src/components/performance/PerformancePanel.jsx +423 -297
  35. package/src/components/performance/SupervisorSelect.jsx +386 -0
  36. package/src/components/performance/index.js +3 -1
@@ -0,0 +1,1863 @@
1
+ import { jsxs as p, jsx as i, Fragment as Qe } from "react/jsx-runtime";
2
+ import Xe, { useState as h, useRef as j, useEffect as X, Suspense as Yt, useMemo as ae, useCallback as L } from "react";
3
+ import { u as qt, a as yt, D as Zt, c as Vt, S as en, h as tn, b as nn, s as rn, K as on, P as sn, d as Ue, e as an, C as ln } from "./sortable.esm.es.js";
4
+ import { CalendarClock as bt, Download as cn, ChevronDown as dn, Settings2 as un, Search as vt, X as fn, GripVertical as Ge, Check as wt, ArrowUp as pn, ArrowDown as hn, ArrowUpDown as mn, ListFilter as gn } from "lucide-react";
5
+ import { createPortal as Ye } from "react-dom";
6
+ import { C as yn, P as bn } from "./CustomFilterChips.es.js";
7
+ import "motion/react";
8
+ import "recharts";
9
+ import "./TourGuideTooltip.es.js";
10
+ function xn({
11
+ dateRangePicker: o,
12
+ onWeekToDate: a,
13
+ exportConfig: l,
14
+ filterChipsConfig: c,
15
+ trailingActions: x
16
+ // Optional extra actions rendered after Export (e.g., Add Users button)
17
+ }) {
18
+ const [v, f] = h(!1), m = j(null), $ = j(null);
19
+ X(() => {
20
+ const S = (b) => {
21
+ $.current && !$.current.contains(b.target) && m.current && !m.current.contains(b.target) && f(!1);
22
+ };
23
+ if (v)
24
+ return document.addEventListener("mousedown", S), () => {
25
+ document.removeEventListener("mousedown", S);
26
+ };
27
+ }, [v]);
28
+ const y = () => {
29
+ f((S) => !S);
30
+ }, C = (S) => {
31
+ f(!1), l != null && l.onExport && l.onExport(S);
32
+ }, M = (() => {
33
+ if (!(c != null && c.filters))
34
+ return !1;
35
+ const S = c.filters, b = c.customFilters || [], P = Object.entries(S).some(([k, N]) => !!(Array.isArray(N) && N.length || typeof N == "string" && N.trim() !== "" || N && typeof N == "object" && (N.min != null || N.max != null))), T = b.some((k) => k.active);
36
+ return P || T;
37
+ })();
38
+ return /* @__PURE__ */ p("div", { className: "flex items-center gap-3 flex-wrap", children: [
39
+ a && /* @__PURE__ */ p(
40
+ "button",
41
+ {
42
+ onClick: a,
43
+ className: "inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900",
44
+ style: { fontFamily: "var(--font-sans)" },
45
+ children: [
46
+ /* @__PURE__ */ i(bt, { size: 16 }),
47
+ /* @__PURE__ */ i("span", { children: "Week to Date" })
48
+ ]
49
+ }
50
+ ),
51
+ o && /* @__PURE__ */ i(
52
+ Yt,
53
+ {
54
+ fallback: /* @__PURE__ */ p("div", { className: "inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400", children: [
55
+ /* @__PURE__ */ i(bt, { size: 16 }),
56
+ /* @__PURE__ */ i("span", { children: "Loading..." })
57
+ ] }),
58
+ children: o
59
+ }
60
+ ),
61
+ l && /* @__PURE__ */ p("div", { className: "relative", children: [
62
+ /* @__PURE__ */ p(
63
+ "button",
64
+ {
65
+ ref: m,
66
+ onClick: y,
67
+ disabled: l.isExporting,
68
+ className: "inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]",
69
+ style: { fontFamily: "var(--font-sans)" },
70
+ children: [
71
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
72
+ /* @__PURE__ */ i(cn, { size: 16 }),
73
+ /* @__PURE__ */ i("span", { children: l.isExporting ? "Exporting..." : "Export" })
74
+ ] }),
75
+ /* @__PURE__ */ i(dn, { size: 16 })
76
+ ]
77
+ }
78
+ ),
79
+ v && /* @__PURE__ */ i(
80
+ "div",
81
+ {
82
+ ref: $,
83
+ className: "absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]",
84
+ children: (l.types || ["csv"]).map((S) => /* @__PURE__ */ p(
85
+ "button",
86
+ {
87
+ onClick: () => C(S),
88
+ className: "w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",
89
+ style: { fontFamily: "var(--font-sans)" },
90
+ children: [
91
+ "Export ",
92
+ S.toUpperCase()
93
+ ]
94
+ },
95
+ S
96
+ ))
97
+ }
98
+ )
99
+ ] }),
100
+ (M || x) && /* @__PURE__ */ p(Qe, { children: [
101
+ M && /* @__PURE__ */ i("div", { className: "h-9 mt-1 w-px bg-gray-300 flex-shrink-0" }),
102
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-3 justify-end", children: [
103
+ M && c && /* @__PURE__ */ i(
104
+ yn,
105
+ {
106
+ filters: c.filters,
107
+ onChange: c.onChange,
108
+ onClear: c.onClear,
109
+ customFilters: c.customFilters || [],
110
+ fieldOptions: c.fieldOptions || {}
111
+ }
112
+ ),
113
+ x && /* @__PURE__ */ i("div", { className: "flex-shrink-0", children: x })
114
+ ] })
115
+ ] })
116
+ ] });
117
+ }
118
+ function vn(o) {
119
+ if (o == null)
120
+ return NaN;
121
+ const a = String(o).replace(/[,$%]|pp/gi, "").trim(), l = parseFloat(a);
122
+ return Number.isFinite(l) ? l : NaN;
123
+ }
124
+ function wn(o) {
125
+ if (o == null)
126
+ return NaN;
127
+ const a = String(o).trim(), l = a.match(/^(\d+):(\d+)(?::(\d+))?$/);
128
+ if (l) {
129
+ const y = +l[1], C = +l[2], z = l[3] != null ? +l[3] : null;
130
+ return z != null ? y * 3600 + C * 60 + z : y * 60 + C;
131
+ }
132
+ let c = 0, x = !1;
133
+ const v = a.match(/(\d+)\s*d\b/i), f = a.match(/(\d+)\s*h\b/i), m = a.match(/(\d+)\s*m(?!s)\b/i), $ = a.match(/(\d+)\s*s\b/i);
134
+ return v && (c += +v[1] * 86400, x = !0), f && (c += +f[1] * 3600, x = !0), m && (c += +m[1] * 60, x = !0), $ && (c += +$[1], x = !0), x ? c : NaN;
135
+ }
136
+ function Sn(o) {
137
+ if (!o)
138
+ return null;
139
+ const a = String(o).trim(), l = a.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/);
140
+ if (l) {
141
+ const x = l[3].length === 2 ? 2e3 + +l[3] : +l[3], v = new Date(x, +l[1] - 1, +l[2]);
142
+ return isNaN(v.getTime()) ? null : v;
143
+ }
144
+ const c = new Date(a);
145
+ return isNaN(c.getTime()) ? null : c;
146
+ }
147
+ function Fn(o) {
148
+ if (!o || o.length === 0)
149
+ return "text";
150
+ const a = o.slice(0, 25), l = (c) => a.every(c);
151
+ return l((c) => /^\d{1,2}\/\d{1,2}\/\d{2,4}$/.test(c) || /^\d{4}-\d{2}-\d{2}/.test(c)) ? "date" : l((c) => /^\d+\s*[dhms]\b/i.test(c) || /^\d+:\d+(:\d+)?$/.test(c)) ? "duration" : l((c) => /^-?[\d,.]+(%|pp)?$/i.test(c)) ? "number" : "text";
152
+ }
153
+ function Ne(o) {
154
+ return o ? Array.isArray(o) ? o.length > 0 : o.type === "range" ? o.min !== "" && o.min !== void 0 && o.min !== null || o.max !== "" && o.max !== void 0 && o.max !== null : o.type === "durationRange" ? o.minSec !== "" && o.minSec != null || o.maxSec !== "" && o.maxSec != null : o.type === "dateRange" ? !!(o.from || o.to) : !1 : !1;
155
+ }
156
+ function xt(o) {
157
+ if (o == null || o === "" || isNaN(o))
158
+ return "";
159
+ const a = Number(o), l = Math.floor(a / 3600), c = Math.floor(a % 3600 / 60), x = Math.floor(a % 60);
160
+ return l > 0 ? `${l}h ${c}m` : c > 0 ? `${c}m ${x}s` : `${x}s`;
161
+ }
162
+ function kn(o) {
163
+ if (!o)
164
+ return "";
165
+ if (Array.isArray(o))
166
+ return o.length === 0 ? "" : String(o[0]);
167
+ if (o.type === "range") {
168
+ const a = o.min !== "" && o.min != null ? o.min : null, l = o.max !== "" && o.max != null ? o.max : null;
169
+ return a != null && l != null ? `${a} – ${l}` : a != null ? `≥ ${a}` : l != null ? `≤ ${l}` : "";
170
+ }
171
+ if (o.type === "durationRange") {
172
+ const a = o.minSec !== "" && o.minSec != null ? xt(o.minSec) : null, l = o.maxSec !== "" && o.maxSec != null ? xt(o.maxSec) : null;
173
+ return a && l ? `${a} – ${l}` : a ? `≥ ${a}` : l ? `≤ ${l}` : "";
174
+ }
175
+ return o.type === "dateRange" ? o.from && o.to ? `${o.from} – ${o.to}` : o.from ? `from ${o.from}` : o.to ? `to ${o.to}` : "" : "";
176
+ }
177
+ function Dn(o) {
178
+ return Array.isArray(o) ? Math.max(0, o.length - 1) : 0;
179
+ }
180
+ function Cn(o) {
181
+ return Array.isArray(o) ? o.slice(1).map(String).join(", ") : "";
182
+ }
183
+ function Rn({ count: o, values: a }) {
184
+ const [l, c] = h(!1);
185
+ return /* @__PURE__ */ p(
186
+ "span",
187
+ {
188
+ onMouseEnter: () => c(!0),
189
+ onMouseLeave: () => c(!1),
190
+ style: {
191
+ position: "relative",
192
+ display: "inline-flex",
193
+ alignItems: "center",
194
+ justifyContent: "center",
195
+ height: 22,
196
+ minWidth: 22,
197
+ padding: "0 6px",
198
+ background: "#D8D8D8",
199
+ color: "#0B0B0B",
200
+ borderRadius: 14,
201
+ fontSize: 12,
202
+ fontWeight: 500,
203
+ lineHeight: 1,
204
+ cursor: "pointer"
205
+ },
206
+ children: [
207
+ "+",
208
+ o,
209
+ l && /* @__PURE__ */ i(
210
+ "span",
211
+ {
212
+ role: "tooltip",
213
+ style: {
214
+ position: "absolute",
215
+ bottom: "calc(100% + 6px)",
216
+ left: "50%",
217
+ transform: "translateX(-50%)",
218
+ background: "#1E2125",
219
+ color: "#FFFFFF",
220
+ fontFamily: "var(--font-sans)",
221
+ fontSize: 12,
222
+ fontWeight: 400,
223
+ lineHeight: "20px",
224
+ padding: "6px 10px",
225
+ borderRadius: 8,
226
+ whiteSpace: "nowrap",
227
+ pointerEvents: "none",
228
+ zIndex: 100,
229
+ boxShadow: "0 6px 16px rgba(11, 11, 11, 0.18)"
230
+ },
231
+ children: a
232
+ }
233
+ )
234
+ ]
235
+ }
236
+ );
237
+ }
238
+ function Je({ leftLabel: o, rightLabel: a, leftValue: l, rightValue: c, onLeftChange: x, onRightChange: v, type: f = "number", placeholderLeft: m = "Min", placeholderRight: $ = "Max" }) {
239
+ const y = {
240
+ width: "100%",
241
+ height: 32,
242
+ borderRadius: 8,
243
+ border: "1px solid #D9D9D9",
244
+ background: "#FFFFFF",
245
+ padding: "0 10px",
246
+ fontFamily: "var(--font-sans)",
247
+ fontSize: 14,
248
+ color: "#0B0B0B",
249
+ outline: "none",
250
+ boxSizing: "border-box"
251
+ }, C = { fontSize: 12, color: "#676767", marginBottom: 4, fontFamily: "var(--font-sans)" };
252
+ return /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
253
+ /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "column" }, children: [
254
+ /* @__PURE__ */ i("span", { style: C, children: o }),
255
+ /* @__PURE__ */ i(
256
+ "input",
257
+ {
258
+ type: f,
259
+ value: l,
260
+ onChange: (z) => x(z.target.value),
261
+ placeholder: m,
262
+ style: y
263
+ }
264
+ )
265
+ ] }),
266
+ /* @__PURE__ */ p("div", { style: { display: "flex", flexDirection: "column" }, children: [
267
+ /* @__PURE__ */ i("span", { style: C, children: a }),
268
+ /* @__PURE__ */ i(
269
+ "input",
270
+ {
271
+ type: f,
272
+ value: c,
273
+ onChange: (z) => v(z.target.value),
274
+ placeholder: $,
275
+ style: y
276
+ }
277
+ )
278
+ ] })
279
+ ] });
280
+ }
281
+ function zn({ column: o, columnId: a, filterType: l = "text", position: c, popoverRef: x, distinctValues: v, initialValue: f, onApply: m, onCancel: $ }) {
282
+ const y = l === "text", C = l === "number", z = l === "date", M = l === "duration", [S, b] = h(
283
+ () => y ? new Set(Array.isArray(f) ? f : []) : /* @__PURE__ */ new Set()
284
+ ), [P, T] = h(""), [k, N] = h(() => C && (f == null ? void 0 : f.type) === "range" && f.min != null ? f.min : ""), [V, W] = h(() => C && (f == null ? void 0 : f.type) === "range" && f.max != null ? f.max : ""), [_, U] = h(() => M && (f == null ? void 0 : f.type) === "durationRange" && f.minSec != null ? f.minSec : ""), [E, O] = h(() => M && (f == null ? void 0 : f.type) === "durationRange" && f.maxSec != null ? f.maxSec : ""), [ne, G] = h(() => z && (f == null ? void 0 : f.type) === "dateRange" && f.from || ""), [re, ee] = h(() => z && (f == null ? void 0 : f.type) === "dateRange" && f.to || "");
285
+ X(() => {
286
+ y && b(new Set(Array.isArray(f) ? f : []));
287
+ }, [a, y]);
288
+ const H = ae(() => {
289
+ const w = P.trim().toLowerCase();
290
+ return w ? v.filter((D) => String(D).toLowerCase().includes(w)) : v;
291
+ }, [v, P]), Q = (w) => {
292
+ b((D) => {
293
+ const A = new Set(D);
294
+ return A.has(w) ? A.delete(w) : A.add(w), A;
295
+ });
296
+ }, Y = () => {
297
+ y && b(/* @__PURE__ */ new Set()), C && (N(""), W("")), M && (U(""), O("")), z && (G(""), ee("")), T("");
298
+ }, pe = () => {
299
+ if (y)
300
+ return m(Array.from(S));
301
+ if (C)
302
+ return m({ type: "range", min: k === "" ? "" : Number(k), max: V === "" ? "" : Number(V) });
303
+ if (M)
304
+ return m({ type: "durationRange", minSec: _ === "" ? "" : Number(_), maxSec: E === "" ? "" : Number(E) });
305
+ if (z)
306
+ return m({ type: "dateRange", from: ne, to: re });
307
+ };
308
+ return /* @__PURE__ */ p(
309
+ "div",
310
+ {
311
+ ref: x,
312
+ role: "dialog",
313
+ "aria-label": `Filter ${o.label || a}`,
314
+ style: {
315
+ position: "fixed",
316
+ top: c.top,
317
+ left: c.left,
318
+ zIndex: 50,
319
+ width: y ? 240 : 280,
320
+ background: "#FFFFFF",
321
+ border: "1px solid #E6E6E6",
322
+ borderRadius: 10,
323
+ padding: 12,
324
+ display: "flex",
325
+ flexDirection: "column",
326
+ gap: 10,
327
+ boxShadow: "0 8px 24px rgba(11, 11, 11, 0.10)",
328
+ fontFamily: "var(--font-sans)"
329
+ },
330
+ children: [
331
+ y && /* @__PURE__ */ p(Qe, { children: [
332
+ /* @__PURE__ */ i(
333
+ "div",
334
+ {
335
+ style: {
336
+ background: "#D8D8D8",
337
+ height: 32,
338
+ borderRadius: 10,
339
+ padding: 1,
340
+ display: "flex",
341
+ alignItems: "center"
342
+ },
343
+ children: /* @__PURE__ */ p(
344
+ "div",
345
+ {
346
+ style: {
347
+ background: "#FFFFFF",
348
+ flex: 1,
349
+ height: 30,
350
+ borderRadius: 10,
351
+ display: "flex",
352
+ alignItems: "center",
353
+ gap: 8,
354
+ padding: "0 8px"
355
+ },
356
+ children: [
357
+ /* @__PURE__ */ i(vt, { size: 16, color: "#989898", strokeWidth: 2 }),
358
+ /* @__PURE__ */ i(
359
+ "input",
360
+ {
361
+ autoFocus: !0,
362
+ type: "text",
363
+ value: P,
364
+ onChange: (w) => T(w.target.value),
365
+ placeholder: "Search",
366
+ style: {
367
+ flex: 1,
368
+ border: "none",
369
+ outline: "none",
370
+ background: "transparent",
371
+ fontSize: 14,
372
+ color: "#0B0B0B",
373
+ minWidth: 0,
374
+ fontFamily: "var(--font-sans)"
375
+ }
376
+ }
377
+ )
378
+ ]
379
+ }
380
+ )
381
+ }
382
+ ),
383
+ /* @__PURE__ */ i("div", { style: { maxHeight: 220, overflowY: "auto", display: "flex", flexDirection: "column", gap: 4 }, children: H.length === 0 ? /* @__PURE__ */ i("div", { style: { fontSize: 13, color: "#676767", padding: "8px 4px", textAlign: "center" }, children: "No values" }) : H.map((w) => {
384
+ const D = S.has(w);
385
+ return /* @__PURE__ */ p(
386
+ "label",
387
+ {
388
+ style: {
389
+ display: "flex",
390
+ alignItems: "center",
391
+ gap: 12,
392
+ padding: "6px 4px",
393
+ cursor: "pointer",
394
+ borderRadius: 6
395
+ },
396
+ children: [
397
+ /* @__PURE__ */ i(
398
+ "span",
399
+ {
400
+ style: {
401
+ width: 20,
402
+ height: 20,
403
+ borderRadius: 4,
404
+ display: "inline-flex",
405
+ alignItems: "center",
406
+ justifyContent: "center",
407
+ background: D ? "#0B0B0B" : "#FFFFFF",
408
+ border: `1px solid ${D ? "#0B0B0B" : "#676767"}`,
409
+ flexShrink: 0
410
+ },
411
+ children: D && /* @__PURE__ */ i(wt, { size: 14, color: "#FFFFFF", strokeWidth: 3 })
412
+ }
413
+ ),
414
+ /* @__PURE__ */ i(
415
+ "input",
416
+ {
417
+ type: "checkbox",
418
+ checked: D,
419
+ onChange: () => Q(w),
420
+ style: { position: "absolute", opacity: 0, pointerEvents: "none" },
421
+ tabIndex: -1
422
+ }
423
+ ),
424
+ /* @__PURE__ */ i(
425
+ "span",
426
+ {
427
+ onClick: (A) => {
428
+ A.preventDefault(), Q(w);
429
+ },
430
+ style: {
431
+ fontSize: 14,
432
+ lineHeight: "20px",
433
+ color: "#0B0B0B",
434
+ flex: 1,
435
+ overflow: "hidden",
436
+ textOverflow: "ellipsis",
437
+ whiteSpace: "nowrap"
438
+ },
439
+ children: w
440
+ }
441
+ )
442
+ ]
443
+ },
444
+ w
445
+ );
446
+ }) })
447
+ ] }),
448
+ C && /* @__PURE__ */ i(
449
+ Je,
450
+ {
451
+ leftLabel: "Min",
452
+ rightLabel: "Max",
453
+ leftValue: k,
454
+ rightValue: V,
455
+ onLeftChange: N,
456
+ onRightChange: W,
457
+ type: "number"
458
+ }
459
+ ),
460
+ M && /* @__PURE__ */ p(Qe, { children: [
461
+ /* @__PURE__ */ i("div", { style: { fontSize: 12, color: "#676767" }, children: "Duration in seconds" }),
462
+ /* @__PURE__ */ i(
463
+ Je,
464
+ {
465
+ leftLabel: "Min (sec)",
466
+ rightLabel: "Max (sec)",
467
+ leftValue: _,
468
+ rightValue: E,
469
+ onLeftChange: U,
470
+ onRightChange: O,
471
+ type: "number",
472
+ placeholderLeft: "0",
473
+ placeholderRight: "3600"
474
+ }
475
+ )
476
+ ] }),
477
+ z && /* @__PURE__ */ i(
478
+ Je,
479
+ {
480
+ leftLabel: "From",
481
+ rightLabel: "To",
482
+ leftValue: ne,
483
+ rightValue: re,
484
+ onLeftChange: G,
485
+ onRightChange: ee,
486
+ type: "date",
487
+ placeholderLeft: "",
488
+ placeholderRight: ""
489
+ }
490
+ ),
491
+ /* @__PURE__ */ i("div", { style: { height: 1, background: "#D9D9D9", margin: "0 -12px" } }),
492
+ /* @__PURE__ */ p("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
493
+ /* @__PURE__ */ i(
494
+ "button",
495
+ {
496
+ type: "button",
497
+ onClick: Y,
498
+ style: {
499
+ background: "transparent",
500
+ border: "none",
501
+ padding: 0,
502
+ cursor: "pointer",
503
+ fontSize: 14,
504
+ fontWeight: 500,
505
+ color: "#323232",
506
+ fontFamily: "var(--font-sans)"
507
+ },
508
+ children: "Reset"
509
+ }
510
+ ),
511
+ /* @__PURE__ */ i(
512
+ "button",
513
+ {
514
+ type: "button",
515
+ onClick: pe,
516
+ style: {
517
+ background: "#0B0B0B",
518
+ color: "#FFFFFF",
519
+ border: "none",
520
+ borderRadius: 10,
521
+ height: 28,
522
+ padding: "0 14px",
523
+ fontSize: 14,
524
+ fontWeight: 600,
525
+ cursor: "pointer",
526
+ fontFamily: "var(--font-sans)"
527
+ },
528
+ children: "Apply"
529
+ }
530
+ )
531
+ ] })
532
+ ]
533
+ }
534
+ );
535
+ }
536
+ const Mn = () => ({ userData: { email: "anonymous" } }), Nn = (o) => /* @__PURE__ */ i("img", { ...o });
537
+ function En({
538
+ children: o,
539
+ content: a,
540
+ direction: l = "top",
541
+ align: c = "center",
542
+ styling: x,
543
+ indicatorColor: v
544
+ }) {
545
+ const f = typeof a == "string" ? a : a != null ? String(a) : "", m = typeof v == "string" && (v.startsWith("#") || v.startsWith("rgb") || v.startsWith("hsl") || v.startsWith("var(")) ? v : "var(--Grey-Strong, #2E3236)", [$, y] = h(!1), [C, z] = h(!1), [M, S] = h({ top: 0, left: 0, arrowLeft: 0, placement: "top" }), b = j(null), P = j(null);
546
+ if (!f)
547
+ return o;
548
+ X(() => {
549
+ z(!0);
550
+ }, []);
551
+ const T = L(() => {
552
+ if (!b.current || !P.current || typeof window > "u")
553
+ return;
554
+ const k = b.current.getBoundingClientRect(), N = P.current.getBoundingClientRect(), V = window.innerWidth, W = window.innerHeight, _ = 8, U = 10, E = N.width, O = N.height, ne = k.top, G = W - k.bottom, re = l === "bottom" ? "bottom" : "top";
555
+ let ee = re;
556
+ re === "top" && ne < O + U + _ && G > ne ? ee = "bottom" : re === "bottom" && G < O + U + _ && ne > G && (ee = "top");
557
+ let H = k.left + k.width / 2;
558
+ c === "start" && (H = k.left), c === "end" && (H = k.right);
559
+ let Q = ee === "top" ? k.top - O - U : k.bottom + U, Y = c === "start" ? H : c === "end" ? H - E : H - E / 2;
560
+ Q = Math.max(_, Math.min(Q, W - O - _)), Y = Math.max(_, Math.min(Y, V - E - _));
561
+ const pe = Math.max(10, Math.min(H - Y, E - 10));
562
+ S({ top: Q, left: Y, arrowLeft: pe, placement: ee });
563
+ }, [c, l]);
564
+ return X(() => {
565
+ if (!$ || !C)
566
+ return;
567
+ T();
568
+ const k = () => T();
569
+ return window.addEventListener("resize", k), window.addEventListener("scroll", k, !0), () => {
570
+ window.removeEventListener("resize", k), window.removeEventListener("scroll", k, !0);
571
+ };
572
+ }, [$, C, T]), /* @__PURE__ */ p(
573
+ "span",
574
+ {
575
+ ref: b,
576
+ style: { display: "block", width: "100%" },
577
+ onMouseEnter: () => y(!0),
578
+ onMouseLeave: () => y(!1),
579
+ children: [
580
+ o,
581
+ $ && C && Ye(
582
+ /* @__PURE__ */ p(
583
+ "span",
584
+ {
585
+ ref: P,
586
+ style: {
587
+ position: "fixed",
588
+ top: `${M.top}px`,
589
+ left: `${M.left}px`,
590
+ background: "var(--Grey-Strong, #2E3236)",
591
+ color: "var(--Grey-White, #FFF)",
592
+ fontSize: "12px",
593
+ lineHeight: 1.3,
594
+ fontWeight: 500,
595
+ padding: "8px 10px",
596
+ borderRadius: "6px",
597
+ whiteSpace: "normal",
598
+ maxWidth: "320px",
599
+ width: "max-content",
600
+ boxShadow: "0 6px 18px rgba(0, 0, 0, 0.2)",
601
+ zIndex: 99999,
602
+ pointerEvents: "none",
603
+ ...typeof x == "object" ? x : {}
604
+ },
605
+ children: [
606
+ f,
607
+ /* @__PURE__ */ i(
608
+ "span",
609
+ {
610
+ style: {
611
+ position: "absolute",
612
+ left: `${M.arrowLeft}px`,
613
+ transform: "translateX(-50%)",
614
+ width: 0,
615
+ height: 0,
616
+ borderLeft: "6px solid transparent",
617
+ borderRight: "6px solid transparent",
618
+ ...M.placement === "top" ? {
619
+ top: "100%",
620
+ borderTop: `7px solid ${m}`
621
+ } : {
622
+ bottom: "100%",
623
+ borderBottom: `7px solid ${m}`
624
+ }
625
+ }
626
+ }
627
+ )
628
+ ]
629
+ }
630
+ ),
631
+ document.body
632
+ )
633
+ ]
634
+ }
635
+ );
636
+ }
637
+ function _n({
638
+ data: o = [],
639
+ columns: a = [],
640
+ initialPageSize: l = 10,
641
+ onRowClick: c,
642
+ // Server-side pagination props (optional)
643
+ totalCount: x = null,
644
+ // Total count from server (null = use client-side pagination)
645
+ page: v = null,
646
+ // Controlled page (null = use internal state)
647
+ pageSize: f = null,
648
+ // Controlled pageSize (null = use internal state)
649
+ onPageChange: m = null,
650
+ // Callback for page changes (null = use internal state)
651
+ onPageSizeChange: $ = null,
652
+ // Callback for pageSize changes (null = use internal state)
653
+ onFilterChange: y = null,
654
+ // Callback for filter changes (null = use client-side filtering)
655
+ columnFilters: C = null,
656
+ // Controlled inline header filters (columnId -> value). Used to rehydrate inputs in server-side filtering mode.
657
+ // Optional callback to surface column limit errors to host app
658
+ onMaxColumnsError: z = null,
659
+ // Server-side sorting props (optional)
660
+ onSort: M = null,
661
+ // Callback for sort changes (null = use client-side sorting)
662
+ sortFields: S = [],
663
+ // Array of [field, direction] tuples from parent (null = use internal state)
664
+ tableId: b = null,
665
+ // Optional unique identifier for localStorage persistence (e.g., "history", "agents")
666
+ isLoading: P = !1,
667
+ // Loading state to show overlay inside table
668
+ // Filter props (optional)
669
+ filtersConfig: T = null,
670
+ // Top toolbar filter config (chips/date/export). Note: this is different from `columnFilters` for inline header inputs.
671
+ // Column resize (optional) — min/max in px; columns may override with column.minWidth / column.maxWidth
672
+ columnResizeMinWidth: k = 100,
673
+ columnResizeMaxWidth: N = 280
674
+ }) {
675
+ var gt;
676
+ const { userData: V } = Mn(), W = (V == null ? void 0 : V.email) || "anonymous", _ = Xe.memo(({ children: e, content: t, className: n = "" }) => {
677
+ const s = j(null), [r, d] = h(!1);
678
+ X(() => {
679
+ const g = () => {
680
+ if (s.current) {
681
+ const B = s.current.scrollWidth > s.current.clientWidth;
682
+ d(B);
683
+ }
684
+ };
685
+ g();
686
+ const K = setTimeout(g, 0);
687
+ return window.addEventListener("resize", g), () => {
688
+ clearTimeout(K), window.removeEventListener("resize", g);
689
+ };
690
+ }, [e, t]);
691
+ const u = /* @__PURE__ */ i("span", { className: `truncate block ${n}`, ref: s, children: e });
692
+ return r && t ? /* @__PURE__ */ i(
693
+ En,
694
+ {
695
+ content: t,
696
+ styling: "bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal",
697
+ indicatorColor: "bg-green-2",
698
+ direction: "top",
699
+ children: u
700
+ }
701
+ ) : u;
702
+ });
703
+ _.displayName = "TruncatedCell";
704
+ const U = x !== null && m !== null, E = y !== null, O = M !== null, [ne, G] = h(1), [re, ee] = h(l), H = v !== null ? v : ne, Q = f !== null ? f : re, Y = (e) => {
705
+ m ? m(e) : G(e);
706
+ }, pe = (e) => {
707
+ $ ? $(e) : ee(e);
708
+ }, w = 50, D = "action", A = j(!1), oe = ae(() => b ? `dataTable_columns_${b}:${W}` : `dataTable_columns_${a.map((t) => t.id || t.key).sort().join("_")}:${W}`, [b, a, W]), le = ae(() => b ? `dataTable_manual_change_${b}:${W}` : null, [b, W]);
709
+ L((e, t) => {
710
+ if (typeof window > "u" || !e || !t || t.length === 0)
711
+ return null;
712
+ try {
713
+ const n = localStorage.getItem(e);
714
+ if (n) {
715
+ const r = JSON.parse(n).filter(
716
+ (d) => t.some((u) => (u.id || u.key) === d)
717
+ );
718
+ if (r.length > 0)
719
+ return r;
720
+ }
721
+ } catch (n) {
722
+ console.warn("Failed to load saved columns from localStorage:", n);
723
+ }
724
+ return null;
725
+ }, []);
726
+ const [q, Ee] = h({}), [Be, qe] = h(""), [J, he] = h(null), [St, Ft] = h({ top: 0, left: 0 }), Le = j(null), Ze = j({}), [Ve, kt] = h(null), [et, tt] = h("asc"), $e = L((e, t) => {
727
+ const n = Ne(t);
728
+ Ee((s) => {
729
+ const r = { ...s };
730
+ return n ? r[e] = t : delete r[e], r;
731
+ }), m ? m(1) : G(1), E && y && y(
732
+ n ? { ...q, [e]: t } : Object.fromEntries(Object.entries(q).filter(([s]) => s !== e))
733
+ );
734
+ }, [q, y, E, m]), Dt = L(() => {
735
+ Ee({}), qe(""), m ? m(1) : G(1), E && y && y({});
736
+ }, [y, E, m]), We = L((e) => {
737
+ if (!o || o.length === 0)
738
+ return [];
739
+ const t = /* @__PURE__ */ new Set(), n = [];
740
+ for (const s of o) {
741
+ const r = s[e];
742
+ if (r == null)
743
+ continue;
744
+ const d = typeof r == "object" ? JSON.stringify(r) : String(r);
745
+ t.has(d) || (t.add(d), n.push(d));
746
+ }
747
+ return n.sort((s, r) => s.localeCompare(r));
748
+ }, [o]), Ct = L((e) => {
749
+ const t = a.find((n) => I(n) === e);
750
+ return t && t.filterType ? t.filterType : Fn(We(e));
751
+ }, [a, We]), Rt = L((e, t) => {
752
+ if (!t) {
753
+ he(e);
754
+ return;
755
+ }
756
+ const n = t.getBoundingClientRect();
757
+ Ft({ top: n.bottom + 6, left: n.left }), he((s) => s === e ? null : e);
758
+ }, []);
759
+ X(() => {
760
+ if (!J)
761
+ return;
762
+ const e = (t) => {
763
+ if (Le.current && Le.current.contains(t.target))
764
+ return;
765
+ const n = Ze.current[J];
766
+ n && n.contains(t.target) || he(null);
767
+ };
768
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
769
+ }, [J]);
770
+ const nt = L((e) => !e || typeof e != "object" ? {} : Object.fromEntries(
771
+ Object.entries(e).filter(([, t]) => t == null ? !1 : typeof t == "string" ? t.trim() !== "" : !0)
772
+ ), []), rt = L((e, t) => {
773
+ const n = Object.keys(e || {}), s = Object.keys(t || {});
774
+ return n.length !== s.length ? !1 : n.every((r) => e[r] === t[r]);
775
+ }, []);
776
+ X(() => {
777
+ if (!E || C === null)
778
+ return;
779
+ const e = nt(C);
780
+ Ee((t) => rt(t, e) ? t : e);
781
+ }, [E, C, nt, rt]), L((e, t) => e === "csat_score" && t === "evaluation.csat_score" ? t : e, []);
782
+ const me = O && S.length > 0 ? S[0][0] : Ve, be = O && S.length > 0 ? S[0][1] : et, [Bn, ot] = h(
783
+ () => a.map((e) => e.id || e.key)
784
+ ), Z = L((e) => {
785
+ if (!e || e.length === 0)
786
+ return e;
787
+ let t = Array.from(new Set(e));
788
+ t.length > w && (t = t.slice(0, w));
789
+ const s = a.map((u) => u.id || u.key).includes(D);
790
+ return !t.includes(D) && s && (t.length >= w ? t = [...t.slice(0, w - 1), D] : t = [...t, D]), [...t.filter((u) => u !== D), D];
791
+ }, [a]), [R, se] = h(() => {
792
+ if (typeof window < "u" && b)
793
+ try {
794
+ if (localStorage.getItem(`dataTable_manual_change_${b}:${W}`) === "true") {
795
+ const s = localStorage.getItem(`dataTable_columns_${b}:${W}`);
796
+ if (s) {
797
+ const r = JSON.parse(s);
798
+ if (Array.isArray(r) && r.length > 0) {
799
+ A.current = !0;
800
+ const d = r.filter(
801
+ (u) => a.some((g) => (g.id || g.key) === u)
802
+ );
803
+ if (d.length > 0)
804
+ return d.slice(0, w);
805
+ }
806
+ }
807
+ }
808
+ } catch (n) {
809
+ console.warn("Failed to load saved columns from localStorage:", n);
810
+ }
811
+ const t = a.map((n) => n.id || n.key).slice(0, w);
812
+ return Z(t);
813
+ }), [ie, Te] = h(!1), [st, zt] = h({ top: 0, left: 0, width: 0 }), [it, Ae] = h(/* @__PURE__ */ new Set()), [at, Oe] = h(/* @__PURE__ */ new Set()), xe = j(null);
814
+ xe.current === null && (xe.current = [...R]);
815
+ const [te, Ie] = h(null), [Mt, ve] = h(null), ce = j(null), je = j(null), de = j(null), [lt, Pe] = h(null), [_e, Nt] = h({}), Et = j(null), we = j(null), I = (e) => e.id || e.key, Se = L((e) => {
816
+ if (typeof e == "number" && Number.isFinite(e))
817
+ return e;
818
+ if (typeof e == "string") {
819
+ const t = e.trim();
820
+ if (t.endsWith("px")) {
821
+ const s = parseFloat(t);
822
+ return Number.isFinite(s) ? s : null;
823
+ }
824
+ const n = parseFloat(t);
825
+ return Number.isFinite(n) && `${n}` === t ? n : null;
826
+ }
827
+ return null;
828
+ }, []), ct = L((e, t) => _e[e] != null ? `${_e[e]}px` : typeof t == "number" ? `${t}px` : t || "auto", [_e]), Fe = L((e) => {
829
+ if (!we.current)
830
+ return;
831
+ const { columnId: t, startX: n, startWidth: s, minWidth: r, maxWidth: d } = we.current, u = e.clientX - n, g = Math.round(s + u), K = Math.min(d, Math.max(r, g));
832
+ Nt((B) => ({ ...B, [t]: K }));
833
+ }, []), ge = L(() => {
834
+ we.current = null, document.body.style.cursor = "", document.body.style.userSelect = "", document.removeEventListener("mousemove", Fe), document.removeEventListener("mouseup", ge);
835
+ }, [Fe]), Bt = L((e, t, n) => {
836
+ var ze;
837
+ e.preventDefault(), e.stopPropagation();
838
+ const s = t.id || t.key, r = Se(t.minWidth) ?? k, d = Se(t.maxWidth) ?? N, u = Math.min(r, d), g = Math.max(r, d), K = ((ze = e.currentTarget.closest("th")) == null ? void 0 : ze.getBoundingClientRect().width) || 0, B = Se(n), ye = B ?? Math.max(u, Math.round(K) || u), He = Math.min(g, Math.max(u, ye));
839
+ we.current = { columnId: s, startX: e.clientX, startWidth: He, minWidth: u, maxWidth: g }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", Fe), document.addEventListener("mouseup", ge);
840
+ }, [N, k, Fe, ge, Se]);
841
+ X(() => () => ge(), [ge]);
842
+ const Lt = qt(
843
+ yt(sn),
844
+ yt(on, {
845
+ coordinateGetter: rn
846
+ })
847
+ ), $t = (e) => {
848
+ const { active: t, over: n } = e;
849
+ if (n && t.id !== n.id) {
850
+ if (t.id === D || n.id === D) {
851
+ ut("Cannot drop columns on the Action column"), Pe(null);
852
+ return;
853
+ }
854
+ A.current = !0, se((s) => {
855
+ const r = s.indexOf(t.id), d = s.indexOf(n.id);
856
+ if (r !== -1 && d !== -1) {
857
+ const u = Ue(s, r, d), g = Z(u);
858
+ return Re(g), g;
859
+ }
860
+ return s;
861
+ }), ot((s) => {
862
+ const r = s.indexOf(t.id), d = s.indexOf(n.id);
863
+ return Ue(s, r, d);
864
+ });
865
+ }
866
+ Pe(null);
867
+ }, Wt = (e) => {
868
+ Pe(e.active.id);
869
+ }, ke = ae(() => {
870
+ if (E)
871
+ return o || [];
872
+ if (!o || o.length === 0)
873
+ return [];
874
+ const e = Be.trim().toLowerCase(), t = Object.entries(q).filter(([, n]) => Ne(n));
875
+ return o.filter((n) => {
876
+ for (const [s, r] of t) {
877
+ const d = n[s];
878
+ if (d == null)
879
+ return !1;
880
+ if (Array.isArray(r)) {
881
+ const u = String(d);
882
+ if (!r.some((g) => String(g) === u))
883
+ return !1;
884
+ continue;
885
+ }
886
+ if (r.type === "range") {
887
+ const u = vn(d);
888
+ if (isNaN(u) || r.min !== "" && r.min != null && u < Number(r.min) || r.max !== "" && r.max != null && u > Number(r.max))
889
+ return !1;
890
+ continue;
891
+ }
892
+ if (r.type === "durationRange") {
893
+ const u = wn(d);
894
+ if (isNaN(u) || r.minSec !== "" && r.minSec != null && u < Number(r.minSec) || r.maxSec !== "" && r.maxSec != null && u > Number(r.maxSec))
895
+ return !1;
896
+ continue;
897
+ }
898
+ if (r.type === "dateRange") {
899
+ const u = Sn(d);
900
+ if (!u)
901
+ return !1;
902
+ if (r.from) {
903
+ const g = /* @__PURE__ */ new Date(r.from + "T00:00:00");
904
+ if (u < g)
905
+ return !1;
906
+ }
907
+ if (r.to) {
908
+ const g = /* @__PURE__ */ new Date(r.to + "T23:59:59");
909
+ if (u > g)
910
+ return !1;
911
+ }
912
+ continue;
913
+ }
914
+ }
915
+ return !(e && !Object.values(n).some((r) => r == null ? !1 : String(r).toLowerCase().includes(e)));
916
+ });
917
+ }, [o, q, Be, E]), De = ae(() => O || !me ? ke : [...ke].sort((e, t) => {
918
+ const n = e[me], s = t[me];
919
+ if (n == null)
920
+ return 1;
921
+ if (s == null)
922
+ return -1;
923
+ if (typeof n == "number" && typeof s == "number")
924
+ return be === "asc" ? n - s : s - n;
925
+ const r = String(n).toLowerCase(), d = String(s).toLowerCase();
926
+ return be === "asc" ? r.localeCompare(d) : d.localeCompare(r);
927
+ }), [ke, me, be, O]), Ce = ae(() => {
928
+ if (U)
929
+ return o || [];
930
+ {
931
+ const e = (H - 1) * Q, t = e + Q;
932
+ return De.slice(e, t);
933
+ }
934
+ }, [o, De, H, Q, U]), dt = (e) => {
935
+ O && M ? (M(e), m ? m(1) : G(1)) : (Ve === e ? tt(et === "asc" ? "desc" : "asc") : (kt(e), tt("asc")), Y(1));
936
+ }, Tt = (e, t) => {
937
+ const n = (t || "").split(/\s+/).map((s) => s.trim()).filter(Boolean);
938
+ $e(e, n);
939
+ }, ut = (e) => {
940
+ de.current || (typeof z == "function" && z(e), de.current = setTimeout(() => {
941
+ de.current = null;
942
+ }, 3e3));
943
+ }, Re = L((e) => {
944
+ if (typeof window < "u" && oe && e.length > 0 && A.current)
945
+ try {
946
+ localStorage.setItem(oe, JSON.stringify(e)), le && localStorage.setItem(le, "true");
947
+ } catch (t) {
948
+ console.warn("Failed to save columns to localStorage:", t);
949
+ }
950
+ }, [oe, le]), At = (e) => {
951
+ e !== D && (A.current = !0, se((t) => t.includes(e) ? (de.current && (clearTimeout(de.current), de.current = null), t.length === 1 || (Oe((n) => new Set(n).add(e)), setTimeout(() => {
952
+ se((n) => {
953
+ const s = n.filter((d) => d !== e), r = Z(s);
954
+ return Re(r), r;
955
+ }), Oe((n) => {
956
+ const s = new Set(n);
957
+ return s.delete(e), s;
958
+ });
959
+ }, 200)), t) : t.length >= w ? (ut("Maximum 9 column selection allowed"), t) : (Ae((n) => new Set(n).add(e)), setTimeout(() => {
960
+ se((n) => {
961
+ const s = n.includes(e) ? n : [...n, e], r = Z(s);
962
+ return Re(r), r;
963
+ }), Ae((n) => {
964
+ const s = new Set(n);
965
+ return s.delete(e), s;
966
+ });
967
+ }, 200), t)));
968
+ }, Ot = (e, t) => {
969
+ R[t] !== D && Ie(t);
970
+ }, It = () => {
971
+ Ie(null), ve(null);
972
+ }, jt = (e, t) => {
973
+ e.preventDefault(), te !== null && te !== t && ve(t);
974
+ }, Pt = () => {
975
+ ve(null);
976
+ }, _t = (e, t) => {
977
+ e.preventDefault(), te !== null && te !== t && R[t] !== D && R[te] !== D && (A.current = !0, se((n) => {
978
+ const s = Ue(n, te, t), r = Z(s);
979
+ return Re(r), r;
980
+ })), Ie(null), ve(null);
981
+ };
982
+ X(() => {
983
+ ot((e) => {
984
+ const t = R.filter((r) => e.includes(r)), n = R.filter((r) => !e.includes(r)), s = e.filter((r) => !R.includes(r));
985
+ return [...t, ...n, ...s];
986
+ });
987
+ }, [R]), X(() => {
988
+ if (typeof window < "u" && oe && R.length > 0 && A.current)
989
+ try {
990
+ const e = Z(R);
991
+ localStorage.setItem(oe, JSON.stringify(e)), le && localStorage.setItem(le, "true");
992
+ } catch (e) {
993
+ console.warn("Failed to save columns to localStorage:", e);
994
+ }
995
+ }, [R, oe, le]), X(() => {
996
+ if (a.length > 0 && R.length === 0) {
997
+ if (typeof window < "u" && b)
998
+ try {
999
+ if (localStorage.getItem(`dataTable_manual_change_${b}:${W}`) === "true") {
1000
+ const n = localStorage.getItem(`dataTable_columns_${b}:${W}`);
1001
+ if (n) {
1002
+ const s = JSON.parse(n);
1003
+ if (Array.isArray(s) && s.length > 0) {
1004
+ const r = s.filter(
1005
+ (d) => a.some((u) => (u.id || u.key) === d)
1006
+ );
1007
+ if (r.length > 0) {
1008
+ A.current = !0, se(r.slice(0, w));
1009
+ return;
1010
+ }
1011
+ }
1012
+ }
1013
+ }
1014
+ } catch (t) {
1015
+ console.warn("Failed to load saved columns from localStorage:", t);
1016
+ }
1017
+ const e = a.map((t) => t.id || t.key);
1018
+ se(Z(e.slice(0, w)));
1019
+ }
1020
+ }, [a, b, W, Z]);
1021
+ const ue = ae(() => {
1022
+ const e = R.map((t) => a.find((n) => I(n) === t)).filter(Boolean);
1023
+ return Z(e.map(I)).map((t) => a.find((n) => I(n) === t)).filter(Boolean);
1024
+ }, [a, R]);
1025
+ ae(() => ue.some((e) => e.filterable === !0), [ue]), X(() => {
1026
+ if (!ie || !ce.current)
1027
+ return;
1028
+ const e = () => {
1029
+ if (ce.current) {
1030
+ const t = ce.current.getBoundingClientRect();
1031
+ zt({
1032
+ top: t.bottom,
1033
+ // No gap - connect directly
1034
+ left: t.left,
1035
+ width: Math.max(t.width || 220, 220)
1036
+ });
1037
+ }
1038
+ };
1039
+ return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
1040
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
1041
+ };
1042
+ }, [ie]), X(() => {
1043
+ const e = (t) => {
1044
+ ie && ce.current && !ce.current.contains(t.target) && je.current && !je.current.contains(t.target) && Te(!1);
1045
+ };
1046
+ if (ie)
1047
+ return document.addEventListener("mousedown", e), () => {
1048
+ document.removeEventListener("mousedown", e);
1049
+ };
1050
+ }, [ie]), R.length === 1 ? (gt = a.find((e) => (e.id || e.key) === R[0])) != null && gt.label : `${R.length}`;
1051
+ function Ht({ column: e, isHeaderRow: t = !0 }) {
1052
+ const n = I(e), s = n === D, r = ct(n, e.width), [d, u] = h(!1), {
1053
+ attributes: g,
1054
+ listeners: K,
1055
+ setNodeRef: B,
1056
+ transform: ye,
1057
+ transition: He,
1058
+ isDragging: ze
1059
+ } = an({ id: n }), Xt = {
1060
+ transform: ln.Transform.toString(ye),
1061
+ transition: He,
1062
+ opacity: ze ? 0.5 : 1,
1063
+ width: r,
1064
+ minWidth: r
1065
+ };
1066
+ let fe = !1;
1067
+ if (O && S.length > 0) {
1068
+ const F = S[0][0];
1069
+ (F === n || F === "csat_score" && n === "evaluation.csat_score") && (fe = !0);
1070
+ } else
1071
+ fe = me === n;
1072
+ const Ut = be === "asc", Gt = e.filterable === !0;
1073
+ if (!t)
1074
+ return /* @__PURE__ */ i(
1075
+ "th",
1076
+ {
1077
+ style: {
1078
+ width: r,
1079
+ minWidth: r,
1080
+ backgroundColor: "var(--primary-foreground)"
1081
+ },
1082
+ className: "sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",
1083
+ children: Gt ? /* @__PURE__ */ p("div", { className: "relative", children: [
1084
+ /* @__PURE__ */ i(
1085
+ Filter,
1086
+ {
1087
+ size: 12,
1088
+ className: "absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"
1089
+ }
1090
+ ),
1091
+ /* @__PURE__ */ i(
1092
+ "input",
1093
+ {
1094
+ type: "text",
1095
+ placeholder: "Filter...",
1096
+ value: q[n] || "",
1097
+ onChange: (F) => {
1098
+ F.stopPropagation(), Tt(n, F.target.value);
1099
+ },
1100
+ onKeyDown: (F) => F.stopPropagation(),
1101
+ onMouseDown: (F) => F.stopPropagation(),
1102
+ className: "w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors",
1103
+ style: { fontFamily: "var(--font-sans)", backgroundColor: "var(--primary-foreground)" },
1104
+ autoComplete: "off"
1105
+ }
1106
+ )
1107
+ ] }) : /* @__PURE__ */ i("div", { className: "h-[34px]" })
1108
+ }
1109
+ );
1110
+ const Ke = J === n, Me = Ne(q[n]), Jt = e.sortable !== !1 && (d || fe), Qt = e.filterable !== !1 && !s && (d || Ke || Me);
1111
+ return /* @__PURE__ */ p(
1112
+ "th",
1113
+ {
1114
+ ref: B,
1115
+ onMouseEnter: () => u(!0),
1116
+ onMouseLeave: () => u(!1),
1117
+ style: {
1118
+ ...Xt,
1119
+ padding: "0 12px",
1120
+ height: 36,
1121
+ textAlign: s ? "center" : "left",
1122
+ fontWeight: 500,
1123
+ fontSize: "14px",
1124
+ letterSpacing: "normal",
1125
+ textTransform: "none",
1126
+ color: "#0b0b0b",
1127
+ cursor: e.sortable !== !1 ? "pointer" : "default",
1128
+ width: r,
1129
+ borderRight: "none",
1130
+ userSelect: "none",
1131
+ background: d || Ke ? "#e6e6e6" : "#f2f2f0",
1132
+ borderBottom: "1px solid #e6e6e6",
1133
+ position: "sticky",
1134
+ top: 0,
1135
+ zIndex: 10,
1136
+ fontFamily: "var(--font-sans)",
1137
+ transition: "background 100ms ease"
1138
+ },
1139
+ children: [
1140
+ !s && /* @__PURE__ */ i(
1141
+ "span",
1142
+ {
1143
+ "aria-hidden": "true",
1144
+ style: {
1145
+ position: "absolute",
1146
+ left: 0,
1147
+ top: "50%",
1148
+ transform: "translateY(-50%)",
1149
+ width: 1,
1150
+ height: 16,
1151
+ background: "#e6e6e6",
1152
+ pointerEvents: "none"
1153
+ }
1154
+ }
1155
+ ),
1156
+ /* @__PURE__ */ p(
1157
+ "div",
1158
+ {
1159
+ style: {
1160
+ display: "flex",
1161
+ alignItems: "center",
1162
+ gap: "4px",
1163
+ justifyContent: s ? "center" : "flex-start",
1164
+ position: "relative",
1165
+ minHeight: 20
1166
+ },
1167
+ children: [
1168
+ !s && /* @__PURE__ */ i(
1169
+ "div",
1170
+ {
1171
+ ...g,
1172
+ ...K,
1173
+ style: { cursor: "grab", color: "rgba(11, 11, 11, 0.36)", display: "inline-flex", alignItems: "center" },
1174
+ children: /* @__PURE__ */ i(Ge, { size: 14 })
1175
+ }
1176
+ ),
1177
+ /* @__PURE__ */ i(
1178
+ "span",
1179
+ {
1180
+ onClick: () => e.sortable !== !1 && dt(n),
1181
+ style: { cursor: e.sortable !== !1 ? "pointer" : "default", flex: 1, lineHeight: "20px" },
1182
+ children: e.label
1183
+ }
1184
+ ),
1185
+ Jt && /* @__PURE__ */ i(
1186
+ "button",
1187
+ {
1188
+ type: "button",
1189
+ onClick: (F) => {
1190
+ F.stopPropagation(), dt(n);
1191
+ },
1192
+ title: "Sort",
1193
+ style: {
1194
+ background: "transparent",
1195
+ border: "none",
1196
+ padding: 4,
1197
+ borderRadius: 4,
1198
+ cursor: "pointer",
1199
+ display: "inline-flex",
1200
+ alignItems: "center",
1201
+ justifyContent: "center",
1202
+ color: fe ? "#0b0b0b" : "rgba(11, 11, 11, 0.55)"
1203
+ },
1204
+ children: fe ? Ut ? /* @__PURE__ */ i(pn, { size: 14, strokeWidth: 1.75 }) : /* @__PURE__ */ i(hn, { size: 14, strokeWidth: 1.75 }) : /* @__PURE__ */ i(mn, { size: 14, strokeWidth: 1.75 })
1205
+ }
1206
+ ),
1207
+ Qt && /* @__PURE__ */ p(
1208
+ "button",
1209
+ {
1210
+ type: "button",
1211
+ ref: (F) => {
1212
+ Ze.current[n] = F;
1213
+ },
1214
+ onClick: (F) => {
1215
+ F.stopPropagation(), Rt(n, F.currentTarget);
1216
+ },
1217
+ title: "Filter",
1218
+ style: {
1219
+ position: "relative",
1220
+ background: Ke || Me ? "#D8D8D8" : "transparent",
1221
+ border: "none",
1222
+ padding: 4,
1223
+ borderRadius: 4,
1224
+ cursor: "pointer",
1225
+ display: "inline-flex",
1226
+ alignItems: "center",
1227
+ justifyContent: "center",
1228
+ color: Me ? "#0b0b0b" : "rgba(11, 11, 11, 0.7)"
1229
+ },
1230
+ children: [
1231
+ /* @__PURE__ */ i(gn, { size: 14, strokeWidth: 1.75 }),
1232
+ Me && /* @__PURE__ */ i(
1233
+ "span",
1234
+ {
1235
+ "aria-hidden": "true",
1236
+ style: {
1237
+ position: "absolute",
1238
+ top: 0,
1239
+ right: 0,
1240
+ width: 6,
1241
+ height: 6,
1242
+ borderRadius: "50%",
1243
+ background: "#0B0B0B"
1244
+ }
1245
+ }
1246
+ )
1247
+ ]
1248
+ }
1249
+ )
1250
+ ]
1251
+ }
1252
+ ),
1253
+ !s && /* @__PURE__ */ i(
1254
+ "span",
1255
+ {
1256
+ "aria-hidden": "true",
1257
+ style: {
1258
+ position: "absolute",
1259
+ right: 0,
1260
+ top: "50%",
1261
+ transform: "translateY(-50%)",
1262
+ width: 1,
1263
+ height: 16,
1264
+ background: "#e6e6e6",
1265
+ pointerEvents: "none"
1266
+ }
1267
+ }
1268
+ ),
1269
+ !s && /* @__PURE__ */ i(
1270
+ "div",
1271
+ {
1272
+ role: "separator",
1273
+ "aria-orientation": "vertical",
1274
+ "aria-label": `Resize ${e.label || n} column`,
1275
+ title: "Drag to resize column",
1276
+ onMouseDown: (F) => Bt(F, e, r),
1277
+ onClick: (F) => F.stopPropagation(),
1278
+ onMouseEnter: (F) => {
1279
+ F.currentTarget.style.background = "rgba(30, 33, 37, 0.18)";
1280
+ },
1281
+ onMouseLeave: (F) => {
1282
+ F.currentTarget.style.background = "transparent";
1283
+ },
1284
+ style: {
1285
+ position: "absolute",
1286
+ top: 0,
1287
+ right: -2,
1288
+ width: 4,
1289
+ height: "100%",
1290
+ cursor: "col-resize",
1291
+ zIndex: 4,
1292
+ background: "transparent"
1293
+ }
1294
+ }
1295
+ )
1296
+ ]
1297
+ }
1298
+ );
1299
+ }
1300
+ const ft = lt ? a.find((e) => I(e) === lt) : null, pt = ({ col: e, columnId: t, isSelected: n, draggable: s, isAction: r, actualIndex: d }) => {
1301
+ const u = s && te === d, g = s && Mt === d && te !== null && te !== d;
1302
+ n ? at.has(t) : it.has(t);
1303
+ const K = n ? !at.has(t) : it.has(t);
1304
+ return /* @__PURE__ */ p(
1305
+ "div",
1306
+ {
1307
+ draggable: s,
1308
+ onDragStart: s ? (B) => Ot(B, d) : void 0,
1309
+ onDragEnd: s ? It : void 0,
1310
+ onDragOver: s ? (B) => jt(B, d) : void 0,
1311
+ onDragLeave: s ? Pt : void 0,
1312
+ onDrop: s ? (B) => _t(B, d) : void 0,
1313
+ onClick: () => {
1314
+ r || At(t);
1315
+ },
1316
+ style: {
1317
+ display: "flex",
1318
+ alignItems: "center",
1319
+ gap: 4,
1320
+ padding: "2px 0",
1321
+ cursor: r ? "default" : s ? "grab" : "pointer",
1322
+ opacity: u ? 0.5 : 1,
1323
+ background: g ? "#F2F2F0" : "transparent",
1324
+ borderRadius: 6
1325
+ },
1326
+ children: [
1327
+ /* @__PURE__ */ i(
1328
+ "span",
1329
+ {
1330
+ style: {
1331
+ width: 16,
1332
+ height: 16,
1333
+ display: "inline-flex",
1334
+ alignItems: "center",
1335
+ justifyContent: "center",
1336
+ color: "#989898",
1337
+ visibility: s ? "visible" : "hidden",
1338
+ flexShrink: 0
1339
+ },
1340
+ children: /* @__PURE__ */ i(Ge, { size: 14, strokeWidth: 1.75 })
1341
+ }
1342
+ ),
1343
+ /* @__PURE__ */ i(
1344
+ "span",
1345
+ {
1346
+ style: {
1347
+ width: 20,
1348
+ height: 20,
1349
+ borderRadius: 4,
1350
+ display: "inline-flex",
1351
+ alignItems: "center",
1352
+ justifyContent: "center",
1353
+ background: K ? "#0B0B0B" : "#FFFFFF",
1354
+ border: `1px solid ${K ? "#0B0B0B" : "#676767"}`,
1355
+ flexShrink: 0,
1356
+ marginLeft: 8
1357
+ },
1358
+ children: K && /* @__PURE__ */ i(wt, { size: 14, color: "#FFFFFF", strokeWidth: 3 })
1359
+ }
1360
+ ),
1361
+ /* @__PURE__ */ i(
1362
+ "span",
1363
+ {
1364
+ style: {
1365
+ flex: 1,
1366
+ fontFamily: "var(--font-sans)",
1367
+ fontSize: 14,
1368
+ lineHeight: "20px",
1369
+ color: "#0B0B0B",
1370
+ marginLeft: 8
1371
+ },
1372
+ children: e.label
1373
+ }
1374
+ )
1375
+ ]
1376
+ }
1377
+ );
1378
+ }, Kt = ie ? /* @__PURE__ */ p(
1379
+ "div",
1380
+ {
1381
+ ref: je,
1382
+ style: {
1383
+ position: "fixed",
1384
+ top: `${st.top}px`,
1385
+ left: `${st.left}px`,
1386
+ width: 217,
1387
+ maxHeight: 400,
1388
+ overflow: "auto",
1389
+ zIndex: 49,
1390
+ background: "#FFFFFF",
1391
+ border: "1px solid #E6E6E6",
1392
+ borderRadius: 10,
1393
+ padding: 12,
1394
+ display: "flex",
1395
+ flexDirection: "column",
1396
+ gap: 12,
1397
+ fontFamily: "var(--font-sans)",
1398
+ boxShadow: "0 8px 24px rgba(11, 11, 11, 0.08)"
1399
+ },
1400
+ children: [
1401
+ R.map((e, t) => {
1402
+ const n = a.find((r) => I(r) === e);
1403
+ if (!n)
1404
+ return null;
1405
+ const s = e === D;
1406
+ return /* @__PURE__ */ i(Xe.Fragment, { children: pt({
1407
+ col: n,
1408
+ columnId: e,
1409
+ isSelected: !0,
1410
+ draggable: !s,
1411
+ isAction: s,
1412
+ actualIndex: t
1413
+ }) }, `selected-${e}-${t}`);
1414
+ }),
1415
+ a.filter((e) => !R.includes(I(e))).map((e) => {
1416
+ const t = I(e);
1417
+ return /* @__PURE__ */ i(Xe.Fragment, { children: pt({
1418
+ col: e,
1419
+ columnId: t,
1420
+ isSelected: !1,
1421
+ draggable: !1,
1422
+ isAction: !1,
1423
+ actualIndex: -1
1424
+ }) }, `unselected-${t}`);
1425
+ }),
1426
+ /* @__PURE__ */ i("div", { style: { height: 1, background: "#D9D9D9", margin: "0 -12px" } }),
1427
+ /* @__PURE__ */ p(
1428
+ "div",
1429
+ {
1430
+ style: {
1431
+ display: "flex",
1432
+ alignItems: "center",
1433
+ justifyContent: "space-between",
1434
+ height: 30
1435
+ },
1436
+ children: [
1437
+ /* @__PURE__ */ i(
1438
+ "button",
1439
+ {
1440
+ type: "button",
1441
+ onClick: (e) => {
1442
+ e.preventDefault(), e.stopPropagation();
1443
+ const t = xe.current ? [...xe.current] : a.map(I).slice(0, w);
1444
+ if (A.current = !1, se(Z(t)), Ae(/* @__PURE__ */ new Set()), Oe(/* @__PURE__ */ new Set()), typeof window < "u" && oe)
1445
+ try {
1446
+ localStorage.removeItem(oe);
1447
+ } catch {
1448
+ }
1449
+ },
1450
+ style: {
1451
+ background: "transparent",
1452
+ border: "none",
1453
+ padding: 0,
1454
+ cursor: "pointer",
1455
+ fontFamily: "var(--font-sans)",
1456
+ fontSize: 14,
1457
+ fontWeight: 500,
1458
+ color: "#323232"
1459
+ },
1460
+ children: "Reset"
1461
+ }
1462
+ ),
1463
+ /* @__PURE__ */ i(
1464
+ "button",
1465
+ {
1466
+ type: "button",
1467
+ onClick: (e) => {
1468
+ e.preventDefault(), e.stopPropagation(), Te(!1);
1469
+ },
1470
+ style: {
1471
+ background: "#2E3236",
1472
+ color: "#FFFFFF",
1473
+ border: "none",
1474
+ borderRadius: 10,
1475
+ height: 28,
1476
+ padding: "0 14px",
1477
+ fontFamily: "var(--font-sans)",
1478
+ fontSize: 14,
1479
+ fontWeight: 600,
1480
+ cursor: "pointer"
1481
+ },
1482
+ children: "Apply"
1483
+ }
1484
+ )
1485
+ ]
1486
+ }
1487
+ )
1488
+ ]
1489
+ }
1490
+ ) : null, ht = J ? a.find((e) => I(e) === J) : null, mt = ht ? /* @__PURE__ */ i(
1491
+ zn,
1492
+ {
1493
+ column: ht,
1494
+ columnId: J,
1495
+ filterType: Ct(J),
1496
+ position: St,
1497
+ popoverRef: Le,
1498
+ distinctValues: We(J),
1499
+ initialValue: q[J],
1500
+ onApply: (e) => {
1501
+ $e(J, e), he(null);
1502
+ },
1503
+ onCancel: () => he(null)
1504
+ },
1505
+ J
1506
+ ) : null;
1507
+ return /* @__PURE__ */ p("div", { className: "w-full", style: { top: "130px", position: "sticky", zIndex: 35, backgroundColor: "var(--primary-foreground)" }, children: [
1508
+ mt && Ye(mt, document.body),
1509
+ a.length > 0 && /* @__PURE__ */ i(
1510
+ "div",
1511
+ {
1512
+ className: "pt-2 pb-1",
1513
+ style: {
1514
+ position: "sticky",
1515
+ zIndex: 35,
1516
+ backgroundColor: "var(--primary-foreground)"
1517
+ },
1518
+ children: /* @__PURE__ */ p(
1519
+ "div",
1520
+ {
1521
+ style: {
1522
+ display: "flex",
1523
+ alignItems: "center",
1524
+ justifyContent: "flex-end",
1525
+ gap: 16,
1526
+ flexWrap: "wrap"
1527
+ },
1528
+ children: [
1529
+ T && /* @__PURE__ */ i("div", { style: { marginRight: "auto" }, children: /* @__PURE__ */ i(
1530
+ xn,
1531
+ {
1532
+ dateRangePicker: T.dateRangePicker,
1533
+ onWeekToDate: T.onWeekToDate,
1534
+ exportConfig: T.exportConfig,
1535
+ filterChipsConfig: T.filterChipsConfig,
1536
+ trailingActions: T.trailingActions
1537
+ }
1538
+ ) }),
1539
+ /* @__PURE__ */ p("div", { style: { position: "relative" }, children: [
1540
+ /* @__PURE__ */ p(
1541
+ "button",
1542
+ {
1543
+ ref: ce,
1544
+ type: "button",
1545
+ onClick: () => Te(!ie),
1546
+ style: {
1547
+ display: "inline-flex",
1548
+ alignItems: "center",
1549
+ gap: 10,
1550
+ height: 32,
1551
+ padding: "0 16px",
1552
+ background: "#FFFFFF",
1553
+ border: "1px solid #D9D9D9",
1554
+ borderRadius: 10,
1555
+ cursor: "pointer",
1556
+ fontFamily: "var(--font-sans)",
1557
+ fontSize: 14,
1558
+ fontWeight: 600,
1559
+ color: "#2E3236",
1560
+ whiteSpace: "nowrap"
1561
+ },
1562
+ children: [
1563
+ /* @__PURE__ */ i(un, { size: 20, strokeWidth: 1.75 }),
1564
+ "Columns"
1565
+ ]
1566
+ }
1567
+ ),
1568
+ ie && Ye(Kt, document.body)
1569
+ ] }),
1570
+ /* @__PURE__ */ i(
1571
+ "div",
1572
+ {
1573
+ style: {
1574
+ background: "#D8D8D8",
1575
+ width: 260,
1576
+ height: 32,
1577
+ borderRadius: 11,
1578
+ padding: 1,
1579
+ display: "flex",
1580
+ alignItems: "center"
1581
+ },
1582
+ children: /* @__PURE__ */ p(
1583
+ "div",
1584
+ {
1585
+ style: {
1586
+ background: "#FFFFFF",
1587
+ flex: 1,
1588
+ height: 30,
1589
+ borderRadius: 10,
1590
+ display: "flex",
1591
+ alignItems: "center",
1592
+ gap: 8,
1593
+ padding: "0 8px"
1594
+ },
1595
+ children: [
1596
+ /* @__PURE__ */ i(vt, { size: 18, color: "#989898", strokeWidth: 1.75 }),
1597
+ /* @__PURE__ */ i(
1598
+ "input",
1599
+ {
1600
+ type: "text",
1601
+ placeholder: "Search",
1602
+ value: Be,
1603
+ onChange: (e) => {
1604
+ qe(e.target.value), m ? m(1) : G(1);
1605
+ },
1606
+ style: {
1607
+ flex: 1,
1608
+ border: "none",
1609
+ outline: "none",
1610
+ background: "transparent",
1611
+ fontFamily: "var(--font-sans)",
1612
+ fontSize: 14,
1613
+ color: "#0B0B0B",
1614
+ minWidth: 0
1615
+ }
1616
+ }
1617
+ )
1618
+ ]
1619
+ }
1620
+ )
1621
+ }
1622
+ )
1623
+ ]
1624
+ }
1625
+ )
1626
+ }
1627
+ ),
1628
+ Object.keys(q).length > 0 && /* @__PURE__ */ p(
1629
+ "div",
1630
+ {
1631
+ style: {
1632
+ display: "flex",
1633
+ alignItems: "center",
1634
+ gap: 8,
1635
+ flexWrap: "wrap",
1636
+ padding: "8px 0"
1637
+ },
1638
+ children: [
1639
+ Object.entries(q).map(([e, t]) => {
1640
+ const n = a.find((u) => I(u) === e);
1641
+ if (!n || !Ne(t))
1642
+ return null;
1643
+ const s = kn(t), r = Dn(t), d = Cn(t);
1644
+ return /* @__PURE__ */ p(
1645
+ "span",
1646
+ {
1647
+ style: {
1648
+ display: "inline-flex",
1649
+ alignItems: "center",
1650
+ gap: 8,
1651
+ height: 28,
1652
+ padding: "0 12px",
1653
+ borderRadius: 20,
1654
+ border: "1px solid #B2B2B0",
1655
+ background: "#F2F2F0",
1656
+ fontFamily: "var(--font-sans)",
1657
+ fontSize: 14,
1658
+ lineHeight: "20px",
1659
+ color: "#0B0B0B",
1660
+ whiteSpace: "nowrap"
1661
+ },
1662
+ children: [
1663
+ /* @__PURE__ */ p("span", { children: [
1664
+ /* @__PURE__ */ p("span", { style: { color: "#676767" }, children: [
1665
+ n.label,
1666
+ ": "
1667
+ ] }),
1668
+ /* @__PURE__ */ i("span", { children: s })
1669
+ ] }),
1670
+ r > 0 && /* @__PURE__ */ i(Rn, { count: r, values: d }),
1671
+ /* @__PURE__ */ i(
1672
+ "button",
1673
+ {
1674
+ type: "button",
1675
+ onClick: () => $e(e, []),
1676
+ "aria-label": `Remove ${n.label} filter`,
1677
+ style: {
1678
+ background: "transparent",
1679
+ border: "none",
1680
+ padding: 0,
1681
+ cursor: "pointer",
1682
+ display: "inline-flex",
1683
+ color: "#676767"
1684
+ },
1685
+ children: /* @__PURE__ */ i(fn, { size: 14, strokeWidth: 2 })
1686
+ }
1687
+ )
1688
+ ]
1689
+ },
1690
+ `chip-${e}`
1691
+ );
1692
+ }),
1693
+ /* @__PURE__ */ i(
1694
+ "button",
1695
+ {
1696
+ type: "button",
1697
+ onClick: Dt,
1698
+ style: {
1699
+ marginLeft: "auto",
1700
+ background: "transparent",
1701
+ border: "none",
1702
+ padding: "0 4px",
1703
+ cursor: "pointer",
1704
+ fontFamily: "var(--font-sans)",
1705
+ fontSize: 14,
1706
+ fontWeight: 500,
1707
+ color: "#323232"
1708
+ },
1709
+ children: "Reset"
1710
+ }
1711
+ )
1712
+ ]
1713
+ }
1714
+ ),
1715
+ a.length > 0 && ue.length > 0 ? /* @__PURE__ */ p(
1716
+ Zt,
1717
+ {
1718
+ sensors: Lt,
1719
+ collisionDetection: Vt,
1720
+ onDragStart: Wt,
1721
+ onDragEnd: $t,
1722
+ children: [
1723
+ /* @__PURE__ */ p("div", { style: {
1724
+ borderRadius: 8,
1725
+ border: "1px solid #E6E6E6",
1726
+ overflow: "hidden",
1727
+ background: "var(--primary-foreground)",
1728
+ position: "relative",
1729
+ top: "0.5rem"
1730
+ }, children: [
1731
+ P && /* @__PURE__ */ i("div", { style: {
1732
+ position: "absolute",
1733
+ inset: 0,
1734
+ background: "rgba(255, 255, 255, 0.9)",
1735
+ backdropFilter: "blur(2px)",
1736
+ zIndex: 20,
1737
+ display: "flex",
1738
+ flexDirection: "column",
1739
+ alignItems: "center",
1740
+ justifyContent: "center",
1741
+ borderRadius: "14px"
1742
+ }, children: /* @__PURE__ */ p("div", { style: {
1743
+ display: "flex",
1744
+ flexDirection: "column",
1745
+ alignItems: "center",
1746
+ gap: "12px"
1747
+ }, children: [
1748
+ /* @__PURE__ */ i("p", { style: {
1749
+ fontSize: "13px",
1750
+ color: "rgba(30, 33, 37, 0.6)",
1751
+ margin: 0
1752
+ }, children: "Loading..." }),
1753
+ /* @__PURE__ */ i(
1754
+ Nn,
1755
+ {
1756
+ src: "/BrandLoading.gif",
1757
+ alt: "Loading",
1758
+ width: 50,
1759
+ height: 50,
1760
+ unoptimized: !0,
1761
+ className: "mt-1"
1762
+ }
1763
+ )
1764
+ ] }) }),
1765
+ /* @__PURE__ */ i("div", { className: "overflow-x-auto custom-thin-scrollbar-hidden", ref: Et, style: { maxHeight: "500px", overflowY: "auto", position: "relative", zIndex: 1 }, children: /* @__PURE__ */ p("table", { style: {
1766
+ width: "auto",
1767
+ minWidth: "100%",
1768
+ borderCollapse: "collapse",
1769
+ fontSize: "13px",
1770
+ fontFamily: "var(--font-sans)"
1771
+ }, children: [
1772
+ /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(
1773
+ en,
1774
+ {
1775
+ items: R,
1776
+ strategy: tn,
1777
+ children: ue.map((e) => /* @__PURE__ */ i(Ht, { column: e, isHeaderRow: !0 }, `header-${I(e)}`))
1778
+ }
1779
+ ) }) }),
1780
+ /* @__PURE__ */ i("tbody", { children: !P && Ce.length === 0 ? /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(
1781
+ "td",
1782
+ {
1783
+ colSpan: ue.length,
1784
+ style: {
1785
+ padding: "32px",
1786
+ textAlign: "center",
1787
+ color: "rgba(30, 33, 37, 0.42)",
1788
+ fontSize: "12px",
1789
+ fontFamily: "var(--font-sans)"
1790
+ },
1791
+ children: "No results found"
1792
+ }
1793
+ ) }) : !P && Ce.length > 0 ? Ce.map((e, t) => /* @__PURE__ */ i(
1794
+ "tr",
1795
+ {
1796
+ "data-row-id": e.id || t,
1797
+ style: {
1798
+ borderBottom: "1px solid #e6e6e6",
1799
+ cursor: c ? "pointer" : "default",
1800
+ transition: "background 0.15s ease"
1801
+ },
1802
+ onClick: c ? (n) => {
1803
+ n.stopPropagation(), c(e, t);
1804
+ } : void 0,
1805
+ onMouseEnter: (n) => {
1806
+ n.currentTarget.style.background = "rgba(231, 212, 162, 0.12)";
1807
+ },
1808
+ onMouseLeave: (n) => {
1809
+ n.currentTarget.style.background = "transparent";
1810
+ },
1811
+ children: ue.map((n) => {
1812
+ const s = I(n), r = ct(s, n.width), d = e[s], u = n.render ? n.render(d, e) : d, g = r && r !== "auto", K = typeof u == "string" && u.trim() !== "", B = g && K, ye = B ? /* @__PURE__ */ i(_, { content: u, children: u }) : u;
1813
+ return /* @__PURE__ */ i(
1814
+ "td",
1815
+ {
1816
+ style: {
1817
+ padding: "10px 14px",
1818
+ color: "rgba(30, 33, 37, 0.78)",
1819
+ fontSize: "13px",
1820
+ borderRight: "1px solid rgba(52, 58, 64, 0.04)",
1821
+ width: r,
1822
+ fontFamily: "var(--font-sans)",
1823
+ ...B && { maxWidth: r || "200px" }
1824
+ },
1825
+ children: ye
1826
+ },
1827
+ s
1828
+ );
1829
+ })
1830
+ },
1831
+ t
1832
+ )) : null })
1833
+ ] }) })
1834
+ ] }),
1835
+ /* @__PURE__ */ i(nn, { children: ft ? /* @__PURE__ */ i("div", { className: "bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg", children: /* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
1836
+ /* @__PURE__ */ i(Ge, { size: 14, className: "text-[var(--text-faint)]" }),
1837
+ /* @__PURE__ */ i("span", { className: "text-sm font-semibold text-[var(--text-ink)]", children: ft.label })
1838
+ ] }) }) : null })
1839
+ ]
1840
+ }
1841
+ ) : null,
1842
+ (U ? x > 0 : De.length > 0) && /* @__PURE__ */ i(
1843
+ bn,
1844
+ {
1845
+ page: H,
1846
+ pageSizeOptions: [5, 10, 20, 50, 100],
1847
+ pageSize: Q,
1848
+ totalCount: U ? x : De.length,
1849
+ currentDataLength: Ce.length,
1850
+ onPageChange: Y,
1851
+ onPageSizeChange: (e) => {
1852
+ pe(e), Y(1);
1853
+ },
1854
+ showPageSizeSelector: !0
1855
+ }
1856
+ )
1857
+ ] });
1858
+ }
1859
+ export {
1860
+ _n as D,
1861
+ xn as a
1862
+ };
1863
+ //# sourceMappingURL=DataTable2.es.js.map