@epam/ai-dial-conversation-panel 1.3.0-dev.108 → 1.3.0-dev.110

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