@epam/ai-dial-conversation-panel 1.1.0-dev.297 → 1.1.0-dev.299

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
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
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";
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 G = typeof window < "u" ? F : P;
9
- function me(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,11 +14,11 @@ function me(e) {
14
14
  break;
15
15
  }
16
16
  }
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({
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;
@@ -42,7 +42,7 @@ function he({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), I(() => ({
45
+ ]), L(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -51,16 +51,16 @@ function he({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
51
51
  c
52
52
  ]);
53
53
  }
54
- function ge(e) {
55
- let t = L(() => {
54
+ function _e(e) {
55
+ let t = R(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
58
  return G(() => {
59
59
  t.current = e;
60
- }, [e]), N((e) => t.current?.(e), [t]);
60
+ }, [e]), P((e) => t.current?.(e), [t]);
61
61
  }
62
62
  var K = null;
63
- function _e(e = !1) {
63
+ function ve(e = !1) {
64
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";
@@ -69,8 +69,8 @@ function _e(e = !1) {
69
69
  }
70
70
  return K;
71
71
  }
72
- function ve({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (_e()) {
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) {
@@ -84,13 +84,13 @@ function ve({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
84
84
  function q(e, t = "Assertion error") {
85
85
  if (!e) throw console.error(t), Error(t);
86
86
  }
87
- function J(e, t) {
87
+ function be(e, t) {
88
88
  if (e === t) return !0;
89
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 ye({ 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
  {
@@ -98,9 +98,9 @@ function ye({ cachedBounds: e, itemCount: t, itemSize: n }) {
98
98
  return q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
99
99
  }
100
100
  }
101
- function be({ 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 = ye({
103
+ let s = xe({
104
104
  cachedBounds: t,
105
105
  itemCount: r,
106
106
  itemSize: i
@@ -112,7 +112,7 @@ function be({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
112
112
  default: return a >= u && a <= l ? a : a < u ? u : l;
113
113
  }
114
114
  }
115
- function xe({ 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,7 +131,7 @@ function xe({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
131
131
  stopIndexOverscan: l
132
132
  };
133
133
  }
134
- function Se({ 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) {
@@ -168,8 +168,8 @@ function Se({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function Ce({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return I(() => Se({
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,7 +179,7 @@ function Ce({ itemCount: e, itemProps: t, itemSize: n }) {
179
179
  n
180
180
  ]);
181
181
  }
182
- function we({ containerSize: e, itemSize: t }) {
182
+ function Te({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
@@ -191,21 +191,21 @@ function we({ containerSize: e, itemSize: t }) {
191
191
  }
192
192
  return n;
193
193
  }
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({
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 = L({
201
+ }), f = R({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = we({
204
+ }), p = r === "vertical" ? u : d, m = Te({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- F(() => {
208
+ ie(() => {
209
209
  if (typeof c == "function") {
210
210
  let e = f.current;
211
211
  (e.height !== u || e.width !== d) && (c({
@@ -218,11 +218,11 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
218
218
  c,
219
219
  d
220
220
  ]);
221
- let h = Ce({
221
+ let h = we({
222
222
  itemCount: a,
223
223
  itemProps: o,
224
224
  itemSize: m
225
- }), g = N((e) => h.get(e), [h]), [_, v] = R(() => xe({
225
+ }), g = P((e) => h.get(e), [h]), [_, v] = z(() => J({
226
226
  cachedBounds: h,
227
227
  containerScrollOffset: 0,
228
228
  containerSize: p,
@@ -233,7 +233,7 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
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
- }, C = N(() => ye({
236
+ }, C = P(() => xe({
237
237
  cachedBounds: h,
238
238
  itemCount: a,
239
239
  itemSize: m
@@ -241,9 +241,9 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
241
241
  h,
242
242
  a,
243
243
  m
244
- ]), w = N((t) => xe({
244
+ ]), w = P((t) => J({
245
245
  cachedBounds: h,
246
- containerScrollOffset: ve({
246
+ containerScrollOffset: ye({
247
247
  containerElement: e,
248
248
  direction: r,
249
249
  isRtl: i,
@@ -271,9 +271,9 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
271
271
  if (!e) return;
272
272
  let t = () => {
273
273
  v((t) => {
274
- let { scrollLeft: n, scrollTop: o } = e, s = xe({
274
+ let { scrollLeft: n, scrollTop: o } = e, s = J({
275
275
  cachedBounds: h,
276
- containerScrollOffset: ve({
276
+ containerScrollOffset: ye({
277
277
  containerElement: e,
278
278
  direction: r,
279
279
  isRtl: i,
@@ -283,7 +283,7 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
283
283
  itemCount: a,
284
284
  overscanCount: l
285
285
  });
286
- return J(s, t) ? t : s;
286
+ return be(s, t) ? t : s;
287
287
  });
288
288
  };
289
289
  return e.addEventListener("scroll", t), () => {
@@ -299,8 +299,8 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
299
299
  ]), {
300
300
  getCellBounds: g,
301
301
  getEstimatedSize: C,
302
- scrollToIndex: ge(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
- let s = be({
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,14 +310,14 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
310
310
  itemSize: m
311
311
  });
312
312
  if (e) {
313
- if (s = ve({
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
319
  let e = w(s);
320
- J(_, e) || v(e);
320
+ be(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
@@ -328,30 +328,30 @@ function Te({ containerElement: e, containerStyle: t, defaultContainerSize: n =
328
328
  stopIndexVisible: x
329
329
  };
330
330
  }
331
- function Ee(e) {
332
- return I(() => e, Object.values(e));
331
+ function De(e) {
332
+ return L(() => e, Object.values(e));
333
333
  }
334
- function De(e, t) {
334
+ function Oe(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
- return J(n, a) && J(r, o) && J(i, s);
336
+ return be(n, a) && be(r, o) && be(i, s);
337
337
  }
338
- function Oe(e) {
338
+ function Y(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
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({
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: I(() => 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
- ie(r, () => ({
354
+ I(r, () => ({
355
355
  get element() {
356
356
  return g;
357
357
  },
@@ -371,7 +371,7 @@ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
371
371
  let e = Array.from(g.children).filter((e, t) => {
372
372
  if (e.hasAttribute("aria-hidden")) return !1;
373
373
  let n = `${S + t}`;
374
- return e.setAttribute(Y, n), !0;
374
+ return e.setAttribute(ke, n), !0;
375
375
  });
376
376
  if (v) return l.observeRowElements(e);
377
377
  }, [
@@ -380,7 +380,7 @@ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
380
380
  l,
381
381
  S,
382
382
  w
383
- ]), P(() => {
383
+ ]), F(() => {
384
384
  S >= 0 && w >= 0 && a && a({
385
385
  startIndex: C,
386
386
  stopIndex: T
@@ -395,11 +395,11 @@ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
395
395
  w,
396
396
  T
397
397
  ]);
398
- let E = I(() => {
398
+ let E = L(() => {
399
399
  let e = [];
400
400
  if (c > 0) for (let t = S; t <= w; t++) {
401
401
  let n = y(t);
402
- e.push(/* @__PURE__ */ j(h, {
402
+ e.push(/* @__PURE__ */ ne(h, {
403
403
  ...m,
404
404
  ariaAttributes: {
405
405
  "aria-posinset": t + 1,
@@ -426,7 +426,7 @@ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
426
426
  m,
427
427
  S,
428
428
  w
429
- ]), D = /* @__PURE__ */ z("div", {
429
+ ]), D = /* @__PURE__ */ B("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
432
  height: b(),
@@ -434,7 +434,7 @@ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
434
434
  zIndex: -1
435
435
  }
436
436
  });
437
- return j(d, {
437
+ return ne(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -452,25 +452,25 @@ function ke({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
452
452
  //#region src/types/virtual-row.ts
453
453
  var X = /* @__PURE__ */ function(e) {
454
454
  return e.Header = "header", e.Item = "item", 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) => {
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) => {
456
456
  switch (e) {
457
457
  case r.Shared: return r.Shared;
458
458
  case r.Organization: return r.Organization;
459
459
  default: return r.MyChats;
460
460
  }
461
- }, Pe = (e, t) => {
461
+ }, Fe = (e, t) => {
462
462
  let n = null;
463
463
  for (let r of e) if (r.kind === X.Header) n = r.groupKey;
464
464
  else if (r.item.id === t) return n;
465
465
  return null;
466
- }, Fe = (e, t, n) => {
466
+ }, Ie = (e, t, n) => {
467
467
  let i = /* @__PURE__ */ new Set();
468
468
  if (t != null && i.add(t), t === r.Pinned) {
469
469
  let t = n.find((t) => t.id === e);
470
- t && i.add(Ne(t.source));
470
+ t && i.add(Pe(t.source));
471
471
  } else i.add(r.Pinned);
472
472
  return i;
473
- }, Ie = (e, t, n, r) => {
473
+ }, Le = (e, t, n, r) => {
474
474
  let i = e.currentTarget.getBoundingClientRect();
475
475
  if (e.clientY >= i.top + i.height / 2) return t;
476
476
  let a = null, o = !1;
@@ -480,7 +480,7 @@ var X = /* @__PURE__ */ function(e) {
480
480
  a = e.item.id;
481
481
  }
482
482
  return null;
483
- }, Le = [
483
+ }, Re = [
484
484
  {
485
485
  value: r.All,
486
486
  labelKey: "all"
@@ -497,50 +497,50 @@ var X = /* @__PURE__ */ function(e) {
497
497
  value: r.Organization,
498
498
  labelKey: "organization"
499
499
  }
500
- ], Re = M(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ z("div", {
500
+ ], ze = N(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ B("div", {
501
501
  role: "group",
502
502
  "aria-label": t.groupAriaLabel ?? "Filter chats",
503
503
  className: "flex flex-nowrap gap-1 px-3 py-2",
504
- children: Le.map(({ value: i, labelKey: a }) => /* @__PURE__ */ z(A, {
504
+ children: Re.map(({ value: i, labelKey: a }) => /* @__PURE__ */ B(j, {
505
505
  label: t[a],
506
506
  appearance: te.Selectable,
507
507
  selected: e === i,
508
508
  onClick: () => n(i),
509
- className: ne("flex-1 justify-center rounded-full", r)
509
+ className: M("flex-1 justify-center rounded-full", r)
510
510
  }, i))
511
- })), ze = { button: "_button_8xsgo_1" }, Be = M(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: r }) => /* @__PURE__ */ z("div", {
511
+ })), Z = { button: "_button_8xsgo_1" }, Be = N(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: r }) => /* @__PURE__ */ B("div", {
512
512
  className: "px-3 py-2",
513
513
  style: i({
514
514
  "--cp-new-chat-bg": r?.background,
515
515
  "--cp-new-chat-text": r?.text,
516
516
  "--cp-new-chat-focus-outline": r?.focusOutline
517
517
  }),
518
- children: /* @__PURE__ */ B("button", {
518
+ children: /* @__PURE__ */ V("button", {
519
519
  onClick: t,
520
520
  type: "button",
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, {
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, {
523
523
  size: 18,
524
- stroke: 2,
524
+ stroke: v,
525
525
  className: "shrink-0"
526
- }), /* @__PURE__ */ z("span", {
526
+ }), /* @__PURE__ */ B("span", {
527
527
  className: n,
528
528
  children: e
529
529
  })]
530
530
  })
531
- })), Z = {
531
+ })), Q = {
532
532
  skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
533
- item: "_item_1rnkj_1",
534
- itemActive: "_itemActive_1rnkj_7",
535
- groupHeader: "_groupHeader_1rnkj_12",
536
- taskBadge: "_taskBadge_1rnkj_16",
537
- dropZoneActive: "_dropZoneActive_1rnkj_22",
538
- triggerActive: "_triggerActive_1rnkj_27",
539
- triggerIcon: "_triggerIcon_1rnkj_30",
540
- unreadDot: "_unreadDot_1rnkj_38"
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 }) => {
533
+ item: "_item_1c8qk_1",
534
+ itemActive: "_itemActive_1c8qk_7",
535
+ groupHeader: "_groupHeader_1c8qk_12",
536
+ taskBadge: "_taskBadge_1c8qk_16",
537
+ dropZoneActive: "_dropZoneActive_1c8qk_22",
538
+ triggerActive: "_triggerActive_1c8qk_27",
539
+ triggerIcon: "_triggerIcon_1c8qk_30",
540
+ unreadDot: "_unreadDot_1c8qk_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
542
  let d = a != null;
543
- return /* @__PURE__ */ B("button", {
543
+ return /* @__PURE__ */ V("button", {
544
544
  type: "button",
545
545
  "aria-expanded": t,
546
546
  "aria-controls": r,
@@ -554,126 +554,126 @@ var X = /* @__PURE__ */ function(e) {
554
554
  onDrop: d ? (e) => {
555
555
  d && (e.preventDefault(), u?.(a, a, null));
556
556
  } : void 0,
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, {
559
- 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, {
560
559
  size: 12,
561
560
  className: "shrink-0",
562
561
  "aria-hidden": !0
563
- }) : /* @__PURE__ */ z(H, {
564
- stroke: .5,
562
+ }) : /* @__PURE__ */ B(oe, {
565
563
  size: 12,
566
564
  className: "shrink-0 rtl:scale-x-[-1]",
567
565
  "aria-hidden": !0
568
- }), /* @__PURE__ */ z(b, { text: e })]
566
+ }), /* @__PURE__ */ B(x, { text: e })]
569
567
  });
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,
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,
575
573
  width: _.LG,
576
574
  height: _.LG,
577
- color: Z.skeletonColor,
575
+ color: Q.skeletonColor,
578
576
  "aria-hidden": !0
579
- }) : /* @__PURE__ */ z(n, {
577
+ }) : /* @__PURE__ */ B(n, {
580
578
  src: e.iconUrl,
581
579
  size: _.LG,
582
580
  initialsName: e.iconTooltip ?? "",
583
581
  labels: { tooltip: e.iconTooltip },
584
582
  styles: { badgeClassName: u }
585
- }), ie = /* @__PURE__ */ B("span", {
583
+ }), I = /* @__PURE__ */ V("span", {
586
584
  className: "flex shrink-0 items-center",
587
- children: [/* @__PURE__ */ z("span", {
585
+ children: [/* @__PURE__ */ B("span", {
588
586
  className: "relative flex size-3 shrink-0 items-center justify-center",
589
- children: e.isUnread && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z("span", {
590
- className: o("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),
591
589
  "aria-hidden": !0
592
- }), /* @__PURE__ */ z("span", {
590
+ }), /* @__PURE__ */ B("span", {
593
591
  className: "sr-only",
594
592
  children: f
595
593
  })] })
596
594
  }), 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, {
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, {
600
598
  size: 12,
601
- "aria-hidden": !0
599
+ "aria-hidden": !0,
600
+ stroke: v
602
601
  }), 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;
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;
607
606
  t.preventDefault();
608
- let n = Ie(t, e.id, h, m);
609
- k(e.id, m, n);
607
+ let n = Le(t, e.id, h, m);
608
+ A(e.id, m, n);
610
609
  }, [
611
610
  e.id,
612
611
  h,
613
612
  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);
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);
623
622
  } : void 0,
624
- onDragLeave: V ? oe : void 0,
625
- onDrop: V ? H : void 0,
626
- children: [/* @__PURE__ */ z("a", {
623
+ onDragLeave: H ? U : void 0,
624
+ onDrop: H ? oe : void 0,
625
+ children: [/* @__PURE__ */ B("a", {
627
626
  href: e.href,
628
627
  className: "contents",
629
628
  onClick: (t) => {
630
629
  e.href && (t.preventDefault(), r(e.id));
631
630
  },
632
- children: /* @__PURE__ */ z(p, {
633
- iconBefore: ie,
634
- label: /* @__PURE__ */ z(S, {
631
+ children: /* @__PURE__ */ B(p, {
632
+ iconBefore: I,
633
+ label: /* @__PURE__ */ B(C, {
635
634
  text: e.title,
636
635
  query: i,
637
636
  className: l,
638
637
  maxLines: 1
639
638
  }),
640
- iconAfter: I,
639
+ iconAfter: L,
641
640
  textClassName: "min-w-0 flex-1",
642
641
  "aria-current": t ? "page" : void 0,
643
642
  onClick: e.href ? void 0 : () => r(e.id),
644
643
  tabIndex: e.href ? -1 : void 0,
645
- className: o("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0 after:pointer-events-none", F, Z.item, t && Z.itemActive, A && Z.itemActive)
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)
646
645
  })
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,
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,
652
651
  matchReferenceWidth: !1,
653
652
  listClassName: "w-[200px]",
654
- children: /* @__PURE__ */ z(x, {
655
- ref: ne,
656
- icon: /* @__PURE__ */ z(le, {
653
+ children: /* @__PURE__ */ B(S, {
654
+ ref: M,
655
+ icon: /* @__PURE__ */ B(ue, {
657
656
  size: _.SM,
658
- className: Z.triggerIcon,
659
- "aria-hidden": !0
657
+ className: Q.triggerIcon,
658
+ "aria-hidden": !0,
659
+ stroke: v
660
660
  }),
661
- size: y.Small,
661
+ size: b.Small,
662
662
  "aria-label": c,
663
- className: o(A && Z.triggerActive)
663
+ className: o(j && Q.triggerActive)
664
664
  })
665
665
  })
666
666
  })]
667
667
  });
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 }) => {
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
669
  let C = n[e];
670
670
  if (C.kind === X.Header) {
671
671
  let n = C.groupKey === r.Pinned;
672
- return /* @__PURE__ */ z("div", {
672
+ return /* @__PURE__ */ B("div", {
673
673
  role: "presentation",
674
674
  style: t,
675
675
  className: e === 0 ? "pt-0" : "pt-8",
676
- children: /* @__PURE__ */ z(Q, {
676
+ children: /* @__PURE__ */ B(Ve, {
677
677
  label: C.label,
678
678
  isExpanded: i.has(C.groupKey),
679
679
  onToggle: () => a(C.groupKey),
@@ -687,11 +687,11 @@ var X = /* @__PURE__ */ function(e) {
687
687
  })
688
688
  });
689
689
  }
690
- return /* @__PURE__ */ z("div", {
690
+ return /* @__PURE__ */ B("div", {
691
691
  role: "presentation",
692
692
  style: t,
693
693
  className: "pt-1",
694
- children: /* @__PURE__ */ z(Ve, {
694
+ children: /* @__PURE__ */ B(He, {
695
695
  item: C.item,
696
696
  isActive: C.item.id === s,
697
697
  searchQuery: c,
@@ -715,44 +715,44 @@ var X = /* @__PURE__ */ function(e) {
715
715
  onDrop: S
716
716
  })
717
717
  });
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([
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
719
  r.Pinned,
720
720
  r.MyChats,
721
721
  r.Shared,
722
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);
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
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 }) => {
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
729
  de(Math.ceil(e / 36 * 2));
730
- }, []), be = N((e) => {
731
- se(e ?? "");
732
- }, []), xe = N((e) => {
730
+ }, []), xe = P((e) => {
731
+ oe(e ?? "");
732
+ }, []), Se = P((e) => {
733
733
  le((t) => {
734
734
  let n = new Set(t);
735
735
  return n.has(e) ? n.delete(e) : n.add(e), n;
736
736
  });
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?.({
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?.({
751
751
  draggedId: r,
752
752
  targetGroupKey: t,
753
753
  afterId: n
754
754
  });
755
- }, [Se, b]), Oe = i({
755
+ }, [J, b]), Oe = i({
756
756
  "--cp-item-hover": w?.itemHover,
757
757
  "--cp-item-active": w?.itemActive,
758
758
  "--cp-text": w?.text,
@@ -769,40 +769,40 @@ var X = /* @__PURE__ */ function(e) {
769
769
  "--cp-task-badge-bg": w?.taskBadgeBackground,
770
770
  "--cp-task-badge-text": w?.taskBadgeText,
771
771
  "--cp-unread-dot": w?.unreadDot
772
- }), Y = I(() => e.filter((e) => Ue(e, ce) && We(e, H)), [
772
+ }), Y = L(() => e.filter((e) => We(e, se) && Ge(e, U)), [
773
773
  e,
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(() => [
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(() => [
777
777
  {
778
778
  key: r.Pinned,
779
- label: F?.pinned ?? "Pinned",
780
- items: je
779
+ label: I?.pinned ?? "Pinned",
780
+ items: ke
781
781
  },
782
782
  {
783
783
  key: r.MyChats,
784
- label: F?.myChats ?? "My chats",
785
- items: Ne
784
+ label: I?.myChats ?? "My chats",
785
+ items: Me
786
786
  },
787
787
  {
788
788
  key: r.Shared,
789
- label: F?.shared ?? "Shared",
790
- items: Ie
789
+ label: I?.shared ?? "Shared",
790
+ items: Pe
791
791
  },
792
792
  {
793
793
  key: r.Organization,
794
- label: F?.organization ?? "Organization",
794
+ label: I?.organization ?? "Organization",
795
795
  items: Le
796
796
  }
797
797
  ], [
798
- F,
799
- je,
800
- Ne,
801
- Ie,
798
+ I,
799
+ ke,
800
+ Me,
801
+ Pe,
802
802
  Le
803
- ]), Q = I(() => {
803
+ ]), Z = L(() => {
804
804
  let e = [];
805
- for (let t of ze) if (t.items.length !== 0 && (e.push({
805
+ for (let t of Re) if (t.items.length !== 0 && (e.push({
806
806
  kind: X.Header,
807
807
  groupKey: t.key,
808
808
  label: t.label
@@ -812,79 +812,79 @@ var X = /* @__PURE__ */ function(e) {
812
812
  groupKey: t.key
813
813
  });
814
814
  return e;
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);
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
819
  e >= 0 && (pe.current?.scrollToRow({
820
820
  index: e,
821
821
  align: "smart",
822
822
  behavior: "smooth"
823
- }), G.current = s);
823
+ }), me.current = s);
824
824
  }, [
825
825
  s,
826
- ze,
826
+ Re,
827
827
  W,
828
- Q
828
+ Z
829
829
  ]);
830
- let Ve = I(() => ({
831
- rows: Q,
830
+ let Ve = L(() => ({
831
+ rows: Z,
832
832
  expandedGroups: W,
833
- onToggleGroup: xe,
833
+ onToggleGroup: Se,
834
834
  listId: fe,
835
835
  activeConversationId: s,
836
- searchQuery: H,
836
+ searchQuery: U,
837
837
  onSelectConversation: a,
838
838
  getActions: g,
839
839
  onActionMenuOpen: _,
840
- actionsLabel: ae,
841
- unreadIndicatorLabel: V,
840
+ actionsLabel: ie,
841
+ unreadIndicatorLabel: ae,
842
842
  styles: {
843
843
  groupHeaderClassName: T?.groupHeaderClassName,
844
844
  itemTitleClassName: T?.itemTitleClassName,
845
845
  itemIconBadgeClassName: m?.itemIconBadgeClassName,
846
846
  taskBadgeClassName: m?.taskBadgeClassName
847
847
  },
848
- draggingId: me,
848
+ draggingId: G,
849
849
  dragOverId: ge,
850
- allowedDropGroups: _e,
851
- onDragStart: (e) => Ce(e, Q),
850
+ allowedDropGroups: K,
851
+ onDragStart: (e) => Ce(e, Z),
852
852
  onDragEnd: we,
853
853
  onDragOver: Te,
854
854
  onDragLeave: Ee,
855
855
  onDrop: De
856
856
  }), [
857
- Q,
857
+ Z,
858
858
  W,
859
- xe,
859
+ Se,
860
860
  fe,
861
861
  s,
862
- H,
862
+ U,
863
863
  a,
864
864
  g,
865
865
  _,
866
+ ie,
866
867
  ae,
867
- V,
868
868
  T?.groupHeaderClassName,
869
869
  T?.itemTitleClassName,
870
870
  m?.itemIconBadgeClassName,
871
871
  m?.taskBadgeClassName,
872
- me,
872
+ G,
873
873
  ge,
874
- _e,
874
+ K,
875
875
  Ce,
876
876
  we,
877
877
  Te,
878
878
  Ee,
879
879
  De
880
- ]), Ke = e.length === 0, $ = e.length > 0 && Y.length === 0;
881
- return /* @__PURE__ */ B(f, {
880
+ ]), He = e.length === 0, qe = e.length > 0 && Y.length === 0;
881
+ return /* @__PURE__ */ V(f, {
882
882
  isOpen: n,
883
883
  orientation: d.Left,
884
- title: O,
884
+ title: D,
885
885
  labels: {
886
- ariaLabel: O,
887
- closeLabel: oe
886
+ ariaLabel: D,
887
+ closeLabel: H
888
888
  },
889
889
  onClose: v,
890
890
  styles: {
@@ -901,59 +901,59 @@ var X = /* @__PURE__ */ function(e) {
901
901
  },
902
902
  rightActions: y,
903
903
  children: [
904
- /* @__PURE__ */ z(Be, {
905
- label: ne,
904
+ /* @__PURE__ */ B(Be, {
905
+ label: te,
906
906
  onClick: p,
907
907
  labelClassName: T?.newChatLabelClassName,
908
908
  colors: E
909
909
  }),
910
- /* @__PURE__ */ z("div", {
910
+ /* @__PURE__ */ B("div", {
911
911
  role: "search",
912
912
  className: "px-3 py-2",
913
- children: /* @__PURE__ */ z(D, {
913
+ children: /* @__PURE__ */ B(O, {
914
914
  wrapperClassName: "rounded-full",
915
- value: H,
916
- onChange: be,
917
- placeholder: j,
918
- clearLabel: M,
919
- "aria-label": j
915
+ value: U,
916
+ onChange: xe,
917
+ placeholder: M,
918
+ clearLabel: ne,
919
+ "aria-label": M
920
920
  })
921
921
  }),
922
- !C && /* @__PURE__ */ z(Re, {
923
- activeTab: ce,
924
- labels: ie,
922
+ !C && /* @__PURE__ */ B(ze, {
923
+ activeTab: se,
924
+ labels: N,
925
925
  onChange: (e) => {
926
- U(e), S?.(e);
926
+ ce(e), S?.(e);
927
927
  },
928
928
  tabClassName: T?.tabClassName
929
929
  }),
930
- /* @__PURE__ */ z("span", {
930
+ /* @__PURE__ */ B("span", {
931
931
  role: "status",
932
932
  "aria-live": "polite",
933
933
  className: "sr-only",
934
- children: t ? te : Ke ? k : $ ? A : ""
934
+ children: t ? j : He ? k : qe ? A : ""
935
935
  }),
936
- /* @__PURE__ */ z("div", {
936
+ /* @__PURE__ */ B("div", {
937
937
  className: "flex-1 overflow-hidden px-2 py-1",
938
- children: t ? /* @__PURE__ */ z("div", {
938
+ children: t ? /* @__PURE__ */ B("div", {
939
939
  className: "flex flex-col gap-3 px-2 py-3",
940
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ z(ee, {
940
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ B(ee, {
941
941
  avatar: { size: 24 },
942
- showTitle: { width: Ae(t) },
942
+ showTitle: { width: je(t) },
943
943
  paragraph: !1,
944
944
  active: !0,
945
- color: Z.skeletonColor
945
+ color: Q.skeletonColor
946
946
  }, t))
947
- }) : Ke ? /* @__PURE__ */ z(l, { label: k }) : $ ? /* @__PURE__ */ z(u, { label: A }) : /* @__PURE__ */ z(ke, {
947
+ }) : He ? /* @__PURE__ */ B(l, { label: k }) : qe ? /* @__PURE__ */ B(u, { label: A }) : /* @__PURE__ */ B(Ae, {
948
948
  listRef: pe,
949
949
  id: fe,
950
950
  role: "list",
951
951
  style: { height: "100%" },
952
- rowComponent: He,
953
- rowCount: Q.length,
954
- rowHeight: Me,
952
+ rowComponent: Ue,
953
+ rowCount: Z.length,
954
+ rowHeight: Ne,
955
955
  overscanCount: ue,
956
- onResize: ye,
956
+ onResize: be,
957
957
  rowProps: Ve
958
958
  })
959
959
  })
@@ -966,60 +966,62 @@ var X = /* @__PURE__ */ function(e) {
966
966
  successIcon: "_successIcon_fgzx8_13",
967
967
  errorIcon: "_errorIcon_fgzx8_17",
968
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", {
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
972
  className: "flex items-center gap-2 px-3 py-2",
973
- children: [/* @__PURE__ */ B("div", {
973
+ children: [/* @__PURE__ */ V("div", {
974
974
  className: "min-w-0 flex-1",
975
- children: [c && /* @__PURE__ */ z(b, {
975
+ children: [c && /* @__PURE__ */ B(x, {
976
976
  text: c,
977
977
  className: o($.textSecondary, l?.jobDescriptionClassName || "dial-caption-text"),
978
978
  contentClassName: "!z-[80]"
979
- }), /* @__PURE__ */ z(b, {
979
+ }), /* @__PURE__ */ B(x, {
980
980
  text: s,
981
981
  className: o($.text, l?.jobLabelClassName || "dial-small-text"),
982
982
  contentClassName: "!z-[80]"
983
983
  })]
984
- }), /* @__PURE__ */ B("div", {
984
+ }), /* @__PURE__ */ V("div", {
985
985
  className: "flex shrink-0 items-center gap-1",
986
986
  children: [
987
- t.status === e.Success && /* @__PURE__ */ z("span", {
988
- className: Je,
989
- children: /* @__PURE__ */ z(U, {
987
+ t.status === e.Success && /* @__PURE__ */ B("span", {
988
+ className: Ye,
989
+ children: /* @__PURE__ */ B(W, {
990
990
  size: 16,
991
991
  className: $.successIcon
992
992
  })
993
993
  }),
994
- t.status === e.Failed && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z(x, {
994
+ t.status === e.Failed && /* @__PURE__ */ V(ae, { children: [/* @__PURE__ */ B(S, {
995
995
  "aria-label": n.retryJobAriaLabel(s),
996
- icon: /* @__PURE__ */ z(de, {
996
+ icon: /* @__PURE__ */ B(fe, {
997
997
  size: _.SM,
998
- className: $.textSecondary
998
+ className: $.textSecondary,
999
+ stroke: v
999
1000
  }),
1000
1001
  onClick: () => i(t.id)
1001
- }), /* @__PURE__ */ z("span", {
1002
- className: Je,
1003
- children: /* @__PURE__ */ z(V, {
1002
+ }), /* @__PURE__ */ B("span", {
1003
+ className: Ye,
1004
+ children: /* @__PURE__ */ B(H, {
1004
1005
  size: 16,
1005
1006
  className: $.errorIcon
1006
1007
  })
1007
1008
  })] }),
1008
- t.status === e.InProgress && /* @__PURE__ */ z(x, {
1009
+ t.status === e.InProgress && /* @__PURE__ */ B(S, {
1009
1010
  "aria-label": n.closeJobAriaLabel(s),
1010
- size: y.Small,
1011
- icon: /* @__PURE__ */ z(pe, {
1011
+ size: b.Small,
1012
+ icon: /* @__PURE__ */ B(me, {
1012
1013
  size: _.SM,
1013
- className: $.textSecondary
1014
+ className: $.textSecondary,
1015
+ stroke: v
1014
1016
  }),
1015
1017
  onClick: () => r(t.id),
1016
- className: Je
1018
+ className: Ye
1017
1019
  })
1018
1020
  ]
1019
1021
  })]
1020
1022
  });
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
+ }, 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 = {
1023
1025
  ...i({
1024
1026
  "--cp-transfer-queue-bg": m?.background,
1025
1027
  "--cp-transfer-queue-text": m?.text,
@@ -1030,73 +1032,75 @@ var X = /* @__PURE__ */ function(e) {
1030
1032
  "--cp-transfer-queue-failure-count-text": m?.failureCountText
1031
1033
  }),
1032
1034
  ...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
+ }, 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();
1035
1037
  }, [
1036
- S,
1037
1038
  C,
1039
+ w,
1038
1040
  r
1039
- ]), D = N(() => {
1041
+ ]), O = P(() => {
1040
1042
  p(!1), r();
1041
1043
  }, [r]);
1042
- if (P(() => {
1043
- if (!w) return;
1044
- let e = setTimeout(r, qe);
1044
+ if (F(() => {
1045
+ if (!T) return;
1046
+ let e = setTimeout(r, Je);
1045
1047
  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", {
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", {
1049
1051
  role: "status",
1050
1052
  "aria-live": "polite",
1051
- style: b,
1053
+ style: x,
1052
1054
  className: o($.root, "w-[320px] rounded-lg shadow-lg", l?.rootClassName),
1053
1055
  children: [
1054
- /* @__PURE__ */ B("div", {
1056
+ /* @__PURE__ */ V("div", {
1055
1057
  className: "flex items-center justify-between px-3 py-2",
1056
- children: [/* @__PURE__ */ B("div", {
1058
+ children: [/* @__PURE__ */ V("div", {
1057
1059
  className: "flex items-center gap-2",
1058
- children: [/* @__PURE__ */ z("span", {
1059
- className: o($.text, v?.titleClassName || "dial-small-semi-text"),
1060
+ children: [/* @__PURE__ */ B("span", {
1061
+ className: o($.text, y?.titleClassName || "dial-small-semi-text"),
1060
1062
  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
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
1064
1066
  })]
1065
- }), /* @__PURE__ */ B("div", {
1067
+ }), /* @__PURE__ */ V("div", {
1066
1068
  className: "flex items-center gap-1",
1067
- children: [/* @__PURE__ */ z(x, {
1069
+ children: [/* @__PURE__ */ B(S, {
1068
1070
  "aria-label": u ? c.expandQueueAriaLabel : c.collapseQueueAriaLabel,
1069
- size: y.Small,
1070
- icon: z(u ? ce : se, {
1071
+ size: b.Small,
1072
+ icon: B(u ? ce : se, {
1071
1073
  size: _.SM,
1072
- className: $.textSecondary
1074
+ className: $.textSecondary,
1075
+ stroke: v
1073
1076
  }),
1074
1077
  onClick: () => d((e) => !e),
1075
- className: Je
1076
- }), /* @__PURE__ */ z(x, {
1078
+ className: Ye
1079
+ }), /* @__PURE__ */ B(S, {
1077
1080
  "aria-label": c.closeQueueAriaLabel,
1078
- size: y.Small,
1079
- icon: /* @__PURE__ */ z(pe, {
1081
+ size: b.Small,
1082
+ icon: /* @__PURE__ */ B(me, {
1080
1083
  size: _.SM,
1081
- className: $.textSecondary
1084
+ className: $.textSecondary,
1085
+ stroke: v
1082
1086
  }),
1083
- onClick: T,
1084
- className: Je
1087
+ onClick: E,
1088
+ className: Ye
1085
1089
  })]
1086
1090
  })]
1087
1091
  }),
1088
- /* @__PURE__ */ z("div", {
1092
+ /* @__PURE__ */ B("div", {
1089
1093
  className: "px-3 pb-2",
1090
- children: /* @__PURE__ */ z(E, {
1091
- value: k,
1092
- size: y.Small,
1094
+ children: /* @__PURE__ */ B(D, {
1095
+ value: A,
1096
+ size: b.Small,
1093
1097
  "aria-label": t,
1094
1098
  className: "w-full"
1095
1099
  })
1096
1100
  }),
1097
- !u && /* @__PURE__ */ z("div", {
1101
+ !u && /* @__PURE__ */ B("div", {
1098
1102
  className: o("flex max-h-[40vh] flex-col overflow-y-auto", l?.bodyClassName),
1099
- children: n.map((e) => /* @__PURE__ */ z(Qe, {
1103
+ children: n.map((e) => /* @__PURE__ */ B($e, {
1100
1104
  job: e,
1101
1105
  labels: c,
1102
1106
  onDismiss: a,
@@ -1104,68 +1108,68 @@ var X = /* @__PURE__ */ function(e) {
1104
1108
  styles: l
1105
1109
  }, e.id))
1106
1110
  }),
1107
- /* @__PURE__ */ z(h, {
1111
+ /* @__PURE__ */ B(h, {
1108
1112
  open: f,
1109
1113
  header: c.closeQueueConfirmHeader,
1110
- description: Ze(S, C, c),
1114
+ description: Qe(C, w, c),
1111
1115
  confirmLabel: c.closeLabel,
1112
1116
  cancelLabel: c.cancelLabel,
1113
1117
  variant: g.Danger,
1114
- onConfirm: D,
1118
+ onConfirm: O,
1115
1119
  onClose: () => p(!1)
1116
1120
  })
1117
1121
  ]
1118
1122
  });
1119
1123
  });
1120
- $e.displayName = "ImportExportQueue";
1124
+ et.displayName = "ImportExportQueue";
1121
1125
  //#endregion
1122
1126
  //#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);
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);
1129
1133
  return;
1130
1134
  }
1131
1135
  if (!n) return;
1132
- E.current += 1, p(t), y(null), g(!1);
1133
- let r = setTimeout(() => b.current?.focus(), 0);
1136
+ D.current += 1, p(t), b(null), g(!1);
1137
+ let r = setTimeout(() => x.current?.focus(), 0);
1134
1138
  return () => clearTimeout(r);
1135
- }, [e, t]), P(() => () => {
1136
- E.current += 1;
1139
+ }, [e, t]), F(() => () => {
1140
+ D.current += 1;
1137
1141
  }, []);
1138
- let D = c(f.trim()), ee = a(D) > 255, O = n || D === "" || D === t.trim() || ee, A = N(() => {
1139
- O || i(D);
1142
+ let O = c(f.trim()), ee = a(O) > 255, k = n || O === "" || O === t.trim() || ee, j = P(() => {
1143
+ k || i(O);
1140
1144
  }, [
1141
- O,
1145
+ k,
1142
1146
  i,
1143
- D
1144
- ]), te = N((e) => {
1145
- e.key === "Enter" && A();
1146
- }, [A]), ne = N(async () => {
1147
+ O
1148
+ ]), te = P((e) => {
1149
+ e.key === "Enter" && j();
1150
+ }, [j]), M = P(async () => {
1147
1151
  if (h) return;
1148
- let e = ++E.current;
1149
- g(!0), y(null);
1152
+ let e = ++D.current;
1153
+ g(!0), b(null);
1150
1154
  try {
1151
1155
  let t = await l();
1152
- if (e !== E.current) return;
1156
+ if (e !== D.current) return;
1153
1157
  p(s(t));
1154
1158
  } catch {
1155
- if (e !== E.current) return;
1156
- y(u.renameWithAiError);
1159
+ if (e !== D.current) return;
1160
+ b(u.renameWithAiError);
1157
1161
  } finally {
1158
- e === E.current && g(!1);
1162
+ e === D.current && g(!1);
1159
1163
  }
1160
1164
  }, [
1161
1165
  h,
1162
1166
  l,
1163
1167
  u.renameWithAiError
1164
- ]), j;
1165
- return j = ee ? u.nameTooLongError : v ?? r ?? void 0, /* @__PURE__ */ z(w, {
1168
+ ]), ne;
1169
+ return ne = ee ? u.nameTooLongError : y ?? r ?? void 0, /* @__PURE__ */ B(T, {
1166
1170
  open: e,
1167
1171
  header: u.popupTitle,
1168
- size: T.Sm,
1172
+ size: E.Sm,
1169
1173
  onClose: o,
1170
1174
  mainButtons: n ? void 0 : [{
1171
1175
  label: u.cancelLabel,
@@ -1173,41 +1177,41 @@ var et = M(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: i, onCa
1173
1177
  }, {
1174
1178
  label: u.saveLabel,
1175
1179
  variant: m.Primary,
1176
- disabled: O,
1177
- onClick: A
1180
+ disabled: k,
1181
+ onClick: j
1178
1182
  }],
1179
- children: /* @__PURE__ */ z("div", {
1183
+ children: /* @__PURE__ */ B("div", {
1180
1184
  className: d?.bodyClassName,
1181
1185
  style: d?.cssVars,
1182
- children: n ? /* @__PURE__ */ z("div", {
1186
+ children: n ? /* @__PURE__ */ B("div", {
1183
1187
  className: "h-[120px] px-6 py-4",
1184
- children: /* @__PURE__ */ z(k, { size: 50 })
1185
- }) : /* @__PURE__ */ B("div", {
1188
+ children: /* @__PURE__ */ B(A, { size: 50 })
1189
+ }) : /* @__PURE__ */ V("div", {
1186
1190
  className: "flex items-start gap-2 px-6 py-3",
1187
- children: [/* @__PURE__ */ z("div", {
1191
+ children: [/* @__PURE__ */ B("div", {
1188
1192
  className: "min-w-0 flex-1",
1189
- children: /* @__PURE__ */ z(C, {
1190
- inputRef: b,
1193
+ children: /* @__PURE__ */ B(w, {
1194
+ inputRef: x,
1191
1195
  value: f,
1192
1196
  placeholder: u.inputPlaceholder,
1193
- error: j,
1197
+ error: ne,
1194
1198
  onChange: (e) => p(s(e ?? "")),
1195
1199
  onKeyDown: te
1196
1200
  })
1197
- }), /* @__PURE__ */ z(x, {
1201
+ }), /* @__PURE__ */ B(S, {
1198
1202
  "aria-label": u.renameWithAiLabel,
1199
1203
  tooltipProps: { tooltip: u.renameWithAiLabel },
1200
1204
  disabled: h || n,
1201
- onClick: ne,
1202
- icon: h ? /* @__PURE__ */ z(k, { size: _.MD }) : /* @__PURE__ */ z(fe, {
1205
+ onClick: M,
1206
+ icon: h ? /* @__PURE__ */ B(A, { size: _.MD }) : /* @__PURE__ */ B(pe, {
1203
1207
  size: _.MD,
1204
- stroke: 1.5
1208
+ stroke: v
1205
1209
  })
1206
1210
  })]
1207
1211
  })
1208
1212
  })
1209
1213
  });
1210
1214
  });
1211
- et.displayName = "RenameConversationPopup";
1215
+ tt.displayName = "RenameConversationPopup";
1212
1216
  //#endregion
1213
- export { Ke as ConversationPanel, $e as ImportExportQueue, et as RenameConversationPopup };
1217
+ export { qe as ConversationPanel, et as ImportExportQueue, tt as RenameConversationPopup };