@epam/ai-dial-conversation-panel 1.0.0-dev.481 → 1.0.0-dev.486
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ConversationGroup/ConversationGroup.d.ts +7 -1
- package/components/ConversationGroup/ConversationGroup.d.ts.map +1 -1
- package/components/ConversationGroup/ConversationRow.d.ts +2 -0
- package/components/ConversationGroup/ConversationRow.d.ts.map +1 -1
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/FilterTabs/FilterTabs.d.ts.map +1 -1
- package/components/RowRenderer/RowRenderer.d.ts +1 -1
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +321 -315
- package/models/panel-props.d.ts +2 -0
- package/models/panel-props.d.ts.map +1 -1
- package/models/virtual-row.d.ts +2 -0
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DeploymentIcon as e, Highlight as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { PanelEmpty as i, PanelNoResults as a, SearchInput as o, SidebarOrientation as s, SidebarPanel as c } from "@epam/ai-dial-sidebar";
|
|
3
|
-
import { ButtonAppearance as l, DIAL_ICON_SIZE as u, DialButton as d, DialDropdown as f, DialEllipsisTooltip as p, DialIconButton as m, DialSkeleton as h, DialSkeletonVariant as g, DialTag as _, ElementSize as v } from "@epam/ai-dial-ui-kit";
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
3
|
+
import { ButtonAppearance as l, DIAL_ICON_SIZE as u, DialButton as d, DialDropdown as f, DialEllipsisTooltip as p, DialIconButton as m, DialSkeleton as h, DialSkeletonVariant as g, DialTag as _, ElementSize as v, mergeClasses as y } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { createElement as b, memo as x, useCallback as S, useEffect as C, useId as w, useImperativeHandle as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
5
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
6
|
+
import { IconCaretDownFilled as M, IconCaretRightFilled as N, IconDotsVertical as P, IconPlus as F } from "@tabler/icons-react";
|
|
7
7
|
//#region ../../node_modules/react-window/dist/react-window.js
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var I = typeof window < "u" ? E : C;
|
|
9
|
+
function L(e) {
|
|
10
10
|
if (e !== void 0) switch (typeof e) {
|
|
11
11
|
case "number": return e;
|
|
12
12
|
case "string":
|
|
@@ -14,15 +14,15 @@ function I(e) {
|
|
|
14
14
|
break;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let { styleHeight: s, styleWidth: c } =
|
|
19
|
-
styleHeight:
|
|
20
|
-
styleWidth:
|
|
21
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
17
|
+
function R({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
18
|
+
let { styleHeight: s, styleWidth: c } = D(() => ({
|
|
19
|
+
styleHeight: L(o?.height),
|
|
20
|
+
styleWidth: L(o?.width)
|
|
21
|
+
}), [o?.height, o?.width]), [l, u] = k({
|
|
22
22
|
height: t,
|
|
23
23
|
width: n
|
|
24
24
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
25
|
-
return
|
|
25
|
+
return I(() => {
|
|
26
26
|
if (i === null || d) return;
|
|
27
27
|
let t = new ResizeObserver((e) => {
|
|
28
28
|
for (let t of e) {
|
|
@@ -42,7 +42,7 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
42
42
|
i,
|
|
43
43
|
s,
|
|
44
44
|
c
|
|
45
|
-
]),
|
|
45
|
+
]), D(() => ({
|
|
46
46
|
height: s ?? l.height,
|
|
47
47
|
width: c ?? l.width
|
|
48
48
|
}), [
|
|
@@ -51,26 +51,26 @@ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
51
51
|
c
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
54
|
+
function ee(e) {
|
|
55
|
+
let t = O(() => {
|
|
56
56
|
throw Error("Cannot call during render.");
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return I(() => {
|
|
59
59
|
t.current = e;
|
|
60
|
-
}, [e]),
|
|
60
|
+
}, [e]), S((e) => t.current?.(e), [t]);
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
62
|
+
var z = null;
|
|
63
|
+
function te(e = !1) {
|
|
64
|
+
if (z === null || e) {
|
|
65
65
|
let e = document.createElement("div"), t = e.style;
|
|
66
66
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
67
67
|
let n = document.createElement("div"), r = n.style;
|
|
68
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
68
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? z = "positive-descending" : (e.scrollLeft = 1, z = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), z;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return z;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
if (t === "horizontal" && n) switch (
|
|
72
|
+
function B({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
73
|
+
if (t === "horizontal" && n) switch (te()) {
|
|
74
74
|
case "negative": return -r;
|
|
75
75
|
case "positive-descending":
|
|
76
76
|
if (e) {
|
|
@@ -81,26 +81,26 @@ function z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
81
81
|
}
|
|
82
82
|
return r;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function V(e, t = "Assertion error") {
|
|
85
85
|
if (!e) throw console.error(t), Error(t);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function H(e, t) {
|
|
88
88
|
if (e === t) return !0;
|
|
89
|
-
if (!!e != !!t || (
|
|
89
|
+
if (!!e != !!t || (V(e !== void 0), V(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
90
90
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
91
91
|
return !0;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function U({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
94
94
|
if (t === 0) return 0;
|
|
95
95
|
if (typeof n == "number") return t * n;
|
|
96
96
|
{
|
|
97
97
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
98
|
-
return
|
|
98
|
+
return V(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function ne({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
102
102
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
103
|
-
let s =
|
|
103
|
+
let s = U({
|
|
104
104
|
cachedBounds: t,
|
|
105
105
|
itemCount: r,
|
|
106
106
|
itemSize: i
|
|
@@ -131,11 +131,11 @@ function W({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
|
|
|
131
131
|
stopIndexOverscan: l
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function G({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
135
135
|
let r = /* @__PURE__ */ new Map();
|
|
136
136
|
return {
|
|
137
137
|
get(i) {
|
|
138
|
-
for (
|
|
138
|
+
for (V(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
139
139
|
let e = r.size, a;
|
|
140
140
|
switch (typeof n) {
|
|
141
141
|
case "function":
|
|
@@ -151,14 +151,14 @@ function ne({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
151
151
|
});
|
|
152
152
|
else {
|
|
153
153
|
let t = r.get(e - 1);
|
|
154
|
-
|
|
154
|
+
V(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
155
155
|
scrollOffset: t.scrollOffset + t.size,
|
|
156
156
|
size: a
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
let a = r.get(i);
|
|
161
|
-
return
|
|
161
|
+
return V(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
162
162
|
},
|
|
163
163
|
set(e, t) {
|
|
164
164
|
r.set(e, t);
|
|
@@ -168,8 +168,8 @@ function ne({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
171
|
+
function K({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
172
|
+
return D(() => G({
|
|
173
173
|
itemCount: e,
|
|
174
174
|
itemProps: t,
|
|
175
175
|
itemSize: n
|
|
@@ -183,7 +183,7 @@ function re({ containerSize: e, itemSize: t }) {
|
|
|
183
183
|
let n;
|
|
184
184
|
switch (typeof t) {
|
|
185
185
|
case "string":
|
|
186
|
-
|
|
186
|
+
V(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), V(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
187
187
|
break;
|
|
188
188
|
default:
|
|
189
189
|
n = t;
|
|
@@ -192,20 +192,20 @@ function re({ containerSize: e, itemSize: t }) {
|
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
194
|
function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
195
|
-
let { height: u = n, width: d = n } =
|
|
195
|
+
let { height: u = n, width: d = n } = R({
|
|
196
196
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
197
197
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
198
198
|
element: e,
|
|
199
199
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
200
200
|
style: t
|
|
201
|
-
}), f =
|
|
201
|
+
}), f = O({
|
|
202
202
|
height: 0,
|
|
203
203
|
width: 0
|
|
204
204
|
}), p = r === "vertical" ? u : d, m = re({
|
|
205
205
|
containerSize: p,
|
|
206
206
|
itemSize: s
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
E(() => {
|
|
209
209
|
if (typeof c == "function") {
|
|
210
210
|
let e = f.current;
|
|
211
211
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -218,22 +218,22 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
218
218
|
c,
|
|
219
219
|
d
|
|
220
220
|
]);
|
|
221
|
-
let h =
|
|
221
|
+
let h = K({
|
|
222
222
|
itemCount: a,
|
|
223
223
|
itemProps: o,
|
|
224
224
|
itemSize: m
|
|
225
|
-
}), g =
|
|
225
|
+
}), g = S((e) => h.get(e), [h]), [_, v] = k(() => W({
|
|
226
226
|
cachedBounds: h,
|
|
227
227
|
containerScrollOffset: 0,
|
|
228
228
|
containerSize: p,
|
|
229
229
|
itemCount: a,
|
|
230
230
|
overscanCount: l
|
|
231
|
-
})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible:
|
|
231
|
+
})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: C } = {
|
|
232
232
|
startIndexVisible: Math.min(a - 1, _.startIndexVisible),
|
|
233
233
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
234
234
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
235
235
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
236
|
-
}, w =
|
|
236
|
+
}, w = S(() => U({
|
|
237
237
|
cachedBounds: h,
|
|
238
238
|
itemCount: a,
|
|
239
239
|
itemSize: m
|
|
@@ -241,9 +241,9 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
241
241
|
h,
|
|
242
242
|
a,
|
|
243
243
|
m
|
|
244
|
-
]),
|
|
244
|
+
]), T = S((t) => W({
|
|
245
245
|
cachedBounds: h,
|
|
246
|
-
containerScrollOffset:
|
|
246
|
+
containerScrollOffset: B({
|
|
247
247
|
containerElement: e,
|
|
248
248
|
direction: r,
|
|
249
249
|
isRtl: i,
|
|
@@ -261,19 +261,19 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
261
261
|
a,
|
|
262
262
|
l
|
|
263
263
|
]);
|
|
264
|
-
return
|
|
265
|
-
v(
|
|
264
|
+
return I(() => {
|
|
265
|
+
v(T((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
266
266
|
}, [
|
|
267
267
|
e,
|
|
268
268
|
r,
|
|
269
|
-
|
|
270
|
-
]),
|
|
269
|
+
T
|
|
270
|
+
]), I(() => {
|
|
271
271
|
if (!e) return;
|
|
272
272
|
let t = () => {
|
|
273
273
|
v((t) => {
|
|
274
274
|
let { scrollLeft: n, scrollTop: o } = e, s = W({
|
|
275
275
|
cachedBounds: h,
|
|
276
|
-
containerScrollOffset:
|
|
276
|
+
containerScrollOffset: B({
|
|
277
277
|
containerElement: e,
|
|
278
278
|
direction: r,
|
|
279
279
|
isRtl: i,
|
|
@@ -283,7 +283,7 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
283
283
|
itemCount: a,
|
|
284
284
|
overscanCount: l
|
|
285
285
|
});
|
|
286
|
-
return
|
|
286
|
+
return H(s, t) ? t : s;
|
|
287
287
|
});
|
|
288
288
|
};
|
|
289
289
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -299,8 +299,8 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
299
299
|
]), {
|
|
300
300
|
getCellBounds: g,
|
|
301
301
|
getEstimatedSize: w,
|
|
302
|
-
scrollToIndex:
|
|
303
|
-
let s =
|
|
302
|
+
scrollToIndex: ee(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
303
|
+
let s = ne({
|
|
304
304
|
align: t,
|
|
305
305
|
cachedBounds: h,
|
|
306
306
|
containerScrollOffset: n,
|
|
@@ -310,14 +310,14 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
310
310
|
itemSize: m
|
|
311
311
|
});
|
|
312
312
|
if (e) {
|
|
313
|
-
if (s =
|
|
313
|
+
if (s = B({
|
|
314
314
|
containerElement: e,
|
|
315
315
|
direction: r,
|
|
316
316
|
isRtl: i,
|
|
317
317
|
scrollOffset: s
|
|
318
318
|
}), typeof e.scrollTo != "function") {
|
|
319
|
-
let e =
|
|
320
|
-
|
|
319
|
+
let e = T(s);
|
|
320
|
+
H(_, e) || v(e);
|
|
321
321
|
}
|
|
322
322
|
return s;
|
|
323
323
|
}
|
|
@@ -325,38 +325,38 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
325
325
|
startIndexOverscan: b,
|
|
326
326
|
startIndexVisible: y,
|
|
327
327
|
stopIndexOverscan: C,
|
|
328
|
-
stopIndexVisible:
|
|
328
|
+
stopIndexVisible: x
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
331
|
function ae(e) {
|
|
332
|
-
return
|
|
332
|
+
return D(() => e, Object.values(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function oe(e, t) {
|
|
335
335
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
336
|
-
return
|
|
336
|
+
return H(n, a) && H(r, o) && H(i, s);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function se(e) {
|
|
339
339
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
function
|
|
343
|
-
let m = ae(u), h =
|
|
341
|
+
var ce = "data-react-window-index";
|
|
342
|
+
function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
343
|
+
let m = ae(u), h = D(() => x(s, oe), [s]), [g, _] = k(null), v = se(l), { getCellBounds: y, getEstimatedSize: S, scrollToIndex: w, startIndexOverscan: E, startIndexVisible: O, stopIndexOverscan: j, stopIndexVisible: M } = ie({
|
|
344
344
|
containerElement: g,
|
|
345
345
|
containerStyle: f,
|
|
346
346
|
defaultContainerSize: n,
|
|
347
347
|
direction: "vertical",
|
|
348
348
|
itemCount: c,
|
|
349
349
|
itemProps: m,
|
|
350
|
-
itemSize:
|
|
350
|
+
itemSize: D(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
351
351
|
onResize: i,
|
|
352
352
|
overscanCount: o
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
T(r, () => ({
|
|
355
355
|
get element() {
|
|
356
356
|
return g;
|
|
357
357
|
},
|
|
358
358
|
scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
|
|
359
|
-
let r =
|
|
359
|
+
let r = w({
|
|
360
360
|
align: e,
|
|
361
361
|
containerScrollOffset: g?.scrollTop ?? 0,
|
|
362
362
|
index: n
|
|
@@ -366,40 +366,40 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
366
366
|
top: r
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
}), [g,
|
|
369
|
+
}), [g, w]), I(() => {
|
|
370
370
|
if (!g) return;
|
|
371
371
|
let e = Array.from(g.children).filter((e, t) => {
|
|
372
372
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
373
|
-
let n = `${
|
|
374
|
-
return e.setAttribute(
|
|
373
|
+
let n = `${E + t}`;
|
|
374
|
+
return e.setAttribute(ce, n), !0;
|
|
375
375
|
});
|
|
376
376
|
if (v) return l.observeRowElements(e);
|
|
377
377
|
}, [
|
|
378
378
|
g,
|
|
379
379
|
v,
|
|
380
380
|
l,
|
|
381
|
-
|
|
381
|
+
E,
|
|
382
382
|
j
|
|
383
|
-
]),
|
|
384
|
-
|
|
385
|
-
startIndex:
|
|
383
|
+
]), C(() => {
|
|
384
|
+
E >= 0 && j >= 0 && a && a({
|
|
385
|
+
startIndex: O,
|
|
386
386
|
stopIndex: M
|
|
387
387
|
}, {
|
|
388
|
-
startIndex:
|
|
388
|
+
startIndex: E,
|
|
389
389
|
stopIndex: j
|
|
390
390
|
});
|
|
391
391
|
}, [
|
|
392
392
|
a,
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
E,
|
|
394
|
+
O,
|
|
395
395
|
j,
|
|
396
396
|
M
|
|
397
397
|
]);
|
|
398
|
-
let N =
|
|
398
|
+
let N = D(() => {
|
|
399
399
|
let e = [];
|
|
400
|
-
if (c > 0) for (let t =
|
|
401
|
-
let n =
|
|
402
|
-
e.push(/* @__PURE__ */
|
|
400
|
+
if (c > 0) for (let t = E; t <= j; t++) {
|
|
401
|
+
let n = y(t);
|
|
402
|
+
e.push(/* @__PURE__ */ b(h, {
|
|
403
403
|
...m,
|
|
404
404
|
ariaAttributes: {
|
|
405
405
|
"aria-posinset": t + 1,
|
|
@@ -420,21 +420,21 @@ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
420
420
|
return e;
|
|
421
421
|
}, [
|
|
422
422
|
h,
|
|
423
|
-
|
|
423
|
+
y,
|
|
424
424
|
v,
|
|
425
425
|
c,
|
|
426
426
|
m,
|
|
427
|
-
|
|
427
|
+
E,
|
|
428
428
|
j
|
|
429
|
-
]), P = /* @__PURE__ */
|
|
429
|
+
]), P = /* @__PURE__ */ A("div", {
|
|
430
430
|
"aria-hidden": !0,
|
|
431
431
|
style: {
|
|
432
|
-
height:
|
|
432
|
+
height: S(),
|
|
433
433
|
width: "100%",
|
|
434
434
|
zIndex: -1
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
|
-
return
|
|
437
|
+
return b(d, {
|
|
438
438
|
role: "list",
|
|
439
439
|
...p,
|
|
440
440
|
className: t,
|
|
@@ -454,25 +454,25 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
454
454
|
return e.Header = "header", e.Item = "item", e;
|
|
455
455
|
}({}), J = /* @__PURE__ */ function(e) {
|
|
456
456
|
return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
|
|
457
|
-
}({}),
|
|
457
|
+
}({}), ue = (e) => `${60 + e * 23 % 35}%`, de = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", fe = (e, t) => t.rows[e].kind === q.Item ? 36 : e === 0 ? 24 : 56, pe = (e) => {
|
|
458
458
|
switch (e) {
|
|
459
459
|
case J.Shared: return J.Shared;
|
|
460
460
|
case J.Organization: return J.Organization;
|
|
461
461
|
default: return J.MyChats;
|
|
462
462
|
}
|
|
463
|
-
},
|
|
463
|
+
}, me = (e, t) => {
|
|
464
464
|
let n = null;
|
|
465
465
|
for (let r of e) if (r.kind === q.Header) n = r.groupKey;
|
|
466
466
|
else if (r.item.id === t) return n;
|
|
467
467
|
return null;
|
|
468
|
-
},
|
|
468
|
+
}, he = (e, t, n) => {
|
|
469
469
|
let r = /* @__PURE__ */ new Set();
|
|
470
470
|
if (t != null && r.add(t), t === J.Pinned) {
|
|
471
471
|
let t = n.find((t) => t.id === e);
|
|
472
|
-
t && r.add(
|
|
472
|
+
t && r.add(pe(t.source));
|
|
473
473
|
} else r.add(J.Pinned);
|
|
474
474
|
return r;
|
|
475
|
-
},
|
|
475
|
+
}, ge = (e, t, n, r) => {
|
|
476
476
|
let i = e.currentTarget.getBoundingClientRect();
|
|
477
477
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
478
478
|
let a = null, o = !1;
|
|
@@ -485,18 +485,18 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
485
485
|
}, Y = {
|
|
486
486
|
tab: "_tab_1mi6x_1",
|
|
487
487
|
tabActive: "_tabActive_1mi6x_13"
|
|
488
|
-
},
|
|
488
|
+
}, _e = x(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ A("div", {
|
|
489
489
|
className: "flex flex-nowrap gap-1",
|
|
490
490
|
children: e.map((e) => {
|
|
491
491
|
let a = t === e.id;
|
|
492
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ A(_, {
|
|
493
493
|
label: e.label,
|
|
494
494
|
selected: a,
|
|
495
495
|
onClick: () => n(e.id),
|
|
496
496
|
className: r("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, Y.tab, a && Y.tabActive)
|
|
497
497
|
}, e.id);
|
|
498
498
|
})
|
|
499
|
-
})),
|
|
499
|
+
})), ve = [
|
|
500
500
|
{
|
|
501
501
|
value: J.All,
|
|
502
502
|
labelKey: "all"
|
|
@@ -513,122 +513,125 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
513
513
|
value: J.Organization,
|
|
514
514
|
labelKey: "organization"
|
|
515
515
|
}
|
|
516
|
-
],
|
|
516
|
+
], ye = x(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ A("div", {
|
|
517
517
|
className: "mx-3 my-2",
|
|
518
|
-
children: /* @__PURE__ */
|
|
519
|
-
tabs:
|
|
518
|
+
children: /* @__PURE__ */ A(_e, {
|
|
519
|
+
tabs: ve.map(({ value: e, labelKey: n }) => ({
|
|
520
520
|
id: e,
|
|
521
521
|
label: t[n]
|
|
522
522
|
})),
|
|
523
523
|
activeTabId: e,
|
|
524
524
|
onTabChange: (e) => n(e),
|
|
525
|
-
tabClassName: r
|
|
525
|
+
tabClassName: y(r, "flex-1")
|
|
526
526
|
})
|
|
527
|
-
})),
|
|
527
|
+
})), be = { button: "_button_1ggx8_1" }, xe = x(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ A("div", {
|
|
528
528
|
className: "px-3 py-2",
|
|
529
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ j("button", {
|
|
530
530
|
onClick: t,
|
|
531
531
|
type: "button",
|
|
532
|
-
className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
532
|
+
className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1", be.button),
|
|
533
|
+
children: [/* @__PURE__ */ A(F, {
|
|
534
534
|
size: 18,
|
|
535
535
|
stroke: 2,
|
|
536
536
|
className: "shrink-0"
|
|
537
|
-
}), /* @__PURE__ */
|
|
537
|
+
}), /* @__PURE__ */ A("span", {
|
|
538
538
|
className: n,
|
|
539
539
|
children: e
|
|
540
540
|
})]
|
|
541
541
|
})
|
|
542
542
|
})), X = {
|
|
543
543
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-layer-4, #d1dbea))",
|
|
544
|
-
header: "
|
|
545
|
-
item: "
|
|
546
|
-
itemActive: "
|
|
547
|
-
groupHeader: "
|
|
548
|
-
dropZoneActive: "
|
|
549
|
-
trigger: "
|
|
550
|
-
triggerActive: "
|
|
551
|
-
triggerIcon: "
|
|
552
|
-
},
|
|
553
|
-
let [
|
|
544
|
+
header: "_header_1nqh6_1",
|
|
545
|
+
item: "_item_1nqh6_5",
|
|
546
|
+
itemActive: "_itemActive_1nqh6_11",
|
|
547
|
+
groupHeader: "_groupHeader_1nqh6_16",
|
|
548
|
+
dropZoneActive: "_dropZoneActive_1nqh6_21",
|
|
549
|
+
trigger: "_trigger_1nqh6_29",
|
|
550
|
+
triggerActive: "_triggerActive_1nqh6_29",
|
|
551
|
+
triggerIcon: "_triggerIcon_1nqh6_32"
|
|
552
|
+
}, Se = ({ item: n, isActive: i, onSelectConversation: a, searchQuery: o = "", getActions: s, onActionMenuOpen: c, actionsLabel: p = "More actions", itemTitleClassName: _ = "dial-small-text", itemIconBadgeClassName: y, rowGroupKey: b, rows: x, draggingId: C, dragOverId: w, allowedDropGroups: T, onDragStart: E, onDragEnd: D, onDragOver: M, onDragLeave: N, onDrop: F }) => {
|
|
553
|
+
let [I, L] = k(!1), R = O(null), ee = S((e) => {
|
|
554
|
+
L(e), e && R.current && c?.(n, R.current);
|
|
555
|
+
}, [n, c]), z = s?.(n) ?? [], te = z.length > 0, B = n.isIconLoading ? /* @__PURE__ */ A(h, {
|
|
554
556
|
variant: g.Circular,
|
|
555
557
|
width: u.LG,
|
|
556
558
|
height: u.LG,
|
|
557
559
|
color: X.skeletonColor,
|
|
558
560
|
"aria-hidden": !0
|
|
559
|
-
}) : /* @__PURE__ */
|
|
561
|
+
}) : /* @__PURE__ */ A(e, {
|
|
560
562
|
src: n.iconUrl,
|
|
561
563
|
size: u.LG,
|
|
562
564
|
initialsName: n.iconTooltip ?? "",
|
|
563
565
|
tooltip: n.iconTooltip,
|
|
564
|
-
badgeClassName:
|
|
565
|
-
}),
|
|
566
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
567
|
-
}, [
|
|
568
|
-
if (!
|
|
566
|
+
badgeClassName: y
|
|
567
|
+
}), V = de(te, I), H = b != null, U = S((e) => {
|
|
568
|
+
e.currentTarget.contains(e.relatedTarget) || N?.();
|
|
569
|
+
}, [N]), ne = S((e) => {
|
|
570
|
+
if (!b || !x || !F) return;
|
|
569
571
|
e.preventDefault();
|
|
570
|
-
let t =
|
|
571
|
-
|
|
572
|
+
let t = ge(e, n.id, x, b);
|
|
573
|
+
F(n.id, b, t);
|
|
572
574
|
}, [
|
|
573
575
|
n.id,
|
|
576
|
+
x,
|
|
574
577
|
b,
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
e.preventDefault(), D?.(n.id);
|
|
578
|
+
F
|
|
579
|
+
]), W = n.id === C, G = n.id === w, K = b != null && (T?.has(b) ?? !1), re = C != null;
|
|
580
|
+
return /* @__PURE__ */ j("li", {
|
|
581
|
+
className: r("group/conversation relative", W && "cursor-grabbing opacity-50", G && K && "rounded", G && K && X.dropZoneActive, re && !W && !K && "cursor-not-allowed"),
|
|
582
|
+
draggable: H || void 0,
|
|
583
|
+
onDragStart: H ? () => E?.(n.id) : void 0,
|
|
584
|
+
onDragEnd: H ? D : void 0,
|
|
585
|
+
onDragOver: H ? (e) => {
|
|
586
|
+
e.preventDefault(), M?.(n.id);
|
|
585
587
|
} : void 0,
|
|
586
|
-
onDragLeave:
|
|
587
|
-
onDrop:
|
|
588
|
-
children: [/* @__PURE__ */
|
|
588
|
+
onDragLeave: H ? U : void 0,
|
|
589
|
+
onDrop: H ? ne : void 0,
|
|
590
|
+
children: [/* @__PURE__ */ A("a", {
|
|
589
591
|
href: n.href,
|
|
590
592
|
className: "contents",
|
|
591
593
|
onClick: (e) => {
|
|
592
594
|
n.href && (e.preventDefault(), a(n.id));
|
|
593
595
|
},
|
|
594
|
-
children: /* @__PURE__ */
|
|
595
|
-
iconBefore:
|
|
596
|
-
label: /* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ A(d, {
|
|
597
|
+
iconBefore: B,
|
|
598
|
+
label: /* @__PURE__ */ A(t, {
|
|
597
599
|
text: n.title,
|
|
598
600
|
query: o,
|
|
599
|
-
className:
|
|
601
|
+
className: _,
|
|
600
602
|
maxLines: 1
|
|
601
603
|
}),
|
|
602
604
|
textClassName: "min-w-0",
|
|
603
605
|
"aria-current": i ? "page" : void 0,
|
|
604
606
|
onClick: n.href ? void 0 : () => a(n.id),
|
|
605
607
|
tabIndex: n.href ? -1 : void 0,
|
|
606
|
-
className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3",
|
|
608
|
+
className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", V, X.item, i && X.itemActive, I && X.itemActive)
|
|
607
609
|
})
|
|
608
|
-
}),
|
|
609
|
-
className: r("absolute inset-y-0 end-1 flex items-center",
|
|
610
|
-
children: /* @__PURE__ */
|
|
611
|
-
items:
|
|
612
|
-
onOpenChange:
|
|
610
|
+
}), te && /* @__PURE__ */ A("div", {
|
|
611
|
+
className: r("absolute inset-y-0 end-1 flex items-center", I ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
612
|
+
children: /* @__PURE__ */ A(f, {
|
|
613
|
+
items: z,
|
|
614
|
+
onOpenChange: ee,
|
|
613
615
|
matchReferenceWidth: !1,
|
|
614
616
|
listClassName: "w-[140px] cp-dropdown-overlay",
|
|
615
|
-
children: /* @__PURE__ */
|
|
616
|
-
|
|
617
|
+
children: /* @__PURE__ */ A(m, {
|
|
618
|
+
ref: R,
|
|
619
|
+
icon: /* @__PURE__ */ A(P, {
|
|
617
620
|
size: u.SM,
|
|
618
621
|
className: X.triggerIcon,
|
|
619
622
|
"aria-hidden": !0
|
|
620
623
|
}),
|
|
621
624
|
appearance: l.Ghost,
|
|
622
625
|
size: v.Small,
|
|
623
|
-
"aria-label":
|
|
624
|
-
className: r("flex items-center justify-center rounded", X.trigger,
|
|
626
|
+
"aria-label": p,
|
|
627
|
+
className: r("flex items-center justify-center rounded", X.trigger, I && X.triggerActive)
|
|
625
628
|
})
|
|
626
629
|
})
|
|
627
630
|
})]
|
|
628
631
|
});
|
|
629
|
-
},
|
|
632
|
+
}, Ce = ({ label: e, isExpanded: t, onToggle: n, listId: i, className: a = "dial-tiny-semi-text uppercase", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
|
|
630
633
|
let d = o != null;
|
|
631
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ j("button", {
|
|
632
635
|
type: "button",
|
|
633
636
|
"aria-expanded": t,
|
|
634
637
|
"aria-controls": i,
|
|
@@ -643,301 +646,304 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
643
646
|
d && (e.preventDefault(), u?.(o, o, null));
|
|
644
647
|
} : void 0,
|
|
645
648
|
className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, X.groupHeader, s && X.dropZoneActive),
|
|
646
|
-
children: [t ? /* @__PURE__ */
|
|
649
|
+
children: [t ? /* @__PURE__ */ A(M, {
|
|
647
650
|
stroke: .5,
|
|
648
651
|
size: 12,
|
|
649
652
|
className: "shrink-0",
|
|
650
653
|
"aria-hidden": !0
|
|
651
|
-
}) : /* @__PURE__ */
|
|
654
|
+
}) : /* @__PURE__ */ A(N, {
|
|
652
655
|
stroke: .5,
|
|
653
656
|
size: 12,
|
|
654
657
|
className: "shrink-0 rtl:scale-x-[-1]",
|
|
655
658
|
"aria-hidden": !0
|
|
656
|
-
}), /* @__PURE__ */
|
|
659
|
+
}), /* @__PURE__ */ A(p, { text: e })]
|
|
657
660
|
});
|
|
658
|
-
},
|
|
659
|
-
let
|
|
660
|
-
if (
|
|
661
|
-
let n =
|
|
662
|
-
return /* @__PURE__ */
|
|
661
|
+
}, we = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, onActionMenuOpen: u, actionsLabel: d, styles: f, draggingId: p, dragOverId: m, allowedDropGroups: h, onDragStart: g, onDragEnd: _, onDragOver: v, onDragLeave: y, onDrop: b }) => {
|
|
662
|
+
let x = n[e];
|
|
663
|
+
if (x.kind === q.Header) {
|
|
664
|
+
let n = x.groupKey === J.Pinned;
|
|
665
|
+
return /* @__PURE__ */ A("div", {
|
|
663
666
|
role: "presentation",
|
|
664
667
|
style: t,
|
|
665
668
|
className: e === 0 ? "pt-0" : "pt-8",
|
|
666
|
-
children: /* @__PURE__ */
|
|
667
|
-
label:
|
|
668
|
-
isExpanded: r.has(
|
|
669
|
-
onToggle: () => i(
|
|
669
|
+
children: /* @__PURE__ */ A(Ce, {
|
|
670
|
+
label: x.label,
|
|
671
|
+
isExpanded: r.has(x.groupKey),
|
|
672
|
+
onToggle: () => i(x.groupKey),
|
|
670
673
|
listId: a,
|
|
671
|
-
className:
|
|
674
|
+
className: f?.groupHeaderClassName,
|
|
672
675
|
dropZoneGroupKey: n ? J.Pinned : void 0,
|
|
673
|
-
isDragOver: n &&
|
|
674
|
-
onDragOver: n ?
|
|
675
|
-
onDragLeave: n ?
|
|
676
|
-
onDrop: n ?
|
|
676
|
+
isDragOver: n && m === J.Pinned,
|
|
677
|
+
onDragOver: n ? v : void 0,
|
|
678
|
+
onDragLeave: n ? y : void 0,
|
|
679
|
+
onDrop: n ? b : void 0
|
|
677
680
|
})
|
|
678
681
|
});
|
|
679
682
|
}
|
|
680
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ A("div", {
|
|
681
684
|
role: "presentation",
|
|
682
685
|
style: t,
|
|
683
686
|
className: "pt-1",
|
|
684
|
-
children: /* @__PURE__ */
|
|
685
|
-
item:
|
|
686
|
-
isActive:
|
|
687
|
+
children: /* @__PURE__ */ A(Se, {
|
|
688
|
+
item: x.item,
|
|
689
|
+
isActive: x.item.id === o,
|
|
687
690
|
searchQuery: s,
|
|
688
691
|
onSelectConversation: c,
|
|
689
692
|
getActions: l,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
693
|
+
onActionMenuOpen: u,
|
|
694
|
+
actionsLabel: d,
|
|
695
|
+
itemTitleClassName: f?.itemTitleClassName,
|
|
696
|
+
itemIconBadgeClassName: f?.itemIconBadgeClassName,
|
|
697
|
+
rowGroupKey: x.groupKey,
|
|
694
698
|
rows: n,
|
|
695
|
-
draggingId:
|
|
696
|
-
dragOverId:
|
|
697
|
-
allowedDropGroups:
|
|
698
|
-
onDragStart:
|
|
699
|
-
onDragEnd:
|
|
700
|
-
onDragOver:
|
|
701
|
-
onDragLeave:
|
|
702
|
-
onDrop:
|
|
699
|
+
draggingId: p,
|
|
700
|
+
dragOverId: m,
|
|
701
|
+
allowedDropGroups: h,
|
|
702
|
+
onDragStart: g,
|
|
703
|
+
onDragEnd: _,
|
|
704
|
+
onDragOver: v,
|
|
705
|
+
onDragLeave: y,
|
|
706
|
+
onDrop: b
|
|
703
707
|
})
|
|
704
708
|
});
|
|
705
|
-
},
|
|
709
|
+
}, Te = (e, t) => t === J.All ? !0 : e.source === t, Ee = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, De = new Set([
|
|
706
710
|
J.Pinned,
|
|
707
711
|
J.MyChats,
|
|
708
712
|
J.Shared,
|
|
709
713
|
J.Organization
|
|
710
|
-
]), Z =
|
|
711
|
-
let { colors:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}, [
|
|
715
|
-
let [
|
|
714
|
+
]), Z = x(({ conversations: e, isLoading: t, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: f, onNewChat: p, styles: m, className: g, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: T, onActiveFilterChange: E }) => {
|
|
715
|
+
let { colors: M, typography: N } = m ?? {}, { title: P, emptyLabel: F, noResultsLabel: I, loadingLabel: L = "Loading conversations", newChatLabel: R, searchPlaceholder: ee, searchClearLabel: z, filterLabels: te, groupLabels: B, actionsLabel: V, closeAriaLabel: H } = f, [U, ne] = k(""), [W, G] = k(J.All);
|
|
716
|
+
C(() => {
|
|
717
|
+
T != null && (G(T), E?.(T));
|
|
718
|
+
}, [T]);
|
|
719
|
+
let [K, re] = k(() => De), [ie, ae] = k(5), oe = w(), se = O(null), ce = O(null), [de, pe] = k(null), [ge, Y] = k(null), [_e, ve] = k(null), be = O(null), X = O(null), Se = S(({ height: e }) => {
|
|
716
720
|
ae(Math.ceil(e / 36 * 2));
|
|
717
|
-
}, []),
|
|
721
|
+
}, []), Ce = S((e) => {
|
|
718
722
|
re((t) => {
|
|
719
723
|
let n = new Set(t);
|
|
720
724
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
721
725
|
});
|
|
722
|
-
}, []), Z =
|
|
723
|
-
|
|
724
|
-
}, []),
|
|
725
|
-
let r =
|
|
726
|
-
|
|
727
|
-
}, [e]),
|
|
726
|
+
}, []), Z = S(() => {
|
|
727
|
+
be.current = null, X.current = null, pe(null), Y(null), ve(null);
|
|
728
|
+
}, []), Oe = S((t, n) => {
|
|
729
|
+
let r = he(t, me(n, t), e);
|
|
730
|
+
be.current = t, X.current = r, pe(t), ve(r);
|
|
731
|
+
}, [e]), ke = S(() => {
|
|
728
732
|
Z();
|
|
729
|
-
}, [Z]),
|
|
733
|
+
}, [Z]), Ae = S((e) => {
|
|
730
734
|
Y(e);
|
|
731
|
-
}, []),
|
|
735
|
+
}, []), je = S(() => {
|
|
732
736
|
Y(null);
|
|
733
|
-
}, []),
|
|
734
|
-
let r =
|
|
735
|
-
Z(), r != null && r !== e && i?.has(t) &&
|
|
737
|
+
}, []), Me = S((e, t, n) => {
|
|
738
|
+
let r = be.current, i = X.current;
|
|
739
|
+
Z(), r != null && r !== e && i?.has(t) && x?.({
|
|
736
740
|
draggedId: r,
|
|
737
741
|
targetGroupKey: t,
|
|
738
742
|
afterId: n
|
|
739
743
|
});
|
|
740
|
-
}, [Z,
|
|
741
|
-
"--cp-bg":
|
|
742
|
-
"--sb-border":
|
|
743
|
-
"--cp-item-hover":
|
|
744
|
-
"--cp-item-active":
|
|
745
|
-
"--cp-text":
|
|
746
|
-
"--cp-text-secondary":
|
|
747
|
-
"--cp-new-chat-hover":
|
|
748
|
-
"--cp-new-chat-active":
|
|
749
|
-
"--cp-new-chat-bg":
|
|
750
|
-
"--cp-new-chat-text":
|
|
751
|
-
"--cp-new-chat-shadow-blue":
|
|
752
|
-
"--cp-new-chat-shadow-blue-hover":
|
|
753
|
-
"--cp-new-chat-shadow-blue-active":
|
|
754
|
-
"--cp-new-chat-shadow-purple":
|
|
755
|
-
"--cp-new-chat-shadow-purple-hover":
|
|
756
|
-
"--cp-new-chat-shadow-purple-active":
|
|
757
|
-
"--cp-drop-zone-ring":
|
|
758
|
-
"--cp-trigger-bg":
|
|
759
|
-
"--cp-trigger-icon":
|
|
760
|
-
"--cp-trigger-icon-idle":
|
|
761
|
-
"--cp-skeleton-color":
|
|
762
|
-
}), Q =
|
|
744
|
+
}, [Z, x]), Ne = n({
|
|
745
|
+
"--cp-bg": M?.background,
|
|
746
|
+
"--sb-border": M?.border,
|
|
747
|
+
"--cp-item-hover": M?.itemHover,
|
|
748
|
+
"--cp-item-active": M?.itemActive,
|
|
749
|
+
"--cp-text": M?.text,
|
|
750
|
+
"--cp-text-secondary": M?.textSecondary,
|
|
751
|
+
"--cp-new-chat-hover": M?.newChatHoverBackground,
|
|
752
|
+
"--cp-new-chat-active": M?.newChatActiveBackground,
|
|
753
|
+
"--cp-new-chat-bg": M?.newChatBackground,
|
|
754
|
+
"--cp-new-chat-text": M?.newChatText,
|
|
755
|
+
"--cp-new-chat-shadow-blue": M?.newChatShadowBlue,
|
|
756
|
+
"--cp-new-chat-shadow-blue-hover": M?.newChatShadowBlueHover,
|
|
757
|
+
"--cp-new-chat-shadow-blue-active": M?.newChatShadowBlueActive,
|
|
758
|
+
"--cp-new-chat-shadow-purple": M?.newChatShadowPurple,
|
|
759
|
+
"--cp-new-chat-shadow-purple-hover": M?.newChatShadowPurpleHover,
|
|
760
|
+
"--cp-new-chat-shadow-purple-active": M?.newChatShadowPurpleActive,
|
|
761
|
+
"--cp-drop-zone-ring": M?.dropZoneRing,
|
|
762
|
+
"--cp-trigger-bg": M?.triggerBackground,
|
|
763
|
+
"--cp-trigger-icon": M?.triggerIcon,
|
|
764
|
+
"--cp-trigger-icon-idle": M?.triggerIconIdle,
|
|
765
|
+
"--cp-skeleton-color": M?.skeletonColor
|
|
766
|
+
}), Q = D(() => e.filter((e) => Te(e, W) && Ee(e, U)), [
|
|
763
767
|
e,
|
|
764
768
|
W,
|
|
765
|
-
|
|
766
|
-
]),
|
|
769
|
+
U
|
|
770
|
+
]), Pe = D(() => Q.filter((e) => e.isPinned), [Q]), Fe = D(() => Q.filter((e) => !e.isPinned && e.source !== J.Shared && e.source !== J.Organization), [Q]), Ie = D(() => Q.filter((e) => !e.isPinned && e.source === J.Shared), [Q]), Le = D(() => Q.filter((e) => !e.isPinned && e.source === J.Organization), [Q]), Re = D(() => [
|
|
767
771
|
{
|
|
768
772
|
key: J.Pinned,
|
|
769
|
-
label:
|
|
770
|
-
items:
|
|
773
|
+
label: B?.pinned ?? "Pinned",
|
|
774
|
+
items: Pe
|
|
771
775
|
},
|
|
772
776
|
{
|
|
773
777
|
key: J.MyChats,
|
|
774
|
-
label:
|
|
775
|
-
items:
|
|
778
|
+
label: B?.myChats ?? "My chats",
|
|
779
|
+
items: Fe
|
|
776
780
|
},
|
|
777
781
|
{
|
|
778
782
|
key: J.Shared,
|
|
779
|
-
label:
|
|
780
|
-
items:
|
|
783
|
+
label: B?.shared ?? "Shared",
|
|
784
|
+
items: Ie
|
|
781
785
|
},
|
|
782
786
|
{
|
|
783
787
|
key: J.Organization,
|
|
784
|
-
label:
|
|
785
|
-
items:
|
|
788
|
+
label: B?.organization ?? "Organization",
|
|
789
|
+
items: Le
|
|
786
790
|
}
|
|
787
791
|
], [
|
|
788
|
-
|
|
789
|
-
Ne,
|
|
792
|
+
B,
|
|
790
793
|
Pe,
|
|
791
794
|
Fe,
|
|
792
|
-
Ie
|
|
793
|
-
|
|
795
|
+
Ie,
|
|
796
|
+
Le
|
|
797
|
+
]), $ = D(() => {
|
|
794
798
|
let e = [];
|
|
795
|
-
for (let t of
|
|
799
|
+
for (let t of Re) if (t.items.length !== 0 && (e.push({
|
|
796
800
|
kind: q.Header,
|
|
797
801
|
groupKey: t.key,
|
|
798
802
|
label: t.label
|
|
799
|
-
}),
|
|
803
|
+
}), K.has(t.key))) for (let n of t.items) e.push({
|
|
800
804
|
kind: q.Item,
|
|
801
805
|
item: n,
|
|
802
806
|
groupKey: t.key
|
|
803
807
|
});
|
|
804
808
|
return e;
|
|
805
|
-
}, [
|
|
806
|
-
|
|
809
|
+
}, [Re, K]);
|
|
810
|
+
C(() => {
|
|
807
811
|
if (!d) return;
|
|
808
|
-
let e =
|
|
809
|
-
if (e && !
|
|
812
|
+
let e = Re.find((e) => e.items.some((e) => e.id === d))?.key;
|
|
813
|
+
if (e && !K.has(e)) {
|
|
810
814
|
re((t) => new Set(t).add(e));
|
|
811
815
|
return;
|
|
812
816
|
}
|
|
813
|
-
if (
|
|
817
|
+
if (ce.current === d) return;
|
|
814
818
|
let t = $.findIndex((e) => e.kind === q.Item && e.item.id === d);
|
|
815
|
-
t >= 0 && (
|
|
819
|
+
t >= 0 && (se.current?.scrollToRow({
|
|
816
820
|
index: t,
|
|
817
821
|
align: "smart",
|
|
818
822
|
behavior: "smooth"
|
|
819
|
-
}),
|
|
823
|
+
}), ce.current = d);
|
|
820
824
|
}, [
|
|
821
825
|
d,
|
|
822
|
-
|
|
823
|
-
|
|
826
|
+
Re,
|
|
827
|
+
K,
|
|
824
828
|
$
|
|
825
829
|
]);
|
|
826
|
-
let
|
|
830
|
+
let ze = D(() => ({
|
|
827
831
|
rows: $,
|
|
828
|
-
expandedGroups:
|
|
829
|
-
onToggleGroup:
|
|
830
|
-
listId:
|
|
832
|
+
expandedGroups: K,
|
|
833
|
+
onToggleGroup: Ce,
|
|
834
|
+
listId: oe,
|
|
831
835
|
activeConversationId: d,
|
|
832
|
-
searchQuery:
|
|
836
|
+
searchQuery: U,
|
|
833
837
|
onSelectConversation: u,
|
|
834
838
|
getActions: _,
|
|
835
|
-
|
|
839
|
+
onActionMenuOpen: v,
|
|
840
|
+
actionsLabel: V,
|
|
836
841
|
styles: {
|
|
837
|
-
groupHeaderClassName:
|
|
838
|
-
itemTitleClassName:
|
|
842
|
+
groupHeaderClassName: N?.groupHeaderClassName,
|
|
843
|
+
itemTitleClassName: N?.itemTitleClassName,
|
|
839
844
|
itemIconBadgeClassName: m?.itemIconBadgeClassName
|
|
840
845
|
},
|
|
841
|
-
draggingId:
|
|
842
|
-
dragOverId:
|
|
843
|
-
allowedDropGroups:
|
|
844
|
-
onDragStart: (e) =>
|
|
845
|
-
onDragEnd:
|
|
846
|
-
onDragOver:
|
|
847
|
-
onDragLeave:
|
|
848
|
-
onDrop:
|
|
846
|
+
draggingId: de,
|
|
847
|
+
dragOverId: ge,
|
|
848
|
+
allowedDropGroups: _e,
|
|
849
|
+
onDragStart: (e) => Oe(e, $),
|
|
850
|
+
onDragEnd: ke,
|
|
851
|
+
onDragOver: Ae,
|
|
852
|
+
onDragLeave: je,
|
|
853
|
+
onDrop: Me
|
|
849
854
|
}), [
|
|
850
855
|
$,
|
|
851
|
-
G,
|
|
852
|
-
Se,
|
|
853
856
|
K,
|
|
857
|
+
Ce,
|
|
858
|
+
oe,
|
|
854
859
|
d,
|
|
855
|
-
|
|
860
|
+
U,
|
|
856
861
|
u,
|
|
857
862
|
_,
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
863
|
+
v,
|
|
864
|
+
V,
|
|
865
|
+
N?.groupHeaderClassName,
|
|
866
|
+
N?.itemTitleClassName,
|
|
861
867
|
m?.itemIconBadgeClassName,
|
|
862
|
-
|
|
863
|
-
he,
|
|
868
|
+
de,
|
|
864
869
|
ge,
|
|
865
|
-
|
|
870
|
+
_e,
|
|
866
871
|
Oe,
|
|
867
872
|
ke,
|
|
868
873
|
Ae,
|
|
869
|
-
je
|
|
870
|
-
|
|
871
|
-
|
|
874
|
+
je,
|
|
875
|
+
Me
|
|
876
|
+
]), Be = e.length === 0, Ve = e.length > 0 && Q.length === 0;
|
|
877
|
+
return /* @__PURE__ */ j(c, {
|
|
872
878
|
isOpen: l,
|
|
873
879
|
orientation: s.Left,
|
|
874
|
-
title:
|
|
880
|
+
title: P,
|
|
875
881
|
labels: {
|
|
876
|
-
ariaLabel:
|
|
877
|
-
closeLabel:
|
|
882
|
+
ariaLabel: P,
|
|
883
|
+
closeLabel: H
|
|
878
884
|
},
|
|
879
|
-
onClose:
|
|
885
|
+
onClose: y,
|
|
880
886
|
styles: {
|
|
881
887
|
colors: {
|
|
882
|
-
background:
|
|
883
|
-
border:
|
|
888
|
+
background: M?.background,
|
|
889
|
+
border: M?.border
|
|
884
890
|
},
|
|
885
|
-
typography: { fontClassName:
|
|
891
|
+
typography: { fontClassName: N?.fontClassName },
|
|
886
892
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
887
|
-
cssVars:
|
|
888
|
-
titleClassName:
|
|
893
|
+
cssVars: Ne,
|
|
894
|
+
titleClassName: N?.fontClassName,
|
|
889
895
|
headerClassName: "h-[64px]",
|
|
890
896
|
className: r(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
|
|
891
897
|
},
|
|
892
|
-
rightActions:
|
|
898
|
+
rightActions: b,
|
|
893
899
|
children: [
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
label:
|
|
900
|
+
/* @__PURE__ */ A(xe, {
|
|
901
|
+
label: R,
|
|
896
902
|
onClick: p,
|
|
897
|
-
labelClassName:
|
|
903
|
+
labelClassName: N?.newChatLabelClassName
|
|
898
904
|
}),
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
placeholder:
|
|
901
|
-
value:
|
|
902
|
-
onChange:
|
|
903
|
-
clearLabel:
|
|
905
|
+
/* @__PURE__ */ A(o, {
|
|
906
|
+
placeholder: ee,
|
|
907
|
+
value: U,
|
|
908
|
+
onChange: ne,
|
|
909
|
+
clearLabel: z
|
|
904
910
|
}),
|
|
905
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ A(ye, {
|
|
906
912
|
activeTab: W,
|
|
907
|
-
labels:
|
|
913
|
+
labels: te,
|
|
908
914
|
onChange: (e) => {
|
|
909
|
-
|
|
915
|
+
G(e), E?.(e);
|
|
910
916
|
},
|
|
911
|
-
tabClassName:
|
|
917
|
+
tabClassName: N?.tabClassName
|
|
912
918
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ A("span", {
|
|
914
920
|
role: "status",
|
|
915
921
|
"aria-live": "polite",
|
|
916
922
|
className: "sr-only",
|
|
917
|
-
children: t ?
|
|
923
|
+
children: t ? L : Be ? F : Ve ? I : ""
|
|
918
924
|
}),
|
|
919
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ A("div", {
|
|
920
926
|
className: "flex-1 overflow-hidden px-2 py-1",
|
|
921
|
-
children: t ? /* @__PURE__ */
|
|
927
|
+
children: t ? /* @__PURE__ */ A("div", {
|
|
922
928
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
923
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
929
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ A(h, {
|
|
924
930
|
avatar: { size: 24 },
|
|
925
|
-
showTitle: { width:
|
|
931
|
+
showTitle: { width: ue(t) },
|
|
926
932
|
paragraph: !1,
|
|
927
933
|
active: !0,
|
|
928
934
|
color: "var(--bg-layer-4)"
|
|
929
935
|
}, t))
|
|
930
|
-
}) :
|
|
931
|
-
listRef:
|
|
932
|
-
id:
|
|
936
|
+
}) : Be ? /* @__PURE__ */ A(i, { label: F }) : Ve ? /* @__PURE__ */ A(a, { label: I }) : /* @__PURE__ */ A(le, {
|
|
937
|
+
listRef: se,
|
|
938
|
+
id: oe,
|
|
933
939
|
role: "list",
|
|
934
940
|
style: { height: "100%" },
|
|
935
|
-
rowComponent:
|
|
941
|
+
rowComponent: we,
|
|
936
942
|
rowCount: $.length,
|
|
937
|
-
rowHeight:
|
|
943
|
+
rowHeight: fe,
|
|
938
944
|
overscanCount: ie,
|
|
939
|
-
onResize:
|
|
940
|
-
rowProps:
|
|
945
|
+
onResize: Se,
|
|
946
|
+
rowProps: ze
|
|
941
947
|
})
|
|
942
948
|
})
|
|
943
949
|
]
|