@epam/ai-dial-conversation-panel 1.3.0-dev.224 → 1.3.0-dev.234

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,32 +1,32 @@
1
1
  import { ConversationKind as e, DeploymentIcon as t, FilterTab as n, buildCssVars as r, getUtf8ByteLength as i, mergeClasses as a, sanitizeConversationName as o, stripTrailingDots as s } from "@epam/ai-dial-chat-shared";
2
2
  import { PanelEmpty as c, PanelNoResults as l, SidebarOrientation as u, SidebarPanel as d } from "@epam/ai-dial-sidebar";
3
- import { Button as f, ButtonVariant as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as _, EllipsisTooltip as v, FilterChips as y, GhostIconButton as b, Highlight as x, Input as S, MenuItemMark as C, Popup as w, PopupSize as T, Search as E, Skeleton as D, SkeletonVariant as O, Spinner as ee, mergeClasses as k } from "@epam/ai-dial-ui-kit";
4
- import { createElement as A, memo as j, useCallback as M, useEffect as N, useId as te, useImperativeHandle as P, useLayoutEffect as F, useMemo as I, useRef as L, useState as R } from "react";
5
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as H, IconCaretRightFilled as ne, IconChevronDown as U, IconChevronRight as re, IconDotsVertical as ie, IconFilter2 as ae, IconPlus as oe, IconSearch as se, IconSparkles as W, IconX as ce } from "@tabler/icons-react";
3
+ import { Button as f, ButtonVariant as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as _, EllipsisTooltip as v, FilterChips as y, GhostIconButton as b, Highlight as x, Input as S, MenuItemMark as C, Popup as w, PopupSize as T, Search as E, Skeleton as D, SkeletonVariant as O, Spinner as k, mergeClasses as A } from "@epam/ai-dial-ui-kit";
4
+ import { createElement as j, memo as M, useCallback as N, useEffect as P, useId as ee, useImperativeHandle as F, useLayoutEffect as I, useMemo as L, useRef as R, useState as z } from "react";
5
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
6
+ import { IconCaretDownFilled as te, IconCaretRightFilled as ne, IconChevronDown as U, IconChevronRight as W, IconDotsVertical as re, IconFilter2 as ie, IconPlus as ae, IconSearch as oe, IconSparkles as G, IconX as se } from "@tabler/icons-react";
7
7
  //#region src/constants/public-class-names.ts
8
- var le = {
8
+ var ce = {
9
9
  newChatButton: "dial-cp-new-chat-button",
10
10
  search: "dial-cp-search",
11
11
  list: "dial-cp-list",
12
12
  listHeader: "dial-cp-list-header",
13
13
  listSection: "dial-cp-list-section"
14
- }, G = typeof window < "u" ? F : N;
15
- function K(e) {
14
+ }, K = typeof window < "u" ? I : P;
15
+ function q(e) {
16
16
  if (e !== void 0) switch (typeof e) {
17
17
  case "number": return e;
18
18
  case "string": if (e.endsWith("px")) return parseFloat(e);
19
19
  }
20
20
  }
21
- function q({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
22
- let { styleHeight: s, styleWidth: c } = I(() => ({
23
- styleHeight: K(o?.height),
24
- styleWidth: K(o?.width)
25
- }), [o?.height, o?.width]), [l, u] = R({
21
+ function le({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
22
+ let { styleHeight: s, styleWidth: c } = L(() => ({
23
+ styleHeight: q(o?.height),
24
+ styleWidth: q(o?.width)
25
+ }), [o?.height, o?.width]), [l, u] = z({
26
26
  height: t,
27
27
  width: n
28
28
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
29
- return G(() => {
29
+ return K(() => {
30
30
  if (i === null || d) return;
31
31
  let t = new ResizeObserver((e) => {
32
32
  for (let t of e) {
@@ -46,7 +46,7 @@ function q({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
46
46
  i,
47
47
  s,
48
48
  c
49
- ]), I(() => ({
49
+ ]), L(() => ({
50
50
  height: s ?? l.height,
51
51
  width: c ?? l.width
52
52
  }), [
@@ -56,25 +56,25 @@ function q({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
56
56
  ]);
57
57
  }
58
58
  function ue(e) {
59
- let t = L(() => {
59
+ let t = R(() => {
60
60
  throw Error("Cannot call during render.");
61
61
  });
62
- return G(() => {
62
+ return K(() => {
63
63
  t.current = e;
64
- }, [e]), M((e) => t.current?.(e), [t]);
64
+ }, [e]), N((e) => t.current?.(e), [t]);
65
65
  }
66
- var J = null;
67
- function de(e = !1) {
68
- if (J === null || e) {
66
+ var de = null;
67
+ function fe(e = !1) {
68
+ if (de === null || e) {
69
69
  let e = document.createElement("div"), t = e.style;
70
70
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
71
71
  let n = document.createElement("div"), r = n.style;
72
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? J = "positive-descending" : (e.scrollLeft = 1, J = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), J;
72
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? de = "positive-descending" : (e.scrollLeft = 1, de = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), de;
73
73
  }
74
- return J;
74
+ return de;
75
75
  }
76
- function fe({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
77
- if (t === "horizontal" && n) switch (de()) {
76
+ function pe({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
77
+ if (t === "horizontal" && n) switch (fe()) {
78
78
  case "negative": return -r;
79
79
  case "positive-descending": if (e) {
80
80
  let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
@@ -83,26 +83,26 @@ function fe({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
83
83
  }
84
84
  return r;
85
85
  }
86
- function Y(e, t = "Assertion error") {
86
+ function J(e, t = "Assertion error") {
87
87
  if (!e) throw console.error(t), Error(t);
88
88
  }
89
- function pe(e, t) {
89
+ function me(e, t) {
90
90
  if (e === t) return !0;
91
- if (!!e != !!t || (Y(e !== void 0), Y(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
91
+ if (!!e != !!t || (J(e !== void 0), J(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
92
92
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
93
93
  return !0;
94
94
  }
95
- function me({ cachedBounds: e, itemCount: t, itemSize: n }) {
95
+ function he({ cachedBounds: e, itemCount: t, itemSize: n }) {
96
96
  if (t === 0) return 0;
97
97
  if (typeof n == "number") return t * n;
98
98
  {
99
99
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
100
- return Y(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
100
+ return J(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
101
101
  }
102
102
  }
103
- function he({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
103
+ function ge({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
104
104
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
105
- let s = me({
105
+ let s = he({
106
106
  cachedBounds: t,
107
107
  itemCount: r,
108
108
  itemSize: i
@@ -114,7 +114,7 @@ function he({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
114
114
  default: return a >= u && a <= l ? a : a < u ? u : l;
115
115
  }
116
116
  }
117
- function ge({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
117
+ function _e({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
118
118
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
119
119
  for (; u < a;) {
120
120
  let n = e.get(u);
@@ -133,11 +133,11 @@ function ge({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
133
133
  stopIndexOverscan: l
134
134
  };
135
135
  }
136
- function _e({ itemCount: e, itemProps: t, itemSize: n }) {
136
+ function ve({ itemCount: e, itemProps: t, itemSize: n }) {
137
137
  let r = /* @__PURE__ */ new Map();
138
138
  return {
139
139
  get(i) {
140
- for (Y(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
140
+ for (J(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
141
141
  let e = r.size, a;
142
142
  switch (typeof n) {
143
143
  case "function":
@@ -151,14 +151,14 @@ function _e({ itemCount: e, itemProps: t, itemSize: n }) {
151
151
  });
152
152
  else {
153
153
  let t = r.get(e - 1);
154
- Y(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
154
+ J(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 Y(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
161
+ return J(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 _e({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function ve({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return I(() => _e({
171
+ function ye({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return L(() => ve({
173
173
  itemCount: e,
174
174
  itemProps: t,
175
175
  itemSize: n
@@ -179,31 +179,31 @@ function ve({ itemCount: e, itemProps: t, itemSize: n }) {
179
179
  n
180
180
  ]);
181
181
  }
182
- function X({ containerSize: e, itemSize: t }) {
182
+ function be({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
186
- Y(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Y(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
186
+ J(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), J(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: n = t;
189
189
  }
190
190
  return n;
191
191
  }
192
- function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
193
- let { height: u = n, width: d = n } = q({
192
+ function xe({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
193
+ let { height: u = n, width: d = n } = le({
194
194
  defaultHeight: r === "vertical" ? n : void 0,
195
195
  defaultWidth: r === "horizontal" ? n : void 0,
196
196
  element: e,
197
197
  mode: r === "vertical" ? "only-height" : "only-width",
198
198
  style: t
199
- }), f = L({
199
+ }), f = R({
200
200
  height: 0,
201
201
  width: 0
202
- }), p = r === "vertical" ? u : d, m = X({
202
+ }), p = r === "vertical" ? u : d, m = be({
203
203
  containerSize: p,
204
204
  itemSize: s
205
205
  });
206
- F(() => {
206
+ I(() => {
207
207
  if (typeof c == "function") {
208
208
  let e = f.current;
209
209
  (e.height !== u || e.width !== d) && (c({
@@ -216,11 +216,11 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
216
216
  c,
217
217
  d
218
218
  ]);
219
- let h = ve({
219
+ let h = ye({
220
220
  itemCount: a,
221
221
  itemProps: o,
222
222
  itemSize: m
223
- }), g = M((e) => h.get(e), [h]), [_, v] = R(() => ge({
223
+ }), g = N((e) => h.get(e), [h]), [_, v] = z(() => _e({
224
224
  cachedBounds: h,
225
225
  containerScrollOffset: 0,
226
226
  containerSize: p,
@@ -231,7 +231,7 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
231
231
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
232
232
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
233
233
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
234
- }, C = M(() => me({
234
+ }, C = N(() => he({
235
235
  cachedBounds: h,
236
236
  itemCount: a,
237
237
  itemSize: m
@@ -239,14 +239,14 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
239
239
  h,
240
240
  a,
241
241
  m
242
- ]), w = M((t) => {
243
- let n = fe({
242
+ ]), w = N((t) => {
243
+ let n = pe({
244
244
  containerElement: e,
245
245
  direction: r,
246
246
  isRtl: i,
247
247
  scrollOffset: t
248
248
  });
249
- return ge({
249
+ return _e({
250
250
  cachedBounds: h,
251
251
  containerScrollOffset: n,
252
252
  containerSize: p,
@@ -262,30 +262,30 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
262
262
  a,
263
263
  l
264
264
  ]);
265
- return G(() => {
265
+ return K(() => {
266
266
  let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
267
267
  v(w(t));
268
268
  }, [
269
269
  e,
270
270
  r,
271
271
  w
272
- ]), G(() => {
272
+ ]), K(() => {
273
273
  if (!e) return;
274
274
  let t = () => {
275
275
  v((t) => {
276
- let { scrollLeft: n, scrollTop: o } = e, s = fe({
276
+ let { scrollLeft: n, scrollTop: o } = e, s = pe({
277
277
  containerElement: e,
278
278
  direction: r,
279
279
  isRtl: i,
280
280
  scrollOffset: r === "vertical" ? o : n
281
- }), c = ge({
281
+ }), c = _e({
282
282
  cachedBounds: h,
283
283
  containerScrollOffset: s,
284
284
  containerSize: p,
285
285
  itemCount: a,
286
286
  overscanCount: l
287
287
  });
288
- return pe(c, t) ? t : c;
288
+ return me(c, t) ? t : c;
289
289
  });
290
290
  };
291
291
  return e.addEventListener("scroll", t), () => {
@@ -302,7 +302,7 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
302
302
  getCellBounds: g,
303
303
  getEstimatedSize: C,
304
304
  scrollToIndex: ue(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
305
- let s = he({
305
+ let s = ge({
306
306
  align: t,
307
307
  cachedBounds: h,
308
308
  containerScrollOffset: n,
@@ -312,14 +312,14 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
312
312
  itemSize: m
313
313
  });
314
314
  if (e) {
315
- if (s = fe({
315
+ if (s = pe({
316
316
  containerElement: e,
317
317
  direction: r,
318
318
  isRtl: i,
319
319
  scrollOffset: s
320
320
  }), typeof e.scrollTo != "function") {
321
321
  let e = w(s);
322
- pe(_, e) || v(e);
322
+ me(_, e) || v(e);
323
323
  }
324
324
  return s;
325
325
  }
@@ -330,30 +330,30 @@ function ye({ containerElement: e, containerStyle: t, defaultContainerSize: n =
330
330
  stopIndexVisible: x
331
331
  };
332
332
  }
333
- function be(e) {
334
- return I(() => e, Object.values(e));
333
+ function Se(e) {
334
+ return L(() => e, Object.values(e));
335
335
  }
336
- function xe(e, t) {
336
+ function Ce(e, t) {
337
337
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
338
- return pe(n, a) && pe(r, o) && pe(i, s);
338
+ return me(n, a) && me(r, o) && me(i, s);
339
339
  }
340
- function Se(e) {
340
+ function we(e) {
341
341
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
342
342
  }
343
- var Ce = "data-react-window-index";
344
- function we({ 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 }) {
345
- let m = be(u), h = I(() => j(s, xe), [s]), [g, _] = R(null), v = Se(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = ye({
343
+ var Te = "data-react-window-index";
344
+ function Ee({ 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 }) {
345
+ let m = Se(u), h = L(() => M(s, Ce), [s]), [g, _] = z(null), v = we(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = xe({
346
346
  containerElement: g,
347
347
  containerStyle: f,
348
348
  defaultContainerSize: n,
349
349
  direction: "vertical",
350
350
  itemCount: c,
351
351
  itemProps: m,
352
- itemSize: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
352
+ itemSize: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
353
353
  onResize: i,
354
354
  overscanCount: o
355
355
  });
356
- P(r, () => ({
356
+ F(r, () => ({
357
357
  get element() {
358
358
  return g;
359
359
  },
@@ -368,12 +368,12 @@ function we({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
368
368
  top: r
369
369
  });
370
370
  }
371
- }), [g, x]), G(() => {
371
+ }), [g, x]), K(() => {
372
372
  if (!g) return;
373
373
  let e = Array.from(g.children).filter((e, t) => {
374
374
  if (e.hasAttribute("aria-hidden")) return !1;
375
375
  let n = `${S + t}`;
376
- return e.setAttribute(Ce, n), !0;
376
+ return e.setAttribute(Te, n), !0;
377
377
  });
378
378
  if (v) return l.observeRowElements(e);
379
379
  }, [
@@ -382,7 +382,7 @@ function we({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
382
382
  l,
383
383
  S,
384
384
  w
385
- ]), N(() => {
385
+ ]), P(() => {
386
386
  S >= 0 && w >= 0 && a && a({
387
387
  startIndex: C,
388
388
  stopIndex: T
@@ -397,11 +397,11 @@ function we({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
397
397
  w,
398
398
  T
399
399
  ]);
400
- let E = I(() => {
400
+ let E = L(() => {
401
401
  let e = [];
402
402
  if (c > 0) for (let t = S; t <= w; t++) {
403
403
  let n = y(t);
404
- e.push(/* @__PURE__ */ A(h, {
404
+ e.push(/* @__PURE__ */ j(h, {
405
405
  ...m,
406
406
  ariaAttributes: {
407
407
  "aria-posinset": t + 1,
@@ -428,7 +428,7 @@ function we({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
428
428
  m,
429
429
  S,
430
430
  w
431
- ]), D = /* @__PURE__ */ B("div", {
431
+ ]), D = /* @__PURE__ */ V("div", {
432
432
  "aria-hidden": !0,
433
433
  style: {
434
434
  height: b(),
@@ -436,7 +436,7 @@ function we({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
436
436
  zIndex: -1
437
437
  }
438
438
  });
439
- return A(d, {
439
+ return j(d, {
440
440
  role: "list",
441
441
  ...p,
442
442
  className: t,
@@ -452,48 +452,48 @@ function we({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
452
452
  }
453
453
  //#endregion
454
454
  //#region src/types/conversation-kind.ts
455
- var Z = /* @__PURE__ */ function(e) {
455
+ var Y = /* @__PURE__ */ function(e) {
456
456
  return e.All = "all", e.Chat = "chat", e.Task = "task", e;
457
- }({}), Q = /* @__PURE__ */ function(e) {
457
+ }({}), X = /* @__PURE__ */ function(e) {
458
458
  return e.Avatar = "avatar", e.Indicator = "indicator", e;
459
- }({}), Te = /* @__PURE__ */ function(e) {
459
+ }({}), De = /* @__PURE__ */ function(e) {
460
460
  return e.Header = "header", e.Item = "item", e;
461
- }({}), Ee = (e, t) => t === n.All || e.source === t, De = (t, n) => {
462
- if (n === Z.All) return !0;
461
+ }({}), Oe = (e, t) => t === n.All || e.source === t, ke = (t, n) => {
462
+ if (n === Y.All) return !0;
463
463
  let r = t.kind ?? e.Chat;
464
- return n === Z.Task ? r === e.Task : r === e.Chat;
465
- }, Oe = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), ke = (e) => `${60 + e * 23 % 35}%`, Ae = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", je = (e, t) => {
464
+ return n === Y.Task ? r === e.Task : r === e.Chat;
465
+ }, Ae = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), je = (e) => `${60 + e * 23 % 35}%`, Me = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", Ne = (e, t) => {
466
466
  let n = t.rows[e];
467
- return t.rowVariant === Q.Indicator ? n.kind === Te.Item ? 34 : e === 0 ? 32 : 40 : n.kind === Te.Item ? 36 : e === 0 ? 24 : 56;
468
- }, Me = 5, Ne = (e) => Math.max(Me, Math.ceil(Math.ceil(e / 36) / 2)), Pe = (e) => {
467
+ return t.rowVariant === X.Indicator ? n.kind === De.Item ? 34 : e === 0 ? 32 : 40 : n.kind === De.Item ? 36 : e === 0 ? 24 : 56;
468
+ }, Z = 5, Pe = (e) => Math.max(Z, Math.ceil(Math.ceil(e / 36) / 2)), Fe = (e) => {
469
469
  switch (e) {
470
470
  case n.Shared: return n.Shared;
471
471
  case n.Organization: return n.Organization;
472
472
  default: return n.MyChats;
473
473
  }
474
- }, Fe = (e, t) => {
474
+ }, Ie = (e, t) => {
475
475
  let n = null;
476
- for (let r of e) if (r.kind === Te.Header) n = r.groupKey;
476
+ for (let r of e) if (r.kind === De.Header) n = r.groupKey;
477
477
  else if (r.item.id === t) return n;
478
478
  return null;
479
- }, Ie = (e, t, r) => {
479
+ }, Le = (e, t, r) => {
480
480
  let i = /* @__PURE__ */ new Set();
481
481
  if (t != null && i.add(t), t === n.Pinned) {
482
482
  let t = r.find((t) => t.id === e);
483
- t && i.add(Pe(t.source));
483
+ t && i.add(Fe(t.source));
484
484
  } else i.add(n.Pinned);
485
485
  return i;
486
- }, Le = (e, t, n, r) => {
486
+ }, Re = (e, t, n, r) => {
487
487
  let i = e.currentTarget.getBoundingClientRect();
488
488
  if (e.clientY >= i.top + i.height / 2) return t;
489
489
  let a = null, o = !1;
490
- for (let e of n) if (e.kind === Te.Header) o = e.groupKey === r;
490
+ for (let e of n) if (e.kind === De.Header) o = e.groupKey === r;
491
491
  else if (o) {
492
492
  if (e.item.id === t) return a;
493
493
  a = e.item.id;
494
494
  }
495
495
  return null;
496
- }, $ = {
496
+ }, Q = {
497
497
  skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
498
498
  item: "_item_gcqru_2",
499
499
  itemActive: "_itemActive_gcqru_15",
@@ -506,9 +506,9 @@ var Z = /* @__PURE__ */ function(e) {
506
506
  unreadDot: "_unreadDot_gcqru_51",
507
507
  search: "_search_gcqru_59",
508
508
  list: "_list_gcqru_70"
509
- }, Re = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = Q.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
510
- let f = s != null, p = o === Q.Indicator;
511
- return /* @__PURE__ */ V("button", {
509
+ }, ze = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", variant: o = X.Avatar, dropZoneGroupKey: s, isDragOver: c, onDragOver: l, onDragLeave: u, onDrop: d }) => {
510
+ let f = s != null, p = o === X.Indicator;
511
+ return /* @__PURE__ */ H("button", {
512
512
  type: "button",
513
513
  "aria-expanded": t,
514
514
  "aria-controls": r,
@@ -522,27 +522,27 @@ var Z = /* @__PURE__ */ function(e) {
522
522
  onDrop: f ? (e) => {
523
523
  f && (e.preventDefault(), d?.(s, s, null));
524
524
  } : void 0,
525
- className: a("group flex h-6 w-full items-center gap-1 rounded text-start", p ? "px-2" : "py-1 pe-3", i, $.groupHeader, c && $.dropZoneActive),
525
+ className: a("group flex h-6 w-full items-center gap-1 rounded text-start", p ? "px-2" : "py-1 pe-3", i, Q.groupHeader, c && Q.dropZoneActive),
526
526
  children: [
527
- !p && (t ? /* @__PURE__ */ B(H, {
527
+ !p && (t ? /* @__PURE__ */ V(te, {
528
528
  size: 12,
529
529
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
530
530
  "aria-hidden": !0
531
- }) : /* @__PURE__ */ B(ne, {
531
+ }) : /* @__PURE__ */ V(ne, {
532
532
  size: 12,
533
533
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
534
534
  "aria-hidden": !0
535
535
  })),
536
- p ? /* @__PURE__ */ B("span", {
536
+ p ? /* @__PURE__ */ V("span", {
537
537
  className: "max-w-full min-w-0",
538
- children: /* @__PURE__ */ B(v, { text: e })
539
- }) : /* @__PURE__ */ B(v, { text: e }),
540
- p && (t ? /* @__PURE__ */ B(U, {
538
+ children: /* @__PURE__ */ V(v, { text: e })
539
+ }) : /* @__PURE__ */ V(v, { text: e }),
540
+ p && (t ? /* @__PURE__ */ V(U, {
541
541
  size: m.SM,
542
542
  stroke: h,
543
543
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",
544
544
  "aria-hidden": !0
545
- }) : /* @__PURE__ */ B(re, {
545
+ }) : /* @__PURE__ */ V(W, {
546
546
  size: m.SM,
547
547
  stroke: h,
548
548
  className: "shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
@@ -550,117 +550,117 @@ var Z = /* @__PURE__ */ function(e) {
550
550
  }))
551
551
  ]
552
552
  });
553
- }, ze = j(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, unreadIndicatorLabel: d = "Unread", variant: p = Q.Avatar, rowGroupKey: v, rows: y, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: ee, onDragLeave: k, onDrop: A }) => {
554
- let [j, N] = R(!1), te = L(null), P = M((t) => {
555
- N(t), t && te.current && s?.(e, te.current);
556
- }, [e, s]), F = I(() => o?.(e) ?? [], [o, e]), z = F.length > 0, H = I(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), ne = I(() => ({ badgeClassName: u }), [u]), U = p === Q.Indicator, re = e.leadingIcon ? /* @__PURE__ */ B("span", {
553
+ }, Be = M(({ item: e, isActive: n, onSelectConversation: r, searchQuery: i = "", getActions: o, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, unreadIndicatorLabel: d = "Unread", variant: p = X.Avatar, rowGroupKey: v, rows: y, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: k, onDragLeave: A, onDrop: j }) => {
554
+ let [M, P] = z(!1), ee = R(null), F = N((t) => {
555
+ P(t), t && ee.current && s?.(e, ee.current);
556
+ }, [e, s]), I = L(() => o?.(e) ?? [], [o, e]), B = I.length > 0, te = L(() => ({ tooltip: e.iconTooltip }), [e.iconTooltip]), ne = L(() => ({ badgeClassName: u }), [u]), U = p === X.Indicator, W = e.leadingIcon ? /* @__PURE__ */ V("span", {
557
557
  className: "flex size-6 shrink-0 items-center justify-center",
558
558
  children: e.leadingIcon
559
- }) : e.isIconLoading ? /* @__PURE__ */ B(D, {
559
+ }) : e.isIconLoading ? /* @__PURE__ */ V(D, {
560
560
  variant: O.Circular,
561
561
  width: m.LG,
562
562
  height: m.LG,
563
- color: $.skeletonColor,
563
+ color: Q.skeletonColor,
564
564
  "aria-hidden": !0
565
- }) : /* @__PURE__ */ B(t, {
565
+ }) : /* @__PURE__ */ V(t, {
566
566
  src: e.iconUrl,
567
567
  size: m.LG,
568
568
  initialsName: e.iconTooltip ?? "",
569
- labels: H,
569
+ labels: te,
570
570
  styles: ne
571
- }), ae = Ae(z, j), oe = /* @__PURE__ */ V("span", {
571
+ }), ie = Me(B, M), ae = /* @__PURE__ */ H("span", {
572
572
  className: "flex size-6 shrink-0 items-center justify-center",
573
- children: [/* @__PURE__ */ B("span", {
574
- className: a("size-2 rounded-full", e.isUnread ? a("size-[7.11px]", $.unreadDot) : $.indicatorDot),
573
+ children: [/* @__PURE__ */ V("span", {
574
+ className: a("size-2 rounded-full", e.isUnread ? a("size-[7.11px]", Q.unreadDot) : Q.indicatorDot),
575
575
  "aria-hidden": !0
576
- }), e.isUnread && /* @__PURE__ */ B("span", {
576
+ }), e.isUnread && /* @__PURE__ */ V("span", {
577
577
  className: "sr-only",
578
578
  children: d
579
579
  })]
580
- }), se = e.isUnread && !U ? /* @__PURE__ */ V("span", {
580
+ }), oe = e.isUnread && !U ? /* @__PURE__ */ H("span", {
581
581
  className: "flex size-6 shrink-0 items-center justify-center",
582
- children: [/* @__PURE__ */ B("span", {
583
- className: a("size-[7.11px] rounded-full", $.unreadDot, z && (j ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
582
+ children: [/* @__PURE__ */ V("span", {
583
+ className: a("size-[7.11px] rounded-full", Q.unreadDot, B && (M ? "opacity-0" : "group-focus-within/conversation:opacity-0 group-hover/conversation:opacity-0")),
584
584
  "aria-hidden": !0
585
- }), /* @__PURE__ */ B("span", {
585
+ }), /* @__PURE__ */ V("span", {
586
586
  className: "sr-only",
587
587
  children: d
588
588
  })]
589
- }) : void 0, W = v != null, ce = M((e) => {
590
- e.currentTarget.contains(e.relatedTarget) || k?.();
591
- }, [k]), le = M((t) => {
592
- if (!v || !y || !A) return;
589
+ }) : void 0, G = v != null, se = N((e) => {
590
+ e.currentTarget.contains(e.relatedTarget) || A?.();
591
+ }, [A]), ce = N((t) => {
592
+ if (!v || !y || !j) return;
593
593
  t.preventDefault();
594
- let n = Le(t, e.id, y, v);
595
- A(e.id, v, n);
594
+ let n = Re(t, e.id, y, v);
595
+ j(e.id, v, n);
596
596
  }, [
597
597
  e.id,
598
598
  y,
599
599
  v,
600
- A
601
- ]), G = e.id === S, K = e.id === C, q = v != null && (w?.has(v) ?? !1), ue = S != null;
602
- return /* @__PURE__ */ V("li", {
603
- className: a("group/conversation relative", G && "cursor-grabbing opacity-50", K && q && "rounded", K && q && $.dropZoneActive, ue && !G && !q && "cursor-not-allowed"),
604
- draggable: W || void 0,
605
- onDragStart: W ? () => T?.(e.id) : void 0,
606
- onDragEnd: W ? E : void 0,
607
- onDragOver: W ? (t) => {
608
- t.preventDefault(), ee?.(e.id);
600
+ j
601
+ ]), K = e.id === S, q = e.id === C, le = v != null && (w?.has(v) ?? !1), ue = S != null;
602
+ return /* @__PURE__ */ H("li", {
603
+ className: a("group/conversation relative", K && "cursor-grabbing opacity-50", q && le && "rounded", q && le && Q.dropZoneActive, ue && !K && !le && "cursor-not-allowed"),
604
+ draggable: G || void 0,
605
+ onDragStart: G ? () => T?.(e.id) : void 0,
606
+ onDragEnd: G ? E : void 0,
607
+ onDragOver: G ? (t) => {
608
+ t.preventDefault(), k?.(e.id);
609
609
  } : void 0,
610
- onDragLeave: W ? ce : void 0,
611
- onDrop: W ? le : void 0,
612
- children: [/* @__PURE__ */ B("a", {
610
+ onDragLeave: G ? se : void 0,
611
+ onDrop: G ? ce : void 0,
612
+ children: [/* @__PURE__ */ V("a", {
613
613
  href: e.href,
614
614
  className: "contents",
615
615
  onClick: (t) => {
616
616
  e.href && (t.preventDefault(), r(e.id));
617
617
  },
618
- children: /* @__PURE__ */ B(f, {
619
- iconBefore: U ? oe : re,
620
- label: /* @__PURE__ */ B(x, {
618
+ children: /* @__PURE__ */ V(f, {
619
+ iconBefore: U ? ae : W,
620
+ label: /* @__PURE__ */ V(x, {
621
621
  text: e.title,
622
622
  query: i,
623
623
  className: e.isUnread ? "dial-small-semi-text" : l,
624
624
  maxLines: 1
625
625
  }),
626
- iconAfter: se,
626
+ iconAfter: oe,
627
627
  textClassName: "min-w-0 flex-1",
628
628
  "aria-current": n ? "page" : void 0,
629
629
  onClick: e.href ? void 0 : () => r(e.id),
630
630
  tabIndex: e.href ? -1 : void 0,
631
- className: a("h-8 w-full justify-start py-2 after:pointer-events-none", U ? "gap-0.5 ps-0" : "gap-2 ps-3", ae, $.item, U && $.itemIndicator, n && $.itemActive, j && $.itemActive)
631
+ className: a("h-8 w-full justify-start py-2 after:pointer-events-none", U ? "gap-0.5 ps-0" : "gap-2 ps-3", ie, Q.item, U && Q.itemIndicator, n && Q.itemActive, M && Q.itemActive)
632
632
  })
633
- }), z && /* @__PURE__ */ B("div", {
634
- className: a("absolute inset-y-0 flex items-center", U ? "end-2" : "end-1", j ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
635
- children: /* @__PURE__ */ B(g, {
636
- items: F,
637
- onOpenChange: P,
633
+ }), B && /* @__PURE__ */ V("div", {
634
+ className: a("absolute inset-y-0 flex items-center", U ? "end-2" : "end-1", M ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
635
+ children: /* @__PURE__ */ V(g, {
636
+ items: I,
637
+ onOpenChange: F,
638
638
  matchReferenceWidth: !1,
639
639
  listClassName: "w-[200px]",
640
- children: /* @__PURE__ */ B(b, {
641
- ref: te,
642
- icon: /* @__PURE__ */ B(ie, {
640
+ children: /* @__PURE__ */ V(b, {
641
+ ref: ee,
642
+ icon: /* @__PURE__ */ V(re, {
643
643
  size: U ? m.SM : m.MD,
644
- className: $.triggerIcon,
644
+ className: Q.triggerIcon,
645
645
  "aria-hidden": !0,
646
646
  stroke: h
647
647
  }),
648
648
  size: _.Small,
649
649
  "aria-label": c,
650
- className: a(U && "!size-6 !min-h-0 !min-w-0 !p-1", j && $.triggerActive)
650
+ className: a(U && "!size-6 !min-h-0 !min-w-0 !p-1", M && Q.triggerActive)
651
651
  })
652
652
  })
653
653
  })]
654
654
  });
655
- }), Be = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", Ve = ({ index: e, style: t, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, rowVariant: h = Q.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
656
- let w = r[e], T = h === Q.Indicator;
657
- if (w.kind === Te.Header) {
655
+ }), Ve = (e, t) => t ? e === 0 ? "pt-2" : "pt-4" : e === 0 ? "pt-0" : "pt-8", He = ({ index: e, style: t, rows: r, expandedGroups: i, onToggleGroup: a, listId: o, activeConversationId: s, searchQuery: c, onSelectConversation: l, getActions: u, onActionMenuOpen: d, actionsLabel: f, unreadIndicatorLabel: p, styles: m, rowVariant: h = X.Avatar, draggingId: g, dragOverId: _, allowedDropGroups: v, onDragStart: y, onDragEnd: b, onDragOver: x, onDragLeave: S, onDrop: C }) => {
656
+ let w = r[e], T = h === X.Indicator;
657
+ if (w.kind === De.Header) {
658
658
  let r = w.groupKey === n.Pinned;
659
- return /* @__PURE__ */ B("div", {
659
+ return /* @__PURE__ */ V("div", {
660
660
  role: "listitem",
661
661
  style: t,
662
- className: Be(e, T),
663
- children: /* @__PURE__ */ B(Re, {
662
+ className: Ve(e, T),
663
+ children: /* @__PURE__ */ V(ze, {
664
664
  variant: h,
665
665
  label: w.label,
666
666
  isExpanded: i.has(w.groupKey),
@@ -675,11 +675,11 @@ var Z = /* @__PURE__ */ function(e) {
675
675
  })
676
676
  });
677
677
  }
678
- return /* @__PURE__ */ B("div", {
678
+ return /* @__PURE__ */ V("div", {
679
679
  role: "presentation",
680
680
  style: t,
681
681
  className: T ? "pt-0.5" : "pt-1",
682
- children: /* @__PURE__ */ B(ze, {
682
+ children: /* @__PURE__ */ V(Be, {
683
683
  variant: h,
684
684
  item: w.item,
685
685
  isActive: w.item.id === s,
@@ -703,199 +703,226 @@ var Z = /* @__PURE__ */ function(e) {
703
703
  onDrop: C
704
704
  })
705
705
  });
706
- }, He = /* @__PURE__ */ new Set([
706
+ }, Ue = /* @__PURE__ */ new Set([
707
707
  n.Pinned,
708
708
  n.MyChats,
709
709
  n.Shared,
710
710
  n.Organization
711
- ]), Ue = j(({ conversations: e, isLoading: t, onSelectConversation: i, activeConversationId: o, labels: s, searchQuery: u = "", activeFilter: d = n.All, activeTypeFilter: f = Z.All, hiddenSources: p, rowVariant: m, getActions: h, onActionMenuOpen: g, onMoveConversation: _, styles: v, id: y, className: b }) => {
712
- let { colors: x, typography: S, itemIconBadgeClassName: C } = v ?? {}, { emptyLabel: w, emptyDescription: T, noResultsLabel: E, noResultsDescription: O, sharedEmptyDescription: ee = O, tabEmptyLabels: k, loadingLabel: A = "Loading conversations", groupLabels: j, actionsLabel: P, unreadIndicatorLabel: F } = s, z = I(() => p?.length ? e.filter((e) => e.source == null || !p.includes(e.source)) : e, [e, p]), [H, ne] = R(() => He), [U, re] = R(5), ie = te(), ae = L(null), oe = L(null), [se, W] = R(null), [ce, G] = R(null), [K, q] = R(null), ue = L(null), J = L(null), de = M(({ height: e }) => {
713
- re(Ne(e));
714
- }, []), fe = M((e) => {
715
- ne((t) => {
711
+ ]), $ = M(({ conversations: e, isLoading: t, isUpdatingTitles: i = !1, preserveActiveSearchResult: o = !1, onSelectConversation: s, activeConversationId: u, labels: d, searchQuery: f = "", activeFilter: p = n.All, activeTypeFilter: m = Y.All, hiddenSources: h, rowVariant: g, getActions: _, onActionMenuOpen: v, onMoveConversation: y, styles: b, id: x, className: S }) => {
712
+ let { colors: C, typography: w, itemIconBadgeClassName: T } = b ?? {}, { emptyLabel: E, emptyDescription: O, noResultsLabel: k, noResultsDescription: A, sharedEmptyDescription: j = A, tabEmptyLabels: M, loadingLabel: F = "Loading conversations", updatingTitlesLabel: I = "Updating conversation names", groupLabels: B, actionsLabel: te, unreadIndicatorLabel: ne } = d, U = L(() => h?.length ? e.filter((e) => e.source == null || !h.includes(e.source)) : e, [e, h]), [W, re] = z(() => Ue), [ie, ae] = z(5), oe = ee(), G = R(null), se = R(null), [K, q] = z(null), [le, ue] = z(null), [de, fe] = z(null), pe = R(null), J = R(null), me = N(({ height: e }) => {
713
+ ae(Pe(e));
714
+ }, []), he = N((e) => {
715
+ re((t) => {
716
716
  let n = new Set(t);
717
717
  return n.has(e) ? n.delete(e) : n.add(e), n;
718
718
  });
719
- }, []), Y = M(() => {
720
- ue.current = null, J.current = null, W(null), G(null), q(null);
721
- }, []), pe = M((e, t) => {
722
- let n = Ie(e, Fe(t, e), z);
723
- ue.current = e, J.current = n, W(e), q(n);
724
- }, [z]), me = M(() => {
725
- Y();
726
- }, [Y]), he = M((e) => {
727
- G(e);
728
- }, []), ge = M(() => {
729
- G(null);
730
- }, []), _e = M((e, t, n) => {
731
- let r = ue.current, i = J.current;
732
- Y(), r != null && r !== e && i?.has(t) && _?.({
719
+ }, []), ge = N(() => {
720
+ pe.current = null, J.current = null, q(null), ue(null), fe(null);
721
+ }, []), _e = N((e, t) => {
722
+ let n = Le(e, Ie(t, e), U);
723
+ pe.current = e, J.current = n, q(e), fe(n);
724
+ }, [U]), ve = N(() => {
725
+ ge();
726
+ }, [ge]), ye = N((e) => {
727
+ ue(e);
728
+ }, []), be = N(() => {
729
+ ue(null);
730
+ }, []), xe = N((e, t, n) => {
731
+ let r = pe.current, i = J.current;
732
+ ge(), r != null && r !== e && i?.has(t) && y?.({
733
733
  draggedId: r,
734
734
  targetGroupKey: t,
735
735
  afterId: n
736
736
  });
737
- }, [Y, _]), ve = r({
738
- "--cp-item-hover": x?.itemHover,
739
- "--cp-item-active": x?.itemActive,
740
- "--cp-text": x?.text,
741
- "--cp-text-secondary": x?.textSecondary,
742
- "--cp-drop-zone-ring": x?.dropZoneRing,
743
- "--cp-trigger-bg": x?.triggerBackground,
744
- "--cp-trigger-icon": x?.triggerIcon,
745
- "--cp-trigger-icon-idle": x?.triggerIconIdle,
746
- "--cp-skeleton-color": x?.skeletonColor,
747
- "--cp-unread-dot": x?.unreadDot,
748
- "--cp-indicator-dot": x?.indicatorDot,
749
- "--cp-list-font-family": S?.fontFamily
750
- }), X = I(() => z.filter((e) => Ee(e, d) && De(e, f) && Oe(e, u)), [
751
- z,
752
- d,
737
+ }, [ge, y]), Se = r({
738
+ "--cp-item-hover": C?.itemHover,
739
+ "--cp-item-active": C?.itemActive,
740
+ "--cp-text": C?.text,
741
+ "--cp-text-secondary": C?.textSecondary,
742
+ "--cp-drop-zone-ring": C?.dropZoneRing,
743
+ "--cp-trigger-bg": C?.triggerBackground,
744
+ "--cp-trigger-icon": C?.triggerIcon,
745
+ "--cp-trigger-icon-idle": C?.triggerIconIdle,
746
+ "--cp-skeleton-color": C?.skeletonColor,
747
+ "--cp-unread-dot": C?.unreadDot,
748
+ "--cp-indicator-dot": C?.indicatorDot,
749
+ "--cp-list-font-family": w?.fontFamily
750
+ }), [Ce, we] = z(null);
751
+ P(() => {
752
+ if (!o || !f || !u) {
753
+ we(null);
754
+ return;
755
+ }
756
+ let e = U.find((e) => e.id === u);
757
+ we((t) => e && Ae(e, f) ? t?.id === e.id && t.query === f ? t : {
758
+ id: e.id,
759
+ query: f
760
+ } : t?.id === u && t.query === f ? t : null);
761
+ }, [
762
+ o,
763
+ f,
764
+ u,
765
+ U
766
+ ]);
767
+ let Te = N((e) => {
768
+ o && f && we({
769
+ id: e,
770
+ query: f
771
+ }), s(e);
772
+ }, [
773
+ o,
753
774
  f,
754
- u
755
- ]), ye = I(() => X.filter((e) => e.isPinned), [X]), be = I(() => X.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [X]), xe = I(() => X.filter((e) => !e.isPinned && e.source === n.Shared), [X]), Se = I(() => X.filter((e) => !e.isPinned && e.source === n.Organization), [X]), Ce = I(() => [
775
+ s
776
+ ]), Me = o && f !== "" && Ce?.query === f && Ce.id === u ? Ce.id : void 0, Z = L(() => U.filter((e) => Oe(e, p) && ke(e, m) && (Ae(e, f) || e.id === Me)), [
777
+ U,
778
+ p,
779
+ m,
780
+ f,
781
+ Me
782
+ ]), Fe = L(() => Z.filter((e) => e.isPinned), [Z]), Re = L(() => Z.filter((e) => !e.isPinned && e.source !== n.Shared && e.source !== n.Organization), [Z]), ze = L(() => Z.filter((e) => !e.isPinned && e.source === n.Shared), [Z]), Be = L(() => Z.filter((e) => !e.isPinned && e.source === n.Organization), [Z]), Ve = L(() => [
756
783
  {
757
784
  key: n.Pinned,
758
- label: j?.pinned ?? "Pinned",
759
- items: ye
785
+ label: B?.pinned ?? "Pinned",
786
+ items: Fe
760
787
  },
761
788
  {
762
789
  key: n.MyChats,
763
- label: j?.myChats ?? "My chats",
764
- items: be
790
+ label: B?.myChats ?? "My chats",
791
+ items: Re
765
792
  },
766
793
  {
767
794
  key: n.Shared,
768
- label: j?.shared ?? "Shared",
769
- items: xe
795
+ label: B?.shared ?? "Shared",
796
+ items: ze
770
797
  },
771
798
  {
772
799
  key: n.Organization,
773
- label: j?.organization ?? "Organization",
774
- items: Se
800
+ label: B?.organization ?? "Organization",
801
+ items: Be
775
802
  }
776
803
  ], [
777
- j,
778
- ye,
779
- be,
780
- xe,
781
- Se
782
- ]), Ae = I(() => {
804
+ B,
805
+ Fe,
806
+ Re,
807
+ ze,
808
+ Be
809
+ ]), $ = L(() => {
783
810
  let e = [];
784
- for (let t of Ce) if (t.items.length !== 0 && (e.push({
785
- kind: Te.Header,
811
+ for (let t of Ve) if (t.items.length !== 0 && (e.push({
812
+ kind: De.Header,
786
813
  groupKey: t.key,
787
814
  label: t.label
788
- }), H.has(t.key))) for (let n of t.items) e.push({
789
- kind: Te.Item,
815
+ }), W.has(t.key))) for (let n of t.items) e.push({
816
+ kind: De.Item,
790
817
  item: n,
791
818
  groupKey: t.key
792
819
  });
793
820
  return e;
794
- }, [Ce, H]);
795
- N(() => {
796
- if (!o || oe.current === o) return;
797
- let e = Ae.findIndex((e) => e.kind === Te.Item && e.item.id === o);
798
- e >= 0 && (ae.current?.scrollToRow({
821
+ }, [Ve, W]);
822
+ P(() => {
823
+ if (!u || se.current === u) return;
824
+ let e = $.findIndex((e) => e.kind === De.Item && e.item.id === u);
825
+ e >= 0 && (G.current?.scrollToRow({
799
826
  index: e,
800
827
  align: "smart",
801
828
  behavior: "smooth"
802
- }), oe.current = o);
829
+ }), se.current = u);
803
830
  }, [
804
- o,
805
- Ce,
806
- H,
807
- Ae
831
+ u,
832
+ Ve,
833
+ W,
834
+ $
808
835
  ]);
809
- let Me = L(Ae);
810
- N(() => {
811
- Me.current = Ae;
812
- }, [Ae]);
813
- let Pe = M((e) => pe(e, Me.current), [pe]), Le = I(() => ({
814
- rows: Ae,
815
- expandedGroups: H,
816
- onToggleGroup: fe,
817
- listId: ie,
818
- activeConversationId: o,
819
- searchQuery: u,
820
- onSelectConversation: i,
821
- getActions: h,
822
- onActionMenuOpen: g,
823
- actionsLabel: P,
824
- unreadIndicatorLabel: F,
825
- rowVariant: m,
836
+ let We = R($);
837
+ P(() => {
838
+ We.current = $;
839
+ }, [$]);
840
+ let Ge = N((e) => _e(e, We.current), [_e]), Ke = L(() => ({
841
+ rows: $,
842
+ expandedGroups: W,
843
+ onToggleGroup: he,
844
+ listId: oe,
845
+ activeConversationId: u,
846
+ searchQuery: f,
847
+ onSelectConversation: Te,
848
+ getActions: _,
849
+ onActionMenuOpen: v,
850
+ actionsLabel: te,
851
+ unreadIndicatorLabel: ne,
852
+ rowVariant: g,
826
853
  styles: {
827
- groupHeaderClassName: S?.groupHeaderClassName,
828
- itemTitleClassName: S?.itemTitleClassName,
829
- itemIconBadgeClassName: C
854
+ groupHeaderClassName: w?.groupHeaderClassName,
855
+ itemTitleClassName: w?.itemTitleClassName,
856
+ itemIconBadgeClassName: T
830
857
  },
831
- draggingId: se,
832
- dragOverId: ce,
833
- allowedDropGroups: K,
834
- onDragStart: Pe,
835
- onDragEnd: me,
836
- onDragOver: he,
837
- onDragLeave: ge,
838
- onDrop: _e
858
+ draggingId: K,
859
+ dragOverId: le,
860
+ allowedDropGroups: de,
861
+ onDragStart: Ge,
862
+ onDragEnd: ve,
863
+ onDragOver: ye,
864
+ onDragLeave: be,
865
+ onDrop: xe
839
866
  }), [
840
- Ae,
841
- H,
842
- fe,
843
- ie,
844
- o,
867
+ $,
868
+ W,
869
+ he,
870
+ oe,
845
871
  u,
846
- i,
847
- h,
872
+ f,
873
+ Te,
874
+ _,
875
+ v,
876
+ te,
877
+ ne,
848
878
  g,
849
- P,
850
- F,
851
- m,
852
- S?.groupHeaderClassName,
853
- S?.itemTitleClassName,
854
- C,
855
- se,
856
- ce,
879
+ w?.groupHeaderClassName,
880
+ w?.itemTitleClassName,
881
+ T,
857
882
  K,
858
- Pe,
859
- me,
860
- he,
861
- ge,
862
- _e
863
- ]), Re = u !== "" || d !== n.All || f !== Z.All, ze = X.length === 0, Be = ze && Re, Ue = ze && !Re, We = Be && u === "" && f === Z.All ? k?.[d] : void 0, Ge = We?.label ?? E, Ke = d === n.Shared && u === "" ? ee : O, qe = We?.description ?? Ke;
864
- return /* @__PURE__ */ V("div", {
865
- id: y,
866
- style: ve,
867
- className: a("flex-1 overflow-hidden px-3", $.list, S?.fontClassName, m !== Q.Indicator && "py-1", b, le.list),
868
- children: [/* @__PURE__ */ B("span", {
883
+ le,
884
+ de,
885
+ Ge,
886
+ ve,
887
+ ye,
888
+ be,
889
+ xe
890
+ ]), qe = f !== "" || p !== n.All || m !== Y.All, Je = Z.length === 0, Ye = Je && qe, Xe = Je && !qe, Ze = Ye && f === "" && m === Y.All ? M?.[p] : void 0, Qe = Ze?.label ?? k, $e = p === n.Shared && f === "" ? j : A, et = Ze?.description ?? $e;
891
+ return /* @__PURE__ */ H("div", {
892
+ id: x,
893
+ style: Se,
894
+ className: a("flex-1 overflow-hidden px-3", Q.list, w?.fontClassName, g !== X.Indicator && "py-1", S, ce.list),
895
+ children: [/* @__PURE__ */ V("span", {
869
896
  role: "status",
870
897
  "aria-live": "polite",
871
898
  className: "sr-only",
872
- children: t ? A : Ue ? w : Be ? Ge : ""
873
- }), t ? /* @__PURE__ */ B("div", {
899
+ children: t ? F : i ? I : Xe ? E : Ye ? Qe : ""
900
+ }), t ? /* @__PURE__ */ V("div", {
874
901
  className: "flex flex-col gap-3 px-2 py-3",
875
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ B(D, {
902
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ V(D, {
876
903
  avatar: { size: 24 },
877
- showTitle: { width: ke(t) },
904
+ showTitle: { width: je(t) },
878
905
  paragraph: !1,
879
906
  active: !0,
880
- color: $.skeletonColor
907
+ color: Q.skeletonColor
881
908
  }, t))
882
- }) : Ue ? /* @__PURE__ */ B(c, {
883
- label: w,
884
- description: T
885
- }) : Be ? /* @__PURE__ */ B(l, {
886
- label: Ge,
887
- description: qe
888
- }) : /* @__PURE__ */ B(we, {
889
- listRef: ae,
890
- id: ie,
909
+ }) : Xe ? /* @__PURE__ */ V(c, {
910
+ label: E,
911
+ description: O
912
+ }) : Ye && f !== "" && i ? /* @__PURE__ */ V(c, { label: I }) : Ye ? /* @__PURE__ */ V(l, {
913
+ label: Qe,
914
+ description: et
915
+ }) : /* @__PURE__ */ V(Ee, {
916
+ listRef: G,
917
+ id: oe,
891
918
  role: "list",
892
919
  style: { height: "100%" },
893
- rowComponent: Ve,
894
- rowCount: Ae.length,
895
- rowHeight: je,
896
- overscanCount: U,
897
- onResize: de,
898
- rowProps: Le
920
+ rowComponent: He,
921
+ rowCount: $.length,
922
+ rowHeight: Ne,
923
+ overscanCount: ie,
924
+ onResize: me,
925
+ rowProps: Ke
899
926
  })]
900
927
  });
901
928
  }), We = {
@@ -920,35 +947,35 @@ var Z = /* @__PURE__ */ function(e) {
920
947
  }
921
948
  ], qe = [
922
949
  {
923
- value: Z.All,
950
+ value: Y.All,
924
951
  getLabel: (e) => e.all
925
952
  },
926
953
  {
927
- value: Z.Chat,
954
+ value: Y.Chat,
928
955
  getLabel: (e) => e.chat ?? "Chat"
929
956
  },
930
957
  {
931
- value: Z.Task,
958
+ value: Y.Task,
932
959
  getLabel: (e) => e.task ?? "Task"
933
960
  }
934
- ], Je = j(({ labels: e, isExpanded: t = !0, onToggleExpanded: i, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = n.All, onFilterChange: f, activeTypeFilter: p = Z.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: w }) => {
935
- let T = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", D = S?.typography?.searchTextClassName ?? "dial-tiny-text", O = L(null), ee = L(null), k = L(c), A = e.filterLabels.groupAriaLabel ?? "Filter chats", j = e.filterActiveLabel ?? "Filters applied", P = te(), F = d !== n.All || p !== Z.All, R = l != null && u != null;
936
- N(() => {
937
- c ? ee.current?.focus() : k.current && O.current?.focus(), k.current = c;
961
+ ], Je = M(({ labels: e, isExpanded: t = !0, onToggleExpanded: i, controlsId: o, searchQuery: s = "", isSearchOpen: c = !1, onSearchChange: l, onSearchOpenChange: u, activeFilter: d = n.All, onFilterChange: f, activeTypeFilter: p = Y.All, onTypeFilterChange: v, hiddenSources: y, actions: x, styles: S, className: w }) => {
962
+ let T = S?.typography?.titleClassName ?? "dial-tiny-lead-semi-text", D = S?.typography?.searchTextClassName ?? "dial-tiny-text", O = R(null), k = R(null), A = R(c), j = e.filterLabels.groupAriaLabel ?? "Filter chats", M = e.filterActiveLabel ?? "Filters applied", F = ee(), I = d !== n.All || p !== Y.All, z = l != null && u != null;
963
+ P(() => {
964
+ c ? k.current?.focus() : A.current && O.current?.focus(), A.current = c;
938
965
  }, [c]);
939
- let H = M(() => {
966
+ let te = N(() => {
940
967
  u?.(!0);
941
- }, [u]), ne = M(() => {
968
+ }, [u]), ne = N(() => {
942
969
  l?.(""), u?.(!1);
943
- }, [l, u]), ie = M((e) => {
970
+ }, [l, u]), re = N((e) => {
944
971
  l?.(e ?? "");
945
- }, [l]), oe = M((e) => {
972
+ }, [l]), ae = N((e) => {
946
973
  e.key === "Escape" && (e.stopPropagation(), ne());
947
- }, [ne]), W = I(() => {
948
- let { filterLabels: t } = e, n = (e, t) => () => /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
974
+ }, [ne]), G = L(() => {
975
+ let { filterLabels: t } = e, n = (e, t) => () => /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
949
976
  className: "min-w-0 flex-1 truncate text-start",
950
977
  children: e
951
- }), /* @__PURE__ */ B("span", {
978
+ }), /* @__PURE__ */ V("span", {
952
979
  className: "shrink-0 text-secondary",
953
980
  children: t
954
981
  })] }), r = [];
@@ -990,7 +1017,7 @@ var Z = /* @__PURE__ */ function(e) {
990
1017
  p,
991
1018
  f,
992
1019
  v
993
- ]), G = I(() => r({
1020
+ ]), K = L(() => r({
994
1021
  "--cp-list-header-title": S?.colors?.title,
995
1022
  "--cp-list-header-title-focus": S?.colors?.titleFocus,
996
1023
  "--cp-list-header-filter-indicator": S?.colors?.filterIndicator
@@ -998,23 +1025,23 @@ var Z = /* @__PURE__ */ function(e) {
998
1025
  S?.colors?.title,
999
1026
  S?.colors?.titleFocus,
1000
1027
  S?.colors?.filterIndicator
1001
- ]), K = (e) => a("flex min-h-6 items-center justify-between ps-2", e, w, le.listHeader);
1002
- if (R && c) return /* @__PURE__ */ V("div", {
1028
+ ]), q = (e) => a("flex min-h-6 items-center justify-between ps-2", e, w, ce.listHeader);
1029
+ if (z && c) return /* @__PURE__ */ H("div", {
1003
1030
  role: "search",
1004
- style: G,
1005
- className: K("gap-2"),
1006
- onKeyDown: oe,
1007
- children: [/* @__PURE__ */ B(E, {
1031
+ style: K,
1032
+ className: q("gap-2"),
1033
+ onKeyDown: ae,
1034
+ children: [/* @__PURE__ */ V(E, {
1008
1035
  containerClassName: "min-w-0 flex-1",
1009
1036
  wrapperClassName: a("!h-6 !min-h-0 !py-1 !pe-2 [&_svg]:!size-4", D),
1010
- inputRef: ee,
1037
+ inputRef: k,
1011
1038
  value: s,
1012
- onChange: ie,
1039
+ onChange: re,
1013
1040
  placeholder: e.searchPlaceholder,
1014
1041
  clearLabel: e.searchClearLabel,
1015
1042
  "aria-label": e.searchPlaceholder
1016
- }), /* @__PURE__ */ B(b, {
1017
- icon: /* @__PURE__ */ B(ce, {
1043
+ }), /* @__PURE__ */ V(b, {
1044
+ icon: /* @__PURE__ */ V(se, {
1018
1045
  size: m.SM,
1019
1046
  stroke: h,
1020
1047
  "aria-hidden": !0
@@ -1025,39 +1052,39 @@ var Z = /* @__PURE__ */ function(e) {
1025
1052
  onClick: ne
1026
1053
  })]
1027
1054
  });
1028
- let q = /* @__PURE__ */ B("span", {
1055
+ let le = /* @__PURE__ */ V("span", {
1029
1056
  className: T,
1030
1057
  children: e.title
1031
1058
  });
1032
- return /* @__PURE__ */ V("div", {
1033
- style: G,
1034
- className: K(),
1035
- children: [i ? /* @__PURE__ */ V("button", {
1059
+ return /* @__PURE__ */ H("div", {
1060
+ style: K,
1061
+ className: q(),
1062
+ children: [i ? /* @__PURE__ */ H("button", {
1036
1063
  type: "button",
1037
1064
  "aria-expanded": t,
1038
1065
  "aria-controls": o,
1039
1066
  onClick: i,
1040
1067
  className: a("group flex items-center gap-1 rounded", We.title),
1041
- children: [q, t ? /* @__PURE__ */ B(U, {
1068
+ children: [le, t ? /* @__PURE__ */ V(U, {
1042
1069
  size: m.SM,
1043
1070
  stroke: h,
1044
1071
  className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100",
1045
1072
  "aria-hidden": !0
1046
- }) : /* @__PURE__ */ B(re, {
1073
+ }) : /* @__PURE__ */ V(W, {
1047
1074
  size: m.SM,
1048
1075
  stroke: h,
1049
1076
  className: "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 rtl:scale-x-[-1]",
1050
1077
  "aria-hidden": !0
1051
1078
  })]
1052
- }) : /* @__PURE__ */ B("span", {
1079
+ }) : /* @__PURE__ */ V("span", {
1053
1080
  className: We.title,
1054
- children: q
1055
- }), /* @__PURE__ */ V("div", {
1081
+ children: le
1082
+ }), /* @__PURE__ */ H("div", {
1056
1083
  className: "flex items-center gap-2",
1057
1084
  children: [
1058
- R && /* @__PURE__ */ B(b, {
1085
+ z && /* @__PURE__ */ V(b, {
1059
1086
  ref: O,
1060
- icon: /* @__PURE__ */ B(se, {
1087
+ icon: /* @__PURE__ */ V(oe, {
1061
1088
  size: m.SM,
1062
1089
  stroke: h,
1063
1090
  "aria-hidden": !0
@@ -1065,96 +1092,98 @@ var Z = /* @__PURE__ */ function(e) {
1065
1092
  size: _.Small,
1066
1093
  className: Ge,
1067
1094
  "aria-label": e.searchOpenLabel,
1068
- onClick: H
1095
+ onClick: te
1069
1096
  }),
1070
- (f || v) && /* @__PURE__ */ B(g, {
1071
- items: W,
1097
+ (f || v) && /* @__PURE__ */ V(g, {
1098
+ items: G,
1072
1099
  placement: "bottom-end",
1073
1100
  matchReferenceWidth: !1,
1074
- children: /* @__PURE__ */ B(b, {
1075
- icon: /* @__PURE__ */ V("span", {
1101
+ children: /* @__PURE__ */ V(b, {
1102
+ icon: /* @__PURE__ */ H("span", {
1076
1103
  className: "relative inline-flex",
1077
- children: [/* @__PURE__ */ B(ae, {
1104
+ children: [/* @__PURE__ */ V(ie, {
1078
1105
  size: m.SM,
1079
1106
  stroke: h,
1080
1107
  "aria-hidden": !0
1081
- }), F && /* @__PURE__ */ B("span", {
1108
+ }), I && /* @__PURE__ */ V("span", {
1082
1109
  "aria-hidden": !0,
1083
1110
  className: a(We.filterIndicator, "absolute -end-0.5 -top-0.5 size-1.5 rounded-full")
1084
1111
  })]
1085
1112
  }),
1086
1113
  size: _.Small,
1087
1114
  className: Ge,
1088
- "aria-label": A,
1089
- "aria-describedby": F ? P : void 0
1115
+ "aria-label": j,
1116
+ "aria-describedby": I ? F : void 0
1090
1117
  })
1091
1118
  }),
1092
- F && (f || v) && /* @__PURE__ */ B("span", {
1093
- id: P,
1119
+ I && (f || v) && /* @__PURE__ */ V("span", {
1120
+ id: F,
1094
1121
  className: "sr-only",
1095
- children: j
1122
+ children: M
1096
1123
  }),
1097
1124
  x
1098
1125
  ]
1099
1126
  })]
1100
1127
  });
1101
- }), Ye = j(({ conversations: e, isLoading: t, onSelectConversation: r, activeConversationId: i, labels: o, requestedFilter: s, isFilterHidden: c = !1, onFilterChange: l, isTypeFilterHidden: u = !1, onTypeFilterChange: d, hiddenSources: f, headerActions: p, getActions: m, onActionMenuOpen: h, onMoveConversation: g, styles: _, listClassName: v, className: y }) => {
1102
- let b = te(), [x, S] = R(""), [C, w] = R(!1), [T, E] = R(!0), [D, O] = R(n.All), [ee, k] = R(Z.All);
1103
- N(() => {
1104
- s != null && O(s);
1105
- }, [s]);
1106
- let A = M((e) => {
1107
- O(e), l?.(e);
1108
- }, [l]), j = M((e) => {
1109
- S(e), e !== "" && E(!0);
1110
- }, []), P = M((e) => {
1111
- w(e), e && E(!0);
1112
- }, []), F = M((e) => {
1113
- k(e), d?.(e);
1114
- }, [d]), I = M(() => E((e) => !e), []);
1115
- return /* @__PURE__ */ V("section", {
1116
- "aria-label": o.title,
1117
- className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", y, le.listSection),
1118
- children: [/* @__PURE__ */ B("div", {
1128
+ }), Ye = M(({ conversations: e, isLoading: t, isUpdatingTitles: r, preserveActiveSearchResult: i, onSelectConversation: o, activeConversationId: s, labels: c, requestedFilter: l, isFilterHidden: u = !1, onFilterChange: d, isTypeFilterHidden: f = !1, onTypeFilterChange: p, hiddenSources: m, headerActions: h, getActions: g, onActionMenuOpen: _, onMoveConversation: v, styles: y, listClassName: b, className: x }) => {
1129
+ let S = ee(), [C, w] = z(""), [T, E] = z(!1), [D, O] = z(!0), [k, A] = z(n.All), [j, M] = z(Y.All);
1130
+ P(() => {
1131
+ l != null && A(l);
1132
+ }, [l]);
1133
+ let F = N((e) => {
1134
+ A(e), d?.(e);
1135
+ }, [d]), I = N((e) => {
1136
+ w(e), e !== "" && O(!0);
1137
+ }, []), L = N((e) => {
1138
+ E(e), e && O(!0);
1139
+ }, []), R = N((e) => {
1140
+ M(e), p?.(e);
1141
+ }, [p]), B = N(() => O((e) => !e), []);
1142
+ return /* @__PURE__ */ H("section", {
1143
+ "aria-label": c.title,
1144
+ className: a("flex min-h-0 flex-1 flex-col px-1 pt-4", x, ce.listSection),
1145
+ children: [/* @__PURE__ */ V("div", {
1119
1146
  className: "px-3 pb-2",
1120
- children: /* @__PURE__ */ B(Je, {
1121
- labels: o,
1122
- isExpanded: T,
1123
- onToggleExpanded: I,
1124
- controlsId: b,
1125
- searchQuery: x,
1126
- isSearchOpen: C,
1127
- onSearchChange: j,
1128
- onSearchOpenChange: P,
1129
- activeFilter: D,
1130
- onFilterChange: c ? void 0 : A,
1131
- activeTypeFilter: ee,
1132
- onTypeFilterChange: c || u ? void 0 : F,
1133
- hiddenSources: f,
1134
- actions: p,
1135
- styles: _?.header
1147
+ children: /* @__PURE__ */ V(Je, {
1148
+ labels: c,
1149
+ isExpanded: D,
1150
+ onToggleExpanded: B,
1151
+ controlsId: S,
1152
+ searchQuery: C,
1153
+ isSearchOpen: T,
1154
+ onSearchChange: I,
1155
+ onSearchOpenChange: L,
1156
+ activeFilter: k,
1157
+ onFilterChange: u ? void 0 : F,
1158
+ activeTypeFilter: j,
1159
+ onTypeFilterChange: u || f ? void 0 : R,
1160
+ hiddenSources: m,
1161
+ actions: h,
1162
+ styles: y?.header
1136
1163
  })
1137
- }), /* @__PURE__ */ B("div", {
1138
- hidden: !T,
1139
- inert: !T,
1140
- className: T ? "flex min-h-0 flex-1 flex-col" : "hidden",
1141
- children: /* @__PURE__ */ B(Ue, {
1142
- id: b,
1164
+ }), /* @__PURE__ */ V("div", {
1165
+ hidden: !D,
1166
+ inert: !D,
1167
+ className: D ? "flex min-h-0 flex-1 flex-col" : "hidden",
1168
+ children: /* @__PURE__ */ V($, {
1169
+ id: S,
1143
1170
  conversations: e,
1144
1171
  isLoading: t,
1145
- onSelectConversation: r,
1146
- activeConversationId: i,
1147
- labels: o,
1148
- searchQuery: x,
1149
- activeFilter: D,
1150
- activeTypeFilter: ee,
1151
- hiddenSources: f,
1152
- rowVariant: Q.Indicator,
1153
- getActions: m,
1154
- onActionMenuOpen: h,
1155
- onMoveConversation: g,
1156
- styles: _?.list,
1157
- className: v
1172
+ isUpdatingTitles: r,
1173
+ preserveActiveSearchResult: i,
1174
+ onSelectConversation: o,
1175
+ activeConversationId: s,
1176
+ labels: c,
1177
+ searchQuery: C,
1178
+ activeFilter: k,
1179
+ activeTypeFilter: j,
1180
+ hiddenSources: m,
1181
+ rowVariant: X.Indicator,
1182
+ getActions: g,
1183
+ onActionMenuOpen: _,
1184
+ onMoveConversation: v,
1185
+ styles: y?.list,
1186
+ className: b
1158
1187
  })
1159
1188
  })]
1160
1189
  });
@@ -1175,163 +1204,167 @@ var Z = /* @__PURE__ */ function(e) {
1175
1204
  value: n.Organization,
1176
1205
  labelKey: "organization"
1177
1206
  }
1178
- ], Ze = j(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
1179
- let a = I(() => Xe.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
1207
+ ], Ze = M(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
1208
+ let a = L(() => Xe.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
1180
1209
  value: e,
1181
1210
  label: t[n]
1182
1211
  })), [t, i]);
1183
- return /* @__PURE__ */ B(y, {
1212
+ return /* @__PURE__ */ V(y, {
1184
1213
  items: a,
1185
1214
  value: e,
1186
1215
  onChange: n,
1187
1216
  stretch: !0,
1188
1217
  "aria-label": t.groupAriaLabel ?? "Filter chats",
1189
1218
  className: "px-3 py-2",
1190
- chipClassName: k("!px-2", r)
1219
+ chipClassName: A("!px-2", r)
1191
1220
  });
1192
- }), Qe = { button: "_button_vjird_1" }, $e = j(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
1221
+ }), Qe = { button: "_button_vjird_1" }, $e = M(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i, className: o }) => {
1193
1222
  let s = r({
1194
1223
  "--cp-new-chat-bg": i?.background,
1195
1224
  "--cp-new-chat-text": i?.text,
1196
1225
  "--cp-new-chat-focus-outline": i?.focusOutline
1197
1226
  });
1198
- return /* @__PURE__ */ B("div", {
1227
+ return /* @__PURE__ */ V("div", {
1199
1228
  className: "px-3 py-2",
1200
1229
  style: s,
1201
- children: /* @__PURE__ */ B(f, {
1230
+ children: /* @__PURE__ */ V(f, {
1202
1231
  label: e,
1203
1232
  textClassName: n,
1204
- iconBefore: /* @__PURE__ */ B(oe, {
1233
+ iconBefore: /* @__PURE__ */ V(ae, {
1205
1234
  size: 18,
1206
1235
  stroke: h,
1207
1236
  className: "shrink-0",
1208
1237
  "aria-hidden": !0
1209
1238
  }),
1210
1239
  onClick: t,
1211
- className: a("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Qe.button, o, le.newChatButton)
1240
+ className: a("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Qe.button, o, ce.newChatButton)
1212
1241
  })
1213
1242
  });
1214
- }), et = j(({ conversations: e, isLoading: t, isOpen: i, onSelectConversation: o, activeConversationId: s, labels: c, onNewChat: l, styles: f, className: p, isOverlay: m = !1, getActions: h, onActionMenuOpen: g, onToggle: _, headerActions: v, onMoveConversation: y, activeFilter: b, onActiveFilterChange: x, isFilterTabsHidden: S = !1, hiddenSources: C }) => {
1215
- let { colors: w, typography: T, newChatButton: D, searchWrapperClassName: O, headerClassName: ee, headerActionsClassName: k, newChatButtonClassName: A } = f ?? {}, { title: j, emptyLabel: te, emptyDescription: P, noResultsLabel: F, noResultsDescription: L, sharedEmptyDescription: z, tabEmptyLabels: H, loadingLabel: ne, newChatLabel: U, searchPlaceholder: re, searchClearLabel: ie, filterLabels: ae, groupLabels: oe, actionsLabel: se, unreadIndicatorLabel: W, closeAriaLabel: ce } = c, [G, K] = R(""), [q, ue] = R(n.All);
1216
- N(() => {
1217
- b != null && ue(b);
1218
- }, [b]);
1219
- let J = M((e) => {
1220
- K(e ?? "");
1221
- }, []), de = r({
1222
- "--cp-text": w?.text,
1223
- "--cp-new-chat-bg": D?.background,
1224
- "--cp-new-chat-text": D?.text,
1225
- "--cp-new-chat-focus-outline": D?.focusOutline
1226
- }), fe = I(() => ({
1227
- emptyLabel: te,
1228
- emptyDescription: P,
1229
- noResultsLabel: F,
1230
- noResultsDescription: L,
1231
- sharedEmptyDescription: z,
1232
- tabEmptyLabels: H,
1233
- loadingLabel: ne,
1234
- groupLabels: oe,
1235
- actionsLabel: se,
1236
- unreadIndicatorLabel: W
1243
+ }), et = M(({ conversations: e, isLoading: t, isUpdatingTitles: i, preserveActiveSearchResult: o, isOpen: s, onSelectConversation: c, activeConversationId: l, labels: f, onNewChat: p, styles: m, className: h, isOverlay: g = !1, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: S, onActiveFilterChange: C, isFilterTabsHidden: w = !1, hiddenSources: T }) => {
1244
+ let { colors: D, typography: O, newChatButton: k, searchWrapperClassName: A, headerClassName: j, headerActionsClassName: M, newChatButtonClassName: ee } = m ?? {}, { title: F, emptyLabel: I, emptyDescription: R, noResultsLabel: B, noResultsDescription: te, sharedEmptyDescription: ne, tabEmptyLabels: U, loadingLabel: W, updatingTitlesLabel: re, newChatLabel: ie, searchPlaceholder: ae, searchClearLabel: oe, filterLabels: G, groupLabels: se, actionsLabel: K, unreadIndicatorLabel: q, closeAriaLabel: le } = f, [ue, de] = z(""), [fe, pe] = z(n.All);
1245
+ P(() => {
1246
+ S != null && pe(S);
1247
+ }, [S]);
1248
+ let J = N((e) => {
1249
+ de(e ?? "");
1250
+ }, []), me = r({
1251
+ "--cp-text": D?.text,
1252
+ "--cp-new-chat-bg": k?.background,
1253
+ "--cp-new-chat-text": k?.text,
1254
+ "--cp-new-chat-focus-outline": k?.focusOutline
1255
+ }), he = L(() => ({
1256
+ emptyLabel: I,
1257
+ emptyDescription: R,
1258
+ noResultsLabel: B,
1259
+ noResultsDescription: te,
1260
+ sharedEmptyDescription: ne,
1261
+ tabEmptyLabels: U,
1262
+ loadingLabel: W,
1263
+ updatingTitlesLabel: re,
1264
+ groupLabels: se,
1265
+ actionsLabel: K,
1266
+ unreadIndicatorLabel: q
1237
1267
  }), [
1268
+ I,
1269
+ R,
1270
+ B,
1238
1271
  te,
1239
- P,
1240
- F,
1241
- L,
1242
- z,
1243
- H,
1244
1272
  ne,
1245
- oe,
1273
+ U,
1274
+ W,
1275
+ re,
1246
1276
  se,
1247
- W
1248
- ]), Y = I(() => ({
1249
- colors: w,
1277
+ K,
1278
+ q
1279
+ ]), ge = L(() => ({
1280
+ colors: D,
1250
1281
  typography: {
1251
- fontFamily: T?.fontFamily,
1252
- groupHeaderClassName: T?.groupHeaderClassName,
1253
- itemTitleClassName: T?.itemTitleClassName
1282
+ fontFamily: O?.fontFamily,
1283
+ groupHeaderClassName: O?.groupHeaderClassName,
1284
+ itemTitleClassName: O?.itemTitleClassName
1254
1285
  },
1255
- itemIconBadgeClassName: f?.itemIconBadgeClassName
1286
+ itemIconBadgeClassName: m?.itemIconBadgeClassName
1256
1287
  }), [
1257
- w,
1258
- T?.fontFamily,
1259
- T?.groupHeaderClassName,
1260
- T?.itemTitleClassName,
1261
- f?.itemIconBadgeClassName
1288
+ D,
1289
+ O?.fontFamily,
1290
+ O?.groupHeaderClassName,
1291
+ O?.itemTitleClassName,
1292
+ m?.itemIconBadgeClassName
1262
1293
  ]);
1263
- return /* @__PURE__ */ V(d, {
1264
- isOpen: i,
1265
- isOverlay: m,
1294
+ return /* @__PURE__ */ H(d, {
1295
+ isOpen: s,
1296
+ isOverlay: g,
1266
1297
  orientation: u.Left,
1267
- title: j,
1298
+ title: F,
1268
1299
  labels: {
1269
- ariaLabel: j,
1270
- closeLabel: ce
1300
+ ariaLabel: F,
1301
+ closeLabel: le
1271
1302
  },
1272
- onClose: _,
1303
+ onClose: y,
1273
1304
  styles: {
1274
1305
  colors: {
1275
- background: w?.background,
1276
- border: w?.border
1306
+ background: D?.background,
1307
+ border: D?.border
1277
1308
  },
1278
- typography: { fontClassName: T?.fontClassName },
1309
+ typography: { fontClassName: O?.fontClassName },
1279
1310
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
1280
- cssVars: de,
1281
- titleClassName: T?.fontClassName,
1282
- headerClassName: a("h-[64px]", ee),
1283
- headerActionsClassName: k,
1284
- className: a(i ? "w-[324px] mobile:w-full" : "w-0", p)
1311
+ cssVars: me,
1312
+ titleClassName: O?.fontClassName,
1313
+ headerClassName: a("h-[64px]", j),
1314
+ headerActionsClassName: M,
1315
+ className: a(s ? "w-[324px] mobile:w-full" : "w-0", h)
1285
1316
  },
1286
- rightActions: v,
1317
+ rightActions: b,
1287
1318
  children: [
1288
- /* @__PURE__ */ B($e, {
1289
- label: U,
1290
- onClick: l,
1291
- labelClassName: T?.newChatLabelClassName,
1292
- colors: D,
1293
- className: A
1319
+ /* @__PURE__ */ V($e, {
1320
+ label: ie,
1321
+ onClick: p,
1322
+ labelClassName: O?.newChatLabelClassName,
1323
+ colors: k,
1324
+ className: ee
1294
1325
  }),
1295
- /* @__PURE__ */ B("div", {
1326
+ /* @__PURE__ */ V("div", {
1296
1327
  role: "search",
1297
- className: a("px-3 py-2", le.search),
1298
- children: /* @__PURE__ */ B(E, {
1299
- wrapperClassName: a($.search, O),
1300
- value: G,
1328
+ className: a("px-3 py-2", ce.search),
1329
+ children: /* @__PURE__ */ V(E, {
1330
+ wrapperClassName: a(Q.search, A),
1331
+ value: ue,
1301
1332
  onChange: J,
1302
- placeholder: re,
1303
- clearLabel: ie,
1304
- "aria-label": re
1333
+ placeholder: ae,
1334
+ clearLabel: oe,
1335
+ "aria-label": ae
1305
1336
  })
1306
1337
  }),
1307
- !S && /* @__PURE__ */ B(Ze, {
1308
- activeTab: q,
1309
- labels: ae,
1338
+ !w && /* @__PURE__ */ V(Ze, {
1339
+ activeTab: fe,
1340
+ labels: G,
1310
1341
  onChange: (e) => {
1311
- ue(e), x?.(e);
1342
+ pe(e), C?.(e);
1312
1343
  },
1313
- tabClassName: T?.tabClassName,
1314
- hiddenSources: C
1344
+ tabClassName: O?.tabClassName,
1345
+ hiddenSources: T
1315
1346
  }),
1316
- /* @__PURE__ */ B(Ue, {
1347
+ /* @__PURE__ */ V($, {
1317
1348
  conversations: e,
1318
1349
  isLoading: t,
1319
- onSelectConversation: o,
1320
- activeConversationId: s,
1321
- labels: fe,
1322
- searchQuery: G,
1323
- activeFilter: q,
1324
- hiddenSources: C,
1325
- getActions: h,
1326
- onActionMenuOpen: g,
1327
- onMoveConversation: y,
1328
- styles: Y
1350
+ isUpdatingTitles: i,
1351
+ preserveActiveSearchResult: o,
1352
+ onSelectConversation: c,
1353
+ activeConversationId: l,
1354
+ labels: he,
1355
+ searchQuery: ue,
1356
+ activeFilter: fe,
1357
+ hiddenSources: T,
1358
+ getActions: _,
1359
+ onActionMenuOpen: v,
1360
+ onMoveConversation: x,
1361
+ styles: ge
1329
1362
  })
1330
1363
  ]
1331
1364
  });
1332
- }), tt = j(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
1333
- let [f, g] = R(t), [_, v] = R(!1), [y, x] = R(null), C = L(null), E = L(!1), D = L(0);
1334
- N(() => {
1365
+ }), tt = M(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
1366
+ let [f, g] = z(t), [_, v] = z(!1), [y, x] = z(null), C = R(null), E = R(!1), D = R(0);
1367
+ P(() => {
1335
1368
  let n = e && !E.current;
1336
1369
  if (E.current = e, !e) {
1337
1370
  D.current += 1, v(!1);
@@ -1341,18 +1374,18 @@ var Z = /* @__PURE__ */ function(e) {
1341
1374
  D.current += 1, g(t), x(null), v(!1);
1342
1375
  let r = setTimeout(() => C.current?.focus(), 0);
1343
1376
  return () => clearTimeout(r);
1344
- }, [e, t]), N(() => () => {
1377
+ }, [e, t]), P(() => () => {
1345
1378
  D.current += 1;
1346
1379
  }, []);
1347
- let O = s(f.trim()), k = i(O) > 255, A = n || O === "" || O === t.trim() || k, j = M(() => {
1348
- A || a(O);
1380
+ let O = s(f.trim()), A = i(O) > 255, j = n || O === "" || O === t.trim() || A, M = N(() => {
1381
+ j || a(O);
1349
1382
  }, [
1350
- A,
1383
+ j,
1351
1384
  a,
1352
1385
  O
1353
- ]), te = M((e) => {
1354
- e.key === "Enter" && j();
1355
- }, [j]), P = M(async () => {
1386
+ ]), ee = N((e) => {
1387
+ e.key === "Enter" && M();
1388
+ }, [M]), F = N(async () => {
1356
1389
  if (_) return;
1357
1390
  let e = ++D.current;
1358
1391
  v(!0), x(null);
@@ -1370,8 +1403,8 @@ var Z = /* @__PURE__ */ function(e) {
1370
1403
  _,
1371
1404
  l,
1372
1405
  u.renameWithAiError
1373
- ]), F = y ?? r ?? void 0, I;
1374
- return I = k ? u.nameTooLongError : F, /* @__PURE__ */ B(w, {
1406
+ ]), I = y ?? r ?? void 0, L;
1407
+ return L = A ? u.nameTooLongError : I, /* @__PURE__ */ V(w, {
1375
1408
  open: e,
1376
1409
  header: u.popupTitle,
1377
1410
  size: T.Sm,
@@ -1382,45 +1415,45 @@ var Z = /* @__PURE__ */ function(e) {
1382
1415
  }, {
1383
1416
  label: u.saveLabel,
1384
1417
  variant: p.Primary,
1385
- disabled: A,
1386
- onClick: j
1418
+ disabled: j,
1419
+ onClick: M
1387
1420
  }],
1388
- children: /* @__PURE__ */ B("div", {
1421
+ children: /* @__PURE__ */ V("div", {
1389
1422
  className: d?.bodyClassName,
1390
1423
  style: d?.cssVars,
1391
- children: n ? /* @__PURE__ */ B("div", {
1424
+ children: n ? /* @__PURE__ */ V("div", {
1392
1425
  className: "h-[120px] px-6 py-4",
1393
- children: /* @__PURE__ */ B(ee, { size: 50 })
1394
- }) : /* @__PURE__ */ V("div", {
1426
+ children: /* @__PURE__ */ V(k, { size: 50 })
1427
+ }) : /* @__PURE__ */ H("div", {
1395
1428
  className: "flex items-start gap-2 px-6 py-3",
1396
1429
  children: [
1397
- /* @__PURE__ */ B("span", {
1430
+ /* @__PURE__ */ V("span", {
1398
1431
  role: "alert",
1399
1432
  className: "sr-only",
1400
- children: k ? "" : F ?? ""
1433
+ children: A ? "" : I ?? ""
1401
1434
  }),
1402
- /* @__PURE__ */ B("div", {
1435
+ /* @__PURE__ */ V("div", {
1403
1436
  className: "min-w-0 flex-1",
1404
- children: /* @__PURE__ */ B(S, {
1437
+ children: /* @__PURE__ */ V(S, {
1405
1438
  inputRef: C,
1406
1439
  value: f,
1407
1440
  placeholder: u.inputPlaceholder,
1408
- error: I,
1441
+ error: L,
1409
1442
  onChange: (e) => g(o(e ?? "")),
1410
- onKeyDown: te
1443
+ onKeyDown: ee
1411
1444
  })
1412
1445
  }),
1413
- /* @__PURE__ */ B(b, {
1446
+ /* @__PURE__ */ V(b, {
1414
1447
  "aria-label": u.renameWithAiLabel,
1415
1448
  tooltipProps: { tooltip: u.renameWithAiLabel },
1416
1449
  disabled: _ || n,
1417
1450
  "aria-busy": _,
1418
- onClick: P,
1419
- icon: _ ? /* @__PURE__ */ B("span", {
1451
+ onClick: F,
1452
+ icon: _ ? /* @__PURE__ */ V("span", {
1420
1453
  className: "flex",
1421
1454
  "aria-hidden": !0,
1422
- children: /* @__PURE__ */ B(ee, { size: m.MD })
1423
- }) : /* @__PURE__ */ B(W, {
1455
+ children: /* @__PURE__ */ V(k, { size: m.MD })
1456
+ }) : /* @__PURE__ */ V(G, {
1424
1457
  size: m.MD,
1425
1458
  stroke: h,
1426
1459
  "aria-hidden": !0
@@ -1433,4 +1466,4 @@ var Z = /* @__PURE__ */ function(e) {
1433
1466
  });
1434
1467
  tt.displayName = "RenameConversationPopup";
1435
1468
  //#endregion
1436
- export { le as CONVERSATION_PANEL_CLASS, Ue as ConversationList, Je as ConversationListHeader, Ye as ConversationListSection, et as ConversationPanel, Q as ConversationRowVariant, Z as ConversationTypeFilter, tt as RenameConversationPopup };
1469
+ export { ce as CONVERSATION_PANEL_CLASS, $ as ConversationList, Je as ConversationListHeader, Ye as ConversationListSection, et as ConversationPanel, X as ConversationRowVariant, Y as ConversationTypeFilter, tt as RenameConversationPopup };