@epam/ai-dial-conversation-panel 1.1.0-dev.290 → 1.1.0-dev.294

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.
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { DeploymentIcon as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
2
- import { PanelEmpty as r, PanelNoResults as i, SidebarOrientation as a, SidebarPanel as o } from "@epam/ai-dial-sidebar";
3
- import { Button as s, DIAL_ICON_SIZE as c, Dropdown as l, ElementSize as u, EllipsisTooltip as d, GhostIconButton as f, Highlight as p, Search as m, Skeleton as h, SkeletonVariant as g, Tag as _, TagAppearance as v, mergeClasses as y } from "@epam/ai-dial-ui-kit";
4
- import { createElement as b, memo as x, useCallback as S, useEffect as C, useId as w, useImperativeHandle as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
5
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as N, IconCaretRightFilled as P, IconClock as F, IconDotsVertical as ee, IconPlus as I } from "@tabler/icons-react";
1
+ import { ConversationTransferJobStatus as e, ConversationTransferSubjectKind as t, DeploymentIcon as n, FilterTab as r, buildCssVars as i, getUtf8ByteLength as a, mergeClasses as o, sanitizeConversationName as s, stripTrailingDots as c } from "@epam/ai-dial-chat-shared";
2
+ import { PanelEmpty as l, PanelNoResults as u, SidebarOrientation as d, SidebarPanel as f } from "@epam/ai-dial-sidebar";
3
+ import { Button as p, ButtonVariant as m, ConfirmationPopup as h, ConfirmationPopupVariant as g, DIAL_ICON_SIZE as _, Dropdown as v, ElementSize as y, EllipsisTooltip as b, GhostIconButton as x, Highlight as S, Input as C, Popup as w, PopupSize as T, ProgressBar as E, Search as D, Skeleton as ee, SkeletonVariant as O, Spinner as k, Tag as A, TagAppearance as te, mergeClasses as ne } from "@epam/ai-dial-ui-kit";
4
+ import { createElement as j, memo as M, useCallback as N, useEffect as P, useId as re, useImperativeHandle as ie, useLayoutEffect as F, useMemo as I, useRef as L, useState as R } from "react";
5
+ import { Fragment as ae, jsx as z, jsxs as B } from "react/jsx-runtime";
6
+ import { IconAlertCircleFilled as V, IconCaretDownFilled as oe, IconCaretRightFilled as H, IconChevronDown as se, IconChevronUp as ce, IconCircleCheckFilled as U, IconClock as W, IconDotsVertical as le, IconPlus as ue, IconRefresh as de, IconSparkles as fe, IconX as pe } from "@tabler/icons-react";
7
7
  //#region ../../node_modules/react-window/dist/react-window.js
8
- var L = typeof window < "u" ? E : C;
9
- function R(e) {
8
+ var G = typeof window < "u" ? F : P;
9
+ function me(e) {
10
10
  if (e !== void 0) switch (typeof e) {
11
11
  case "number": return e;
12
12
  case "string":
@@ -14,15 +14,15 @@ function R(e) {
14
14
  break;
15
15
  }
16
16
  }
17
- function te({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
- let { styleHeight: s, styleWidth: c } = D(() => ({
19
- styleHeight: R(o?.height),
20
- styleWidth: R(o?.width)
21
- }), [o?.height, o?.width]), [l, u] = k({
17
+ function he({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
+ let { styleHeight: s, styleWidth: c } = I(() => ({
19
+ styleHeight: me(o?.height),
20
+ styleWidth: me(o?.width)
21
+ }), [o?.height, o?.width]), [l, u] = R({
22
22
  height: t,
23
23
  width: n
24
24
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
25
- return L(() => {
25
+ return G(() => {
26
26
  if (i === null || d) return;
27
27
  let t = new ResizeObserver((e) => {
28
28
  for (let t of e) {
@@ -42,7 +42,7 @@ function te({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), D(() => ({
45
+ ]), I(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -51,26 +51,26 @@ function te({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
51
51
  c
52
52
  ]);
53
53
  }
54
- function z(e) {
55
- let t = O(() => {
54
+ function ge(e) {
55
+ let t = L(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
- return L(() => {
58
+ return G(() => {
59
59
  t.current = e;
60
- }, [e]), S((e) => t.current?.(e), [t]);
60
+ }, [e]), N((e) => t.current?.(e), [t]);
61
61
  }
62
- var B = null;
63
- function ne(e = !1) {
64
- if (B === null || e) {
62
+ var K = null;
63
+ function _e(e = !1) {
64
+ if (K === null || e) {
65
65
  let e = document.createElement("div"), t = e.style;
66
66
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
67
67
  let n = document.createElement("div"), r = n.style;
68
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? B = "positive-descending" : (e.scrollLeft = 1, B = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), B;
68
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? K = "positive-descending" : (e.scrollLeft = 1, K = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), K;
69
69
  }
70
- return B;
70
+ return K;
71
71
  }
72
- function V({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (ne()) {
72
+ function ve({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
+ if (t === "horizontal" && n) switch (_e()) {
74
74
  case "negative": return -r;
75
75
  case "positive-descending":
76
76
  if (e) {
@@ -81,26 +81,26 @@ function V({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
81
81
  }
82
82
  return r;
83
83
  }
84
- function H(e, t = "Assertion error") {
84
+ function q(e, t = "Assertion error") {
85
85
  if (!e) throw console.error(t), Error(t);
86
86
  }
87
- function U(e, t) {
87
+ function J(e, t) {
88
88
  if (e === t) return !0;
89
- if (!!e != !!t || (H(e !== void 0), H(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
89
+ if (!!e != !!t || (q(e !== void 0), q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
90
90
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
91
91
  return !0;
92
92
  }
93
- function re({ cachedBounds: e, itemCount: t, itemSize: n }) {
93
+ function ye({ cachedBounds: e, itemCount: t, itemSize: n }) {
94
94
  if (t === 0) return 0;
95
95
  if (typeof n == "number") return t * n;
96
96
  {
97
97
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
98
- return H(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
98
+ return q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
99
99
  }
100
100
  }
101
- function W({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
101
+ function be({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
102
102
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
103
- let s = re({
103
+ let s = ye({
104
104
  cachedBounds: t,
105
105
  itemCount: r,
106
106
  itemSize: i
@@ -112,7 +112,7 @@ function W({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, con
112
112
  default: return a >= u && a <= l ? a : a < u ? u : l;
113
113
  }
114
114
  }
115
- function G({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
115
+ function xe({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
116
116
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
117
117
  for (; u < a;) {
118
118
  let n = e.get(u);
@@ -131,11 +131,11 @@ function G({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
131
131
  stopIndexOverscan: l
132
132
  };
133
133
  }
134
- function K({ itemCount: e, itemProps: t, itemSize: n }) {
134
+ function Se({ itemCount: e, itemProps: t, itemSize: n }) {
135
135
  let r = /* @__PURE__ */ new Map();
136
136
  return {
137
137
  get(i) {
138
- for (H(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
138
+ for (q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
139
139
  let e = r.size, a;
140
140
  switch (typeof n) {
141
141
  case "function":
@@ -151,14 +151,14 @@ function K({ itemCount: e, itemProps: t, itemSize: n }) {
151
151
  });
152
152
  else {
153
153
  let t = r.get(e - 1);
154
- H(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
154
+ q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
155
155
  scrollOffset: t.scrollOffset + t.size,
156
156
  size: a
157
157
  });
158
158
  }
159
159
  }
160
160
  let a = r.get(i);
161
- return H(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
161
+ return q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
162
162
  },
163
163
  set(e, t) {
164
164
  r.set(e, t);
@@ -168,8 +168,8 @@ function K({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function ie({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return D(() => K({
171
+ function Ce({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return I(() => Se({
173
173
  itemCount: e,
174
174
  itemProps: t,
175
175
  itemSize: n
@@ -179,11 +179,11 @@ function ie({ itemCount: e, itemProps: t, itemSize: n }) {
179
179
  n
180
180
  ]);
181
181
  }
182
- function q({ containerSize: e, itemSize: t }) {
182
+ function we({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
186
- H(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), H(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
186
+ q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), q(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
187
187
  break;
188
188
  default:
189
189
  n = t;
@@ -191,21 +191,21 @@ function q({ containerSize: e, itemSize: t }) {
191
191
  }
192
192
  return n;
193
193
  }
194
- function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
195
- let { height: u = n, width: d = n } = te({
194
+ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
195
+ let { height: u = n, width: d = n } = he({
196
196
  defaultHeight: r === "vertical" ? n : void 0,
197
197
  defaultWidth: r === "horizontal" ? n : void 0,
198
198
  element: e,
199
199
  mode: r === "vertical" ? "only-height" : "only-width",
200
200
  style: t
201
- }), f = O({
201
+ }), f = L({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = q({
204
+ }), p = r === "vertical" ? u : d, m = we({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- E(() => {
208
+ F(() => {
209
209
  if (typeof c == "function") {
210
210
  let e = f.current;
211
211
  (e.height !== u || e.width !== d) && (c({
@@ -218,22 +218,22 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
218
218
  c,
219
219
  d
220
220
  ]);
221
- let h = ie({
221
+ let h = Ce({
222
222
  itemCount: a,
223
223
  itemProps: o,
224
224
  itemSize: m
225
- }), g = S((e) => h.get(e), [h]), [_, v] = k(() => G({
225
+ }), g = N((e) => h.get(e), [h]), [_, v] = R(() => xe({
226
226
  cachedBounds: h,
227
227
  containerScrollOffset: 0,
228
228
  containerSize: p,
229
229
  itemCount: a,
230
230
  overscanCount: l
231
- })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: C } = {
231
+ })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: S } = {
232
232
  startIndexVisible: Math.min(a - 1, _.startIndexVisible),
233
233
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
234
234
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
235
235
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
236
- }, w = S(() => re({
236
+ }, C = N(() => ye({
237
237
  cachedBounds: h,
238
238
  itemCount: a,
239
239
  itemSize: m
@@ -241,9 +241,9 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
241
241
  h,
242
242
  a,
243
243
  m
244
- ]), T = S((t) => G({
244
+ ]), w = N((t) => xe({
245
245
  cachedBounds: h,
246
- containerScrollOffset: V({
246
+ containerScrollOffset: ve({
247
247
  containerElement: e,
248
248
  direction: r,
249
249
  isRtl: i,
@@ -261,19 +261,19 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
261
261
  a,
262
262
  l
263
263
  ]);
264
- return L(() => {
265
- v(T((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
264
+ return G(() => {
265
+ v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
266
266
  }, [
267
267
  e,
268
268
  r,
269
- T
270
- ]), L(() => {
269
+ w
270
+ ]), G(() => {
271
271
  if (!e) return;
272
272
  let t = () => {
273
273
  v((t) => {
274
- let { scrollLeft: n, scrollTop: o } = e, s = G({
274
+ let { scrollLeft: n, scrollTop: o } = e, s = xe({
275
275
  cachedBounds: h,
276
- containerScrollOffset: V({
276
+ containerScrollOffset: ve({
277
277
  containerElement: e,
278
278
  direction: r,
279
279
  isRtl: i,
@@ -283,7 +283,7 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
283
283
  itemCount: a,
284
284
  overscanCount: l
285
285
  });
286
- return U(s, t) ? t : s;
286
+ return J(s, t) ? t : s;
287
287
  });
288
288
  };
289
289
  return e.addEventListener("scroll", t), () => {
@@ -298,9 +298,9 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
298
298
  l
299
299
  ]), {
300
300
  getCellBounds: g,
301
- getEstimatedSize: w,
302
- scrollToIndex: z(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
- let s = W({
301
+ getEstimatedSize: C,
302
+ scrollToIndex: ge(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
+ let s = be({
304
304
  align: t,
305
305
  cachedBounds: h,
306
306
  containerScrollOffset: n,
@@ -310,53 +310,53 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
310
310
  itemSize: m
311
311
  });
312
312
  if (e) {
313
- if (s = V({
313
+ if (s = ve({
314
314
  containerElement: e,
315
315
  direction: r,
316
316
  isRtl: i,
317
317
  scrollOffset: s
318
318
  }), typeof e.scrollTo != "function") {
319
- let e = T(s);
320
- U(_, e) || v(e);
319
+ let e = w(s);
320
+ J(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
324
324
  }),
325
325
  startIndexOverscan: b,
326
326
  startIndexVisible: y,
327
- stopIndexOverscan: C,
327
+ stopIndexOverscan: S,
328
328
  stopIndexVisible: x
329
329
  };
330
330
  }
331
- function J(e) {
332
- return D(() => e, Object.values(e));
331
+ function Ee(e) {
332
+ return I(() => e, Object.values(e));
333
333
  }
334
- function oe(e, t) {
334
+ function De(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
- return U(n, a) && U(r, o) && U(i, s);
336
+ return J(n, a) && J(r, o) && J(i, s);
337
337
  }
338
- function se(e) {
338
+ function Oe(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
341
- var ce = "data-react-window-index";
342
- function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
343
- let m = J(u), h = D(() => x(s, oe), [s]), [g, _] = k(null), v = se(l), { getCellBounds: y, getEstimatedSize: S, scrollToIndex: w, startIndexOverscan: E, startIndexVisible: O, stopIndexOverscan: A, stopIndexVisible: M } = ae({
341
+ var Y = "data-react-window-index";
342
+ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
343
+ let m = Ee(u), h = I(() => M(s, De), [s]), [g, _] = R(null), v = Oe(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Te({
344
344
  containerElement: g,
345
345
  containerStyle: f,
346
346
  defaultContainerSize: n,
347
347
  direction: "vertical",
348
348
  itemCount: c,
349
349
  itemProps: m,
350
- itemSize: D(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
350
+ itemSize: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
351
351
  onResize: i,
352
352
  overscanCount: o
353
353
  });
354
- T(r, () => ({
354
+ ie(r, () => ({
355
355
  get element() {
356
356
  return g;
357
357
  },
358
358
  scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
359
- let r = w({
359
+ let r = x({
360
360
  align: e,
361
361
  containerScrollOffset: g?.scrollTop ?? 0,
362
362
  index: n
@@ -366,40 +366,40 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
366
366
  top: r
367
367
  });
368
368
  }
369
- }), [g, w]), L(() => {
369
+ }), [g, x]), G(() => {
370
370
  if (!g) return;
371
371
  let e = Array.from(g.children).filter((e, t) => {
372
372
  if (e.hasAttribute("aria-hidden")) return !1;
373
- let n = `${E + t}`;
374
- return e.setAttribute(ce, n), !0;
373
+ let n = `${S + t}`;
374
+ return e.setAttribute(Y, n), !0;
375
375
  });
376
376
  if (v) return l.observeRowElements(e);
377
377
  }, [
378
378
  g,
379
379
  v,
380
380
  l,
381
- E,
382
- A
383
- ]), C(() => {
384
- E >= 0 && A >= 0 && a && a({
385
- startIndex: O,
386
- stopIndex: M
381
+ S,
382
+ w
383
+ ]), P(() => {
384
+ S >= 0 && w >= 0 && a && a({
385
+ startIndex: C,
386
+ stopIndex: T
387
387
  }, {
388
- startIndex: E,
389
- stopIndex: A
388
+ startIndex: S,
389
+ stopIndex: w
390
390
  });
391
391
  }, [
392
392
  a,
393
- E,
394
- O,
395
- A,
396
- M
393
+ S,
394
+ C,
395
+ w,
396
+ T
397
397
  ]);
398
- let N = D(() => {
398
+ let E = I(() => {
399
399
  let e = [];
400
- if (c > 0) for (let t = E; t <= A; t++) {
400
+ if (c > 0) for (let t = S; t <= w; t++) {
401
401
  let n = y(t);
402
- e.push(/* @__PURE__ */ b(h, {
402
+ e.push(/* @__PURE__ */ j(h, {
403
403
  ...m,
404
404
  ariaAttributes: {
405
405
  "aria-posinset": t + 1,
@@ -424,17 +424,17 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
424
424
  v,
425
425
  c,
426
426
  m,
427
- E,
428
- A
429
- ]), P = /* @__PURE__ */ j("div", {
427
+ S,
428
+ w
429
+ ]), D = /* @__PURE__ */ z("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
- height: S(),
432
+ height: b(),
433
433
  width: "100%",
434
434
  zIndex: -1
435
435
  }
436
436
  });
437
- return b(d, {
437
+ return j(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -446,87 +446,85 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
446
446
  overflowY: "auto",
447
447
  ...f
448
448
  }
449
- }, N, e, P);
449
+ }, E, e, D);
450
450
  }
451
451
  //#endregion
452
452
  //#region src/types/virtual-row.ts
453
- var Y = /* @__PURE__ */ function(e) {
453
+ var X = /* @__PURE__ */ function(e) {
454
454
  return e.Header = "header", e.Item = "item", e;
455
- }({}), X = /* @__PURE__ */ function(e) {
456
- return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
457
- }({}), ue = (e) => `${60 + e * 23 % 35}%`, de = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", fe = (e, t) => t.rows[e].kind === Y.Item ? 36 : e === 0 ? 24 : 56, pe = (e) => {
455
+ }({}), Ae = (e) => `${60 + e * 23 % 35}%`, je = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", Me = (e, t) => t.rows[e].kind === X.Item ? 36 : e === 0 ? 24 : 56, Ne = (e) => {
458
456
  switch (e) {
459
- case X.Shared: return X.Shared;
460
- case X.Organization: return X.Organization;
461
- default: return X.MyChats;
457
+ case r.Shared: return r.Shared;
458
+ case r.Organization: return r.Organization;
459
+ default: return r.MyChats;
462
460
  }
463
- }, me = (e, t) => {
461
+ }, Pe = (e, t) => {
464
462
  let n = null;
465
- for (let r of e) if (r.kind === Y.Header) n = r.groupKey;
463
+ for (let r of e) if (r.kind === X.Header) n = r.groupKey;
466
464
  else if (r.item.id === t) return n;
467
465
  return null;
468
- }, he = (e, t, n) => {
469
- let r = /* @__PURE__ */ new Set();
470
- if (t != null && r.add(t), t === X.Pinned) {
466
+ }, Fe = (e, t, n) => {
467
+ let i = /* @__PURE__ */ new Set();
468
+ if (t != null && i.add(t), t === r.Pinned) {
471
469
  let t = n.find((t) => t.id === e);
472
- t && r.add(pe(t.source));
473
- } else r.add(X.Pinned);
474
- return r;
475
- }, ge = (e, t, n, r) => {
470
+ t && i.add(Ne(t.source));
471
+ } else i.add(r.Pinned);
472
+ return i;
473
+ }, Ie = (e, t, n, r) => {
476
474
  let i = e.currentTarget.getBoundingClientRect();
477
475
  if (e.clientY >= i.top + i.height / 2) return t;
478
476
  let a = null, o = !1;
479
- for (let e of n) if (e.kind === Y.Header) o = e.groupKey === r;
477
+ for (let e of n) if (e.kind === X.Header) o = e.groupKey === r;
480
478
  else if (o) {
481
479
  if (e.item.id === t) return a;
482
480
  a = e.item.id;
483
481
  }
484
482
  return null;
485
- }, _e = [
483
+ }, Le = [
486
484
  {
487
- value: X.All,
485
+ value: r.All,
488
486
  labelKey: "all"
489
487
  },
490
488
  {
491
- value: X.MyChats,
489
+ value: r.MyChats,
492
490
  labelKey: "myChats"
493
491
  },
494
492
  {
495
- value: X.Shared,
493
+ value: r.Shared,
496
494
  labelKey: "shared"
497
495
  },
498
496
  {
499
- value: X.Organization,
497
+ value: r.Organization,
500
498
  labelKey: "organization"
501
499
  }
502
- ], ve = x(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ j("div", {
500
+ ], Re = M(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ z("div", {
503
501
  role: "group",
504
502
  "aria-label": t.groupAriaLabel ?? "Filter chats",
505
503
  className: "flex flex-nowrap gap-1 px-3 py-2",
506
- children: _e.map(({ value: i, labelKey: a }) => /* @__PURE__ */ j(_, {
504
+ children: Le.map(({ value: i, labelKey: a }) => /* @__PURE__ */ z(A, {
507
505
  label: t[a],
508
- appearance: v.Selectable,
506
+ appearance: te.Selectable,
509
507
  selected: e === i,
510
508
  onClick: () => n(i),
511
- className: y("flex-1 justify-center rounded-full", r)
509
+ className: ne("flex-1 justify-center rounded-full", r)
512
510
  }, i))
513
- })), ye = { button: "_button_8xsgo_1" }, be = x(({ label: e, onClick: r, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ j("div", {
511
+ })), ze = { button: "_button_8xsgo_1" }, Be = M(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: r }) => /* @__PURE__ */ z("div", {
514
512
  className: "px-3 py-2",
515
- style: t({
516
- "--cp-new-chat-bg": a?.background,
517
- "--cp-new-chat-text": a?.text,
518
- "--cp-new-chat-focus-outline": a?.focusOutline
513
+ style: i({
514
+ "--cp-new-chat-bg": r?.background,
515
+ "--cp-new-chat-text": r?.text,
516
+ "--cp-new-chat-focus-outline": r?.focusOutline
519
517
  }),
520
- children: /* @__PURE__ */ M("button", {
521
- onClick: r,
518
+ children: /* @__PURE__ */ B("button", {
519
+ onClick: t,
522
520
  type: "button",
523
- className: n("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1 shadow-sm hover:shadow-xs active:shadow-xs", ye.button),
524
- children: [/* @__PURE__ */ j(I, {
521
+ className: o("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1 shadow-sm hover:shadow-xs active:shadow-xs", ze.button),
522
+ children: [/* @__PURE__ */ z(ue, {
525
523
  size: 18,
526
524
  stroke: 2,
527
525
  className: "shrink-0"
528
- }), /* @__PURE__ */ j("span", {
529
- className: i,
526
+ }), /* @__PURE__ */ z("span", {
527
+ className: n,
530
528
  children: e
531
529
  })]
532
530
  })
@@ -540,427 +538,676 @@ var Y = /* @__PURE__ */ function(e) {
540
538
  triggerActive: "_triggerActive_1rnkj_27",
541
539
  triggerIcon: "_triggerIcon_1rnkj_30",
542
540
  unreadDot: "_unreadDot_1rnkj_38"
543
- }, xe = ({ label: e, isExpanded: t, onToggle: r, listId: i, className: a = "dial-tiny-lead-text", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
544
- let f = o != null;
545
- return /* @__PURE__ */ M("button", {
541
+ }, Q = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", dropZoneGroupKey: a, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
542
+ let d = a != null;
543
+ return /* @__PURE__ */ B("button", {
546
544
  type: "button",
547
545
  "aria-expanded": t,
548
- "aria-controls": i,
549
- onClick: r,
550
- onDragOver: f ? (e) => {
551
- f && (e.preventDefault(), c?.(o));
546
+ "aria-controls": r,
547
+ onClick: n,
548
+ onDragOver: d ? (e) => {
549
+ d && (e.preventDefault(), c?.(a));
552
550
  } : void 0,
553
- onDragLeave: f ? (e) => {
554
- f && (e.currentTarget.contains(e.relatedTarget) || l?.());
551
+ onDragLeave: d ? (e) => {
552
+ d && (e.currentTarget.contains(e.relatedTarget) || l?.());
555
553
  } : void 0,
556
- onDrop: f ? (e) => {
557
- f && (e.preventDefault(), u?.(o, o, null));
554
+ onDrop: d ? (e) => {
555
+ d && (e.preventDefault(), u?.(a, a, null));
558
556
  } : void 0,
559
- className: n("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
560
- children: [t ? /* @__PURE__ */ j(N, {
557
+ className: o("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Z.groupHeader, s && Z.dropZoneActive),
558
+ children: [t ? /* @__PURE__ */ z(oe, {
561
559
  stroke: .5,
562
560
  size: 12,
563
561
  className: "shrink-0",
564
562
  "aria-hidden": !0
565
- }) : /* @__PURE__ */ j(P, {
563
+ }) : /* @__PURE__ */ z(H, {
566
564
  stroke: .5,
567
565
  size: 12,
568
566
  className: "shrink-0 rtl:scale-x-[-1]",
569
567
  "aria-hidden": !0
570
- }), /* @__PURE__ */ j(d, { text: e })]
568
+ }), /* @__PURE__ */ z(b, { text: e })]
571
569
  });
572
- }, Se = ({ item: t, isActive: r, onSelectConversation: i, searchQuery: a = "", getActions: o, onActionMenuOpen: d, actionsLabel: m = "More actions", itemTitleClassName: _ = "dial-small-text", itemIconBadgeClassName: v, taskBadgeClassName: y = "dial-caption-lead-semi-text", unreadIndicatorLabel: b = "Unread", rowGroupKey: x, rows: C, draggingId: w, dragOverId: T, allowedDropGroups: E, onDragStart: D, onDragEnd: N, onDragOver: P, onDragLeave: I, onDrop: L }) => {
573
- let [R, te] = k(!1), z = O(null), B = S((e) => {
574
- te(e), e && z.current && d?.(t, z.current);
575
- }, [t, d]), ne = o?.(t) ?? [], V = ne.length > 0, H = t.isIconLoading ? /* @__PURE__ */ j(h, {
576
- variant: g.Circular,
577
- width: c.LG,
578
- height: c.LG,
570
+ }, Ve = ({ item: e, isActive: t, onSelectConversation: r, searchQuery: i = "", getActions: a, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, taskBadgeClassName: d = "dial-caption-lead-semi-text", unreadIndicatorLabel: f = "Unread", rowGroupKey: m, rows: h, draggingId: g, dragOverId: b, allowedDropGroups: C, onDragStart: w, onDragEnd: T, onDragOver: E, onDragLeave: D, onDrop: k }) => {
571
+ let [A, te] = R(!1), ne = L(null), j = N((t) => {
572
+ te(t), t && ne.current && s?.(e, ne.current);
573
+ }, [e, s]), M = a?.(e) ?? [], P = M.length > 0, re = e.isIconLoading ? /* @__PURE__ */ z(ee, {
574
+ variant: O.Circular,
575
+ width: _.LG,
576
+ height: _.LG,
579
577
  color: Z.skeletonColor,
580
578
  "aria-hidden": !0
581
- }) : /* @__PURE__ */ j(e, {
582
- src: t.iconUrl,
583
- size: c.LG,
584
- initialsName: t.iconTooltip ?? "",
585
- labels: { tooltip: t.iconTooltip },
586
- styles: { badgeClassName: v }
587
- }), U = /* @__PURE__ */ M("span", {
579
+ }) : /* @__PURE__ */ z(n, {
580
+ src: e.iconUrl,
581
+ size: _.LG,
582
+ initialsName: e.iconTooltip ?? "",
583
+ labels: { tooltip: e.iconTooltip },
584
+ styles: { badgeClassName: u }
585
+ }), ie = /* @__PURE__ */ B("span", {
588
586
  className: "flex shrink-0 items-center",
589
- children: [/* @__PURE__ */ j("span", {
587
+ children: [/* @__PURE__ */ z("span", {
590
588
  className: "relative flex size-3 shrink-0 items-center justify-center",
591
- children: t.isUnread && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("span", {
592
- className: n("size-[5.33px] rounded-full", Z.unreadDot),
589
+ children: e.isUnread && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z("span", {
590
+ className: o("size-[5.33px] rounded-full", Z.unreadDot),
593
591
  "aria-hidden": !0
594
- }), /* @__PURE__ */ j("span", {
592
+ }), /* @__PURE__ */ z("span", {
595
593
  className: "sr-only",
596
- children: b
594
+ children: f
597
595
  })] })
598
- }), H]
599
- }), re = de(V, R), W = t.showTaskBadge ? /* @__PURE__ */ M("span", {
600
- className: n("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, y),
601
- children: [/* @__PURE__ */ j(F, {
596
+ }), re]
597
+ }), F = je(P, A), I = e.showTaskBadge ? /* @__PURE__ */ B("span", {
598
+ className: o("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, d),
599
+ children: [/* @__PURE__ */ z(W, {
602
600
  size: 12,
603
601
  "aria-hidden": !0
604
- }), t.taskBadgeLabel]
605
- }) : void 0, G = x != null, K = S((e) => {
606
- e.currentTarget.contains(e.relatedTarget) || I?.();
607
- }, [I]), ie = S((e) => {
608
- if (!x || !C || !L) return;
609
- e.preventDefault();
610
- let n = ge(e, t.id, C, x);
611
- L(t.id, x, n);
602
+ }), e.taskBadgeLabel]
603
+ }) : void 0, V = m != null, oe = N((e) => {
604
+ e.currentTarget.contains(e.relatedTarget) || D?.();
605
+ }, [D]), H = N((t) => {
606
+ if (!m || !h || !k) return;
607
+ t.preventDefault();
608
+ let n = Ie(t, e.id, h, m);
609
+ k(e.id, m, n);
612
610
  }, [
613
- t.id,
614
- C,
615
- x,
616
- L
617
- ]), q = t.id === w, ae = t.id === T, J = x != null && (E?.has(x) ?? !1), oe = w != null;
618
- return /* @__PURE__ */ M("li", {
619
- className: n("group/conversation relative", q && "cursor-grabbing opacity-50", ae && J && "rounded", ae && J && Z.dropZoneActive, oe && !q && !J && "cursor-not-allowed"),
620
- draggable: G || void 0,
621
- onDragStart: G ? () => D?.(t.id) : void 0,
622
- onDragEnd: G ? N : void 0,
623
- onDragOver: G ? (e) => {
624
- e.preventDefault(), P?.(t.id);
611
+ e.id,
612
+ h,
613
+ m,
614
+ k
615
+ ]), se = e.id === g, ce = e.id === b, U = m != null && (C?.has(m) ?? !1), ue = g != null;
616
+ return /* @__PURE__ */ B("li", {
617
+ className: o("group/conversation relative", se && "cursor-grabbing opacity-50", ce && U && "rounded", ce && U && Z.dropZoneActive, ue && !se && !U && "cursor-not-allowed"),
618
+ draggable: V || void 0,
619
+ onDragStart: V ? () => w?.(e.id) : void 0,
620
+ onDragEnd: V ? T : void 0,
621
+ onDragOver: V ? (t) => {
622
+ t.preventDefault(), E?.(e.id);
625
623
  } : void 0,
626
- onDragLeave: G ? K : void 0,
627
- onDrop: G ? ie : void 0,
628
- children: [/* @__PURE__ */ j("a", {
629
- href: t.href,
624
+ onDragLeave: V ? oe : void 0,
625
+ onDrop: V ? H : void 0,
626
+ children: [/* @__PURE__ */ z("a", {
627
+ href: e.href,
630
628
  className: "contents",
631
- onClick: (e) => {
632
- t.href && (e.preventDefault(), i(t.id));
629
+ onClick: (t) => {
630
+ e.href && (t.preventDefault(), r(e.id));
633
631
  },
634
- children: /* @__PURE__ */ j(s, {
635
- iconBefore: U,
636
- label: /* @__PURE__ */ j(p, {
637
- text: t.title,
638
- query: a,
639
- className: _,
632
+ children: /* @__PURE__ */ z(p, {
633
+ iconBefore: ie,
634
+ label: /* @__PURE__ */ z(S, {
635
+ text: e.title,
636
+ query: i,
637
+ className: l,
640
638
  maxLines: 1
641
639
  }),
642
- iconAfter: W,
640
+ iconAfter: I,
643
641
  textClassName: "min-w-0 flex-1",
644
- "aria-current": r ? "page" : void 0,
645
- onClick: t.href ? void 0 : () => i(t.id),
646
- tabIndex: t.href ? -1 : void 0,
647
- className: n("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0", re, Z.item, r && Z.itemActive, R && Z.itemActive)
642
+ "aria-current": t ? "page" : void 0,
643
+ onClick: e.href ? void 0 : () => r(e.id),
644
+ tabIndex: e.href ? -1 : void 0,
645
+ className: o("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0", F, Z.item, t && Z.itemActive, A && Z.itemActive)
648
646
  })
649
- }), V && /* @__PURE__ */ j("div", {
650
- className: n("absolute inset-y-0 end-1 flex items-center", R ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
651
- children: /* @__PURE__ */ j(l, {
652
- items: ne,
653
- onOpenChange: B,
647
+ }), P && /* @__PURE__ */ z("div", {
648
+ className: o("absolute inset-y-0 end-1 flex items-center", A ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
649
+ children: /* @__PURE__ */ z(v, {
650
+ items: M,
651
+ onOpenChange: j,
654
652
  matchReferenceWidth: !1,
655
653
  listClassName: "w-[200px]",
656
- children: /* @__PURE__ */ j(f, {
657
- ref: z,
658
- icon: /* @__PURE__ */ j(ee, {
659
- size: c.SM,
654
+ children: /* @__PURE__ */ z(x, {
655
+ ref: ne,
656
+ icon: /* @__PURE__ */ z(le, {
657
+ size: _.SM,
660
658
  className: Z.triggerIcon,
661
659
  "aria-hidden": !0
662
660
  }),
663
- size: u.Small,
664
- "aria-label": m,
665
- className: n(R && Z.triggerActive)
661
+ size: y.Small,
662
+ "aria-label": c,
663
+ className: o(A && Z.triggerActive)
666
664
  })
667
665
  })
668
666
  })]
669
667
  });
670
- }, Ce = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, onActionMenuOpen: u, actionsLabel: d, unreadIndicatorLabel: f, styles: p, draggingId: m, dragOverId: h, allowedDropGroups: g, onDragStart: _, onDragEnd: v, onDragOver: y, onDragLeave: b, onDrop: x }) => {
671
- let S = n[e];
672
- if (S.kind === Y.Header) {
673
- let n = S.groupKey === X.Pinned;
674
- return /* @__PURE__ */ j("div", {
668
+ }, He = ({ index: e, style: t, rows: n, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, draggingId: h, dragOverId: g, allowedDropGroups: _, onDragStart: v, onDragEnd: y, onDragOver: b, onDragLeave: x, onDrop: S }) => {
669
+ let C = n[e];
670
+ if (C.kind === X.Header) {
671
+ let n = C.groupKey === r.Pinned;
672
+ return /* @__PURE__ */ z("div", {
675
673
  role: "presentation",
676
674
  style: t,
677
675
  className: e === 0 ? "pt-0" : "pt-8",
678
- children: /* @__PURE__ */ j(xe, {
679
- label: S.label,
680
- isExpanded: r.has(S.groupKey),
681
- onToggle: () => i(S.groupKey),
682
- listId: a,
683
- className: p?.groupHeaderClassName,
684
- dropZoneGroupKey: n ? X.Pinned : void 0,
685
- isDragOver: n && h === X.Pinned,
686
- onDragOver: n ? y : void 0,
687
- onDragLeave: n ? b : void 0,
688
- onDrop: n ? x : void 0
676
+ children: /* @__PURE__ */ z(Q, {
677
+ label: C.label,
678
+ isExpanded: i.has(C.groupKey),
679
+ onToggle: () => a(C.groupKey),
680
+ listId: o,
681
+ className: m?.groupHeaderClassName,
682
+ dropZoneGroupKey: n ? r.Pinned : void 0,
683
+ isDragOver: n && g === r.Pinned,
684
+ onDragOver: n ? b : void 0,
685
+ onDragLeave: n ? x : void 0,
686
+ onDrop: n ? S : void 0
689
687
  })
690
688
  });
691
689
  }
692
- return /* @__PURE__ */ j("div", {
690
+ return /* @__PURE__ */ z("div", {
693
691
  role: "presentation",
694
692
  style: t,
695
693
  className: "pt-1",
696
- children: /* @__PURE__ */ j(Se, {
697
- item: S.item,
698
- isActive: S.item.id === o,
699
- searchQuery: s,
700
- onSelectConversation: c,
701
- getActions: l,
702
- onActionMenuOpen: u,
703
- actionsLabel: d,
704
- unreadIndicatorLabel: f,
705
- itemTitleClassName: p?.itemTitleClassName,
706
- itemIconBadgeClassName: p?.itemIconBadgeClassName,
707
- taskBadgeClassName: p?.taskBadgeClassName,
708
- rowGroupKey: S.groupKey,
694
+ children: /* @__PURE__ */ z(Ve, {
695
+ item: C.item,
696
+ isActive: C.item.id === s,
697
+ searchQuery: c,
698
+ onSelectConversation: l,
699
+ getActions: u,
700
+ onActionMenuOpen: d,
701
+ actionsLabel: f,
702
+ unreadIndicatorLabel: p,
703
+ itemTitleClassName: m?.itemTitleClassName,
704
+ itemIconBadgeClassName: m?.itemIconBadgeClassName,
705
+ taskBadgeClassName: m?.taskBadgeClassName,
706
+ rowGroupKey: C.groupKey,
709
707
  rows: n,
710
- draggingId: m,
711
- dragOverId: h,
712
- allowedDropGroups: g,
713
- onDragStart: _,
714
- onDragEnd: v,
715
- onDragOver: y,
716
- onDragLeave: b,
717
- onDrop: x
708
+ draggingId: h,
709
+ dragOverId: g,
710
+ allowedDropGroups: _,
711
+ onDragStart: v,
712
+ onDragEnd: y,
713
+ onDragOver: b,
714
+ onDragLeave: x,
715
+ onDrop: S
718
716
  })
719
717
  });
720
- }, we = (e, t) => t === X.All ? !0 : e.source === t, Te = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ee = new Set([
721
- X.Pinned,
722
- X.MyChats,
723
- X.Shared,
724
- X.Organization
725
- ]), De = x(({ conversations: e, isLoading: s, isOpen: c, onSelectConversation: l, activeConversationId: u, labels: d, onNewChat: f, styles: p, className: g, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: T, onActiveFilterChange: E, isFilterTabsHidden: A = !1 }) => {
726
- let { colors: N, typography: P, newChatButton: F } = p ?? {}, { title: ee, emptyLabel: I, noResultsLabel: L, loadingLabel: R = "Loading conversations", newChatLabel: te, searchPlaceholder: z, searchClearLabel: B, filterLabels: ne, groupLabels: V, actionsLabel: H, unreadIndicatorLabel: U, closeAriaLabel: re } = d, [W, G] = k(""), [K, ie] = k(X.All);
727
- C(() => {
728
- T != null && ie(T);
729
- }, [T]);
730
- let [q, ae] = k(() => Ee), [J, oe] = k(5), se = w(), ce = O(null), de = O(null), [pe, ge] = k(null), [_e, ye] = k(null), [xe, Se] = k(null), De = O(null), Oe = O(null), ke = S(({ height: e }) => {
731
- oe(Math.ceil(e / 36 * 2));
732
- }, []), Ae = S((e) => {
733
- G(e ?? "");
734
- }, []), je = S((e) => {
735
- ae((t) => {
718
+ }, Ue = (e, t) => t === r.All ? !0 : e.source === t, We = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ge = new Set([
719
+ r.Pinned,
720
+ r.MyChats,
721
+ r.Shared,
722
+ r.Organization
723
+ ]), Ke = M(({ conversations: e, isLoading: t, isOpen: n, onSelectConversation: a, activeConversationId: s, labels: c, onNewChat: p, styles: m, className: h, getActions: g, onActionMenuOpen: _, onToggle: v, headerActions: y, onMoveConversation: b, activeFilter: x, onActiveFilterChange: S, isFilterTabsHidden: C = !1 }) => {
724
+ let { colors: w, typography: T, newChatButton: E } = m ?? {}, { title: O, emptyLabel: k, noResultsLabel: A, loadingLabel: te = "Loading conversations", newChatLabel: ne, searchPlaceholder: j, searchClearLabel: M, filterLabels: ie, groupLabels: F, actionsLabel: ae, unreadIndicatorLabel: V, closeAriaLabel: oe } = c, [H, se] = R(""), [ce, U] = R(r.All);
725
+ P(() => {
726
+ x != null && U(x);
727
+ }, [x]);
728
+ let [W, le] = R(() => Ge), [ue, de] = R(5), fe = re(), pe = L(null), G = L(null), [me, he] = R(null), [ge, K] = R(null), [_e, ve] = R(null), q = L(null), J = L(null), ye = N(({ height: e }) => {
729
+ de(Math.ceil(e / 36 * 2));
730
+ }, []), be = N((e) => {
731
+ se(e ?? "");
732
+ }, []), xe = N((e) => {
733
+ le((t) => {
736
734
  let n = new Set(t);
737
735
  return n.has(e) ? n.delete(e) : n.add(e), n;
738
736
  });
739
- }, []), Me = S(() => {
740
- De.current = null, Oe.current = null, ge(null), ye(null), Se(null);
741
- }, []), Ne = S((t, n) => {
742
- let r = he(t, me(n, t), e);
743
- De.current = t, Oe.current = r, ge(t), Se(r);
744
- }, [e]), Pe = S(() => {
745
- Me();
746
- }, [Me]), Fe = S((e) => {
747
- ye(e);
748
- }, []), Ie = S(() => {
749
- ye(null);
750
- }, []), Le = S((e, t, n) => {
751
- let r = De.current, i = Oe.current;
752
- Me(), r != null && r !== e && i?.has(t) && x?.({
737
+ }, []), Se = N(() => {
738
+ q.current = null, J.current = null, he(null), K(null), ve(null);
739
+ }, []), Ce = N((t, n) => {
740
+ let r = Fe(t, Pe(n, t), e);
741
+ q.current = t, J.current = r, he(t), ve(r);
742
+ }, [e]), we = N(() => {
743
+ Se();
744
+ }, [Se]), Te = N((e) => {
745
+ K(e);
746
+ }, []), Ee = N(() => {
747
+ K(null);
748
+ }, []), De = N((e, t, n) => {
749
+ let r = q.current, i = J.current;
750
+ Se(), r != null && r !== e && i?.has(t) && b?.({
753
751
  draggedId: r,
754
752
  targetGroupKey: t,
755
753
  afterId: n
756
754
  });
757
- }, [Me, x]), Re = t({
758
- "--cp-item-hover": N?.itemHover,
759
- "--cp-item-active": N?.itemActive,
760
- "--cp-text": N?.text,
761
- "--cp-text-secondary": N?.textSecondary,
762
- "--cp-new-chat-bg": F?.background,
763
- "--cp-new-chat-text": F?.text,
764
- "--cp-new-chat-focus-outline": F?.focusOutline,
765
- "--cp-drop-zone-ring": N?.dropZoneRing,
766
- "--cp-trigger-bg": N?.triggerBackground,
767
- "--cp-trigger-icon": N?.triggerIcon,
768
- "--cp-trigger-icon-idle": N?.triggerIconIdle,
769
- "--cp-skeleton-color": N?.skeletonColor,
770
- "--cp-task-badge-border": N?.taskBadgeBorder,
771
- "--cp-task-badge-bg": N?.taskBadgeBackground,
772
- "--cp-task-badge-text": N?.taskBadgeText,
773
- "--cp-unread-dot": N?.unreadDot
774
- }), Q = D(() => e.filter((e) => we(e, K) && Te(e, W)), [
755
+ }, [Se, b]), Oe = i({
756
+ "--cp-item-hover": w?.itemHover,
757
+ "--cp-item-active": w?.itemActive,
758
+ "--cp-text": w?.text,
759
+ "--cp-text-secondary": w?.textSecondary,
760
+ "--cp-new-chat-bg": E?.background,
761
+ "--cp-new-chat-text": E?.text,
762
+ "--cp-new-chat-focus-outline": E?.focusOutline,
763
+ "--cp-drop-zone-ring": w?.dropZoneRing,
764
+ "--cp-trigger-bg": w?.triggerBackground,
765
+ "--cp-trigger-icon": w?.triggerIcon,
766
+ "--cp-trigger-icon-idle": w?.triggerIconIdle,
767
+ "--cp-skeleton-color": w?.skeletonColor,
768
+ "--cp-task-badge-border": w?.taskBadgeBorder,
769
+ "--cp-task-badge-bg": w?.taskBadgeBackground,
770
+ "--cp-task-badge-text": w?.taskBadgeText,
771
+ "--cp-unread-dot": w?.unreadDot
772
+ }), Y = I(() => e.filter((e) => Ue(e, ce) && We(e, H)), [
775
773
  e,
776
- K,
777
- W
778
- ]), ze = D(() => Q.filter((e) => e.isPinned), [Q]), Be = D(() => Q.filter((e) => !e.isPinned && e.source !== X.Shared && e.source !== X.Organization), [Q]), Ve = D(() => Q.filter((e) => !e.isPinned && e.source === X.Shared), [Q]), He = D(() => Q.filter((e) => !e.isPinned && e.source === X.Organization), [Q]), Ue = D(() => [
774
+ ce,
775
+ H
776
+ ]), je = I(() => Y.filter((e) => e.isPinned), [Y]), Ne = I(() => Y.filter((e) => !e.isPinned && e.source !== r.Shared && e.source !== r.Organization), [Y]), Ie = I(() => Y.filter((e) => !e.isPinned && e.source === r.Shared), [Y]), Le = I(() => Y.filter((e) => !e.isPinned && e.source === r.Organization), [Y]), ze = I(() => [
779
777
  {
780
- key: X.Pinned,
781
- label: V?.pinned ?? "Pinned",
782
- items: ze
778
+ key: r.Pinned,
779
+ label: F?.pinned ?? "Pinned",
780
+ items: je
783
781
  },
784
782
  {
785
- key: X.MyChats,
786
- label: V?.myChats ?? "My chats",
787
- items: Be
783
+ key: r.MyChats,
784
+ label: F?.myChats ?? "My chats",
785
+ items: Ne
788
786
  },
789
787
  {
790
- key: X.Shared,
791
- label: V?.shared ?? "Shared",
792
- items: Ve
788
+ key: r.Shared,
789
+ label: F?.shared ?? "Shared",
790
+ items: Ie
793
791
  },
794
792
  {
795
- key: X.Organization,
796
- label: V?.organization ?? "Organization",
797
- items: He
793
+ key: r.Organization,
794
+ label: F?.organization ?? "Organization",
795
+ items: Le
798
796
  }
799
797
  ], [
800
- V,
801
- ze,
802
- Be,
803
- Ve,
804
- He
805
- ]), $ = D(() => {
798
+ F,
799
+ je,
800
+ Ne,
801
+ Ie,
802
+ Le
803
+ ]), Q = I(() => {
806
804
  let e = [];
807
- for (let t of Ue) if (t.items.length !== 0 && (e.push({
808
- kind: Y.Header,
805
+ for (let t of ze) if (t.items.length !== 0 && (e.push({
806
+ kind: X.Header,
809
807
  groupKey: t.key,
810
808
  label: t.label
811
- }), q.has(t.key))) for (let n of t.items) e.push({
812
- kind: Y.Item,
809
+ }), W.has(t.key))) for (let n of t.items) e.push({
810
+ kind: X.Item,
813
811
  item: n,
814
812
  groupKey: t.key
815
813
  });
816
814
  return e;
817
- }, [Ue, q]);
818
- C(() => {
819
- if (!u || de.current === u) return;
820
- let e = $.findIndex((e) => e.kind === Y.Item && e.item.id === u);
821
- e >= 0 && (ce.current?.scrollToRow({
815
+ }, [ze, W]);
816
+ P(() => {
817
+ if (!s || G.current === s) return;
818
+ let e = Q.findIndex((e) => e.kind === X.Item && e.item.id === s);
819
+ e >= 0 && (pe.current?.scrollToRow({
822
820
  index: e,
823
821
  align: "smart",
824
822
  behavior: "smooth"
825
- }), de.current = u);
823
+ }), G.current = s);
826
824
  }, [
827
- u,
828
- Ue,
829
- q,
830
- $
825
+ s,
826
+ ze,
827
+ W,
828
+ Q
831
829
  ]);
832
- let We = D(() => ({
833
- rows: $,
834
- expandedGroups: q,
835
- onToggleGroup: je,
836
- listId: se,
837
- activeConversationId: u,
838
- searchQuery: W,
839
- onSelectConversation: l,
840
- getActions: _,
841
- onActionMenuOpen: v,
842
- actionsLabel: H,
843
- unreadIndicatorLabel: U,
830
+ let Ve = I(() => ({
831
+ rows: Q,
832
+ expandedGroups: W,
833
+ onToggleGroup: xe,
834
+ listId: fe,
835
+ activeConversationId: s,
836
+ searchQuery: H,
837
+ onSelectConversation: a,
838
+ getActions: g,
839
+ onActionMenuOpen: _,
840
+ actionsLabel: ae,
841
+ unreadIndicatorLabel: V,
844
842
  styles: {
845
- groupHeaderClassName: P?.groupHeaderClassName,
846
- itemTitleClassName: P?.itemTitleClassName,
847
- itemIconBadgeClassName: p?.itemIconBadgeClassName,
848
- taskBadgeClassName: p?.taskBadgeClassName
843
+ groupHeaderClassName: T?.groupHeaderClassName,
844
+ itemTitleClassName: T?.itemTitleClassName,
845
+ itemIconBadgeClassName: m?.itemIconBadgeClassName,
846
+ taskBadgeClassName: m?.taskBadgeClassName
849
847
  },
850
- draggingId: pe,
851
- dragOverId: _e,
852
- allowedDropGroups: xe,
853
- onDragStart: (e) => Ne(e, $),
854
- onDragEnd: Pe,
855
- onDragOver: Fe,
856
- onDragLeave: Ie,
857
- onDrop: Le
848
+ draggingId: me,
849
+ dragOverId: ge,
850
+ allowedDropGroups: _e,
851
+ onDragStart: (e) => Ce(e, Q),
852
+ onDragEnd: we,
853
+ onDragOver: Te,
854
+ onDragLeave: Ee,
855
+ onDrop: De
858
856
  }), [
859
- $,
860
- q,
861
- je,
862
- se,
863
- u,
857
+ Q,
864
858
  W,
865
- l,
866
- _,
867
- v,
859
+ xe,
860
+ fe,
861
+ s,
868
862
  H,
869
- U,
870
- P?.groupHeaderClassName,
871
- P?.itemTitleClassName,
872
- p?.itemIconBadgeClassName,
873
- p?.taskBadgeClassName,
874
- pe,
863
+ a,
864
+ g,
865
+ _,
866
+ ae,
867
+ V,
868
+ T?.groupHeaderClassName,
869
+ T?.itemTitleClassName,
870
+ m?.itemIconBadgeClassName,
871
+ m?.taskBadgeClassName,
872
+ me,
873
+ ge,
875
874
  _e,
876
- xe,
877
- Ne,
878
- Pe,
879
- Fe,
880
- Ie,
881
- Le
882
- ]), Ge = e.length === 0, Ke = e.length > 0 && Q.length === 0;
883
- return /* @__PURE__ */ M(o, {
884
- isOpen: c,
885
- orientation: a.Left,
886
- title: ee,
875
+ Ce,
876
+ we,
877
+ Te,
878
+ Ee,
879
+ De
880
+ ]), Ke = e.length === 0, $ = e.length > 0 && Y.length === 0;
881
+ return /* @__PURE__ */ B(f, {
882
+ isOpen: n,
883
+ orientation: d.Left,
884
+ title: O,
887
885
  labels: {
888
- ariaLabel: ee,
889
- closeLabel: re
886
+ ariaLabel: O,
887
+ closeLabel: oe
890
888
  },
891
- onClose: y,
889
+ onClose: v,
892
890
  styles: {
893
891
  colors: {
894
- background: N?.background,
895
- border: N?.border
892
+ background: w?.background,
893
+ border: w?.border
896
894
  },
897
- typography: { fontClassName: P?.fontClassName },
895
+ typography: { fontClassName: T?.fontClassName },
898
896
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
899
- cssVars: Re,
900
- titleClassName: P?.fontClassName,
897
+ cssVars: Oe,
898
+ titleClassName: T?.fontClassName,
901
899
  headerClassName: "h-[64px]",
902
- className: n(c ? "w-[324px] mobile:w-full" : "w-0", g)
900
+ className: o(n ? "w-[324px] mobile:w-full" : "w-0", h)
903
901
  },
904
- rightActions: b,
902
+ rightActions: y,
905
903
  children: [
906
- /* @__PURE__ */ j(be, {
907
- label: te,
908
- onClick: f,
909
- labelClassName: P?.newChatLabelClassName,
910
- colors: F
904
+ /* @__PURE__ */ z(Be, {
905
+ label: ne,
906
+ onClick: p,
907
+ labelClassName: T?.newChatLabelClassName,
908
+ colors: E
911
909
  }),
912
- /* @__PURE__ */ j("div", {
910
+ /* @__PURE__ */ z("div", {
913
911
  role: "search",
914
912
  className: "px-3 py-2",
915
- children: /* @__PURE__ */ j(m, {
913
+ children: /* @__PURE__ */ z(D, {
916
914
  wrapperClassName: "rounded-full",
917
- value: W,
918
- onChange: Ae,
919
- placeholder: z,
920
- clearLabel: B,
921
- "aria-label": z
915
+ value: H,
916
+ onChange: be,
917
+ placeholder: j,
918
+ clearLabel: M,
919
+ "aria-label": j
922
920
  })
923
921
  }),
924
- !A && /* @__PURE__ */ j(ve, {
925
- activeTab: K,
926
- labels: ne,
922
+ !C && /* @__PURE__ */ z(Re, {
923
+ activeTab: ce,
924
+ labels: ie,
927
925
  onChange: (e) => {
928
- ie(e), E?.(e);
926
+ U(e), S?.(e);
929
927
  },
930
- tabClassName: P?.tabClassName
928
+ tabClassName: T?.tabClassName
931
929
  }),
932
- /* @__PURE__ */ j("span", {
930
+ /* @__PURE__ */ z("span", {
933
931
  role: "status",
934
932
  "aria-live": "polite",
935
933
  className: "sr-only",
936
- children: s ? R : Ge ? I : Ke ? L : ""
934
+ children: t ? te : Ke ? k : $ ? A : ""
937
935
  }),
938
- /* @__PURE__ */ j("div", {
936
+ /* @__PURE__ */ z("div", {
939
937
  className: "flex-1 overflow-hidden px-2 py-1",
940
- children: s ? /* @__PURE__ */ j("div", {
938
+ children: t ? /* @__PURE__ */ z("div", {
941
939
  className: "flex flex-col gap-3 px-2 py-3",
942
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ j(h, {
940
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ z(ee, {
943
941
  avatar: { size: 24 },
944
- showTitle: { width: ue(t) },
942
+ showTitle: { width: Ae(t) },
945
943
  paragraph: !1,
946
944
  active: !0,
947
945
  color: Z.skeletonColor
948
946
  }, t))
949
- }) : Ge ? /* @__PURE__ */ j(r, { label: I }) : Ke ? /* @__PURE__ */ j(i, { label: L }) : /* @__PURE__ */ j(le, {
950
- listRef: ce,
951
- id: se,
947
+ }) : Ke ? /* @__PURE__ */ z(l, { label: k }) : $ ? /* @__PURE__ */ z(u, { label: A }) : /* @__PURE__ */ z(ke, {
948
+ listRef: pe,
949
+ id: fe,
952
950
  role: "list",
953
951
  style: { height: "100%" },
954
- rowComponent: Ce,
955
- rowCount: $.length,
956
- rowHeight: fe,
957
- overscanCount: J,
958
- onResize: ke,
959
- rowProps: We
952
+ rowComponent: He,
953
+ rowCount: Q.length,
954
+ rowHeight: Me,
955
+ overscanCount: ue,
956
+ onResize: ye,
957
+ rowProps: Ve
958
+ })
959
+ })
960
+ ]
961
+ });
962
+ }), $ = {
963
+ root: "_root_fgzx8_1",
964
+ text: "_text_fgzx8_5",
965
+ textSecondary: "_textSecondary_fgzx8_9",
966
+ successIcon: "_successIcon_fgzx8_13",
967
+ errorIcon: "_errorIcon_fgzx8_17",
968
+ failureCount: "_failureCount_fgzx8_21"
969
+ }, qe = 8e3, Je = "flex size-7 shrink-0 items-center justify-center", Ye = (e, n) => e.subject.kind === t.Single ? e.subject.title : n, Xe = (e) => e.subject.kind === t.Single ? e.subject.sourceBreadcrumb : void 0, Ze = (e, t, n) => e && t ? n.closeQueueConfirmDescriptionMixed : t ? n.closeQueueConfirmDescriptionFailed : n.closeQueueConfirmDescriptionInProgress, Qe = ({ job: t, labels: n, onDismiss: r, onRetry: i, styles: a }) => {
970
+ let s = Ye(t, n.allConversationsJobLabel), c = Xe(t), l = a?.typography;
971
+ return /* @__PURE__ */ B("div", {
972
+ className: "flex items-center gap-2 px-3 py-2",
973
+ children: [/* @__PURE__ */ B("div", {
974
+ className: "min-w-0 flex-1",
975
+ children: [c && /* @__PURE__ */ z(b, {
976
+ text: c,
977
+ className: o($.textSecondary, l?.jobDescriptionClassName || "dial-caption-text"),
978
+ contentClassName: "!z-[80]"
979
+ }), /* @__PURE__ */ z(b, {
980
+ text: s,
981
+ className: o($.text, l?.jobLabelClassName || "dial-small-text"),
982
+ contentClassName: "!z-[80]"
983
+ })]
984
+ }), /* @__PURE__ */ B("div", {
985
+ className: "flex shrink-0 items-center gap-1",
986
+ children: [
987
+ t.status === e.Success && /* @__PURE__ */ z("span", {
988
+ className: Je,
989
+ children: /* @__PURE__ */ z(U, {
990
+ size: 16,
991
+ className: $.successIcon
992
+ })
993
+ }),
994
+ t.status === e.Failed && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z(x, {
995
+ "aria-label": n.retryJobAriaLabel(s),
996
+ icon: /* @__PURE__ */ z(de, {
997
+ size: _.SM,
998
+ className: $.textSecondary
999
+ }),
1000
+ onClick: () => i(t.id)
1001
+ }), /* @__PURE__ */ z("span", {
1002
+ className: Je,
1003
+ children: /* @__PURE__ */ z(V, {
1004
+ size: 16,
1005
+ className: $.errorIcon
1006
+ })
1007
+ })] }),
1008
+ t.status === e.InProgress && /* @__PURE__ */ z(x, {
1009
+ "aria-label": n.closeJobAriaLabel(s),
1010
+ size: y.Small,
1011
+ icon: /* @__PURE__ */ z(pe, {
1012
+ size: _.SM,
1013
+ className: $.textSecondary
1014
+ }),
1015
+ onClick: () => r(t.id),
1016
+ className: Je
1017
+ })
1018
+ ]
1019
+ })]
1020
+ });
1021
+ }, $e = M(({ title: t, jobs: n, onClose: r, onDismiss: a, onRetry: s, labels: c, styles: l }) => {
1022
+ let [u, d] = R(!1), [f, p] = R(!1), m = l?.colors, v = l?.typography, b = {
1023
+ ...i({
1024
+ "--cp-transfer-queue-bg": m?.background,
1025
+ "--cp-transfer-queue-text": m?.text,
1026
+ "--cp-transfer-queue-text-secondary": m?.textSecondary,
1027
+ "--cp-transfer-queue-success-icon": m?.successIcon,
1028
+ "--cp-transfer-queue-error-icon": m?.errorIcon,
1029
+ "--cp-transfer-queue-failure-count-bg": m?.failureCountBackground,
1030
+ "--cp-transfer-queue-failure-count-text": m?.failureCountText
1031
+ }),
1032
+ ...l?.cssVars
1033
+ }, S = n.some((t) => t.status === e.InProgress), C = n.some((t) => t.status === e.Failed), w = n.length > 0 && !S && !C, T = N(() => {
1034
+ S || C ? p(!0) : r();
1035
+ }, [
1036
+ S,
1037
+ C,
1038
+ r
1039
+ ]), D = N(() => {
1040
+ p(!1), r();
1041
+ }, [r]);
1042
+ if (P(() => {
1043
+ if (!w) return;
1044
+ let e = setTimeout(r, qe);
1045
+ return () => clearTimeout(e);
1046
+ }, [w, r]), n.length === 0) return null;
1047
+ let ee = n.filter((t) => t.status !== e.InProgress).length, O = n.filter((t) => t.status === e.Failed).length, k = Math.round(ee / n.length * 100);
1048
+ return /* @__PURE__ */ B("div", {
1049
+ role: "status",
1050
+ "aria-live": "polite",
1051
+ style: b,
1052
+ className: o($.root, "w-[320px] rounded-lg shadow-lg", l?.rootClassName),
1053
+ children: [
1054
+ /* @__PURE__ */ B("div", {
1055
+ className: "flex items-center justify-between px-3 py-2",
1056
+ children: [/* @__PURE__ */ B("div", {
1057
+ className: "flex items-center gap-2",
1058
+ children: [/* @__PURE__ */ z("span", {
1059
+ className: o($.text, v?.titleClassName || "dial-small-semi-text"),
1060
+ children: t
1061
+ }), O > 0 && /* @__PURE__ */ z("span", {
1062
+ className: o($.failureCount, "inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1", v?.failureCountClassName || "dial-small-semi-text"),
1063
+ children: O
1064
+ })]
1065
+ }), /* @__PURE__ */ B("div", {
1066
+ className: "flex items-center gap-1",
1067
+ children: [/* @__PURE__ */ z(x, {
1068
+ "aria-label": u ? c.expandQueueAriaLabel : c.collapseQueueAriaLabel,
1069
+ size: y.Small,
1070
+ icon: z(u ? ce : se, {
1071
+ size: _.SM,
1072
+ className: $.textSecondary
1073
+ }),
1074
+ onClick: () => d((e) => !e),
1075
+ className: Je
1076
+ }), /* @__PURE__ */ z(x, {
1077
+ "aria-label": c.closeQueueAriaLabel,
1078
+ size: y.Small,
1079
+ icon: /* @__PURE__ */ z(pe, {
1080
+ size: _.SM,
1081
+ className: $.textSecondary
1082
+ }),
1083
+ onClick: T,
1084
+ className: Je
1085
+ })]
1086
+ })]
1087
+ }),
1088
+ /* @__PURE__ */ z("div", {
1089
+ className: "px-3 pb-2",
1090
+ children: /* @__PURE__ */ z(E, {
1091
+ value: k,
1092
+ size: y.Small,
1093
+ "aria-label": t,
1094
+ className: "w-full"
960
1095
  })
1096
+ }),
1097
+ !u && /* @__PURE__ */ z("div", {
1098
+ className: o("flex max-h-[40vh] flex-col overflow-y-auto", l?.bodyClassName),
1099
+ children: n.map((e) => /* @__PURE__ */ z(Qe, {
1100
+ job: e,
1101
+ labels: c,
1102
+ onDismiss: a,
1103
+ onRetry: s,
1104
+ styles: l
1105
+ }, e.id))
1106
+ }),
1107
+ /* @__PURE__ */ z(h, {
1108
+ open: f,
1109
+ header: c.closeQueueConfirmHeader,
1110
+ description: Ze(S, C, c),
1111
+ confirmLabel: c.closeLabel,
1112
+ cancelLabel: c.cancelLabel,
1113
+ variant: g.Danger,
1114
+ onConfirm: D,
1115
+ onClose: () => p(!1)
961
1116
  })
962
1117
  ]
963
1118
  });
964
1119
  });
1120
+ $e.displayName = "ImportExportQueue";
1121
+ //#endregion
1122
+ //#region src/components/RenameConversationPopup/RenameConversationPopup.tsx
1123
+ var et = M(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: i, onCancel: o, onGenerateWithAi: l, labels: u, styles: d }) => {
1124
+ let [f, p] = R(t), [h, g] = R(!1), [v, y] = R(null), b = L(null), S = L(!1), E = L(0);
1125
+ P(() => {
1126
+ let n = e && !S.current;
1127
+ if (S.current = e, !e) {
1128
+ E.current += 1, g(!1);
1129
+ return;
1130
+ }
1131
+ if (!n) return;
1132
+ E.current += 1, p(t), y(null), g(!1);
1133
+ let r = setTimeout(() => b.current?.focus(), 0);
1134
+ return () => clearTimeout(r);
1135
+ }, [e, t]), P(() => () => {
1136
+ E.current += 1;
1137
+ }, []);
1138
+ let D = c(f.trim()), ee = a(D) > 255, O = n || D === "" || D === t.trim() || ee, A = N(() => {
1139
+ O || i(D);
1140
+ }, [
1141
+ O,
1142
+ i,
1143
+ D
1144
+ ]), te = N((e) => {
1145
+ e.key === "Enter" && A();
1146
+ }, [A]), ne = N(async () => {
1147
+ if (h) return;
1148
+ let e = ++E.current;
1149
+ g(!0), y(null);
1150
+ try {
1151
+ let t = await l();
1152
+ if (e !== E.current) return;
1153
+ p(s(t));
1154
+ } catch {
1155
+ if (e !== E.current) return;
1156
+ y(u.renameWithAiError);
1157
+ } finally {
1158
+ e === E.current && g(!1);
1159
+ }
1160
+ }, [
1161
+ h,
1162
+ l,
1163
+ u.renameWithAiError
1164
+ ]), j;
1165
+ return j = ee ? u.nameTooLongError : v ?? r ?? void 0, /* @__PURE__ */ z(w, {
1166
+ open: e,
1167
+ header: u.popupTitle,
1168
+ size: T.Sm,
1169
+ onClose: o,
1170
+ mainButtons: n ? void 0 : [{
1171
+ label: u.cancelLabel,
1172
+ onClick: o
1173
+ }, {
1174
+ label: u.saveLabel,
1175
+ variant: m.Primary,
1176
+ disabled: O,
1177
+ onClick: A
1178
+ }],
1179
+ children: /* @__PURE__ */ z("div", {
1180
+ className: d?.bodyClassName,
1181
+ style: d?.cssVars,
1182
+ children: n ? /* @__PURE__ */ z("div", {
1183
+ className: "h-[120px] px-6 py-4",
1184
+ children: /* @__PURE__ */ z(k, { size: 50 })
1185
+ }) : /* @__PURE__ */ B("div", {
1186
+ className: "flex items-start gap-2 px-6 py-3",
1187
+ children: [/* @__PURE__ */ z("div", {
1188
+ className: "min-w-0 flex-1",
1189
+ children: /* @__PURE__ */ z(C, {
1190
+ inputRef: b,
1191
+ value: f,
1192
+ placeholder: u.inputPlaceholder,
1193
+ error: j,
1194
+ onChange: (e) => p(s(e ?? "")),
1195
+ onKeyDown: te
1196
+ })
1197
+ }), /* @__PURE__ */ z(x, {
1198
+ "aria-label": u.renameWithAiLabel,
1199
+ tooltipProps: { tooltip: u.renameWithAiLabel },
1200
+ disabled: h || n,
1201
+ onClick: ne,
1202
+ icon: h ? /* @__PURE__ */ z(k, { size: _.MD }) : /* @__PURE__ */ z(fe, {
1203
+ size: _.MD,
1204
+ stroke: 1.5
1205
+ })
1206
+ })]
1207
+ })
1208
+ })
1209
+ });
1210
+ });
1211
+ et.displayName = "RenameConversationPopup";
965
1212
  //#endregion
966
- export { De as ConversationPanel, X as FilterTab };
1213
+ export { Ke as ConversationPanel, r as FilterTab, $e as ImportExportQueue, et as RenameConversationPopup };