@epam/statgpt-ui-components 0.5.0-rc.12 → 0.5.0-rc.13

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 (3) hide show
  1. package/index.js +1 -1
  2. package/index.mjs +623 -582
  3. package/package.json +2 -2
package/index.mjs CHANGED
@@ -1,63 +1,63 @@
1
- import { jsx as r, jsxs as o, Fragment as H } from "react/jsx-runtime";
2
- import * as oe from "react";
3
- import { useEffect as M, useState as j, useRef as B, useCallback as P, useMemo as W, createContext as U, useContext as V } from "react";
4
- import f from "classnames";
5
- import { IconX as de, IconCalendarEvent as ue, IconSquareCheckFilled as me, IconChevronDown as he, IconGripVertical as Q, IconChevronRight as K, IconDatabase as fe } from "@tabler/icons-react";
6
- import { extendTailwindMerge as pe } from "tailwind-merge";
7
- import ge from "react-flatpickr";
8
- import { CalendarResolution as O } from "@epam/statgpt-shared-toolkit";
9
- import { useFloating as X, useRole as xe, useDismiss as Z, useInteractions as J, FloatingPortal as be, FloatingOverlay as Ne, FloatingFocusManager as Ce, autoUpdate as ve, offset as ye, flip as we, shift as Ee, useClick as Se } from "@floating-ui/react";
10
- import { useSensors as Ie, useSensor as ke, PointerSensor as De, DndContext as Re, closestCenter as Le, DragOverlay as Fe } from "@dnd-kit/core";
11
- import { useSortable as Oe, SortableContext as _e, verticalListSortingStrategy as Ae, arrayMove as Pe } from "@dnd-kit/sortable";
12
- import { CSS as Te } from "@dnd-kit/utilities";
13
- const ee = () => /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ r("div", { className: "loader" }) }), te = ({
1
+ import { jsx as s, jsxs as c, Fragment as U } from "react/jsx-runtime";
2
+ import * as ue from "react";
3
+ import { useEffect as R, useState as Y, useRef as W, useCallback as T, useMemo as V, useId as me, createContext as Q, useContext as K } from "react";
4
+ import p from "classnames";
5
+ import { IconX as he, IconCalendarEvent as fe, IconSquareCheckFilled as pe, IconChevronDown as ge, IconGripVertical as X, IconChevronRight as Z, IconDatabase as xe } from "@tabler/icons-react";
6
+ import { extendTailwindMerge as be } from "tailwind-merge";
7
+ import Ne from "react-flatpickr";
8
+ import { CalendarResolution as A } from "@epam/statgpt-shared-toolkit";
9
+ import { useFloating as J, useRole as we, useDismiss as ee, useInteractions as te, FloatingPortal as ve, FloatingOverlay as ye, FloatingFocusManager as Ce, autoUpdate as Ee, offset as Se, flip as Ie, size as ke, shift as De, useClick as Le } from "@floating-ui/react";
10
+ import { useSensors as Re, useSensor as Oe, PointerSensor as Fe, DndContext as _e, closestCenter as Ae, DragOverlay as Me } from "@dnd-kit/core";
11
+ import { useSortable as Pe, SortableContext as Te, verticalListSortingStrategy as je, arrayMove as Ye } from "@dnd-kit/sortable";
12
+ import { CSS as Ge } from "@dnd-kit/utilities";
13
+ const ne = () => /* @__PURE__ */ s("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ s("div", { className: "loader" }) }), re = ({
14
14
  title: e,
15
15
  btnClassNames: t,
16
16
  iconWidth: n,
17
- iconHeight: s,
18
- onClick: l
19
- }) => /* @__PURE__ */ r(
17
+ iconHeight: r,
18
+ onClick: a
19
+ }) => /* @__PURE__ */ s(
20
20
  "button",
21
21
  {
22
22
  type: "button",
23
23
  "aria-label": "button",
24
24
  className: t,
25
25
  title: e,
26
- onClick: l,
27
- children: /* @__PURE__ */ r(de, { height: s || 20, width: n || 20 })
26
+ onClick: a,
27
+ children: /* @__PURE__ */ s(he, { height: r || 20, width: n || 20 })
28
28
  }
29
29
  );
30
- var F = /* @__PURE__ */ ((e) => (e.ERROR = "error", e.SUCCESS = "success", e.IN_PROGRESS = "in_progress", e))(F || {});
31
- const mt = ({
30
+ var _ = /* @__PURE__ */ ((e) => (e.ERROR = "error", e.SUCCESS = "success", e.IN_PROGRESS = "in_progress", e))(_ || {});
31
+ const xt = ({
32
32
  alertDetails: e,
33
33
  successIcon: t,
34
34
  errorIcon: n,
35
- onClose: s,
36
- closeButtonTitle: l
35
+ onClose: r,
36
+ closeButtonTitle: a
37
37
  }) => {
38
- const a = () => e?.type === F.IN_PROGRESS ? "alert-in-progress" : e?.type === F.SUCCESS ? "alert-success" : "alert-error";
39
- return M(() => {
40
- e?.type !== F.IN_PROGRESS && setTimeout(() => {
41
- s?.();
38
+ const l = () => e?.type === _.IN_PROGRESS ? "alert-in-progress" : e?.type === _.SUCCESS ? "alert-success" : "alert-error";
39
+ return R(() => {
40
+ e?.type !== _.IN_PROGRESS && setTimeout(() => {
41
+ r?.();
42
42
  }, 5e3);
43
- }, [e?.type, s]), /* @__PURE__ */ r(
43
+ }, [e?.type, r]), /* @__PURE__ */ s(
44
44
  "div",
45
45
  {
46
- className: f(
46
+ className: p(
47
47
  "alert alert-shadow fixed bottom-3 right-3 z-10",
48
- a()
48
+ l()
49
49
  ),
50
- children: /* @__PURE__ */ o("div", { className: "alert-content flex items-start", children: [
51
- /* @__PURE__ */ r("div", { className: "alert-icon", children: e?.type === F.IN_PROGRESS ? /* @__PURE__ */ r(ee, {}) : e?.type === F.SUCCESS ? t : n }),
52
- /* @__PURE__ */ o("div", { className: "flex max-w-[300px] flex-col gap-2", children: [
53
- /* @__PURE__ */ r("h3", { className: "truncate", children: e?.title }),
54
- e?.text && /* @__PURE__ */ r("div", { className: "alert-text truncate", title: e?.text, children: e?.text })
50
+ children: /* @__PURE__ */ c("div", { className: "alert-content flex items-start", children: [
51
+ /* @__PURE__ */ s("div", { className: "alert-icon", children: e?.type === _.IN_PROGRESS ? /* @__PURE__ */ s(ne, {}) : e?.type === _.SUCCESS ? t : n }),
52
+ /* @__PURE__ */ c("div", { className: "flex max-w-[300px] flex-col gap-2", children: [
53
+ /* @__PURE__ */ s("h3", { className: "truncate", children: e?.title }),
54
+ e?.text && /* @__PURE__ */ s("div", { className: "alert-text truncate", title: e?.text, children: e?.text })
55
55
  ] }),
56
- /* @__PURE__ */ r(te, { title: l, onClick: s })
56
+ /* @__PURE__ */ s(re, { title: a, onClick: r })
57
57
  ] })
58
58
  }
59
59
  );
60
- }, Me = pe({
60
+ }, ze = be({
61
61
  extend: {
62
62
  classGroups: {
63
63
  typography: [
@@ -74,416 +74,416 @@ const mt = ({
74
74
  }
75
75
  }
76
76
  });
77
- function R(...e) {
78
- return Me(f(...e));
77
+ function O(...e) {
78
+ return ze(p(...e));
79
79
  }
80
- const je = ({
80
+ const He = ({
81
81
  buttonClassName: e,
82
82
  textClassName: t,
83
83
  isLoading: n = !1,
84
- title: s,
85
- disabled: l,
86
- iconAfter: a,
84
+ title: r,
85
+ disabled: a,
86
+ iconAfter: l,
87
87
  iconBefore: d,
88
- onClick: u,
88
+ onClick: m,
89
89
  isSmallButton: h
90
90
  }) => {
91
- const m = R([
91
+ const u = O([
92
92
  h ? "font-semibold" : "",
93
- a ? "mr-2" : "",
93
+ l ? "mr-2" : "",
94
94
  d ? "ml-2" : "",
95
95
  t
96
96
  ]);
97
- return /* @__PURE__ */ o(
97
+ return /* @__PURE__ */ c(
98
98
  "button",
99
99
  {
100
100
  type: "button",
101
- className: f(
101
+ className: p(
102
102
  "base-button",
103
103
  e,
104
104
  h ? "small-button" : ""
105
105
  ),
106
- disabled: l || n,
106
+ disabled: a || n,
107
107
  "aria-label": "button",
108
- onClick: (p) => u?.(p),
109
- title: s,
108
+ onClick: (f) => m?.(f),
109
+ title: r,
110
110
  children: [
111
111
  d,
112
- n && /* @__PURE__ */ r(ee, {}),
113
- s ? h ? /* @__PURE__ */ r("h4", { className: m, children: s }) : /* @__PURE__ */ r("h3", { className: m, children: s }) : null,
114
- a
112
+ n && /* @__PURE__ */ s(ne, {}),
113
+ r ? h ? /* @__PURE__ */ s("h4", { className: u, children: r }) : /* @__PURE__ */ s("h3", { className: u, children: r }) : null,
114
+ l
115
115
  ]
116
116
  }
117
117
  );
118
118
  };
119
- function Ye(e = 719) {
120
- const [t, n] = j(
119
+ function $e(e = 719) {
120
+ const [t, n] = Y(
121
121
  () => typeof window < "u" ? window.innerWidth < e : !1
122
122
  );
123
- return M(() => {
124
- const s = window.matchMedia(`(max-width: ${e}px)`), l = (a) => {
125
- n(a.matches);
123
+ return R(() => {
124
+ const r = window.matchMedia(`(max-width: ${e}px)`), a = (l) => {
125
+ n(l.matches);
126
126
  };
127
- return n(s.matches), s.addEventListener("change", l), () => s.removeEventListener("change", l);
127
+ return n(r.matches), r.addEventListener("change", a), () => r.removeEventListener("change", a);
128
128
  }, [e]), t;
129
129
  }
130
- function ht(e, t) {
131
- const n = B(null);
132
- return P(
133
- (...l) => {
130
+ function bt(e, t) {
131
+ const n = W(null);
132
+ return T(
133
+ (...a) => {
134
134
  n.current && clearTimeout(n.current), n.current = setTimeout(() => {
135
- e(...l);
135
+ e(...a);
136
136
  }, t);
137
137
  },
138
138
  [e, t]
139
139
  );
140
140
  }
141
- const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
141
+ const Nt = 24, wt = 24, q = 1e3, Be = 24, vt = ({
142
142
  label: e,
143
143
  onChange: t,
144
144
  value: n,
145
- options: s,
146
- calendarResolution: l = O.DAY,
147
- id: a,
145
+ options: r,
146
+ calendarResolution: a = A.DAY,
147
+ id: l,
148
148
  icon: d,
149
- isEndDate: u
149
+ isEndDate: m
150
150
  }) => {
151
- const h = B(null), m = Ye();
152
- M(() => {
153
- const b = h?.current;
154
- b && b.querySelector("input")?.setAttribute("aria-label", e);
151
+ const h = W(null), u = $e();
152
+ R(() => {
153
+ const N = h?.current;
154
+ N && N.querySelector("input")?.setAttribute("aria-label", e);
155
155
  }, [e]);
156
- const p = {
157
- ...s,
156
+ const f = {
157
+ ...r,
158
158
  disableMobile: !0,
159
- defaultDate: l === O.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
160
- }, g = (b, N, x) => {
161
- const c = `calendar__${l === O.MONTH ? "month" : "day"}`;
162
- x.calendarContainer && x.calendarContainer.classList.add(c);
163
- }, C = (b, N, x) => {
164
- if (l === O.MONTH && b.length > 0) {
165
- const c = s.minDate, i = s.maxDate, v = b[0].getFullYear(), k = x.calendarContainer, S = "flatpickr-disabled", y = k.querySelectorAll(
159
+ defaultDate: a === A.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
160
+ }, x = (N, v, b) => {
161
+ const o = `calendar__${a === A.MONTH ? "month" : "day"}`;
162
+ b.calendarContainer && b.calendarContainer.classList.add(o);
163
+ }, C = (N, v, b) => {
164
+ if (a === A.MONTH && N.length > 0) {
165
+ const o = r.minDate, i = r.maxDate, g = N[0].getFullYear(), w = b.calendarContainer, I = "flatpickr-disabled", y = w.querySelectorAll(
166
166
  ".flatpickr-monthSelect-month"
167
- ), w = k.querySelectorAll(
167
+ ), E = w.querySelectorAll(
168
168
  ".flatpickr-next-month"
169
- )[0], D = k.querySelectorAll(
169
+ )[0], D = w.querySelectorAll(
170
170
  ".flatpickr-prev-month"
171
171
  )[0];
172
- v === i.getFullYear() && w.classList.add(S), v === c.getFullYear() && D.classList.add(S), (v === c.getFullYear() || v === i.getFullYear()) && y.forEach((I) => {
173
- I.classList.remove(S);
174
- const E = new Date(I.getAttribute("aria-label")), L = E.getFullYear() === c.getFullYear() && E.getMonth() === c.getMonth(), Y = E.getFullYear() === i.getFullYear() && E.getMonth() === i.getMonth();
175
- L || Y || (E < c || E > i) && I.classList.add(S);
172
+ g === i.getFullYear() && E.classList.add(I), g === o.getFullYear() && D.classList.add(I), (g === o.getFullYear() || g === i.getFullYear()) && y.forEach((k) => {
173
+ k.classList.remove(I);
174
+ const S = new Date(k.getAttribute("aria-label")), F = S.getFullYear() === o.getFullYear() && S.getMonth() === o.getMonth(), G = S.getFullYear() === i.getFullYear() && S.getMonth() === i.getMonth();
175
+ F || G || (S < o || S > i) && k.classList.add(I);
176
176
  });
177
177
  }
178
178
  setTimeout(() => {
179
- const c = x.calendarContainer, i = x._input?.getBoundingClientRect();
180
- c && (c.style.top = `${i.top - c.offsetHeight - 8}px`, c.style.width = `${c.style.width}px`, u ? (c.style.right = `${window.innerWidth - i.right - (m ? Ge : 0)}px`, c.style.left = "auto") : c.style.left = `${i.left}px`);
179
+ const o = b.calendarContainer, i = b._input?.getBoundingClientRect();
180
+ o && (o.style.top = `${i.top - o.offsetHeight - 8}px`, o.style.width = `${o.style.width}px`, m ? (o.style.right = `${window.innerWidth - i.right - (u ? Be : 0)}px`, o.style.left = "auto") : o.style.left = `${i.left}px`);
181
181
  }, 0);
182
182
  };
183
- return /* @__PURE__ */ o("div", { className: "calendar relative", ref: h, children: [
184
- /* @__PURE__ */ r("div", { className: "calendar-title mb-1", children: e }),
185
- /* @__PURE__ */ r(
183
+ return /* @__PURE__ */ c("div", { className: "calendar relative", ref: h, children: [
184
+ /* @__PURE__ */ s("div", { className: "calendar-title mb-1", children: e }),
185
+ /* @__PURE__ */ s(
186
186
  "label",
187
187
  {
188
- htmlFor: a,
188
+ htmlFor: l,
189
189
  className: "absolute right-[11px] top-[29px] cursor-pointer",
190
- children: d || /* @__PURE__ */ r(ue, {})
190
+ children: d || /* @__PURE__ */ s(fe, {})
191
191
  }
192
192
  ),
193
- /* @__PURE__ */ r(
194
- ge,
193
+ /* @__PURE__ */ s(
194
+ Ne,
195
195
  {
196
- defaultValue: (l === O.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
197
- options: p,
198
- onChange: (b) => {
199
- t(b[0]);
196
+ defaultValue: (a === A.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
197
+ options: f,
198
+ onChange: (N) => {
199
+ t(N[0]);
200
200
  },
201
201
  onOpen: [C],
202
- onReady: [g],
203
- id: a
202
+ onReady: [x],
203
+ id: l
204
204
  }
205
205
  )
206
206
  ] });
207
- }, ne = ({
207
+ }, se = ({
208
208
  label: e,
209
209
  id: t,
210
210
  checked: n,
211
- checkboxIcon: s,
212
- onChange: l,
213
- disabled: a = !1,
211
+ checkboxIcon: r,
212
+ onChange: a,
213
+ disabled: l = !1,
214
214
  className: d,
215
- stopPropagation: u = !0
215
+ stopPropagation: m = !0
216
216
  }) => {
217
- const h = P(
218
- (g) => {
219
- u && g.stopPropagation();
217
+ const h = T(
218
+ (x) => {
219
+ m && x.stopPropagation();
220
220
  },
221
- [u]
222
- ), m = P(
223
- (g) => {
224
- u && g.stopPropagation(), l?.(t, g.target.checked);
221
+ [m]
222
+ ), u = T(
223
+ (x) => {
224
+ m && x.stopPropagation(), a?.(t, x.target.checked);
225
225
  },
226
- [l, t, u]
227
- ), p = () => {
226
+ [a, t, m]
227
+ ), f = () => {
228
228
  if (n)
229
- return s || /* @__PURE__ */ r(me, { className: "absolute size-4" });
229
+ return r || /* @__PURE__ */ s(pe, { className: "absolute size-4" });
230
230
  };
231
- return /* @__PURE__ */ o(
231
+ return /* @__PURE__ */ c(
232
232
  "label",
233
233
  {
234
234
  htmlFor: t,
235
235
  onClick: h,
236
- className: R(
236
+ className: O(
237
237
  "flex min-w-0 items-center py-1 shrink-0",
238
- a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
238
+ l ? "cursor-not-allowed opacity-50" : "cursor-pointer",
239
239
  d
240
240
  ),
241
241
  children: [
242
- /* @__PURE__ */ r(
242
+ /* @__PURE__ */ s(
243
243
  "span",
244
244
  {
245
- className: f(
245
+ className: p(
246
246
  "checkbox-button relative flex size-[14px] items-center justify-center"
247
247
  ),
248
248
  "aria-hidden": !0,
249
- children: p()
249
+ children: f()
250
250
  }
251
251
  ),
252
- e ? /* @__PURE__ */ r(
252
+ e ? /* @__PURE__ */ s(
253
253
  "p",
254
254
  {
255
- className: f(
255
+ className: p(
256
256
  "checkbox-button-text text-neutrals-1000 min-w-0 ml-2 flex-1 truncate pr-2"
257
257
  ),
258
258
  title: e,
259
259
  children: e
260
260
  }
261
261
  ) : null,
262
- /* @__PURE__ */ r(
262
+ /* @__PURE__ */ s(
263
263
  "input",
264
264
  {
265
265
  id: t,
266
266
  type: "checkbox",
267
267
  checked: n,
268
- disabled: a,
269
- onChange: m,
268
+ disabled: l,
269
+ onChange: u,
270
270
  className: "hidden"
271
271
  }
272
272
  )
273
273
  ]
274
274
  }
275
275
  );
276
- }, xt = ({
276
+ }, yt = ({
277
277
  title: e,
278
278
  icon: t,
279
279
  children: n,
280
- value: s
280
+ value: r
281
281
  }) => {
282
- const [l, a] = j(!1);
283
- return /* @__PURE__ */ o(
282
+ const [a, l] = Y(!1);
283
+ return /* @__PURE__ */ c(
284
284
  "div",
285
285
  {
286
- className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${l ? "collapsible-block-open" : ""}`,
286
+ className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${a ? "collapsible-block-open" : ""}`,
287
287
  children: [
288
- /* @__PURE__ */ o(
288
+ /* @__PURE__ */ c(
289
289
  "div",
290
290
  {
291
291
  className: "collapsible-block-title flex cursor-pointer items-center py-4",
292
- onClick: () => a(!l),
292
+ onClick: () => l(!a),
293
293
  children: [
294
- /* @__PURE__ */ r("div", { className: `${l ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ r(he, { className: "mr-3 size-5" }) }),
295
- /* @__PURE__ */ o("div", { className: "flex flex-1 items-center justify-between", children: [
296
- /* @__PURE__ */ r("span", { children: e }),
297
- s && /* @__PURE__ */ r("p", { className: "body-1 text-neutrals-800", children: s })
294
+ /* @__PURE__ */ s("div", { className: `${a ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ s(ge, { className: "mr-3 size-5" }) }),
295
+ /* @__PURE__ */ c("div", { className: "flex flex-1 items-center justify-between", children: [
296
+ /* @__PURE__ */ s("span", { children: e }),
297
+ r && /* @__PURE__ */ s("p", { className: "body-1 text-neutrals-800", children: r })
298
298
  ] })
299
299
  ]
300
300
  }
301
301
  ),
302
- l && /* @__PURE__ */ r("div", { className: "collapsible-block-content pb-4", children: n })
302
+ a && /* @__PURE__ */ s("div", { className: "collapsible-block-content pb-4", children: n })
303
303
  ]
304
304
  }
305
305
  );
306
- }, bt = ({ text: e, highlightText: t }) => {
307
- const n = W(() => {
308
- const s = [];
306
+ }, Ct = ({ text: e, highlightText: t }) => {
307
+ const n = V(() => {
308
+ const r = [];
309
309
  if (!t)
310
310
  return [{ id: 0, text: e, highlight: !1 }];
311
- const l = t?.toLowerCase() || "", a = e?.toLowerCase()?.split(l) || "";
312
- for (let d = 0, u = 0; d < a?.length; d++) {
313
- const h = a?.[d], m = h.length;
314
- h !== "" && s.push({
315
- id: s.length,
311
+ const a = t?.toLowerCase() || "", l = e?.toLowerCase()?.split(a) || "";
312
+ for (let d = 0, m = 0; d < l?.length; d++) {
313
+ const h = l?.[d], u = h.length;
314
+ h !== "" && r.push({
315
+ id: r.length,
316
316
  highlight: !1,
317
317
  text: e?.substring(
318
- u,
319
- u + m
318
+ m,
319
+ m + u
320
320
  )
321
- }), u += m, d !== a?.length - 1 && (s.push({
322
- id: s.length,
321
+ }), m += u, d !== l?.length - 1 && (r.push({
322
+ id: r.length,
323
323
  highlight: !0,
324
324
  text: e?.substring(
325
- u,
326
- u + t.length
325
+ m,
326
+ m + t.length
327
327
  )
328
- }), u += t.length);
328
+ }), m += t.length);
329
329
  }
330
- return s;
330
+ return r;
331
331
  }, [t, e]);
332
- return /* @__PURE__ */ r(H, { children: n.map((s) => /* @__PURE__ */ r(
332
+ return /* @__PURE__ */ s(U, { children: n.map((r) => /* @__PURE__ */ s(
333
333
  "span",
334
334
  {
335
- className: f(s?.highlight && "bg-highlight"),
336
- children: s?.text
335
+ className: p(r?.highlight && "bg-highlight"),
336
+ children: r?.text
337
337
  },
338
- s?.id
338
+ r?.id
339
339
  )) });
340
- }, Nt = ({
340
+ }, Et = ({
341
341
  icon: e,
342
342
  onClick: t,
343
343
  buttonClassName: n,
344
- disabled: s,
345
- title: l,
346
- isBaseIconStyles: a = !0
347
- }) => /* @__PURE__ */ r(
344
+ disabled: r,
345
+ title: a,
346
+ isBaseIconStyles: l = !0
347
+ }) => /* @__PURE__ */ s(
348
348
  "button",
349
349
  {
350
350
  type: "button",
351
- className: f(
352
- a && "base-icon-button",
351
+ className: p(
352
+ l && "base-icon-button",
353
353
  n
354
354
  ),
355
355
  onClick: (d) => t?.(d),
356
- disabled: s,
357
- title: l,
356
+ disabled: r,
357
+ title: a,
358
358
  "aria-label": "button",
359
359
  children: e
360
360
  }
361
- ), ze = ({
361
+ ), We = ({
362
362
  value: e,
363
363
  inputId: t,
364
364
  placeholder: n = "",
365
- cssClass: s = "",
366
- type: l = "text",
367
- disabled: a,
365
+ cssClass: r = "",
366
+ type: a = "text",
367
+ disabled: l,
368
368
  readonly: d,
369
- onChange: u,
369
+ onChange: m,
370
370
  onKeyDown: h,
371
- onFocus: m,
372
- onBlur: p
371
+ onFocus: u,
372
+ onBlur: f
373
373
  }) => {
374
- const g = f(
374
+ const x = p(
375
375
  "truncate outline-none shadow-none body-1",
376
- s,
376
+ r,
377
377
  d ? "pointer-events-none" : ""
378
378
  );
379
- return /* @__PURE__ */ r(
379
+ return /* @__PURE__ */ s(
380
380
  "input",
381
381
  {
382
- type: l,
382
+ type: a,
383
383
  autoComplete: "off",
384
384
  id: t,
385
385
  placeholder: n,
386
386
  value: e || "",
387
387
  title: e ? String(e) : "",
388
- disabled: a,
389
- className: g,
388
+ disabled: l,
389
+ className: x,
390
390
  onKeyDown: h,
391
- onFocus: m,
392
- onBlur: p,
393
- onChange: (C) => u?.(C.currentTarget.value)
391
+ onFocus: u,
392
+ onBlur: f,
393
+ onChange: (C) => m?.(C.currentTarget.value)
394
394
  }
395
395
  );
396
- }, Ct = ({
396
+ }, St = ({
397
397
  iconBeforeInput: e,
398
398
  iconAfterInput: t,
399
399
  containerClasses: n,
400
- cssClass: s,
401
- ...l
402
- }) => /* @__PURE__ */ o("div", { className: f("input w-full flex flex-row", n), children: [
400
+ cssClass: r,
401
+ ...a
402
+ }) => /* @__PURE__ */ c("div", { className: p("input w-full flex flex-row", n), children: [
403
403
  e,
404
- /* @__PURE__ */ r(
405
- ze,
404
+ /* @__PURE__ */ s(
405
+ We,
406
406
  {
407
- cssClass: f(
407
+ cssClass: p(
408
408
  "border-0 bg-transparent p-0 h-full shadow-none flex-1 min-w-0 rounded-none",
409
- s
409
+ r
410
410
  ),
411
- ...l
411
+ ...a
412
412
  }
413
413
  ),
414
414
  t
415
- ] }), vt = ({
415
+ ] }), It = ({
416
416
  url: e,
417
417
  title: t,
418
418
  linkClassName: n = "",
419
- iconBefore: s,
420
- iconAfter: l
419
+ iconBefore: r,
420
+ iconAfter: a
421
421
  }) => {
422
- const a = f(
423
- l ? "mr-2" : "",
424
- s ? "ml-2" : ""
422
+ const l = p(
423
+ a ? "mr-2" : "",
424
+ r ? "ml-2" : ""
425
425
  );
426
- return /* @__PURE__ */ o(
426
+ return /* @__PURE__ */ c(
427
427
  "a",
428
428
  {
429
429
  href: e,
430
430
  target: "_blank",
431
431
  rel: "noopener noreferrer",
432
- className: f("base-link", n),
432
+ className: p("base-link", n),
433
433
  title: t,
434
434
  children: [
435
- s,
436
- /* @__PURE__ */ r("span", { className: a, children: t }),
437
- l
435
+ r,
436
+ /* @__PURE__ */ s("span", { className: l, children: t }),
437
+ a
438
438
  ]
439
439
  }
440
440
  );
441
- }, yt = ({ title: e, text: t, disabled: n, onClick: s }) => /* @__PURE__ */ r(
441
+ }, kt = ({ title: e, text: t, disabled: n, onClick: r }) => /* @__PURE__ */ s(
442
442
  "button",
443
443
  {
444
444
  type: "button",
445
- className: f(
445
+ className: p(
446
446
  "tag flex items-center justify-center",
447
447
  "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-neutrals-100"
448
448
  ),
449
449
  disabled: n,
450
- onClick: () => s?.(t || e),
450
+ onClick: () => r?.(t || e),
451
451
  "aria-label": "button",
452
- children: /* @__PURE__ */ r("h4", { children: e })
452
+ children: /* @__PURE__ */ s("h4", { children: e })
453
453
  }
454
- ), wt = ({
454
+ ), Dt = ({
455
455
  label: e,
456
456
  id: t,
457
457
  checked: n,
458
- radioIcon: s,
459
- description: l,
460
- onChange: a
458
+ radioIcon: r,
459
+ description: a,
460
+ onChange: l
461
461
  }) => {
462
- const d = P(
463
- (u) => {
464
- u.stopPropagation(), a?.(t, u.target.checked);
462
+ const d = T(
463
+ (m) => {
464
+ m.stopPropagation(), l?.(t, m.target.checked);
465
465
  },
466
- [a, t]
466
+ [l, t]
467
467
  );
468
- return /* @__PURE__ */ o(
468
+ return /* @__PURE__ */ c(
469
469
  "label",
470
470
  {
471
471
  className: "flex min-w-0 cursor-pointer flex-col py-[6px]",
472
472
  htmlFor: t,
473
473
  children: [
474
- /* @__PURE__ */ o("p", { className: "radio-label flex min-w-0 items-center", children: [
475
- /* @__PURE__ */ r(
474
+ /* @__PURE__ */ c("p", { className: "radio-label flex min-w-0 items-center", children: [
475
+ /* @__PURE__ */ s(
476
476
  "span",
477
477
  {
478
- className: f(
478
+ className: p(
479
479
  "flex justify-center items-center w-4 h-4 mr-2 relative",
480
480
  "radio-button",
481
481
  n ? "radio-button-active" : ""
482
482
  ),
483
- children: n && s
483
+ children: n && r
484
484
  }
485
485
  ),
486
- e && /* @__PURE__ */ r(
486
+ e && /* @__PURE__ */ s(
487
487
  "span",
488
488
  {
489
489
  className: "radio-title body-1 min-w-0 flex-1 truncate pr-2 text-neutrals-1000",
@@ -492,15 +492,15 @@ const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
492
492
  }
493
493
  )
494
494
  ] }),
495
- l && /* @__PURE__ */ r(
495
+ a && /* @__PURE__ */ s(
496
496
  "span",
497
497
  {
498
498
  className: "radio-description body-2 ml-6 flex w-auto items-center text-neutrals-800",
499
- title: l,
500
- children: l
499
+ title: a,
500
+ children: a
501
501
  }
502
502
  ),
503
- /* @__PURE__ */ r(
503
+ /* @__PURE__ */ s(
504
504
  "input",
505
505
  {
506
506
  type: "radio",
@@ -514,175 +514,216 @@ const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
514
514
  }
515
515
  );
516
516
  };
517
- var A = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(A || {}), z = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))(z || {});
518
- const $e = ({
517
+ var P = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(P || {}), $ = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))($ || {});
518
+ const Ve = ({
519
519
  portalId: e,
520
- state: t = A.Opened,
520
+ state: t = P.Opened,
521
521
  heading: n,
522
- size: s,
523
- onClose: l,
524
- children: a,
522
+ size: r,
523
+ onClose: a,
524
+ children: l,
525
525
  overlayClassName: d,
526
- containerClassName: u,
526
+ containerClassName: m,
527
527
  dividers: h = !0,
528
- closeButtonTitle: m
528
+ closeButtonTitle: u
529
529
  }) => {
530
- const { refs: p, context: g } = X({
531
- open: t !== A.Closed && !!t,
532
- onOpenChange: l
533
- }), C = xe(g, { role: "dialog" }), b = Z(g, { outsidePress: !0 }), { getFloatingProps: N } = J([C, b]), x = P(
534
- (c) => {
535
- c?.preventDefault(), c?.stopPropagation(), l();
530
+ const { refs: f, context: x } = J({
531
+ open: t !== P.Closed && !!t,
532
+ onOpenChange: a
533
+ }), C = we(x, { role: "dialog" }), N = ee(x, { outsidePress: !0 }), { getFloatingProps: v } = te([C, N]), b = T(
534
+ (o) => {
535
+ o?.preventDefault(), o?.stopPropagation(), a();
536
536
  },
537
- [l]
537
+ [a]
538
538
  );
539
- return /* @__PURE__ */ r(be, { id: e, children: t !== A.Closed && /* @__PURE__ */ r(
540
- Ne,
539
+ return /* @__PURE__ */ s(ve, { id: e, children: t !== P.Closed && /* @__PURE__ */ s(
540
+ ye,
541
541
  {
542
- className: f(
542
+ className: p(
543
543
  "z-modal flex items-center justify-center bg-blackout p-4",
544
544
  d
545
545
  ),
546
- children: /* @__PURE__ */ r(Ce, { context: g, children: /* @__PURE__ */ o(
546
+ children: /* @__PURE__ */ s(Ce, { context: x, children: /* @__PURE__ */ c(
547
547
  "div",
548
548
  {
549
- className: f(
549
+ className: p(
550
550
  "relative max-h-full modal rounded bg-white flex flex-col shadow w-full",
551
- s === z.LG && "max-w-[65%]",
552
- s === z.SM && "max-w-[30%]",
551
+ r === $.LG && "max-w-[65%]",
552
+ r === $.SM && "max-w-[30%]",
553
553
  h && "divide-neutrals-400 divide-y",
554
- u,
554
+ m,
555
555
  "sm:w-full sm:max-w-full sm:px-4 sm:py-6"
556
556
  ),
557
- ref: p.setFloating,
558
- ...N({
559
- onClick(c) {
560
- c.stopPropagation();
557
+ ref: f.setFloating,
558
+ ...v({
559
+ onClick(o) {
560
+ o.stopPropagation();
561
561
  }
562
562
  }),
563
563
  children: [
564
- /* @__PURE__ */ o("div", { className: "modal-heading mb-2 flex flex-row items-center justify-between px-6 py-3 sm:p-0 sm:pb-2", children: [
565
- n && (typeof n == "string" ? /* @__PURE__ */ r("h2", { className: "modal-heading-title sm:h3 mr-3 min-w-0 flex-1", children: n }) : n),
566
- /* @__PURE__ */ r(
567
- te,
564
+ /* @__PURE__ */ c("div", { className: "modal-heading mb-2 flex flex-row items-center justify-between px-6 py-3 sm:p-0 sm:pb-2", children: [
565
+ n && (typeof n == "string" ? /* @__PURE__ */ s("h2", { className: "modal-heading-title sm:h3 mr-3 min-w-0 flex-1", children: n }) : n),
566
+ /* @__PURE__ */ s(
567
+ re,
568
568
  {
569
- title: m,
570
- onClick: x,
569
+ title: u,
570
+ onClick: b,
571
571
  btnClassNames: "sm:h-[24px] sm:w-[24px] sm:top-4"
572
572
  }
573
573
  )
574
574
  ] }),
575
- a.map((c) => c)
575
+ l.map((o) => o)
576
576
  ]
577
577
  }
578
578
  ) })
579
579
  }
580
580
  ) });
581
- }, Et = (e) => e.state === A.Closed ? null : /* @__PURE__ */ r($e, { ...e }), St = ({
581
+ }, Lt = (e) => e.state === P.Closed ? null : /* @__PURE__ */ s(Ve, { ...e }), z = "statgpt-dropdown-open", L = 8, qe = {
582
+ name: "keepDropdownWithinViewport",
583
+ fn({ y: e, rects: t }) {
584
+ if (typeof window > "u")
585
+ return {};
586
+ const n = document.documentElement.clientHeight || window.innerHeight, r = Math.min(
587
+ t.floating.height,
588
+ Math.max(0, n - L * 2)
589
+ ), a = L, l = n - r - L;
590
+ return {
591
+ y: Math.min(Math.max(e, a), Math.max(a, l))
592
+ };
593
+ }
594
+ }, Rt = ({
582
595
  triggerButton: e,
583
596
  options: t,
584
597
  content: n,
585
- selectedOption: s,
586
- disabled: l,
587
- containerClassName: a,
598
+ selectedOption: r,
599
+ disabled: a,
600
+ containerClassName: l,
588
601
  openedClassName: d,
589
- onOptionSelect: u
602
+ onOptionSelect: m
590
603
  }) => {
591
- const [h, m] = j(!1), { refs: p, floatingStyles: g, context: C } = X({
592
- open: h,
593
- onOpenChange: l ? void 0 : m,
604
+ const h = me(), [u, f] = Y(!1), { refs: x, floatingStyles: C, context: N } = J({
605
+ open: u,
606
+ onOpenChange: a ? void 0 : f,
594
607
  placement: "bottom-end",
595
- middleware: [ye(8), we(), Ee()],
596
- whileElementsMounted: ve
597
- }), b = Se(C), N = Z(C, { outsidePress: !0 }), { getReferenceProps: x, getFloatingProps: c } = J([
598
- b,
599
- N
608
+ strategy: "fixed",
609
+ middleware: [
610
+ Se(L),
611
+ Ie({ padding: L }),
612
+ ke({
613
+ padding: L,
614
+ apply({ availableHeight: g, elements: w }) {
615
+ w.floating.style.maxHeight = `${Math.max(
616
+ 0,
617
+ g
618
+ )}px`;
619
+ }
620
+ }),
621
+ De({ padding: L }),
622
+ qe
623
+ ],
624
+ whileElementsMounted: Ee
625
+ }), v = Le(N), b = ee(N, { outsidePress: !0 }), { getReferenceProps: o, getFloatingProps: i } = te([
626
+ v,
627
+ b
600
628
  ]);
601
- return /* @__PURE__ */ o(H, { children: [
602
- /* @__PURE__ */ r(
629
+ return R(() => {
630
+ u && window.dispatchEvent(
631
+ new CustomEvent(z, { detail: h })
632
+ );
633
+ }, [h, u]), R(() => {
634
+ const g = (w) => {
635
+ w instanceof CustomEvent && w.detail !== h && f(!1);
636
+ };
637
+ return window.addEventListener(z, g), () => {
638
+ window.removeEventListener(z, g);
639
+ };
640
+ }, [h]), R(() => {
641
+ a && f(!1);
642
+ }, [a]), /* @__PURE__ */ c(U, { children: [
643
+ /* @__PURE__ */ s(
603
644
  "div",
604
645
  {
605
- ref: p.setReference,
606
- ...x({
607
- onClick(i) {
608
- i.stopPropagation();
646
+ ref: x.setReference,
647
+ ...o({
648
+ onClick(g) {
649
+ g.stopPropagation();
609
650
  }
610
651
  }),
611
- className: f(a, h && d),
652
+ className: p(l, u && d),
612
653
  children: e
613
654
  }
614
655
  ),
615
- h && /* @__PURE__ */ o(
656
+ u && /* @__PURE__ */ c(
616
657
  "div",
617
658
  {
618
- ref: p.setFloating,
619
- style: g,
659
+ ref: x.setFloating,
660
+ style: { ...C, overflowY: "auto" },
620
661
  className: "dropdown-menu-shadow dropdown-container z-10 flex flex-col rounded bg-white",
621
- ...c(),
662
+ ...i(),
622
663
  children: [
623
664
  n && n,
624
- t && t.map((i) => /* @__PURE__ */ r(
665
+ t && t.map((g) => /* @__PURE__ */ s(
625
666
  "div",
626
667
  {
627
- onClick: (v) => {
628
- v.stopPropagation(), u?.(i.key), m(!1);
668
+ onClick: (w) => {
669
+ w.stopPropagation(), m?.(g.key), f(!1);
629
670
  },
630
- className: f(
671
+ className: p(
631
672
  "text-neutrals-900 body-3 cursor-pointer dropdown-item min-w-[200px]",
632
- s === i.key && "bg-hues-100"
673
+ r === g.key && "bg-hues-100"
633
674
  ),
634
- children: /* @__PURE__ */ o(
675
+ children: /* @__PURE__ */ c(
635
676
  "div",
636
677
  {
637
678
  className: "dropdown-item-text flex h-full items-center gap-x-2 p-2 hover:bg-hues-100",
638
- title: i.title,
679
+ title: g.title,
639
680
  children: [
640
- i.icon ? i.icon : null,
641
- /* @__PURE__ */ r("p", { children: i?.title })
681
+ g.icon ? g.icon : null,
682
+ /* @__PURE__ */ s("p", { children: g?.title })
642
683
  ]
643
684
  }
644
685
  )
645
686
  },
646
- i.key
687
+ g.key
647
688
  ))
648
689
  ]
649
690
  }
650
691
  )
651
692
  ] });
652
- }, It = ({ limitMessages: e, query: t }) => /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center justify-between bg-hues-100 px-2 py-1", children: [
653
- /* @__PURE__ */ r("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ r("div", { className: "flex flex-col", children: /* @__PURE__ */ o("div", { className: "flex gap-x-[4px]", children: [
654
- /* @__PURE__ */ o("span", { className: "h5 text-primary", children: [
693
+ }, Ot = ({ limitMessages: e, query: t }) => /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center justify-between bg-hues-100 px-2 py-1", children: [
694
+ /* @__PURE__ */ s("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ s("div", { className: "flex flex-col", children: /* @__PURE__ */ c("div", { className: "flex gap-x-[4px]", children: [
695
+ /* @__PURE__ */ c("span", { className: "h5 text-primary", children: [
655
696
  e?.excelFormatTitle,
656
697
  " "
657
698
  ] }),
658
- /* @__PURE__ */ r("span", { className: "body-3 text-neutrals-800", children: e?.excelFormatText })
699
+ /* @__PURE__ */ s("span", { className: "body-3 text-neutrals-800", children: e?.excelFormatText })
659
700
  ] }) }) }),
660
- /* @__PURE__ */ r("a", { href: t, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ o("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
701
+ /* @__PURE__ */ s("a", { href: t, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ c("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
661
702
  e?.dataExplorerIcon,
662
703
  e?.dataExplorer
663
704
  ] }) })
664
- ] }), kt = ({
705
+ ] }), Ft = ({
665
706
  limitMessages: e,
666
707
  isDownload: t,
667
708
  showAdvancedViewButton: n,
668
- onAdvancedViewClick: s,
669
- query: l
670
- }) => /* @__PURE__ */ o(
709
+ onAdvancedViewClick: r,
710
+ query: a
711
+ }) => /* @__PURE__ */ c(
671
712
  "div",
672
713
  {
673
- className: f(
714
+ className: p(
674
715
  "bg-semantic-warning-light px-2 py-1 flex justify-between flex-wrap items-center",
675
716
  e?.containerClassName
676
717
  ),
677
718
  children: [
678
- /* @__PURE__ */ o("div", { className: "flex items-center gap-x-2", children: [
679
- /* @__PURE__ */ r("span", { children: e?.warningIcon }),
680
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
681
- /* @__PURE__ */ o("div", { className: "flex gap-x-[4px]", children: [
682
- /* @__PURE__ */ o(
719
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-x-2", children: [
720
+ /* @__PURE__ */ s("span", { children: e?.warningIcon }),
721
+ /* @__PURE__ */ c("div", { className: "flex flex-col gap-1", children: [
722
+ /* @__PURE__ */ c("div", { className: "flex gap-x-[4px]", children: [
723
+ /* @__PURE__ */ c(
683
724
  "span",
684
725
  {
685
- className: f(
726
+ className: p(
686
727
  "text-primary h5",
687
728
  e?.largeQueryClassName
688
729
  ),
@@ -693,10 +734,10 @@ const $e = ({
693
734
  ]
694
735
  }
695
736
  ),
696
- /* @__PURE__ */ r(
737
+ /* @__PURE__ */ s(
697
738
  "span",
698
739
  {
699
- className: f(
740
+ className: p(
700
741
  "text-neutrals-800 body-3",
701
742
  e?.limitMessageClassName
702
743
  ),
@@ -704,10 +745,10 @@ const $e = ({
704
745
  }
705
746
  )
706
747
  ] }),
707
- t && /* @__PURE__ */ r(
748
+ t && /* @__PURE__ */ s(
708
749
  "span",
709
750
  {
710
- className: f(
751
+ className: p(
711
752
  "text-neutrals-800 body-3",
712
753
  e?.limitMessageClassName
713
754
  ),
@@ -716,10 +757,10 @@ const $e = ({
716
757
  )
717
758
  ] })
718
759
  ] }),
719
- n && /* @__PURE__ */ o(
760
+ n && /* @__PURE__ */ c(
720
761
  "span",
721
762
  {
722
- onClick: () => s?.(),
763
+ onClick: () => r?.(),
723
764
  className: "h4 flex cursor-pointer items-center gap-x-[4px] text-primary",
724
765
  children: [
725
766
  e?.editIcon,
@@ -727,118 +768,118 @@ const $e = ({
727
768
  ]
728
769
  }
729
770
  ),
730
- t && /* @__PURE__ */ r("a", { href: l || "", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ o("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
771
+ t && /* @__PURE__ */ s("a", { href: a || "", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ c("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
731
772
  e?.dataExplorerIcon,
732
773
  e?.dataExplorer
733
774
  ] }) })
734
775
  ]
735
776
  }
736
- ), re = U(null);
737
- function Dt({
777
+ ), ae = Q(null);
778
+ function _t({
738
779
  value: e,
739
780
  children: t
740
781
  }) {
741
- const n = W(() => e ?? {}, [e]);
742
- return /* @__PURE__ */ r(re.Provider, { value: n, children: t });
782
+ const n = V(() => e ?? {}, [e]);
783
+ return /* @__PURE__ */ s(ae.Provider, { value: n, children: t });
743
784
  }
744
- function Be() {
745
- return V(re);
785
+ function Ue() {
786
+ return K(ae);
746
787
  }
747
- var _ = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e.Note = "note", e))(_ || {});
748
- const We = {
749
- [_.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
750
- [_.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
751
- [_.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000",
752
- [_.Note]: "border-hues-900 bg-neutrals-200 text-neutrals-1000"
753
- }, qe = "shrink-0", He = "min-w-0 body-2", Ue = "flex items-start gap-2 min-w-0 border-l-2 rounded py-2 px-4 items-center";
754
- function Rt({
788
+ var M = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e.Note = "note", e))(M || {});
789
+ const Qe = {
790
+ [M.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
791
+ [M.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
792
+ [M.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000",
793
+ [M.Note]: "border-hues-900 bg-neutrals-200 text-neutrals-1000"
794
+ }, Ke = "shrink-0", Xe = "min-w-0 body-2", Ze = "flex items-start gap-2 min-w-0 border-l-2 rounded py-2 px-4 items-center";
795
+ function At({
755
796
  type: e,
756
797
  icon: t,
757
798
  children: n,
758
- className: s,
759
- contentClassName: l
799
+ className: r,
800
+ contentClassName: a
760
801
  }) {
761
- const a = Be(), d = t ?? a?.icons?.[e], u = a?.classes?.container ?? Ue, h = a?.classes?.types?.[e] ?? We[e], m = R(u, h, s), p = R(qe, a?.classes?.icon), g = R(
762
- He,
763
- a?.classes?.content,
764
- l
802
+ const l = Ue(), d = t ?? l?.icons?.[e], m = l?.classes?.container ?? Ze, h = l?.classes?.types?.[e] ?? Qe[e], u = O(m, h, r), f = O(Ke, l?.classes?.icon), x = O(
803
+ Xe,
804
+ l?.classes?.content,
805
+ a
765
806
  );
766
- return /* @__PURE__ */ o("div", { "data-type": e, className: m, children: [
767
- d ? /* @__PURE__ */ r("span", { className: p, children: d }) : null,
768
- n ? /* @__PURE__ */ r("div", { className: g, children: n }) : null
807
+ return /* @__PURE__ */ c("div", { "data-type": e, className: u, children: [
808
+ d ? /* @__PURE__ */ s("span", { className: f, children: d }) : null,
809
+ n ? /* @__PURE__ */ s("div", { className: x, children: n }) : null
769
810
  ] });
770
811
  }
771
- const Lt = ({
812
+ const Mt = ({
772
813
  title: e,
773
814
  copiedTitle: t,
774
815
  tooltip: n,
775
- icon: s,
776
- copiedIcon: l,
777
- className: a,
816
+ icon: r,
817
+ copiedIcon: a,
818
+ className: l,
778
819
  buttonTextClassName: d,
779
- onClick: u
820
+ onClick: m
780
821
  }) => {
781
- const [h, m] = j(!1), p = B(null), g = () => {
782
- u(), m(!0), p.current && clearTimeout(p.current), p.current = setTimeout(() => {
783
- m(!1);
822
+ const [h, u] = Y(!1), f = W(null), x = () => {
823
+ m(), u(!0), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
824
+ u(!1);
784
825
  }, 1e3);
785
826
  };
786
- return M(() => () => {
787
- p.current && clearTimeout(p.current);
788
- }, []), /* @__PURE__ */ o("div", { className: "relative w-fit", children: [
789
- /* @__PURE__ */ r(
790
- je,
827
+ return R(() => () => {
828
+ f.current && clearTimeout(f.current);
829
+ }, []), /* @__PURE__ */ c("div", { className: "relative w-fit", children: [
830
+ /* @__PURE__ */ s(
831
+ He,
791
832
  {
792
833
  title: h ? t : e,
793
834
  isSmallButton: !0,
794
835
  disabled: h,
795
- buttonClassName: R([
836
+ buttonClassName: O([
796
837
  "text-button-tertiary small-icon-button !h-6 !p-0",
797
- a
838
+ l
798
839
  ]),
799
- textClassName: R(["ml-1", d]),
800
- onClick: g,
801
- iconBefore: h ? l : s
840
+ textClassName: O(["ml-1", d]),
841
+ onClick: x,
842
+ iconBefore: h ? a : r
802
843
  }
803
844
  ),
804
- n && h && /* @__PURE__ */ r("div", { className: "h4 absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 shadow", children: n })
845
+ n && h && /* @__PURE__ */ s("div", { className: "h4 absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 shadow", children: n })
805
846
  ] });
806
847
  };
807
- function Ve({
848
+ function Je({
808
849
  id: e,
809
850
  label: t,
810
851
  hasChildren: n,
811
- showDragHandle: s,
812
- showCheckbox: l,
813
- isChecked: a,
852
+ showDragHandle: r,
853
+ showCheckbox: a,
854
+ isChecked: l,
814
855
  isExpanded: d
815
856
  }) {
816
- return /* @__PURE__ */ o("div", { className: "relative cursor-grabbing rounded bg-neutrals-200 shadow", children: [
817
- /* @__PURE__ */ r("div", { className: "absolute -left-[0.5px] top-0.5 h-5 w-0.5 rounded-full bg-gradients-light" }),
818
- /* @__PURE__ */ o("div", { className: "flex items-stretch overflow-hidden rounded", children: [
819
- s ? /* @__PURE__ */ r("div", { className: "flex w-6 items-center justify-center", children: /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "rounded p-1", children: /* @__PURE__ */ r(Q, { size: 16 }) }) }) : null,
820
- /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
821
- l ? /* @__PURE__ */ r(ne, { id: e, checked: !!a, className: "p-0" }) : null,
822
- /* @__PURE__ */ r("span", { className: "body-3 truncate", children: t })
857
+ return /* @__PURE__ */ c("div", { className: "relative cursor-grabbing rounded bg-neutrals-200 shadow", children: [
858
+ /* @__PURE__ */ s("div", { className: "absolute -left-[0.5px] top-0.5 h-5 w-0.5 rounded-full bg-gradients-light" }),
859
+ /* @__PURE__ */ c("div", { className: "flex items-stretch overflow-hidden rounded", children: [
860
+ r ? /* @__PURE__ */ s("div", { className: "flex w-6 items-center justify-center", children: /* @__PURE__ */ s("span", { "aria-hidden": !0, className: "rounded p-1", children: /* @__PURE__ */ s(X, { size: 16 }) }) }) : null,
861
+ /* @__PURE__ */ c("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
862
+ a ? /* @__PURE__ */ s(se, { id: e, checked: !!l, className: "p-0" }) : null,
863
+ /* @__PURE__ */ s("span", { className: "body-3 truncate", children: t })
823
864
  ] }),
824
- n ? /* @__PURE__ */ r("div", { className: "flex w-8 items-center justify-center", children: /* @__PURE__ */ r(
865
+ n ? /* @__PURE__ */ s("div", { className: "flex w-8 items-center justify-center", children: /* @__PURE__ */ s(
825
866
  "span",
826
867
  {
827
868
  "aria-hidden": !0,
828
- className: f(
869
+ className: p(
829
870
  "transition-transform",
830
871
  d ? "rotate-90" : "rotate-0"
831
872
  ),
832
- children: /* @__PURE__ */ r(K, { size: 16 })
873
+ children: /* @__PURE__ */ s(Z, { size: 16 })
833
874
  }
834
875
  ) }) : null
835
876
  ] })
836
877
  ] });
837
878
  }
838
- function se(e, t) {
879
+ function le(e, t) {
839
880
  return `i:${[...e, t].join("/")}`;
840
881
  }
841
- function G(e) {
882
+ function H(e) {
842
883
  if (!e.startsWith("i:")) return null;
843
884
  const n = e.slice(2).split("/").filter(Boolean);
844
885
  return n.length ? {
@@ -846,85 +887,85 @@ function G(e) {
846
887
  itemId: n[n.length - 1]
847
888
  } : null;
848
889
  }
849
- function Qe(e, t, n) {
850
- const s = ae(e, t);
851
- return s ? s.find((l) => l.id === n) ?? null : null;
890
+ function et(e, t, n) {
891
+ const r = oe(e, t);
892
+ return r ? r.find((a) => a.id === n) ?? null : null;
852
893
  }
853
- function le(e, t) {
894
+ function ie(e, t) {
854
895
  if (t.length === 0) return e;
855
- const [n, ...s] = t, l = e.find((a) => a.id === n);
856
- return l?.items ? le(l.items, s) : null;
896
+ const [n, ...r] = t, a = e.find((l) => l.id === n);
897
+ return a?.items ? ie(a.items, r) : null;
857
898
  }
858
- function ae(e, t) {
859
- const n = le(e, t);
899
+ function oe(e, t) {
900
+ const n = ie(e, t);
860
901
  return n ? n.filter(
861
- (s) => s.type === "item"
902
+ (r) => r.type === "item"
862
903
  ) : null;
863
904
  }
864
- function ie(e, t, n) {
905
+ function ce(e, t, n) {
865
906
  if (t.length === 0)
866
907
  return n(e);
867
- const [s, ...l] = t;
868
- return e.map((a) => a.id !== s || !a.items ? a : {
869
- ...a,
870
- items: ie(a.items, l, n)
908
+ const [r, ...a] = t;
909
+ return e.map((l) => l.id !== r || !l.items ? l : {
910
+ ...l,
911
+ items: ce(l.items, a, n)
871
912
  });
872
913
  }
873
- function Ke({
914
+ function tt({
874
915
  parentPath: e,
875
916
  item: t,
876
917
  showDragHandle: n,
877
- showCheckbox: s,
878
- renderLabel: l,
879
- onItemClick: a,
918
+ showCheckbox: r,
919
+ renderLabel: a,
920
+ onItemClick: l,
880
921
  onToggleExpanded: d,
881
- onToggleChecked: u
922
+ onToggleChecked: m
882
923
  }) {
883
- const h = !!t.items?.length, m = !!t.isExpanded, p = t.isDisabled ? !1 : t.draggable ?? !0, g = t.isDisabled ? !1 : t.checkable ?? !0, C = se(e, t.id), {
884
- attributes: b,
885
- listeners: N,
886
- setNodeRef: x,
887
- setActivatorNodeRef: c,
924
+ const h = !!t.items?.length, u = !!t.isExpanded, f = t.isDisabled ? !1 : t.draggable ?? !0, x = t.isDisabled ? !1 : t.checkable ?? !0, C = le(e, t.id), {
925
+ attributes: N,
926
+ listeners: v,
927
+ setNodeRef: b,
928
+ setActivatorNodeRef: o,
888
929
  transform: i,
889
- transition: v,
890
- isDragging: k
891
- } = Oe({ id: C, disabled: !p }), S = {
892
- transform: Te.Transform.toString(i),
893
- transition: v,
894
- opacity: k ? 0.6 : void 0
895
- }, y = !!t.isDisabled, w = y || !g, D = [...e, t.id];
896
- return /* @__PURE__ */ o(
930
+ transition: g,
931
+ isDragging: w
932
+ } = Pe({ id: C, disabled: !f }), I = {
933
+ transform: Ge.Transform.toString(i),
934
+ transition: g,
935
+ opacity: w ? 0.6 : void 0
936
+ }, y = !!t.isDisabled, E = y || !x, D = [...e, t.id];
937
+ return /* @__PURE__ */ c(
897
938
  "div",
898
939
  {
899
- ref: x,
900
- style: S,
901
- className: f([
940
+ ref: b,
941
+ style: I,
942
+ className: p([
902
943
  "group flex items-stretch overflow-hidden rounded bg-white",
903
944
  "select-none",
904
945
  y ? "opacity-50" : ""
905
946
  ]),
906
947
  children: [
907
- n ? /* @__PURE__ */ r(
948
+ n ? /* @__PURE__ */ s(
908
949
  "div",
909
950
  {
910
- className: f([
951
+ className: p([
911
952
  "group/drag-handle flex w-6 items-center justify-center rounded",
912
953
  y ? "" : "hover:bg-neutrals-100 cursor-grab"
913
954
  ]),
914
- children: /* @__PURE__ */ r(
955
+ children: /* @__PURE__ */ s(
915
956
  "span",
916
957
  {
917
- ref: c,
958
+ ref: o,
918
959
  "aria-hidden": !0,
919
- className: f([
960
+ className: p([
920
961
  "rounded p-1",
921
- p ? "cursor-grab" : "cursor-default",
962
+ f ? "cursor-grab" : "cursor-default",
922
963
  "transition-opacity"
923
964
  ]),
924
- ...p ? N : {},
925
- ...p ? b : {},
926
- children: /* @__PURE__ */ r(
927
- Q,
965
+ ...f ? v : {},
966
+ ...f ? N : {},
967
+ children: /* @__PURE__ */ s(
968
+ X,
928
969
  {
929
970
  size: 16,
930
971
  className: "text-neutrals-800 group-hover/drag-handle:text-primary"
@@ -934,72 +975,72 @@ function Ke({
934
975
  )
935
976
  }
936
977
  ) : null,
937
- /* @__PURE__ */ o(
978
+ /* @__PURE__ */ c(
938
979
  "button",
939
980
  {
940
981
  type: "button",
941
982
  disabled: y,
942
- "aria-disabled": w,
943
- onClick: (I) => {
944
- w || a?.({
983
+ "aria-disabled": E,
984
+ onClick: (k) => {
985
+ E || l?.({
945
986
  itemId: t.id,
946
987
  path: D,
947
- nativeEvent: I
988
+ nativeEvent: k
948
989
  });
949
990
  },
950
- className: f([
991
+ className: p([
951
992
  "flex min-w-0 flex-1 items-center gap-2 p-1 text-left rounded",
952
993
  y ? "" : "hover:bg-neutrals-100",
953
994
  y ? "" : "hover:text-blue-700",
954
995
  "focus:outline-none"
955
996
  ]),
956
997
  children: [
957
- s ? /* @__PURE__ */ r(
958
- ne,
998
+ r ? /* @__PURE__ */ s(
999
+ se,
959
1000
  {
960
1001
  id: `draggable-list-${D.join("-")}`,
961
1002
  checked: !!t.isChecked,
962
- disabled: !g,
1003
+ disabled: !x,
963
1004
  className: "p-0",
964
1005
  stopPropagation: !0,
965
- onChange: (I, E) => u?.({
1006
+ onChange: (k, S) => m?.({
966
1007
  itemId: t.id,
967
1008
  path: D,
968
- nextChecked: !!E
1009
+ nextChecked: !!S
969
1010
  })
970
1011
  }
971
1012
  ) : null,
972
- /* @__PURE__ */ r("span", { className: "body-3 truncate text-neutrals-800", children: l ? l(t) : t.label })
1013
+ /* @__PURE__ */ s("span", { className: "body-3 truncate text-neutrals-800", children: a ? a(t) : t.label })
973
1014
  ]
974
1015
  }
975
1016
  ),
976
- h ? /* @__PURE__ */ r(
1017
+ h ? /* @__PURE__ */ s(
977
1018
  "button",
978
1019
  {
979
1020
  type: "button",
980
1021
  disabled: y,
981
- onClick: (I) => {
982
- I.stopPropagation(), d?.({
1022
+ onClick: (k) => {
1023
+ k.stopPropagation(), d?.({
983
1024
  itemId: t.id,
984
1025
  path: D,
985
- nextExpanded: !m
1026
+ nextExpanded: !u
986
1027
  });
987
1028
  },
988
- "aria-label": m ? "Collapse" : "Expand",
989
- className: f([
1029
+ "aria-label": u ? "Collapse" : "Expand",
1030
+ className: p([
990
1031
  "flex w-8 items-center justify-center rounded",
991
1032
  y ? "" : "hover:bg-neutrals-100",
992
1033
  "focus:outline-none"
993
1034
  ]),
994
- children: /* @__PURE__ */ r(
1035
+ children: /* @__PURE__ */ s(
995
1036
  "span",
996
1037
  {
997
1038
  "aria-hidden": !0,
998
- className: f(
1039
+ className: p(
999
1040
  "transition-transform duration-150 ease-out",
1000
- m ? "rotate-90" : "rotate-0"
1041
+ u ? "rotate-90" : "rotate-0"
1001
1042
  ),
1002
- children: /* @__PURE__ */ r(K, { size: 16 })
1043
+ children: /* @__PURE__ */ s(Z, { size: 16 })
1003
1044
  }
1004
1045
  )
1005
1046
  }
@@ -1008,188 +1049,188 @@ function Ke({
1008
1049
  }
1009
1050
  );
1010
1051
  }
1011
- function Ft({
1052
+ function Pt({
1012
1053
  items: e,
1013
1054
  showDragHandle: t = !0,
1014
1055
  showCheckbox: n = !0,
1015
- onItemsChange: s,
1016
- onToggleExpanded: l,
1017
- onToggleChecked: a,
1056
+ onItemsChange: r,
1057
+ onToggleExpanded: a,
1058
+ onToggleChecked: l,
1018
1059
  onItemClick: d,
1019
- renderLabel: u
1060
+ renderLabel: m
1020
1061
  }) {
1021
- const h = Ie(
1022
- ke(De, { activationConstraint: { distance: 6 } })
1023
- ), [m, p] = oe.useState(null), g = (N) => {
1024
- const x = String(N.active.id), c = G(x);
1025
- if (!c) return;
1026
- const i = Qe(e, c.parentPath, c.itemId);
1027
- !i || i.type !== "item" || p({
1028
- id: x,
1062
+ const h = Re(
1063
+ Oe(Fe, { activationConstraint: { distance: 6 } })
1064
+ ), [u, f] = ue.useState(null), x = (v) => {
1065
+ const b = String(v.active.id), o = H(b);
1066
+ if (!o) return;
1067
+ const i = et(e, o.parentPath, o.itemId);
1068
+ !i || i.type !== "item" || f({
1069
+ id: b,
1029
1070
  label: i.label,
1030
1071
  hasChildren: !!i.items?.length,
1031
1072
  isChecked: i.isChecked,
1032
1073
  isExpanded: i.isExpanded
1033
1074
  });
1034
- }, C = (N) => {
1035
- p(null);
1036
- const x = N.over;
1037
- if (!x) return;
1038
- const c = G(String(N.active.id)), i = G(String(x.id));
1039
- if (!c || !i || c.parentPath.join("/") !== i.parentPath.join("/")) return;
1040
- const v = ae(e, c.parentPath);
1041
- if (!v) return;
1042
- const k = v.findIndex((w) => w.id === c.itemId), S = v.findIndex((w) => w.id === i.itemId);
1043
- if (k === -1 || S === -1 || k === S) return;
1044
- const y = ie(e, c.parentPath, (w) => {
1045
- const D = w.filter(
1046
- (L) => L.type === "item"
1047
- ), I = Pe(D, k, S);
1048
- let E = 0;
1049
- return w.map((L) => {
1050
- if (L.type !== "item") return L;
1051
- const Y = I[E];
1052
- return E += 1, Y;
1075
+ }, C = (v) => {
1076
+ f(null);
1077
+ const b = v.over;
1078
+ if (!b) return;
1079
+ const o = H(String(v.active.id)), i = H(String(b.id));
1080
+ if (!o || !i || o.parentPath.join("/") !== i.parentPath.join("/")) return;
1081
+ const g = oe(e, o.parentPath);
1082
+ if (!g) return;
1083
+ const w = g.findIndex((E) => E.id === o.itemId), I = g.findIndex((E) => E.id === i.itemId);
1084
+ if (w === -1 || I === -1 || w === I) return;
1085
+ const y = ce(e, o.parentPath, (E) => {
1086
+ const D = E.filter(
1087
+ (F) => F.type === "item"
1088
+ ), k = Ye(D, w, I);
1089
+ let S = 0;
1090
+ return E.map((F) => {
1091
+ if (F.type !== "item") return F;
1092
+ const G = k[S];
1093
+ return S += 1, G;
1053
1094
  });
1054
1095
  });
1055
- s(y);
1056
- }, b = (N, x = []) => {
1057
- const c = N.filter((i) => i.type === "item").map((i) => se(x, i.id));
1058
- return /* @__PURE__ */ r(
1059
- _e,
1096
+ r(y);
1097
+ }, N = (v, b = []) => {
1098
+ const o = v.filter((i) => i.type === "item").map((i) => le(b, i.id));
1099
+ return /* @__PURE__ */ s(
1100
+ Te,
1060
1101
  {
1061
- items: c,
1062
- strategy: Ae,
1063
- children: /* @__PURE__ */ r("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: N.map((i) => i.type === "group" ? /* @__PURE__ */ o(
1102
+ items: o,
1103
+ strategy: je,
1104
+ children: /* @__PURE__ */ s("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: v.map((i) => i.type === "group" ? /* @__PURE__ */ c(
1064
1105
  "li",
1065
1106
  {
1066
1107
  className: "m-0 mt-2 flex flex-col gap-2 p-0 first:mt-0",
1067
1108
  children: [
1068
- /* @__PURE__ */ o("div", { className: "h5 flex items-center gap-2 py-1 text-neutrals-1000", children: [
1069
- /* @__PURE__ */ r(fe, { size: 12, className: "shrink-0" }),
1109
+ /* @__PURE__ */ c("div", { className: "h5 flex items-center gap-2 py-1 text-neutrals-1000", children: [
1110
+ /* @__PURE__ */ s(xe, { size: 12, className: "shrink-0" }),
1070
1111
  i.label
1071
1112
  ] }),
1072
- /* @__PURE__ */ r("div", { className: "border-l border-neutrals-600 pl-2", children: b(i.items, [...x, i.id]) })
1113
+ /* @__PURE__ */ s("div", { className: "border-l border-neutrals-600 pl-2", children: N(i.items, [...b, i.id]) })
1073
1114
  ]
1074
1115
  },
1075
1116
  i.id
1076
- ) : /* @__PURE__ */ o("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1077
- /* @__PURE__ */ r(
1078
- Ke,
1117
+ ) : /* @__PURE__ */ c("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1118
+ /* @__PURE__ */ s(
1119
+ tt,
1079
1120
  {
1080
- parentPath: x,
1121
+ parentPath: b,
1081
1122
  item: i,
1082
1123
  showDragHandle: t,
1083
1124
  showCheckbox: n,
1084
- renderLabel: u,
1125
+ renderLabel: m,
1085
1126
  onItemClick: d,
1086
- onToggleExpanded: l,
1087
- onToggleChecked: a
1127
+ onToggleExpanded: a,
1128
+ onToggleChecked: l
1088
1129
  }
1089
1130
  ),
1090
- i.items?.length && i.isExpanded ? /* @__PURE__ */ r("div", { className: "pl-7", children: b(i.items, [...x, i.id]) }) : null
1131
+ i.items?.length && i.isExpanded ? /* @__PURE__ */ s("div", { className: "pl-7", children: N(i.items, [...b, i.id]) }) : null
1091
1132
  ] }, i.id)) })
1092
1133
  }
1093
1134
  );
1094
1135
  };
1095
- return /* @__PURE__ */ o(
1096
- Re,
1136
+ return /* @__PURE__ */ c(
1137
+ _e,
1097
1138
  {
1098
1139
  sensors: h,
1099
- collisionDetection: Le,
1100
- onDragStart: g,
1140
+ collisionDetection: Ae,
1141
+ onDragStart: x,
1101
1142
  onDragEnd: C,
1102
1143
  children: [
1103
- /* @__PURE__ */ r("div", { className: "flex flex-col", children: b(e) }),
1104
- /* @__PURE__ */ r(Fe, { children: m ? /* @__PURE__ */ r(
1105
- Ve,
1144
+ /* @__PURE__ */ s("div", { className: "flex flex-col", children: N(e) }),
1145
+ /* @__PURE__ */ s(Me, { children: u ? /* @__PURE__ */ s(
1146
+ Je,
1106
1147
  {
1107
- id: m.id,
1108
- label: m.label,
1109
- hasChildren: m.hasChildren,
1148
+ id: u.id,
1149
+ label: u.label,
1150
+ hasChildren: u.hasChildren,
1110
1151
  showDragHandle: t,
1111
1152
  showCheckbox: n,
1112
- isChecked: m.isChecked,
1113
- isExpanded: m.isExpanded
1153
+ isChecked: u.isChecked,
1154
+ isExpanded: u.isExpanded
1114
1155
  }
1115
1156
  ) : null })
1116
1157
  ]
1117
1158
  }
1118
1159
  );
1119
1160
  }
1120
- const Xe = (e, t) => e.label.toLowerCase().includes(t);
1121
- function Ot(e, t, n = {}) {
1122
- const s = Je(t);
1123
- if (!s)
1161
+ const nt = (e, t) => e.label.toLowerCase().includes(t);
1162
+ function Tt(e, t, n = {}) {
1163
+ const r = st(t);
1164
+ if (!r)
1124
1165
  return e;
1125
1166
  const {
1126
- expandMatchedBranches: l = !0,
1127
- includeGroupDescendantsOnMatch: a = !0,
1167
+ expandMatchedBranches: a = !0,
1168
+ includeGroupDescendantsOnMatch: l = !0,
1128
1169
  includeItemDescendantsOnMatch: d = !1,
1129
- match: u = Xe
1170
+ match: m = nt
1130
1171
  } = n;
1131
- return $(e, s, {
1132
- expandMatchedBranches: l,
1133
- includeGroupDescendantsOnMatch: a,
1172
+ return B(e, r, {
1173
+ expandMatchedBranches: a,
1174
+ includeGroupDescendantsOnMatch: l,
1134
1175
  includeItemDescendantsOnMatch: d,
1135
- match: u
1176
+ match: m
1136
1177
  }) ?? [];
1137
1178
  }
1138
- function $(e, t, n) {
1139
- const s = [];
1140
- for (const l of e) {
1141
- const a = Ze(l, t, n);
1142
- a && s.push(a);
1179
+ function B(e, t, n) {
1180
+ const r = [];
1181
+ for (const a of e) {
1182
+ const l = rt(a, t, n);
1183
+ l && r.push(l);
1143
1184
  }
1144
- return s.length ? s : null;
1185
+ return r.length ? r : null;
1145
1186
  }
1146
- function Ze(e, t, n) {
1147
- const s = n.match(e, t);
1187
+ function rt(e, t, n) {
1188
+ const r = n.match(e, t);
1148
1189
  if (e.type === "group") {
1149
- if (s && n.includeGroupDescendantsOnMatch)
1150
- return T(e, n.expandMatchedBranches);
1151
- const d = e.items?.length ? $(e.items, t, n) : null;
1152
- return !s && !d ? null : {
1190
+ if (r && n.includeGroupDescendantsOnMatch)
1191
+ return j(e, n.expandMatchedBranches);
1192
+ const d = e.items?.length ? B(e.items, t, n) : null;
1193
+ return !r && !d ? null : {
1153
1194
  ...e,
1154
1195
  items: d ?? []
1155
1196
  };
1156
1197
  }
1157
- const l = e.items?.length ? $(e.items, t, n) : null;
1158
- if (s && n.includeItemDescendantsOnMatch)
1159
- return T(e, n.expandMatchedBranches);
1160
- if (!s && !l)
1198
+ const a = e.items?.length ? B(e.items, t, n) : null;
1199
+ if (r && n.includeItemDescendantsOnMatch)
1200
+ return j(e, n.expandMatchedBranches);
1201
+ if (!r && !a)
1161
1202
  return null;
1162
- const a = {
1203
+ const l = {
1163
1204
  ...e
1164
1205
  };
1165
- return l ? (a.items = l, n.expandMatchedBranches && (a.isExpanded = !0)) : delete a.items, a;
1206
+ return a ? (l.items = a, n.expandMatchedBranches && (l.isExpanded = !0)) : delete l.items, l;
1166
1207
  }
1167
- function T(e, t) {
1208
+ function j(e, t) {
1168
1209
  return e.type === "group" ? {
1169
1210
  ...e,
1170
1211
  items: e.items.map(
1171
- (n) => T(n, t)
1212
+ (n) => j(n, t)
1172
1213
  )
1173
1214
  } : {
1174
1215
  ...e,
1175
1216
  isExpanded: t && e.items?.length ? !0 : e.isExpanded,
1176
- items: e.items?.map((n) => T(n, t))
1217
+ items: e.items?.map((n) => j(n, t))
1177
1218
  };
1178
1219
  }
1179
- function Je(e) {
1220
+ function st(e) {
1180
1221
  return e.trim().toLowerCase();
1181
1222
  }
1182
- var et = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(et || {});
1183
- const ce = U(null);
1184
- function _t({
1223
+ var at = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(at || {});
1224
+ const de = Q(null);
1225
+ function jt({
1185
1226
  children: e,
1186
1227
  isAgentAvailable: t
1187
1228
  }) {
1188
- const n = W(() => ({ isAgentAvailable: t }), [t]);
1189
- return /* @__PURE__ */ r(ce.Provider, { value: n, children: e });
1229
+ const n = V(() => ({ isAgentAvailable: t }), [t]);
1230
+ return /* @__PURE__ */ s(de.Provider, { value: n, children: e });
1190
1231
  }
1191
- function At() {
1192
- const e = V(ce);
1232
+ function Yt() {
1233
+ const e = K(de);
1193
1234
  if (!e)
1194
1235
  throw new Error(
1195
1236
  "useAgentAvailability must be used within AgentAvailabilityProvider"
@@ -1197,40 +1238,40 @@ function At() {
1197
1238
  return e;
1198
1239
  }
1199
1240
  export {
1200
- _t as AgentAvailabilityProvider,
1201
- mt as Alert,
1202
- F as AlertType,
1203
- je as Button,
1204
- Ge as CALENDAR_MOBILE_PADDING,
1205
- gt as Calendar,
1206
- ne as Checkbox,
1207
- te as CloseButton,
1208
- xt as CollapsibleBlock,
1209
- Lt as CopyButton,
1210
- It as DownloadFormatMessage,
1211
- Ft as DraggableList,
1212
- St as Dropdown,
1213
- bt as HighlightText,
1214
- Nt as IconButton,
1215
- Rt as InlineAlert,
1216
- Dt as InlineAlertProvider,
1217
- _ as InlineAlertType,
1218
- ze as Input,
1219
- Ct as InputWithIcon,
1220
- et as KeyboardKey,
1221
- vt as Link,
1222
- ee as Loader,
1223
- z as PopUpSize,
1224
- A as PopUpState,
1225
- Et as Popup,
1226
- wt as Radio,
1227
- kt as RequestLimitMessage,
1241
+ jt as AgentAvailabilityProvider,
1242
+ xt as Alert,
1243
+ _ as AlertType,
1244
+ He as Button,
1245
+ Be as CALENDAR_MOBILE_PADDING,
1246
+ vt as Calendar,
1247
+ se as Checkbox,
1248
+ re as CloseButton,
1249
+ yt as CollapsibleBlock,
1250
+ Mt as CopyButton,
1251
+ Ot as DownloadFormatMessage,
1252
+ Pt as DraggableList,
1253
+ Rt as Dropdown,
1254
+ Ct as HighlightText,
1255
+ Et as IconButton,
1256
+ At as InlineAlert,
1257
+ _t as InlineAlertProvider,
1258
+ M as InlineAlertType,
1259
+ We as Input,
1260
+ St as InputWithIcon,
1261
+ at as KeyboardKey,
1262
+ It as Link,
1263
+ ne as Loader,
1264
+ $ as PopUpSize,
1265
+ P as PopUpState,
1266
+ Lt as Popup,
1267
+ Dt as Radio,
1268
+ Ft as RequestLimitMessage,
1228
1269
  q as SERIES_LIMIT,
1229
- ft as TREE_NODE_ARROW_SIZE,
1230
- pt as TREE_NODE_PADDING,
1231
- yt as Tag,
1232
- Ot as filterDraggableListNodes,
1233
- At as useAgentAvailability,
1234
- ht as useDebounce,
1235
- Ye as useIsMobile
1270
+ Nt as TREE_NODE_ARROW_SIZE,
1271
+ wt as TREE_NODE_PADDING,
1272
+ kt as Tag,
1273
+ Tt as filterDraggableListNodes,
1274
+ Yt as useAgentAvailability,
1275
+ bt as useDebounce,
1276
+ $e as useIsMobile
1236
1277
  };