@epam/ai-dial-conversation-panel 1.0.0 → 1.0.2

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 (33) hide show
  1. package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +1 -1
  2. package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
  3. package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
  4. package/components/ConversationPanel/utils.d.ts +1 -1
  5. package/components/ConversationPanel/utils.d.ts.map +1 -1
  6. package/components/ConversationRow/ConversationRow.d.ts +1 -1
  7. package/components/ConversationRow/ConversationRow.d.ts.map +1 -1
  8. package/components/FilterTabs/FilterTabs.d.ts +1 -1
  9. package/components/FilterTabs/FilterTabs.d.ts.map +1 -1
  10. package/components/ImportExportQueue/ImportExportQueue.d.ts +6 -0
  11. package/components/ImportExportQueue/ImportExportQueue.d.ts.map +1 -0
  12. package/components/NewChatButton/NewChatButton.d.ts.map +1 -1
  13. package/components/RenameConversationPopup/RenameConversationPopup.d.ts +6 -0
  14. package/components/RenameConversationPopup/RenameConversationPopup.d.ts.map +1 -0
  15. package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
  16. package/index.css +1 -1
  17. package/index.d.ts +4 -1
  18. package/index.d.ts.map +1 -1
  19. package/index.js +707 -456
  20. package/models/import-export-queue.d.ts +88 -0
  21. package/models/import-export-queue.d.ts.map +1 -0
  22. package/models/panel-props.d.ts +1 -1
  23. package/models/panel-props.d.ts.map +1 -1
  24. package/models/rename-conversation-popup.d.ts +47 -0
  25. package/models/rename-conversation-popup.d.ts.map +1 -0
  26. package/models/virtual-row.d.ts +1 -2
  27. package/models/virtual-row.d.ts.map +1 -1
  28. package/package.json +4 -4
  29. package/utils/conversation-row.d.ts.map +1 -1
  30. package/utils/drag.d.ts +1 -1
  31. package/utils/drag.d.ts.map +1 -1
  32. package/types/conversation-classification.d.ts +0 -9
  33. package/types/conversation-classification.d.ts.map +0 -1
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 _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, EllipsisTooltip as x, GhostIconButton as S, Highlight as C, Input as w, Popup as T, PopupSize as E, ProgressBar as D, Search as O, Skeleton as ee, SkeletonVariant as k, Spinner as A, Tag as j, TagAppearance as te, mergeClasses as M } from "@epam/ai-dial-ui-kit";
4
+ import { createElement as ne, memo as N, useCallback as P, useEffect as F, useId as re, useImperativeHandle as I, useLayoutEffect as ie, useMemo as L, useRef as R, useState as z } from "react";
5
+ import { Fragment as ae, jsx as B, jsxs as V } from "react/jsx-runtime";
6
+ import { IconAlertCircleFilled as H, IconCaretDownFilled as U, IconCaretRightFilled as oe, IconChevronDown as se, IconChevronUp as ce, IconCircleCheckFilled as W, IconClock as le, IconDotsVertical as ue, IconPlus as de, IconRefresh as fe, IconSparkles as pe, IconX as me } 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" ? ie : F;
9
+ function he(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 ge({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
+ let { styleHeight: s, styleWidth: c } = L(() => ({
19
+ styleHeight: he(o?.height),
20
+ styleWidth: he(o?.width)
21
+ }), [o?.height, o?.width]), [l, u] = z({
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
+ ]), L(() => ({
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 _e(e) {
55
+ let t = R(() => {
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]), P((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 ve(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 ye({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
+ if (t === "horizontal" && n) switch (ve()) {
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 be(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 xe({ 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 Se({ 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 = xe({
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 J({ 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 Ce({ 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 we({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return L(() => Ce({
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 Te({ 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 Ee({ 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 } = ge({
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 = R({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = q({
204
+ }), p = r === "vertical" ? u : d, m = Te({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- E(() => {
208
+ ie(() => {
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 = we({
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 = P((e) => h.get(e), [h]), [_, v] = z(() => J({
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 = P(() => xe({
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 = P((t) => J({
245
245
  cachedBounds: h,
246
- containerScrollOffset: V({
246
+ containerScrollOffset: ye({
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 = J({
275
275
  cachedBounds: h,
276
- containerScrollOffset: V({
276
+ containerScrollOffset: ye({
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 be(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: _e(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
+ let s = Se({
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 = ye({
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
+ be(_, 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 De(e) {
332
+ return L(() => e, Object.values(e));
333
333
  }
334
- function oe(e, t) {
334
+ function Oe(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 be(n, a) && be(r, o) && be(i, s);
337
337
  }
338
- function se(e) {
338
+ function Y(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 ke = "data-react-window-index";
342
+ function Ae({ 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 = De(u), h = L(() => N(s, Oe), [s]), [g, _] = z(null), v = Y(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Ee({
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: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
351
351
  onResize: i,
352
352
  overscanCount: o
353
353
  });
354
- T(r, () => ({
354
+ I(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(ke, 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
+ ]), F(() => {
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 = L(() => {
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__ */ ne(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__ */ B("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 ne(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -446,521 +446,772 @@ 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
+ }({}), je = (e) => `${60 + e * 23 % 35}%`, Me = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", Ne = (e, t) => t.rows[e].kind === X.Item ? 36 : e === 0 ? 24 : 56, Pe = (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
+ }, Fe = (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
+ }, Ie = (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(Pe(t.source));
471
+ } else i.add(r.Pinned);
472
+ return i;
473
+ }, Le = (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
+ }, Re = [
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
+ ], ze = N(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ B("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: Re.map(({ value: i, labelKey: a }) => /* @__PURE__ */ B(j, {
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: M("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
+ })), Z = { button: "_button_8xsgo_1" }, Be = N(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: r }) => /* @__PURE__ */ B("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__ */ V("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-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Z.button),
522
+ children: [/* @__PURE__ */ B(de, {
525
523
  size: 18,
526
- stroke: 2,
524
+ stroke: v,
527
525
  className: "shrink-0"
528
- }), /* @__PURE__ */ j("span", {
529
- className: i,
526
+ }), /* @__PURE__ */ B("span", {
527
+ className: n,
530
528
  children: e
531
529
  })]
532
530
  })
533
- })), Z = {
531
+ })), Q = {
534
532
  skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
535
- item: "_item_1tjrz_1",
536
- itemActive: "_itemActive_1tjrz_7",
537
- groupHeader: "_groupHeader_1tjrz_12",
538
- taskBadge: "_taskBadge_1tjrz_16",
539
- dropZoneActive: "_dropZoneActive_1tjrz_22",
540
- triggerActive: "_triggerActive_1tjrz_27",
541
- triggerIcon: "_triggerIcon_1tjrz_30",
542
- unreadDot: "_unreadDot_1tjrz_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", {
533
+ item: "_item_1x1vj_1",
534
+ itemActive: "_itemActive_1x1vj_7",
535
+ groupHeader: "_groupHeader_1x1vj_12",
536
+ taskBadge: "_taskBadge_1x1vj_16",
537
+ dropZoneActive: "_dropZoneActive_1x1vj_22",
538
+ triggerActive: "_triggerActive_1x1vj_27",
539
+ triggerIcon: "_triggerIcon_1x1vj_30",
540
+ unreadDot: "_unreadDot_1x1vj_38"
541
+ }, Ve = ({ 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__ */ V("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, {
561
- stroke: .5,
557
+ className: o("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Q.groupHeader, s && Q.dropZoneActive),
558
+ children: [t ? /* @__PURE__ */ B(U, {
562
559
  size: 12,
563
560
  className: "shrink-0",
564
561
  "aria-hidden": !0
565
- }) : /* @__PURE__ */ j(P, {
566
- stroke: .5,
562
+ }) : /* @__PURE__ */ B(oe, {
567
563
  size: 12,
568
564
  className: "shrink-0 rtl:scale-x-[-1]",
569
565
  "aria-hidden": !0
570
- }), /* @__PURE__ */ j(d, { text: e })]
566
+ }), /* @__PURE__ */ B(x, { text: e })]
571
567
  });
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,
579
- color: Z.skeletonColor,
568
+ }, He = ({ 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: x, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: D, onDragLeave: O, onDrop: A }) => {
569
+ let [j, te] = z(!1), M = R(null), ne = P((t) => {
570
+ te(t), t && M.current && s?.(e, M.current);
571
+ }, [e, s]), N = a?.(e) ?? [], F = N.length > 0, re = e.isIconLoading ? /* @__PURE__ */ B(ee, {
572
+ variant: k.Circular,
573
+ width: _.LG,
574
+ height: _.LG,
575
+ color: Q.skeletonColor,
580
576
  "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", {
577
+ }) : /* @__PURE__ */ B(n, {
578
+ src: e.iconUrl,
579
+ size: _.LG,
580
+ initialsName: e.iconTooltip ?? "",
581
+ labels: { tooltip: e.iconTooltip },
582
+ styles: { badgeClassName: u }
583
+ }), I = /* @__PURE__ */ V("span", {
588
584
  className: "flex shrink-0 items-center",
589
- children: [/* @__PURE__ */ j("span", {
585
+ children: [/* @__PURE__ */ B("span", {
590
586
  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),
587
+ children: e.isUnread && /* @__PURE__ */ V(ae, { children: [/* @__PURE__ */ B("span", {
588
+ className: o("size-[5.33px] rounded-full", Q.unreadDot),
593
589
  "aria-hidden": !0
594
- }), /* @__PURE__ */ j("span", {
590
+ }), /* @__PURE__ */ B("span", {
595
591
  className: "sr-only",
596
- children: b
592
+ children: f
597
593
  })] })
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, {
594
+ }), re]
595
+ }), ie = Me(F, j), L = e.showTaskBadge ? /* @__PURE__ */ V("span", {
596
+ className: o("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Q.taskBadge, d),
597
+ children: [/* @__PURE__ */ B(le, {
602
598
  size: 12,
603
- "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);
599
+ "aria-hidden": !0,
600
+ stroke: v
601
+ }), e.taskBadgeLabel]
602
+ }) : void 0, H = m != null, U = P((e) => {
603
+ e.currentTarget.contains(e.relatedTarget) || O?.();
604
+ }, [O]), oe = P((t) => {
605
+ if (!m || !h || !A) return;
606
+ t.preventDefault();
607
+ let n = Le(t, e.id, h, m);
608
+ A(e.id, m, n);
612
609
  }, [
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);
610
+ e.id,
611
+ h,
612
+ m,
613
+ A
614
+ ]), se = e.id === g, ce = e.id === x, W = m != null && (w?.has(m) ?? !1), de = g != null;
615
+ return /* @__PURE__ */ V("li", {
616
+ className: o("group/conversation relative", se && "cursor-grabbing opacity-50", ce && W && "rounded", ce && W && Q.dropZoneActive, de && !se && !W && "cursor-not-allowed"),
617
+ draggable: H || void 0,
618
+ onDragStart: H ? () => T?.(e.id) : void 0,
619
+ onDragEnd: H ? E : void 0,
620
+ onDragOver: H ? (t) => {
621
+ t.preventDefault(), D?.(e.id);
625
622
  } : void 0,
626
- onDragLeave: G ? K : void 0,
627
- onDrop: G ? ie : void 0,
628
- children: [/* @__PURE__ */ j("a", {
629
- href: t.href,
623
+ onDragLeave: H ? U : void 0,
624
+ onDrop: H ? oe : void 0,
625
+ children: [/* @__PURE__ */ B("a", {
626
+ href: e.href,
630
627
  className: "contents",
631
- onClick: (e) => {
632
- t.href && (e.preventDefault(), i(t.id));
628
+ onClick: (t) => {
629
+ e.href && (t.preventDefault(), r(e.id));
633
630
  },
634
- children: /* @__PURE__ */ j(s, {
635
- iconBefore: U,
636
- label: /* @__PURE__ */ j(p, {
637
- text: t.title,
638
- query: a,
639
- className: _,
631
+ children: /* @__PURE__ */ B(p, {
632
+ iconBefore: I,
633
+ label: /* @__PURE__ */ B(C, {
634
+ text: e.title,
635
+ query: i,
636
+ className: l,
640
637
  maxLines: 1
641
638
  }),
642
- iconAfter: W,
639
+ iconAfter: L,
643
640
  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)
641
+ "aria-current": t ? "page" : void 0,
642
+ onClick: e.href ? void 0 : () => r(e.id),
643
+ tabIndex: e.href ? -1 : void 0,
644
+ className: o("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0 after:pointer-events-none", ie, Q.item, t && Q.itemActive, j && Q.itemActive)
648
645
  })
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,
646
+ }), F && /* @__PURE__ */ B("div", {
647
+ className: o("absolute inset-y-0 end-1 flex items-center", j ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
648
+ children: /* @__PURE__ */ B(y, {
649
+ items: N,
650
+ onOpenChange: ne,
654
651
  matchReferenceWidth: !1,
655
652
  listClassName: "w-[200px]",
656
- children: /* @__PURE__ */ j(f, {
657
- ref: z,
658
- icon: /* @__PURE__ */ j(ee, {
659
- size: c.SM,
660
- className: Z.triggerIcon,
661
- "aria-hidden": !0
653
+ children: /* @__PURE__ */ B(S, {
654
+ ref: M,
655
+ icon: /* @__PURE__ */ B(ue, {
656
+ size: _.SM,
657
+ className: Q.triggerIcon,
658
+ "aria-hidden": !0,
659
+ stroke: v
662
660
  }),
663
- size: u.Small,
664
- "aria-label": m,
665
- className: n(R && Z.triggerActive)
661
+ size: b.Small,
662
+ "aria-label": c,
663
+ className: o(j && Q.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
+ }, Ue = ({ 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__ */ B("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__ */ B(Ve, {
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__ */ B("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__ */ B(He, {
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
+ }, We = (e, t) => t === r.All ? !0 : e.source === t, Ge = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ke = new Set([
719
+ r.Pinned,
720
+ r.MyChats,
721
+ r.Shared,
722
+ r.Organization
723
+ ]), qe = N(({ 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: D, emptyLabel: k, noResultsLabel: A, loadingLabel: j = "Loading conversations", newChatLabel: te, searchPlaceholder: M, searchClearLabel: ne, filterLabels: N, groupLabels: I, actionsLabel: ie, unreadIndicatorLabel: ae, closeAriaLabel: H } = c, [U, oe] = z(""), [se, ce] = z(r.All);
725
+ F(() => {
726
+ x != null && ce(x);
727
+ }, [x]);
728
+ let [W, le] = z(() => Ke), [ue, de] = z(5), fe = re(), pe = R(null), me = R(null), [G, he] = z(null), [ge, _e] = z(null), [K, ve] = z(null), ye = R(null), q = R(null), be = P(({ height: e }) => {
729
+ de(Math.ceil(e / 36 * 2));
730
+ }, []), xe = P((e) => {
731
+ oe(e ?? "");
732
+ }, []), Se = P((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
+ }, []), J = P(() => {
738
+ ye.current = null, q.current = null, he(null), _e(null), ve(null);
739
+ }, []), Ce = P((t, n) => {
740
+ let r = Ie(t, Fe(n, t), e);
741
+ ye.current = t, q.current = r, he(t), ve(r);
742
+ }, [e]), we = P(() => {
743
+ J();
744
+ }, [J]), Te = P((e) => {
745
+ _e(e);
746
+ }, []), Ee = P(() => {
747
+ _e(null);
748
+ }, []), De = P((e, t, n) => {
749
+ let r = ye.current, i = q.current;
750
+ J(), 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
+ }, [J, 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 = L(() => e.filter((e) => We(e, se) && Ge(e, U)), [
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
+ se,
775
+ U
776
+ ]), ke = L(() => Y.filter((e) => e.isPinned), [Y]), Me = L(() => Y.filter((e) => !e.isPinned && e.source !== r.Shared && e.source !== r.Organization), [Y]), Pe = L(() => Y.filter((e) => !e.isPinned && e.source === r.Shared), [Y]), Le = L(() => Y.filter((e) => !e.isPinned && e.source === r.Organization), [Y]), Re = L(() => [
779
777
  {
780
- key: X.Pinned,
781
- label: V?.pinned ?? "Pinned",
782
- items: ze
778
+ key: r.Pinned,
779
+ label: I?.pinned ?? "Pinned",
780
+ items: ke
783
781
  },
784
782
  {
785
- key: X.MyChats,
786
- label: V?.myChats ?? "My chats",
787
- items: Be
783
+ key: r.MyChats,
784
+ label: I?.myChats ?? "My chats",
785
+ items: Me
788
786
  },
789
787
  {
790
- key: X.Shared,
791
- label: V?.shared ?? "Shared",
792
- items: Ve
788
+ key: r.Shared,
789
+ label: I?.shared ?? "Shared",
790
+ items: Pe
793
791
  },
794
792
  {
795
- key: X.Organization,
796
- label: V?.organization ?? "Organization",
797
- items: He
793
+ key: r.Organization,
794
+ label: I?.organization ?? "Organization",
795
+ items: Le
798
796
  }
799
797
  ], [
800
- V,
801
- ze,
802
- Be,
803
- Ve,
804
- He
805
- ]), $ = D(() => {
798
+ I,
799
+ ke,
800
+ Me,
801
+ Pe,
802
+ Le
803
+ ]), Z = L(() => {
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 Re) 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
+ }, [Re, W]);
816
+ F(() => {
817
+ if (!s || me.current === s) return;
818
+ let e = Z.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
+ }), me.current = s);
826
824
  }, [
827
- u,
828
- Ue,
829
- q,
830
- $
825
+ s,
826
+ Re,
827
+ W,
828
+ Z
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 = L(() => ({
831
+ rows: Z,
832
+ expandedGroups: W,
833
+ onToggleGroup: Se,
834
+ listId: fe,
835
+ activeConversationId: s,
836
+ searchQuery: U,
837
+ onSelectConversation: a,
838
+ getActions: g,
839
+ onActionMenuOpen: _,
840
+ actionsLabel: ie,
841
+ unreadIndicatorLabel: ae,
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: G,
849
+ dragOverId: ge,
850
+ allowedDropGroups: K,
851
+ onDragStart: (e) => Ce(e, Z),
852
+ onDragEnd: we,
853
+ onDragOver: Te,
854
+ onDragLeave: Ee,
855
+ onDrop: De
858
856
  }), [
859
- $,
860
- q,
861
- je,
862
- se,
863
- u,
857
+ Z,
864
858
  W,
865
- l,
866
- _,
867
- v,
868
- H,
859
+ Se,
860
+ fe,
861
+ s,
869
862
  U,
870
- P?.groupHeaderClassName,
871
- P?.itemTitleClassName,
872
- p?.itemIconBadgeClassName,
873
- p?.taskBadgeClassName,
874
- pe,
875
- _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,
863
+ a,
864
+ g,
865
+ _,
866
+ ie,
867
+ ae,
868
+ T?.groupHeaderClassName,
869
+ T?.itemTitleClassName,
870
+ m?.itemIconBadgeClassName,
871
+ m?.taskBadgeClassName,
872
+ G,
873
+ ge,
874
+ K,
875
+ Ce,
876
+ we,
877
+ Te,
878
+ Ee,
879
+ De
880
+ ]), He = e.length === 0, qe = e.length > 0 && Y.length === 0;
881
+ return /* @__PURE__ */ V(f, {
882
+ isOpen: n,
883
+ orientation: d.Left,
884
+ title: D,
887
885
  labels: {
888
- ariaLabel: ee,
889
- closeLabel: re
886
+ ariaLabel: D,
887
+ closeLabel: H
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, {
904
+ /* @__PURE__ */ B(Be, {
907
905
  label: te,
908
- onClick: f,
909
- labelClassName: P?.newChatLabelClassName,
910
- colors: F
906
+ onClick: p,
907
+ labelClassName: T?.newChatLabelClassName,
908
+ colors: E
911
909
  }),
912
- /* @__PURE__ */ j("div", {
910
+ /* @__PURE__ */ B("div", {
913
911
  role: "search",
914
912
  className: "px-3 py-2",
915
- children: /* @__PURE__ */ j(m, {
913
+ children: /* @__PURE__ */ B(O, {
916
914
  wrapperClassName: "rounded-full",
917
- value: W,
918
- onChange: Ae,
919
- placeholder: z,
920
- clearLabel: B,
921
- "aria-label": z
915
+ value: U,
916
+ onChange: xe,
917
+ placeholder: M,
918
+ clearLabel: ne,
919
+ "aria-label": M
922
920
  })
923
921
  }),
924
- !A && /* @__PURE__ */ j(ve, {
925
- activeTab: K,
926
- labels: ne,
922
+ !C && /* @__PURE__ */ B(ze, {
923
+ activeTab: se,
924
+ labels: N,
927
925
  onChange: (e) => {
928
- ie(e), E?.(e);
926
+ ce(e), S?.(e);
929
927
  },
930
- tabClassName: P?.tabClassName
928
+ tabClassName: T?.tabClassName
931
929
  }),
932
- /* @__PURE__ */ j("span", {
930
+ /* @__PURE__ */ B("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 ? j : He ? k : qe ? A : ""
937
935
  }),
938
- /* @__PURE__ */ j("div", {
936
+ /* @__PURE__ */ B("div", {
939
937
  className: "flex-1 overflow-hidden px-2 py-1",
940
- children: s ? /* @__PURE__ */ j("div", {
938
+ children: t ? /* @__PURE__ */ B("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__ */ B(ee, {
943
941
  avatar: { size: 24 },
944
- showTitle: { width: ue(t) },
942
+ showTitle: { width: je(t) },
945
943
  paragraph: !1,
946
944
  active: !0,
947
- color: Z.skeletonColor
945
+ color: Q.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
+ }) : He ? /* @__PURE__ */ B(l, { label: k }) : qe ? /* @__PURE__ */ B(u, { label: A }) : /* @__PURE__ */ B(Ae, {
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: Ue,
953
+ rowCount: Z.length,
954
+ rowHeight: Ne,
955
+ overscanCount: ue,
956
+ onResize: be,
957
+ rowProps: Ve
960
958
  })
961
959
  })
962
960
  ]
963
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
+ }, Je = 8e3, Ye = "flex size-7 shrink-0 items-center justify-center", Xe = (e, n) => e.subject.kind === t.Single ? e.subject.title : n, Ze = (e) => e.subject.kind === t.Single ? e.subject.sourceBreadcrumb : void 0, Qe = (e, t, n) => e && t ? n.closeQueueConfirmDescriptionMixed : t ? n.closeQueueConfirmDescriptionFailed : n.closeQueueConfirmDescriptionInProgress, $e = ({ job: t, labels: n, onDismiss: r, onRetry: i, styles: a }) => {
970
+ let s = Xe(t, n.allConversationsJobLabel), c = Ze(t), l = a?.typography;
971
+ return /* @__PURE__ */ V("div", {
972
+ className: "flex items-center gap-2 px-3 py-2",
973
+ children: [/* @__PURE__ */ V("div", {
974
+ className: "min-w-0 flex-1",
975
+ children: [c && /* @__PURE__ */ B(x, {
976
+ text: c,
977
+ className: o($.textSecondary, l?.jobDescriptionClassName || "dial-caption-text"),
978
+ contentClassName: "!z-[80]"
979
+ }), /* @__PURE__ */ B(x, {
980
+ text: s,
981
+ className: o($.text, l?.jobLabelClassName || "dial-small-text"),
982
+ contentClassName: "!z-[80]"
983
+ })]
984
+ }), /* @__PURE__ */ V("div", {
985
+ className: "flex shrink-0 items-center gap-1",
986
+ children: [
987
+ t.status === e.Success && /* @__PURE__ */ B("span", {
988
+ className: Ye,
989
+ children: /* @__PURE__ */ B(W, {
990
+ size: 16,
991
+ className: $.successIcon
992
+ })
993
+ }),
994
+ t.status === e.Failed && /* @__PURE__ */ V(ae, { children: [/* @__PURE__ */ B(S, {
995
+ "aria-label": n.retryJobAriaLabel(s),
996
+ icon: /* @__PURE__ */ B(fe, {
997
+ size: _.SM,
998
+ className: $.textSecondary,
999
+ stroke: v
1000
+ }),
1001
+ onClick: () => i(t.id)
1002
+ }), /* @__PURE__ */ B("span", {
1003
+ className: Ye,
1004
+ children: /* @__PURE__ */ B(H, {
1005
+ size: 16,
1006
+ className: $.errorIcon
1007
+ })
1008
+ })] }),
1009
+ t.status === e.InProgress && /* @__PURE__ */ B(S, {
1010
+ "aria-label": n.closeJobAriaLabel(s),
1011
+ size: b.Small,
1012
+ icon: /* @__PURE__ */ B(me, {
1013
+ size: _.SM,
1014
+ className: $.textSecondary,
1015
+ stroke: v
1016
+ }),
1017
+ onClick: () => r(t.id),
1018
+ className: Ye
1019
+ })
1020
+ ]
1021
+ })]
1022
+ });
1023
+ }, et = N(({ title: t, jobs: n, onClose: r, onDismiss: a, onRetry: s, labels: c, styles: l }) => {
1024
+ let [u, d] = z(!1), [f, p] = z(!1), m = l?.colors, y = l?.typography, x = {
1025
+ ...i({
1026
+ "--cp-transfer-queue-bg": m?.background,
1027
+ "--cp-transfer-queue-text": m?.text,
1028
+ "--cp-transfer-queue-text-secondary": m?.textSecondary,
1029
+ "--cp-transfer-queue-success-icon": m?.successIcon,
1030
+ "--cp-transfer-queue-error-icon": m?.errorIcon,
1031
+ "--cp-transfer-queue-failure-count-bg": m?.failureCountBackground,
1032
+ "--cp-transfer-queue-failure-count-text": m?.failureCountText
1033
+ }),
1034
+ ...l?.cssVars
1035
+ }, C = n.some((t) => t.status === e.InProgress), w = n.some((t) => t.status === e.Failed), T = n.length > 0 && !C && !w, E = P(() => {
1036
+ C || w ? p(!0) : r();
1037
+ }, [
1038
+ C,
1039
+ w,
1040
+ r
1041
+ ]), O = P(() => {
1042
+ p(!1), r();
1043
+ }, [r]);
1044
+ if (F(() => {
1045
+ if (!T) return;
1046
+ let e = setTimeout(r, Je);
1047
+ return () => clearTimeout(e);
1048
+ }, [T, r]), n.length === 0) return null;
1049
+ let ee = n.filter((t) => t.status !== e.InProgress).length, k = n.filter((t) => t.status === e.Failed).length, A = Math.round(ee / n.length * 100);
1050
+ return /* @__PURE__ */ V("div", {
1051
+ role: "status",
1052
+ "aria-live": "polite",
1053
+ style: x,
1054
+ className: o($.root, "w-[320px] rounded-lg shadow-lg", l?.rootClassName),
1055
+ children: [
1056
+ /* @__PURE__ */ V("div", {
1057
+ className: "flex items-center justify-between px-3 py-2",
1058
+ children: [/* @__PURE__ */ V("div", {
1059
+ className: "flex items-center gap-2",
1060
+ children: [/* @__PURE__ */ B("span", {
1061
+ className: o($.text, y?.titleClassName || "dial-small-semi-text"),
1062
+ children: t
1063
+ }), k > 0 && /* @__PURE__ */ B("span", {
1064
+ className: o($.failureCount, "inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1", y?.failureCountClassName || "dial-small-semi-text"),
1065
+ children: k
1066
+ })]
1067
+ }), /* @__PURE__ */ V("div", {
1068
+ className: "flex items-center gap-1",
1069
+ children: [/* @__PURE__ */ B(S, {
1070
+ "aria-label": u ? c.expandQueueAriaLabel : c.collapseQueueAriaLabel,
1071
+ size: b.Small,
1072
+ icon: B(u ? ce : se, {
1073
+ size: _.SM,
1074
+ className: $.textSecondary,
1075
+ stroke: v
1076
+ }),
1077
+ onClick: () => d((e) => !e),
1078
+ className: Ye
1079
+ }), /* @__PURE__ */ B(S, {
1080
+ "aria-label": c.closeQueueAriaLabel,
1081
+ size: b.Small,
1082
+ icon: /* @__PURE__ */ B(me, {
1083
+ size: _.SM,
1084
+ className: $.textSecondary,
1085
+ stroke: v
1086
+ }),
1087
+ onClick: E,
1088
+ className: Ye
1089
+ })]
1090
+ })]
1091
+ }),
1092
+ /* @__PURE__ */ B("div", {
1093
+ className: "px-3 pb-2",
1094
+ children: /* @__PURE__ */ B(D, {
1095
+ value: A,
1096
+ size: b.Small,
1097
+ "aria-label": t,
1098
+ className: "w-full"
1099
+ })
1100
+ }),
1101
+ !u && /* @__PURE__ */ B("div", {
1102
+ className: o("flex max-h-[40vh] flex-col overflow-y-auto", l?.bodyClassName),
1103
+ children: n.map((e) => /* @__PURE__ */ B($e, {
1104
+ job: e,
1105
+ labels: c,
1106
+ onDismiss: a,
1107
+ onRetry: s,
1108
+ styles: l
1109
+ }, e.id))
1110
+ }),
1111
+ /* @__PURE__ */ B(h, {
1112
+ open: f,
1113
+ header: c.closeQueueConfirmHeader,
1114
+ description: Qe(C, w, c),
1115
+ confirmLabel: c.closeLabel,
1116
+ cancelLabel: c.cancelLabel,
1117
+ variant: g.Danger,
1118
+ onConfirm: O,
1119
+ onClose: () => p(!1)
1120
+ })
1121
+ ]
1122
+ });
1123
+ });
1124
+ et.displayName = "ImportExportQueue";
1125
+ //#endregion
1126
+ //#region src/components/RenameConversationPopup/RenameConversationPopup.tsx
1127
+ var tt = N(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: i, onCancel: o, onGenerateWithAi: l, labels: u, styles: d }) => {
1128
+ let [f, p] = z(t), [h, g] = z(!1), [y, b] = z(null), x = R(null), C = R(!1), D = R(0);
1129
+ F(() => {
1130
+ let n = e && !C.current;
1131
+ if (C.current = e, !e) {
1132
+ D.current += 1, g(!1);
1133
+ return;
1134
+ }
1135
+ if (!n) return;
1136
+ D.current += 1, p(t), b(null), g(!1);
1137
+ let r = setTimeout(() => x.current?.focus(), 0);
1138
+ return () => clearTimeout(r);
1139
+ }, [e, t]), F(() => () => {
1140
+ D.current += 1;
1141
+ }, []);
1142
+ let O = c(f.trim()), ee = a(O) > 255, k = n || O === "" || O === t.trim() || ee, j = P(() => {
1143
+ k || i(O);
1144
+ }, [
1145
+ k,
1146
+ i,
1147
+ O
1148
+ ]), te = P((e) => {
1149
+ e.key === "Enter" && j();
1150
+ }, [j]), M = P(async () => {
1151
+ if (h) return;
1152
+ let e = ++D.current;
1153
+ g(!0), b(null);
1154
+ try {
1155
+ let t = await l();
1156
+ if (e !== D.current) return;
1157
+ p(s(t));
1158
+ } catch {
1159
+ if (e !== D.current) return;
1160
+ b(u.renameWithAiError);
1161
+ } finally {
1162
+ e === D.current && g(!1);
1163
+ }
1164
+ }, [
1165
+ h,
1166
+ l,
1167
+ u.renameWithAiError
1168
+ ]), ne;
1169
+ return ne = ee ? u.nameTooLongError : y ?? r ?? void 0, /* @__PURE__ */ B(T, {
1170
+ open: e,
1171
+ header: u.popupTitle,
1172
+ size: E.Sm,
1173
+ onClose: o,
1174
+ mainButtons: n ? void 0 : [{
1175
+ label: u.cancelLabel,
1176
+ onClick: o
1177
+ }, {
1178
+ label: u.saveLabel,
1179
+ variant: m.Primary,
1180
+ disabled: k,
1181
+ onClick: j
1182
+ }],
1183
+ children: /* @__PURE__ */ B("div", {
1184
+ className: d?.bodyClassName,
1185
+ style: d?.cssVars,
1186
+ children: n ? /* @__PURE__ */ B("div", {
1187
+ className: "h-[120px] px-6 py-4",
1188
+ children: /* @__PURE__ */ B(A, { size: 50 })
1189
+ }) : /* @__PURE__ */ V("div", {
1190
+ className: "flex items-start gap-2 px-6 py-3",
1191
+ children: [/* @__PURE__ */ B("div", {
1192
+ className: "min-w-0 flex-1",
1193
+ children: /* @__PURE__ */ B(w, {
1194
+ inputRef: x,
1195
+ value: f,
1196
+ placeholder: u.inputPlaceholder,
1197
+ error: ne,
1198
+ onChange: (e) => p(s(e ?? "")),
1199
+ onKeyDown: te
1200
+ })
1201
+ }), /* @__PURE__ */ B(S, {
1202
+ "aria-label": u.renameWithAiLabel,
1203
+ tooltipProps: { tooltip: u.renameWithAiLabel },
1204
+ disabled: h || n,
1205
+ onClick: M,
1206
+ icon: h ? /* @__PURE__ */ B(A, { size: _.MD }) : /* @__PURE__ */ B(pe, {
1207
+ size: _.MD,
1208
+ stroke: v
1209
+ })
1210
+ })]
1211
+ })
1212
+ })
1213
+ });
964
1214
  });
1215
+ tt.displayName = "RenameConversationPopup";
965
1216
  //#endregion
966
- export { De as ConversationPanel, X as FilterTab };
1217
+ export { qe as ConversationPanel, et as ImportExportQueue, tt as RenameConversationPopup };