chordia-ui 3.3.8 → 3.3.9

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 (159) hide show
  1. package/dist/AgentLiftCard.cjs.js.map +1 -1
  2. package/dist/AgentLiftCard.es.js +5 -3
  3. package/dist/AgentLiftCard.es.js.map +1 -1
  4. package/dist/CustomFilterChips.cjs.js.map +1 -1
  5. package/dist/CustomFilterChips.es.js +2 -1
  6. package/dist/CustomFilterChips.es.js.map +1 -1
  7. package/dist/FileUploadingState.cjs.js.map +1 -1
  8. package/dist/FileUploadingState.es.js +16 -10
  9. package/dist/FileUploadingState.es.js.map +1 -1
  10. package/dist/IntegrationCard.cjs.js.map +1 -1
  11. package/dist/IntegrationCard.es.js +3 -3
  12. package/dist/IntegrationCard.es.js.map +1 -1
  13. package/dist/SectionLabel.cjs.js.map +1 -1
  14. package/dist/SectionLabel.es.js.map +1 -1
  15. package/dist/SmallButton.cjs.js.map +1 -1
  16. package/dist/SmallButton.es.js +16 -16
  17. package/dist/SmallButton.es.js.map +1 -1
  18. package/dist/SummarySection.cjs.js.map +1 -1
  19. package/dist/SummarySection.es.js +11 -9
  20. package/dist/SummarySection.es.js.map +1 -1
  21. package/dist/TextInput.cjs.js.map +1 -1
  22. package/dist/TextInput.es.js.map +1 -1
  23. package/dist/Timeline.cjs.js.map +1 -1
  24. package/dist/Timeline.es.js +14 -8
  25. package/dist/Timeline.es.js.map +1 -1
  26. package/dist/Tooltip.cjs.js +1 -1
  27. package/dist/Tooltip.cjs.js.map +1 -1
  28. package/dist/Tooltip.es.js +31 -20
  29. package/dist/Tooltip.es.js.map +1 -1
  30. package/dist/TourGuideTooltip.cjs.js.map +1 -1
  31. package/dist/TourGuideTooltip.es.js +2 -1
  32. package/dist/TourGuideTooltip.es.js.map +1 -1
  33. package/dist/UpdatedInteractionRecording.cjs.js +1 -1
  34. package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
  35. package/dist/UpdatedInteractionRecording.es.js +79 -97
  36. package/dist/UpdatedInteractionRecording.es.js.map +1 -1
  37. package/dist/UploadInteraction.cjs.js.map +1 -1
  38. package/dist/UploadInteraction.es.js.map +1 -1
  39. package/dist/colors.cjs.js +2 -0
  40. package/dist/colors.cjs.js.map +1 -0
  41. package/dist/colors.es.js +2 -0
  42. package/dist/colors.es.js.map +1 -0
  43. package/dist/components/UpdatedInteractionDetails.cjs.js +10 -1
  44. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  45. package/dist/components/UpdatedInteractionDetails.es.js +1531 -9
  46. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  47. package/dist/components/chat.cjs.js +30 -1
  48. package/dist/components/chat.cjs.js.map +1 -1
  49. package/dist/components/chat.es.js +2222 -7
  50. package/dist/components/chat.es.js.map +1 -1
  51. package/dist/components/common.cjs.js +1 -1
  52. package/dist/components/common.es.js +32 -25
  53. package/dist/components/common.es.js.map +1 -1
  54. package/dist/components/data.cjs.js +1 -1
  55. package/dist/components/data.cjs.js.map +1 -1
  56. package/dist/components/data.es.js +1033 -4
  57. package/dist/components/data.es.js.map +1 -1
  58. package/dist/components/layout.cjs.js +3 -1
  59. package/dist/components/layout.cjs.js.map +1 -1
  60. package/dist/components/layout.es.js +1533 -8
  61. package/dist/components/layout.es.js.map +1 -1
  62. package/dist/components/login.cjs.js +1 -1
  63. package/dist/components/login.es.js +6 -2
  64. package/dist/components/login.es.js.map +1 -1
  65. package/dist/components/media.cjs.js +1 -1
  66. package/dist/components/media.cjs.js.map +1 -1
  67. package/dist/components/media.es.js +220 -6
  68. package/dist/components/media.es.js.map +1 -1
  69. package/dist/components/models.cjs.js +1 -1
  70. package/dist/components/models.cjs.js.map +1 -1
  71. package/dist/components/models.es.js +91 -2
  72. package/dist/components/models.es.js.map +1 -1
  73. package/dist/components/navigation.cjs.js +1 -1
  74. package/dist/components/navigation.cjs.js.map +1 -1
  75. package/dist/components/navigation.es.js +766 -7
  76. package/dist/components/navigation.es.js.map +1 -1
  77. package/dist/components/notifications.cjs.js +1 -1
  78. package/dist/components/notifications.cjs.js.map +1 -1
  79. package/dist/components/notifications.es.js +368 -3
  80. package/dist/components/notifications.es.js.map +1 -1
  81. package/dist/components/onboarding.cjs.js +1 -1
  82. package/dist/components/onboarding.cjs.js.map +1 -1
  83. package/dist/components/onboarding.es.js +985 -7
  84. package/dist/components/onboarding.es.js.map +1 -1
  85. package/dist/components/primitives.cjs.js +1 -1
  86. package/dist/components/primitives.cjs.js.map +1 -1
  87. package/dist/components/primitives.es.js +635 -25
  88. package/dist/components/primitives.es.js.map +1 -1
  89. package/dist/debugger-wc.cjs.js +4 -4
  90. package/dist/debugger-wc.cjs.js.map +1 -1
  91. package/dist/debugger-wc.es.js +15 -11
  92. package/dist/debugger-wc.es.js.map +1 -1
  93. package/dist/index.cjs.js +1 -1
  94. package/dist/index.cjs2.js +2 -49
  95. package/dist/index.cjs2.js.map +1 -1
  96. package/dist/index.cjs3.js +50 -0
  97. package/dist/index.cjs3.js.map +1 -0
  98. package/dist/index.es.js +104 -99
  99. package/dist/index.es.js.map +1 -1
  100. package/dist/index.es2.js +2632 -1776
  101. package/dist/index.es2.js.map +1 -1
  102. package/dist/index.es3.js +1944 -0
  103. package/dist/index.es3.js.map +1 -0
  104. package/dist/pages/interactionDetails.cjs.js +1 -1
  105. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  106. package/dist/pages/interactionDetails.es.js +70 -47
  107. package/dist/pages/interactionDetails.es.js.map +1 -1
  108. package/dist/sortable.esm.cjs.js +1 -1
  109. package/dist/sortable.esm.cjs.js.map +1 -1
  110. package/dist/sortable.esm.es.js +55 -53
  111. package/dist/sortable.esm.es.js.map +1 -1
  112. package/dist/{chordia-ui.css → style.css} +1 -1
  113. package/package.json +1 -1
  114. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +318 -77
  115. package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +7 -17
  116. package/dist/ChartRenderer.cjs.js +0 -31
  117. package/dist/ChartRenderer.cjs.js.map +0 -1
  118. package/dist/ChartRenderer.es.js +0 -2210
  119. package/dist/ChartRenderer.es.js.map +0 -1
  120. package/dist/GettingStarted.cjs.js +0 -2
  121. package/dist/GettingStarted.cjs.js.map +0 -1
  122. package/dist/GettingStarted.es.js +0 -983
  123. package/dist/GettingStarted.es.js.map +0 -1
  124. package/dist/InlineConfirm.cjs.js +0 -2
  125. package/dist/InlineConfirm.cjs.js.map +0 -1
  126. package/dist/InlineConfirm.es.js +0 -618
  127. package/dist/InlineConfirm.es.js.map +0 -1
  128. package/dist/InteractionSummaryCard.cjs.js +0 -2
  129. package/dist/InteractionSummaryCard.cjs.js.map +0 -1
  130. package/dist/InteractionSummaryCard.es.js +0 -216
  131. package/dist/InteractionSummaryCard.es.js.map +0 -1
  132. package/dist/LoginPage.cjs.js +0 -3
  133. package/dist/LoginPage.cjs.js.map +0 -1
  134. package/dist/LoginPage.es.js +0 -2618
  135. package/dist/LoginPage.es.js.map +0 -1
  136. package/dist/NavigationBar.cjs.js +0 -2
  137. package/dist/NavigationBar.cjs.js.map +0 -1
  138. package/dist/NavigationBar.es.js +0 -762
  139. package/dist/NavigationBar.es.js.map +0 -1
  140. package/dist/NotificationPanel.cjs.js +0 -2
  141. package/dist/NotificationPanel.cjs.js.map +0 -1
  142. package/dist/NotificationPanel.es.js +0 -371
  143. package/dist/NotificationPanel.es.js.map +0 -1
  144. package/dist/OverlayPanel.cjs.js +0 -2
  145. package/dist/OverlayPanel.cjs.js.map +0 -1
  146. package/dist/OverlayPanel.es.js +0 -93
  147. package/dist/OverlayPanel.es.js.map +0 -1
  148. package/dist/SplitPane.cjs.js +0 -4
  149. package/dist/SplitPane.cjs.js.map +0 -1
  150. package/dist/SplitPane.es.js +0 -1531
  151. package/dist/SplitPane.es.js.map +0 -1
  152. package/dist/SummaryStatsPanel.cjs.js +0 -2
  153. package/dist/SummaryStatsPanel.cjs.js.map +0 -1
  154. package/dist/SummaryStatsPanel.es.js +0 -1027
  155. package/dist/SummaryStatsPanel.es.js.map +0 -1
  156. package/dist/UpdatedInteractionDetails.cjs.js +0 -11
  157. package/dist/UpdatedInteractionDetails.cjs.js.map +0 -1
  158. package/dist/UpdatedInteractionDetails.es.js +0 -1310
  159. package/dist/UpdatedInteractionDetails.es.js.map +0 -1
@@ -1,7 +1,1036 @@
1
- import { D as e, a as s, S as l } from "../SummaryStatsPanel.es.js";
1
+ import { jsxs as l, jsx as o, Fragment as je } from "react/jsx-runtime";
2
+ import xe, { useState as m, useRef as T, useEffect as P, Suspense as ft, useMemo as I, useCallback as de } from "react";
3
+ import { u as gt, a as _e, D as mt, c as ht, S as xt, h as yt, b as bt, s as vt, K as wt, P as St, d as ye, e as kt, C as Ct } from "../sortable.esm.es.js";
4
+ import { CalendarClock as Ae, Download as Dt, ChevronDown as ve, ChevronUp as Ie, Filter as Pe, GripVertical as Re } from "lucide-react";
5
+ import { createPortal as Nt } from "react-dom";
6
+ import { C as Ft, P as zt } from "../CustomFilterChips.es.js";
7
+ import "../TourGuideTooltip.es.js";
8
+ function Ot({
9
+ dateRangePicker: g,
10
+ onWeekToDate: d,
11
+ exportConfig: y,
12
+ filterChipsConfig: p,
13
+ trailingActions: C
14
+ // Optional extra actions rendered after Export (e.g., Add Users button)
15
+ }) {
16
+ const [R, j] = m(!1), v = T(null), E = T(null);
17
+ P(() => {
18
+ const c = (z) => {
19
+ E.current && !E.current.contains(z.target) && v.current && !v.current.contains(z.target) && j(!1);
20
+ };
21
+ if (R)
22
+ return document.addEventListener("mousedown", c), () => {
23
+ document.removeEventListener("mousedown", c);
24
+ };
25
+ }, [R]);
26
+ const J = () => {
27
+ j((c) => !c);
28
+ }, q = (c) => {
29
+ j(!1), y != null && y.onExport && y.onExport(c);
30
+ }, S = (() => {
31
+ if (!(p != null && p.filters))
32
+ return !1;
33
+ const c = p.filters, z = p.customFilters || [], O = Object.entries(c).some(([h, w]) => !!(Array.isArray(w) && w.length || typeof w == "string" && w.trim() !== "" || w && typeof w == "object" && (w.min != null || w.max != null))), G = z.some((h) => h.active);
34
+ return O || G;
35
+ })();
36
+ return /* @__PURE__ */ l("div", { className: "flex items-center gap-3 flex-wrap", children: [
37
+ d && /* @__PURE__ */ l(
38
+ "button",
39
+ {
40
+ onClick: d,
41
+ 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",
42
+ style: { fontFamily: "var(--font-sans)" },
43
+ children: [
44
+ /* @__PURE__ */ o(Ae, { size: 16 }),
45
+ /* @__PURE__ */ o("span", { children: "Week to Date" })
46
+ ]
47
+ }
48
+ ),
49
+ g && /* @__PURE__ */ o(
50
+ ft,
51
+ {
52
+ fallback: /* @__PURE__ */ l("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: [
53
+ /* @__PURE__ */ o(Ae, { size: 16 }),
54
+ /* @__PURE__ */ o("span", { children: "Loading..." })
55
+ ] }),
56
+ children: g
57
+ }
58
+ ),
59
+ y && /* @__PURE__ */ l("div", { className: "relative", children: [
60
+ /* @__PURE__ */ l(
61
+ "button",
62
+ {
63
+ ref: v,
64
+ onClick: J,
65
+ disabled: y.isExporting,
66
+ 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]",
67
+ style: { fontFamily: "var(--font-sans)" },
68
+ children: [
69
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
70
+ /* @__PURE__ */ o(Dt, { size: 16 }),
71
+ /* @__PURE__ */ o("span", { children: y.isExporting ? "Exporting..." : "Export" })
72
+ ] }),
73
+ /* @__PURE__ */ o(ve, { size: 16 })
74
+ ]
75
+ }
76
+ ),
77
+ R && /* @__PURE__ */ o(
78
+ "div",
79
+ {
80
+ ref: E,
81
+ 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]",
82
+ children: (y.types || ["csv"]).map((c) => /* @__PURE__ */ l(
83
+ "button",
84
+ {
85
+ onClick: () => q(c),
86
+ className: "w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",
87
+ style: { fontFamily: "var(--font-sans)" },
88
+ children: [
89
+ "Export ",
90
+ c.toUpperCase()
91
+ ]
92
+ },
93
+ c
94
+ ))
95
+ }
96
+ )
97
+ ] }),
98
+ (S || C) && /* @__PURE__ */ l(je, { children: [
99
+ S && /* @__PURE__ */ o("div", { className: "h-9 mt-1 w-px bg-gray-300 flex-shrink-0" }),
100
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-3 justify-end", children: [
101
+ S && p && /* @__PURE__ */ o(
102
+ Ft,
103
+ {
104
+ filters: p.filters,
105
+ onChange: p.onChange,
106
+ onClear: p.onClear,
107
+ customFilters: p.customFilters || [],
108
+ fieldOptions: p.fieldOptions || {}
109
+ }
110
+ ),
111
+ C && /* @__PURE__ */ o("div", { className: "flex-shrink-0", children: C })
112
+ ] })
113
+ ] })
114
+ ] });
115
+ }
116
+ function be() {
117
+ return /* @__PURE__ */ o("div", { style: { height: 1, background: "rgba(52,58,64,0.08)" } });
118
+ }
119
+ const Lt = () => ({ userData: { email: "anonymous" } }), Tt = (g) => /* @__PURE__ */ o("img", { ...g });
120
+ function Et({ children: g }) {
121
+ return g;
122
+ }
123
+ function Bt({
124
+ data: g = [],
125
+ columns: d = [],
126
+ initialPageSize: y = 10,
127
+ onRowClick: p,
128
+ // Server-side pagination props (optional)
129
+ totalCount: C = null,
130
+ // Total count from server (null = use client-side pagination)
131
+ page: R = null,
132
+ // Controlled page (null = use internal state)
133
+ pageSize: j = null,
134
+ // Controlled pageSize (null = use internal state)
135
+ onPageChange: v = null,
136
+ // Callback for page changes (null = use internal state)
137
+ onPageSizeChange: E = null,
138
+ // Callback for pageSize changes (null = use internal state)
139
+ onFilterChange: J = null,
140
+ // Callback for filter changes (null = use client-side filtering)
141
+ // Optional callback to surface column limit errors to host app
142
+ onMaxColumnsError: q = null,
143
+ // Server-side sorting props (optional)
144
+ onSort: Q = null,
145
+ // Callback for sort changes (null = use client-side sorting)
146
+ sortFields: S = [],
147
+ // Array of [field, direction] tuples from parent (null = use internal state)
148
+ tableId: c = null,
149
+ // Optional unique identifier for localStorage persistence (e.g., "history", "agents")
150
+ isLoading: z = !1,
151
+ // Loading state to show overlay inside table
152
+ // Filter props (optional)
153
+ filtersConfig: O = null
154
+ // Configuration for filters (dateRangePicker, onWeekToDate, exportConfig, filterChipsConfig)
155
+ }) {
156
+ var Me;
157
+ const { userData: G } = Lt(), h = (G == null ? void 0 : G.email) || "anonymous", w = xe.memo(({ children: e, content: t, className: r = "" }) => {
158
+ const n = T(null), [s, a] = m(!1);
159
+ P(() => {
160
+ const u = () => {
161
+ if (n.current) {
162
+ const X = n.current.scrollWidth > n.current.clientWidth;
163
+ a(X);
164
+ }
165
+ };
166
+ u();
167
+ const U = setTimeout(u, 0);
168
+ return window.addEventListener("resize", u), () => {
169
+ clearTimeout(U), window.removeEventListener("resize", u);
170
+ };
171
+ }, [e, t]);
172
+ const i = /* @__PURE__ */ o("span", { className: `truncate block ${r}`, ref: n, children: e });
173
+ return s && t ? /* @__PURE__ */ o(
174
+ Et,
175
+ {
176
+ content: t,
177
+ 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",
178
+ indicatorColor: "bg-green-2",
179
+ direction: "top",
180
+ children: i
181
+ }
182
+ ) : i;
183
+ });
184
+ w.displayName = "TruncatedCell";
185
+ const Z = C !== null && v !== null, ce = J !== null, B = Q !== null, [Be, ue] = m(1), [We, Ve] = m(y), pe = R !== null ? R : Be, ee = j !== null ? j : We, te = (e) => {
186
+ v ? v(e) : ue(e);
187
+ }, we = (e) => {
188
+ E ? E(e) : Ve(e);
189
+ }, D = 9, b = "action", $ = T(!1), W = I(() => c ? `dataTable_columns_${c}:${h}` : `dataTable_columns_${d.map((t) => t.id || t.key).sort().join("_")}:${h}`, [c, d, h]), V = I(() => c ? `dataTable_manual_change_${c}:${h}` : null, [c, h]);
190
+ de((e, t) => {
191
+ if (typeof window > "u" || !e || !t || t.length === 0)
192
+ return null;
193
+ try {
194
+ const r = localStorage.getItem(e);
195
+ if (r) {
196
+ const s = JSON.parse(r).filter(
197
+ (a) => t.some((i) => (i.id || i.key) === a)
198
+ );
199
+ if (s.length > 0)
200
+ return s;
201
+ }
202
+ } catch (r) {
203
+ console.warn("Failed to load saved columns from localStorage:", r);
204
+ }
205
+ return null;
206
+ }, []);
207
+ const [M, He] = m({}), [Se, Ke] = m(null), [ke, Ce] = m("asc");
208
+ de((e, t) => e === "csat_score" && t === "evaluation.csat_score" ? t : e, []);
209
+ const Y = B && S.length > 0 ? S[0][0] : Se, re = B && S.length > 0 ? S[0][1] : ke, [$t, De] = m(
210
+ () => d.map((e) => e.id || e.key)
211
+ ), L = de((e) => {
212
+ if (!e || e.length === 0)
213
+ return e;
214
+ let t = Array.from(new Set(e));
215
+ t.length > D && (t = t.slice(0, D));
216
+ const n = d.map((i) => i.id || i.key).includes(b);
217
+ return !t.includes(b) && n && (t.length >= D ? t = [...t.slice(0, D - 1), b] : t = [...t, b]), [...t.filter((i) => i !== b), b];
218
+ }, [d]), [f, _] = m(() => {
219
+ if (typeof window < "u" && c)
220
+ try {
221
+ if (localStorage.getItem(`dataTable_manual_change_${c}:${h}`) === "true") {
222
+ const n = localStorage.getItem(`dataTable_columns_${c}:${h}`);
223
+ if (n) {
224
+ const s = JSON.parse(n);
225
+ if (Array.isArray(s) && s.length > 0) {
226
+ $.current = !0;
227
+ const a = s.filter(
228
+ (i) => d.some((u) => (u.id || u.key) === i)
229
+ );
230
+ if (a.length > 0)
231
+ return a.slice(0, D);
232
+ }
233
+ }
234
+ }
235
+ } catch (r) {
236
+ console.warn("Failed to load saved columns from localStorage:", r);
237
+ }
238
+ const t = d.map((r) => r.id || r.key).slice(0, D);
239
+ return L(t);
240
+ }), [k, Ne] = m(!1), [fe, Ue] = m({ top: 0, left: 0, width: 0 }), [Je, Fe] = m(/* @__PURE__ */ new Set()), [ze, Oe] = m(/* @__PURE__ */ new Set()), [N, ge] = m(null), [Ge, ne] = m(null), H = T(null), me = T(null), K = T(null), [Le, Te] = m(null), Ye = T(null), x = (e) => e.id || e.key, Xe = gt(
241
+ _e(St),
242
+ _e(wt, {
243
+ coordinateGetter: vt
244
+ })
245
+ ), qe = (e) => {
246
+ const { active: t, over: r } = e;
247
+ r && t.id !== r.id && ($.current = !0, _((n) => {
248
+ const s = n.indexOf(t.id), a = n.indexOf(r.id);
249
+ if (s !== -1 && a !== -1) {
250
+ const i = ye(n, s, a);
251
+ return ie(i), i;
252
+ }
253
+ return n;
254
+ }), De((n) => {
255
+ const s = n.indexOf(t.id), a = n.indexOf(r.id);
256
+ return ye(n, s, a);
257
+ })), Te(null);
258
+ }, Qe = (e) => {
259
+ Te(e.active.id);
260
+ }, oe = I(() => ce ? g || [] : !g || g.length === 0 ? [] : g.filter((e) => Object.keys(M).every((t) => {
261
+ const r = M[t];
262
+ if (!r || r.trim() === "")
263
+ return !0;
264
+ const n = e[t];
265
+ if (n == null)
266
+ return !1;
267
+ const s = String(n).toLowerCase();
268
+ return r.toLowerCase().trim().split(/\s+/).filter((u) => u.length > 0).every((u) => s.includes(u));
269
+ })), [g, M, ce]), se = I(() => B || !Y ? oe : [...oe].sort((e, t) => {
270
+ const r = e[Y], n = t[Y];
271
+ if (r == null)
272
+ return 1;
273
+ if (n == null)
274
+ return -1;
275
+ if (typeof r == "number" && typeof n == "number")
276
+ return re === "asc" ? r - n : n - r;
277
+ const s = String(r).toLowerCase(), a = String(n).toLowerCase();
278
+ return re === "asc" ? s.localeCompare(a) : a.localeCompare(s);
279
+ }), [oe, Y, re, B]), ae = I(() => {
280
+ if (Z)
281
+ return g || [];
282
+ {
283
+ const e = (pe - 1) * ee, t = e + ee;
284
+ return se.slice(e, t);
285
+ }
286
+ }, [g, se, pe, ee, Z]), Ze = (e) => {
287
+ B && Q ? (Q(e), v ? v(1) : ue(1)) : (Se === e ? Ce(ke === "asc" ? "desc" : "asc") : (Ke(e), Ce("asc")), te(1));
288
+ }, Ee = (e, t) => {
289
+ const r = t && t.trim() !== "" ? { ...M, [e]: t } : Object.fromEntries(Object.entries(M).filter(([n]) => n !== e));
290
+ He(r), ce && J && J(r), v ? v(1) : ue(1);
291
+ }, et = (e) => {
292
+ K.current || (typeof q == "function" && q(e), K.current = setTimeout(() => {
293
+ K.current = null;
294
+ }, 3e3));
295
+ }, ie = de((e) => {
296
+ if (typeof window < "u" && W && e.length > 0 && $.current)
297
+ try {
298
+ localStorage.setItem(W, JSON.stringify(e)), V && localStorage.setItem(V, "true");
299
+ } catch (t) {
300
+ console.warn("Failed to save columns to localStorage:", t);
301
+ }
302
+ }, [W, V]), he = (e) => {
303
+ e !== b && ($.current = !0, _((t) => t.includes(e) ? (K.current && (clearTimeout(K.current), K.current = null), t.length === 1 || (Oe((r) => new Set(r).add(e)), setTimeout(() => {
304
+ _((r) => {
305
+ const n = r.filter((a) => a !== e), s = L(n);
306
+ return ie(s), s;
307
+ }), Oe((r) => {
308
+ const n = new Set(r);
309
+ return n.delete(e), n;
310
+ });
311
+ }, 200)), t) : t.length >= D ? (et("Maximum 9 column selection allowed"), t) : (Fe((r) => new Set(r).add(e)), setTimeout(() => {
312
+ _((r) => {
313
+ const n = r.includes(e) ? r : [...r, e], s = L(n);
314
+ return ie(s), s;
315
+ }), Fe((r) => {
316
+ const n = new Set(r);
317
+ return n.delete(e), n;
318
+ });
319
+ }, 200), t)));
320
+ }, tt = (e, t) => {
321
+ f[t] !== b && ge(t);
322
+ }, rt = () => {
323
+ ge(null), ne(null);
324
+ }, nt = (e, t) => {
325
+ e.preventDefault(), N !== null && N !== t && ne(t);
326
+ }, ot = () => {
327
+ ne(null);
328
+ }, st = (e, t) => {
329
+ e.preventDefault(), N !== null && N !== t && f[t] !== b && f[N] !== b && ($.current = !0, _((r) => {
330
+ const n = ye(r, N, t), s = L(n);
331
+ return ie(s), s;
332
+ })), ge(null), ne(null);
333
+ };
334
+ P(() => {
335
+ De((e) => {
336
+ const t = f.filter((s) => e.includes(s)), r = f.filter((s) => !e.includes(s)), n = e.filter((s) => !f.includes(s));
337
+ return [...t, ...r, ...n];
338
+ });
339
+ }, [f]), P(() => {
340
+ if (typeof window < "u" && W && f.length > 0 && $.current)
341
+ try {
342
+ const e = L(f);
343
+ localStorage.setItem(W, JSON.stringify(e)), V && localStorage.setItem(V, "true");
344
+ } catch (e) {
345
+ console.warn("Failed to save columns to localStorage:", e);
346
+ }
347
+ }, [f, W, V]), P(() => {
348
+ if (d.length > 0 && f.length === 0) {
349
+ if (typeof window < "u" && c)
350
+ try {
351
+ if (localStorage.getItem(`dataTable_manual_change_${c}:${h}`) === "true") {
352
+ const r = localStorage.getItem(`dataTable_columns_${c}:${h}`);
353
+ if (r) {
354
+ const n = JSON.parse(r);
355
+ if (Array.isArray(n) && n.length > 0) {
356
+ const s = n.filter(
357
+ (a) => d.some((i) => (i.id || i.key) === a)
358
+ );
359
+ if (s.length > 0) {
360
+ $.current = !0, _(s.slice(0, D));
361
+ return;
362
+ }
363
+ }
364
+ }
365
+ }
366
+ } catch (t) {
367
+ console.warn("Failed to load saved columns from localStorage:", t);
368
+ }
369
+ const e = d.map((t) => t.id || t.key);
370
+ _(L(e.slice(0, D)));
371
+ }
372
+ }, [d, c, h, L]);
373
+ const A = I(() => {
374
+ const e = f.map((t) => d.find((r) => x(r) === t)).filter(Boolean);
375
+ return L(e.map(x)).map((t) => d.find((r) => x(r) === t)).filter(Boolean);
376
+ }, [d, f]), at = I(() => A.some((e) => e.filterable === !0), [A]);
377
+ P(() => {
378
+ if (!k || !H.current)
379
+ return;
380
+ const e = () => {
381
+ if (H.current) {
382
+ const t = H.current.getBoundingClientRect();
383
+ Ue({
384
+ top: t.bottom,
385
+ // No gap - connect directly
386
+ left: t.left,
387
+ width: Math.max(t.width || 220, 220)
388
+ });
389
+ }
390
+ };
391
+ return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
392
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
393
+ };
394
+ }, [k]), P(() => {
395
+ const e = (t) => {
396
+ k && H.current && !H.current.contains(t.target) && me.current && !me.current.contains(t.target) && Ne(!1);
397
+ };
398
+ if (k)
399
+ return document.addEventListener("mousedown", e), () => {
400
+ document.removeEventListener("mousedown", e);
401
+ };
402
+ }, [k]);
403
+ const it = f.length === 1 ? ((Me = d.find((e) => (e.id || e.key) === f[0])) == null ? void 0 : Me.label) || "1 selected" : `${f.length} selected`;
404
+ function lt({ column: e, isHeaderRow: t = !0 }) {
405
+ const r = x(e), n = r === b, {
406
+ attributes: s,
407
+ listeners: a,
408
+ setNodeRef: i,
409
+ transform: u,
410
+ transition: U,
411
+ isDragging: X
412
+ } = kt({ id: r }), ct = {
413
+ transform: Ct.Transform.toString(u),
414
+ transition: U,
415
+ opacity: X ? 0.5 : 1,
416
+ width: e.width || "auto",
417
+ minWidth: e.width || "auto"
418
+ };
419
+ let le = !1;
420
+ if (B && S.length > 0) {
421
+ const F = S[0][0];
422
+ (F === r || F === "csat_score" && r === "evaluation.csat_score") && (le = !0);
423
+ } else
424
+ le = Y === r;
425
+ const ut = re === "asc", pt = e.filterable === !0;
426
+ return t ? /* @__PURE__ */ o(
427
+ "th",
428
+ {
429
+ ref: i,
430
+ style: {
431
+ ...ct,
432
+ padding: "12px 14px",
433
+ textAlign: n ? "center" : "left",
434
+ fontWeight: 650,
435
+ fontSize: "11px",
436
+ letterSpacing: "0.14em",
437
+ textTransform: "uppercase",
438
+ color: "rgba(30, 33, 37, 0.62)",
439
+ cursor: e.sortable !== !1 ? "pointer" : "default",
440
+ width: e.width || "auto",
441
+ borderRight: "1px solid rgba(52, 58, 64, 0.06)",
442
+ userSelect: "none",
443
+ background: "var(--primary-foreground)",
444
+ borderBottom: "1px solid rgba(52, 58, 64, 0.12)",
445
+ position: "sticky",
446
+ top: 0,
447
+ zIndex: 10,
448
+ fontFamily: "var(--font-sans)"
449
+ },
450
+ children: /* @__PURE__ */ l(
451
+ "div",
452
+ {
453
+ style: {
454
+ display: "flex",
455
+ alignItems: "center",
456
+ gap: "6px",
457
+ justifyContent: n ? "center" : "flex-start"
458
+ },
459
+ children: [
460
+ !n && /* @__PURE__ */ o(
461
+ "div",
462
+ {
463
+ ...s,
464
+ ...a,
465
+ style: { cursor: "grab", color: "rgba(30, 33, 37, 0.32)" },
466
+ children: /* @__PURE__ */ o(Re, { size: 12 })
467
+ }
468
+ ),
469
+ /* @__PURE__ */ o(
470
+ "span",
471
+ {
472
+ onClick: () => e.sortable !== !1 && Ze(r),
473
+ style: { cursor: e.sortable !== !1 ? "pointer" : "default" },
474
+ children: e.label.toUpperCase()
475
+ }
476
+ ),
477
+ e.sortable !== !1 && le && /* @__PURE__ */ o("span", { children: ut ? /* @__PURE__ */ o(Ie, { size: 12 }) : /* @__PURE__ */ o(ve, { size: 12 }) })
478
+ ]
479
+ }
480
+ )
481
+ }
482
+ ) : /* @__PURE__ */ o(
483
+ "th",
484
+ {
485
+ style: {
486
+ width: e.width || "auto",
487
+ minWidth: e.width || "auto",
488
+ backgroundColor: "var(--primary-foreground)"
489
+ },
490
+ className: "sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",
491
+ children: pt ? /* @__PURE__ */ l("div", { className: "relative", children: [
492
+ /* @__PURE__ */ o(
493
+ Pe,
494
+ {
495
+ size: 12,
496
+ className: "absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"
497
+ }
498
+ ),
499
+ /* @__PURE__ */ o(
500
+ "input",
501
+ {
502
+ type: "text",
503
+ placeholder: "Filter...",
504
+ value: M[r] || "",
505
+ onChange: (F) => {
506
+ F.stopPropagation(), Ee(r, F.target.value);
507
+ },
508
+ onKeyDown: (F) => F.stopPropagation(),
509
+ onMouseDown: (F) => F.stopPropagation(),
510
+ 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",
511
+ style: { fontFamily: "var(--font-sans)", backgroundColor: "var(--primary-foreground)" },
512
+ autoComplete: "off"
513
+ }
514
+ )
515
+ ] }) : /* @__PURE__ */ o("div", { className: "h-[34px]" })
516
+ }
517
+ );
518
+ }
519
+ const $e = Le ? d.find((e) => x(e) === Le) : null, dt = k ? /* @__PURE__ */ l(
520
+ "div",
521
+ {
522
+ ref: me,
523
+ className: "flex flex-col overflow-auto z-[49] min-w-[220px]",
524
+ style: {
525
+ position: "fixed",
526
+ top: `${fe.top}px`,
527
+ left: `${fe.left}px`,
528
+ width: fe.width || 220,
529
+ maxHeight: "400px",
530
+ fontFamily: "var(--font-sans)",
531
+ backgroundColor: "var(--primary-foreground)",
532
+ borderRadius: "0 0 8px 8px",
533
+ // Rounded corners only on bottom
534
+ boxShadow: "4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A",
535
+ border: "1px solid rgba(52, 58, 64, 0.12)",
536
+ borderTop: "none"
537
+ // No top border to connect seamlessly
538
+ },
539
+ children: [
540
+ f.map((e, t) => {
541
+ const r = d.find((u) => x(u) === e);
542
+ if (!r)
543
+ return null;
544
+ const n = f.indexOf(e), s = N === n, a = Ge === n, i = e === b;
545
+ return /* @__PURE__ */ l(xe.Fragment, { children: [
546
+ /* @__PURE__ */ l(
547
+ "div",
548
+ {
549
+ draggable: !i,
550
+ onDragStart: i ? void 0 : (u) => tt(u, n),
551
+ onDragEnd: i ? void 0 : rt,
552
+ onDragOver: i ? void 0 : (u) => nt(u, n),
553
+ onDragLeave: i ? void 0 : ot,
554
+ onDrop: i ? void 0 : (u) => st(u, n),
555
+ className: `flex items-center gap-2 px-3 py-2 rounded transition-all ${i ? "cursor-default opacity-100" : "cursor-move"} ${!i && s ? "opacity-50" : ""} ${!i && a && N !== null && N !== n ? "ring-2 ring-green-2 ring-offset-1" : ""}`,
556
+ children: [
557
+ !i && /* @__PURE__ */ o(
558
+ "svg",
559
+ {
560
+ className: "h-4 w-4 text-gray-600 flex-shrink-0",
561
+ fill: "none",
562
+ stroke: "currentColor",
563
+ viewBox: "0 0 24 24",
564
+ children: /* @__PURE__ */ o(
565
+ "path",
566
+ {
567
+ strokeLinecap: "round",
568
+ strokeLinejoin: "round",
569
+ strokeWidth: 2,
570
+ d: "M4 8h16M4 12h16M4 16h16"
571
+ }
572
+ )
573
+ }
574
+ ),
575
+ /* @__PURE__ */ o(
576
+ "button",
577
+ {
578
+ type: "button",
579
+ onClick: (u) => {
580
+ u.preventDefault(), u.stopPropagation(), i || he(e);
581
+ },
582
+ className: `h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${i ? "bg-green-2 border-green-2 cursor-default" : ze.has(e) ? "bg-white border-gray-300" : "bg-green-2 border-green-2"}`,
583
+ children: !ze.has(e) && /* @__PURE__ */ o(
584
+ "svg",
585
+ {
586
+ className: "h-3 w-3",
587
+ fill: "none",
588
+ stroke: "currentColor",
589
+ viewBox: "0 0 24 24",
590
+ strokeWidth: 3,
591
+ style: { color: "#1E2125" },
592
+ children: /* @__PURE__ */ o(
593
+ "path",
594
+ {
595
+ strokeLinecap: "round",
596
+ strokeLinejoin: "round",
597
+ d: "M5 13l4 4L19 7"
598
+ }
599
+ )
600
+ }
601
+ )
602
+ }
603
+ ),
604
+ /* @__PURE__ */ o("span", { className: "text-sm text-gray-900 flex-1", style: { fontFamily: "var(--font-sans)" }, children: r.label })
605
+ ]
606
+ }
607
+ ),
608
+ t < f.length - 1 && /* @__PURE__ */ o(be, {})
609
+ ] }, `selected-${e}-${t}`);
610
+ }),
611
+ d.filter((e) => !f.includes(x(e))).map((e, t) => {
612
+ const r = x(e), n = Je.has(r), s = d.filter((a) => !f.includes(x(a))).indexOf(e);
613
+ return /* @__PURE__ */ l(xe.Fragment, { children: [
614
+ f.length > 0 && s === 0 && /* @__PURE__ */ o(be, {}),
615
+ /* @__PURE__ */ l(
616
+ "label",
617
+ {
618
+ className: "flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors",
619
+ onClick: (a) => {
620
+ a.preventDefault(), he(r);
621
+ },
622
+ children: [
623
+ /* @__PURE__ */ o(
624
+ "button",
625
+ {
626
+ type: "button",
627
+ onClick: (a) => {
628
+ a.preventDefault(), a.stopPropagation(), he(r);
629
+ },
630
+ className: `h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${n ? "bg-green-2 border-green-2" : "bg-white border-gray-300"}`,
631
+ children: n && /* @__PURE__ */ o(
632
+ "svg",
633
+ {
634
+ className: "h-3 w-3",
635
+ fill: "none",
636
+ stroke: "currentColor",
637
+ viewBox: "0 0 24 24",
638
+ strokeWidth: 3,
639
+ style: { color: "#1E2125" },
640
+ children: /* @__PURE__ */ o(
641
+ "path",
642
+ {
643
+ strokeLinecap: "round",
644
+ strokeLinejoin: "round",
645
+ d: "M5 13l4 4L19 7"
646
+ }
647
+ )
648
+ }
649
+ )
650
+ }
651
+ ),
652
+ /* @__PURE__ */ o("span", { className: "text-sm text-gray-900 flex-1", children: e.label })
653
+ ]
654
+ }
655
+ ),
656
+ s < d.filter((a) => !f.includes(x(a))).length - 1 && /* @__PURE__ */ o(be, {})
657
+ ] }, `unselected-${r}`);
658
+ })
659
+ ]
660
+ }
661
+ ) : null;
662
+ return /* @__PURE__ */ l("div", { className: "w-full", style: { top: "130px", position: "sticky", zIndex: 35, backgroundColor: "var(--primary-foreground)" }, children: [
663
+ d.length > 0 && /* @__PURE__ */ o(
664
+ "div",
665
+ {
666
+ className: "pt-2 pb-1",
667
+ style: {
668
+ position: "sticky",
669
+ zIndex: 35,
670
+ backgroundColor: "var(--primary-foreground)"
671
+ },
672
+ children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3 flex-wrap", children: [
673
+ /* @__PURE__ */ l("div", { className: "flex-shrink-0", children: [
674
+ /* @__PURE__ */ o("div", { className: "mb-1 ml-1.5", children: /* @__PURE__ */ o("p", { className: "text-xs font-medium text-gray-600", style: { fontFamily: "var(--font-sans)" }, children: "Select Columns" }) }),
675
+ /* @__PURE__ */ l(
676
+ "div",
677
+ {
678
+ ref: H,
679
+ className: "inline-flex items-center justify-between gap-2 px-4 py-2.5 cursor-pointer transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]",
680
+ onClick: () => Ne(!k),
681
+ style: {
682
+ fontFamily: "var(--font-sans)",
683
+ backgroundColor: "var(--primary-foreground)",
684
+ borderRadius: k ? "8px 8px 0 0" : "8px"
685
+ // Rounded top corners when open, all corners when closed
686
+ },
687
+ children: [
688
+ /* @__PURE__ */ o("span", { children: it }),
689
+ k ? /* @__PURE__ */ o(Ie, { size: 16 }) : /* @__PURE__ */ o(ve, { size: 16 })
690
+ ]
691
+ }
692
+ ),
693
+ k && Nt(dt, document.body)
694
+ ] }),
695
+ O && /* @__PURE__ */ l(je, { children: [
696
+ /* @__PURE__ */ o("div", { className: "h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0" }),
697
+ /* @__PURE__ */ o("div", { className: "flex-shrink-0 mt-[1.5rem]", children: /* @__PURE__ */ o(
698
+ Ot,
699
+ {
700
+ dateRangePicker: O.dateRangePicker,
701
+ onWeekToDate: O.onWeekToDate,
702
+ exportConfig: O.exportConfig,
703
+ filterChipsConfig: O.filterChipsConfig,
704
+ trailingActions: O.trailingActions
705
+ }
706
+ ) })
707
+ ] })
708
+ ] })
709
+ }
710
+ ),
711
+ d.length > 0 && A.length > 0 ? /* @__PURE__ */ l(
712
+ mt,
713
+ {
714
+ sensors: Xe,
715
+ collisionDetection: ht,
716
+ onDragStart: Qe,
717
+ onDragEnd: qe,
718
+ children: [
719
+ /* @__PURE__ */ l("div", { className: "rounded-t-[14px]", style: {
720
+ border: "1px solid rgba(52, 58, 64, 0.12)",
721
+ borderBottom: "1px solid rgba(52, 58, 64, 0.12)",
722
+ overflow: "hidden",
723
+ background: "var(--primary-foreground)",
724
+ position: "relative",
725
+ top: "0.5rem"
726
+ }, children: [
727
+ z && /* @__PURE__ */ o("div", { style: {
728
+ position: "absolute",
729
+ inset: 0,
730
+ background: "rgba(255, 255, 255, 0.9)",
731
+ backdropFilter: "blur(2px)",
732
+ zIndex: 20,
733
+ display: "flex",
734
+ flexDirection: "column",
735
+ alignItems: "center",
736
+ justifyContent: "center",
737
+ borderRadius: "14px"
738
+ }, children: /* @__PURE__ */ l("div", { style: {
739
+ display: "flex",
740
+ flexDirection: "column",
741
+ alignItems: "center",
742
+ gap: "12px"
743
+ }, children: [
744
+ /* @__PURE__ */ o("p", { style: {
745
+ fontSize: "13px",
746
+ color: "rgba(30, 33, 37, 0.6)",
747
+ margin: 0
748
+ }, children: "Loading..." }),
749
+ /* @__PURE__ */ o(
750
+ Tt,
751
+ {
752
+ src: "/BrandLoading.gif",
753
+ alt: "Loading",
754
+ width: 50,
755
+ height: 50,
756
+ unoptimized: !0,
757
+ className: "mt-1"
758
+ }
759
+ )
760
+ ] }) }),
761
+ /* @__PURE__ */ o("div", { className: "overflow-x-auto custom-thin-scrollbar-hidden", ref: Ye, style: { maxHeight: "500px", overflowY: "auto", position: "relative", zIndex: 1 }, children: /* @__PURE__ */ l("table", { style: {
762
+ width: "100%",
763
+ borderCollapse: "collapse",
764
+ fontSize: "13px",
765
+ fontFamily: "var(--font-sans)"
766
+ }, children: [
767
+ /* @__PURE__ */ l("thead", { children: [
768
+ /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o(
769
+ xt,
770
+ {
771
+ items: f,
772
+ strategy: yt,
773
+ children: A.map((e) => /* @__PURE__ */ o(lt, { column: e, isHeaderRow: !0 }, `header-${x(e)}`))
774
+ }
775
+ ) }),
776
+ at && /* @__PURE__ */ o("tr", { children: A.map((e) => {
777
+ const t = x(e), r = e.filterable === !0;
778
+ return /* @__PURE__ */ o(
779
+ "th",
780
+ {
781
+ style: {
782
+ padding: "8px 14px",
783
+ background: "var(--primary-foreground)",
784
+ borderBottom: "1px solid rgba(52, 58, 64, 0.10)",
785
+ position: "sticky",
786
+ top: "41px",
787
+ zIndex: 10,
788
+ width: e.width || "auto",
789
+ fontFamily: "var(--font-sans)"
790
+ },
791
+ children: r ? /* @__PURE__ */ l("div", { style: { position: "relative" }, children: [
792
+ /* @__PURE__ */ o(
793
+ "input",
794
+ {
795
+ type: "text",
796
+ placeholder: "Filter...",
797
+ value: M[t] || "",
798
+ onChange: (n) => {
799
+ n.stopPropagation(), Ee(t, n.target.value);
800
+ },
801
+ onKeyDown: (n) => n.stopPropagation(),
802
+ onMouseDown: (n) => n.stopPropagation(),
803
+ style: {
804
+ width: "100%",
805
+ padding: "4px 8px 4px 26px",
806
+ fontSize: "11.5px",
807
+ border: "1px solid rgba(52, 58, 64, 0.16)",
808
+ borderRadius: "6px",
809
+ background: "var(--primary-foreground)",
810
+ color: "rgba(30, 33, 37, 0.78)",
811
+ outline: "none",
812
+ fontFamily: "var(--font-sans)"
813
+ },
814
+ onFocus: (n) => {
815
+ n.target.style.borderColor = "rgba(231, 212, 162, 0.65)", n.target.style.background = "var(--primary-foreground)";
816
+ },
817
+ onBlur: (n) => {
818
+ n.target.style.borderColor = "rgba(52, 58, 64, 0.16)", n.target.style.background = "var(--primary-foreground)";
819
+ },
820
+ autoComplete: "off"
821
+ }
822
+ ),
823
+ /* @__PURE__ */ o(
824
+ Pe,
825
+ {
826
+ size: 11,
827
+ style: {
828
+ position: "absolute",
829
+ left: "8px",
830
+ top: "50%",
831
+ transform: "translateY(-50%)",
832
+ color: "rgba(30, 33, 37, 0.42)",
833
+ pointerEvents: "none"
834
+ }
835
+ }
836
+ )
837
+ ] }) : /* @__PURE__ */ o("div", { className: "h-[34px]" })
838
+ },
839
+ `filter-${t}`
840
+ );
841
+ }) })
842
+ ] }),
843
+ /* @__PURE__ */ o("tbody", { children: !z && ae.length === 0 ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o(
844
+ "td",
845
+ {
846
+ colSpan: A.length,
847
+ style: {
848
+ padding: "32px",
849
+ textAlign: "center",
850
+ color: "rgba(30, 33, 37, 0.42)",
851
+ fontSize: "12px",
852
+ fontFamily: "var(--font-sans)"
853
+ },
854
+ children: "No results found"
855
+ }
856
+ ) }) : !z && ae.length > 0 ? ae.map((e, t) => /* @__PURE__ */ o(
857
+ "tr",
858
+ {
859
+ "data-row-id": e.id || t,
860
+ style: {
861
+ borderBottom: "1px solid rgba(52, 58, 64, 0.08)",
862
+ cursor: p ? "pointer" : "default",
863
+ transition: "background 0.15s ease"
864
+ },
865
+ onClick: p ? (r) => {
866
+ r.stopPropagation(), p(e, t);
867
+ } : void 0,
868
+ onMouseEnter: (r) => {
869
+ r.currentTarget.style.background = "rgba(231, 212, 162, 0.12)";
870
+ },
871
+ onMouseLeave: (r) => {
872
+ r.currentTarget.style.background = "transparent";
873
+ },
874
+ children: A.map((r) => {
875
+ const n = x(r), s = e[n], a = r.render ? r.render(s, e) : s, i = r.width && r.width !== "auto", u = typeof a == "string" && a.trim() !== "", U = i && u, X = U ? /* @__PURE__ */ o(w, { content: a, children: a }) : a;
876
+ return /* @__PURE__ */ o(
877
+ "td",
878
+ {
879
+ style: {
880
+ padding: "10px 14px",
881
+ color: "rgba(30, 33, 37, 0.78)",
882
+ fontSize: "13px",
883
+ borderRight: "1px solid rgba(52, 58, 64, 0.04)",
884
+ width: r.width || "auto",
885
+ fontFamily: "var(--font-sans)",
886
+ ...U && { maxWidth: r.width || "200px", overflow: "hidden" }
887
+ },
888
+ children: X
889
+ },
890
+ n
891
+ );
892
+ })
893
+ },
894
+ t
895
+ )) : null })
896
+ ] }) })
897
+ ] }),
898
+ /* @__PURE__ */ o(bt, { children: $e ? /* @__PURE__ */ o("div", { className: "bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
899
+ /* @__PURE__ */ o(Re, { size: 14, className: "text-[var(--text-faint)]" }),
900
+ /* @__PURE__ */ o("span", { className: "text-sm font-semibold text-[var(--text-ink)]", children: $e.label })
901
+ ] }) }) : null })
902
+ ]
903
+ }
904
+ ) : null,
905
+ (Z ? C > 0 : se.length > 0) && /* @__PURE__ */ o("div", { className: "border-t border-gray-200 rounded-b-[14px]", style: { backgroundColor: "var(--primary-foreground)" }, children: /* @__PURE__ */ o(
906
+ zt,
907
+ {
908
+ page: pe,
909
+ pageSizeOptions: [5, 10, 20, 50, 100],
910
+ pageSize: ee,
911
+ totalCount: Z ? C : se.length,
912
+ currentDataLength: ae.length,
913
+ onPageChange: te,
914
+ onPageSizeChange: E ? (e) => {
915
+ we(e), te(1);
916
+ } : (e) => {
917
+ we(e), te(1);
918
+ },
919
+ showPageSizeSelector: !0
920
+ }
921
+ ) })
922
+ ] });
923
+ }
924
+ function Wt({
925
+ title: g = "Summary stats",
926
+ stats: d = [],
927
+ columns: y = 2
928
+ }) {
929
+ return /* @__PURE__ */ l("div", { style: { fontFamily: "system-ui, -apple-system, sans-serif" }, children: [
930
+ /* @__PURE__ */ o(
931
+ "div",
932
+ {
933
+ className: "text-[11px] tracking-[0.14em] uppercase mb-[10px]",
934
+ style: { color: "rgba(30, 33, 37, 0.42)", fontWeight: 650 },
935
+ children: g
936
+ }
937
+ ),
938
+ /* @__PURE__ */ o(
939
+ "div",
940
+ {
941
+ style: {
942
+ display: "grid",
943
+ gridTemplateColumns: `repeat(${y}, minmax(0, 1fr))`,
944
+ gap: "10px"
945
+ },
946
+ children: d.map((p, C) => /* @__PURE__ */ l(
947
+ "div",
948
+ {
949
+ style: {
950
+ position: "relative",
951
+ border: "1px solid rgba(52, 58, 64, 0.12)",
952
+ borderRadius: "12px",
953
+ background: "rgba(255, 255, 255, 0.72)",
954
+ padding: p.accentColor ? "10px 10px 10px 14px" : "10px",
955
+ minHeight: "62px",
956
+ display: "flex",
957
+ flexDirection: "column",
958
+ justifyContent: "center",
959
+ gap: "5px",
960
+ overflow: "hidden"
961
+ },
962
+ children: [
963
+ p.accentColor && /* @__PURE__ */ o(
964
+ "div",
965
+ {
966
+ style: {
967
+ position: "absolute",
968
+ left: 0,
969
+ top: 0,
970
+ bottom: 0,
971
+ width: "4px",
972
+ background: p.accentColor,
973
+ borderTopLeftRadius: "12px",
974
+ borderBottomLeftRadius: "12px"
975
+ }
976
+ }
977
+ ),
978
+ /* @__PURE__ */ o(
979
+ "div",
980
+ {
981
+ className: "text-[10px] tracking-[0.14em] uppercase",
982
+ style: {
983
+ color: "rgba(30, 33, 37, 0.42)",
984
+ fontWeight: 650,
985
+ lineHeight: 1.1,
986
+ whiteSpace: "nowrap",
987
+ overflow: "hidden",
988
+ textOverflow: "ellipsis"
989
+ },
990
+ children: p.label
991
+ }
992
+ ),
993
+ /* @__PURE__ */ o(
994
+ "div",
995
+ {
996
+ style: {
997
+ fontSize: "13px",
998
+ color: p.valueStyle === "muted" ? "rgba(30, 33, 37, 0.56)" : "rgba(30, 33, 37, 0.78)",
999
+ fontWeight: 700,
1000
+ lineHeight: 1.15,
1001
+ whiteSpace: "nowrap",
1002
+ overflow: "hidden",
1003
+ textOverflow: "ellipsis",
1004
+ fontFamily: p.valueStyle === "mono" ? "ui-monospace, monospace" : "inherit"
1005
+ },
1006
+ children: p.value
1007
+ }
1008
+ ),
1009
+ p.subtext && /* @__PURE__ */ o(
1010
+ "div",
1011
+ {
1012
+ style: {
1013
+ fontSize: "11px",
1014
+ color: "rgba(30, 33, 37, 0.52)",
1015
+ lineHeight: 1.15,
1016
+ whiteSpace: "nowrap",
1017
+ overflow: "hidden",
1018
+ textOverflow: "ellipsis"
1019
+ },
1020
+ children: p.subtext
1021
+ }
1022
+ )
1023
+ ]
1024
+ },
1025
+ C
1026
+ ))
1027
+ }
1028
+ )
1029
+ ] });
1030
+ }
2
1031
  export {
3
- e as DataTable,
4
- s as DataTableFilters,
5
- l as SummaryStatsPanel
1032
+ Bt as DataTable,
1033
+ Ot as DataTableFilters,
1034
+ Wt as SummaryStatsPanel
6
1035
  };
7
1036
  //# sourceMappingURL=data.es.js.map