@epam/ai-dial-conversation-panel 1.3.0-dev.14 → 1.3.0-dev.142

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