@epam/ai-dial-conversation-panel 1.1.0-dev.11 → 1.1.0-dev.111
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/ConversationGroupHeader/ConversationGroupHeader.d.ts +1 -4
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/{ConversationGroup → ConversationRow}/ConversationRow.d.ts +4 -9
- package/components/ConversationRow/ConversationRow.d.ts.map +1 -0
- package/components/NewChatButton/NewChatButton.d.ts +4 -1
- package/components/NewChatButton/NewChatButton.d.ts.map +1 -1
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +347 -343
- package/models/panel-props.d.ts +28 -66
- package/models/panel-props.d.ts.map +1 -1
- package/models/virtual-row.d.ts +3 -6
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +5 -5
- package/types/conversation-classification.d.ts +1 -4
- package/types/conversation-classification.d.ts.map +1 -1
- package/utils/conversation-row.d.ts +1 -7
- package/utils/conversation-row.d.ts.map +1 -1
- package/utils/drag.d.ts +2 -14
- package/utils/drag.d.ts.map +1 -1
- package/components/ConversationGroup/ConversationGroup.d.ts +0 -31
- package/components/ConversationGroup/ConversationGroup.d.ts.map +0 -1
- package/components/ConversationGroup/ConversationRow.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DeploymentIcon as e,
|
|
2
|
-
import { PanelEmpty as
|
|
3
|
-
import {
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
1
|
+
import { DeploymentIcon as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { PanelEmpty as r, PanelNoResults as i, SearchInput as a, SidebarOrientation as o, SidebarPanel as s } from "@epam/ai-dial-sidebar";
|
|
3
|
+
import { Button as c, DIAL_ICON_SIZE as l, DialDropdown as u, DialEllipsisTooltip as d, DialSkeleton as f, DialSkeletonVariant as p, DialTag as m, ElementSize as h, GhostIconButton as g, Highlight as _, mergeClasses as v } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { createElement as y, memo as b, useCallback as x, useEffect as S, useId as C, useImperativeHandle as w, useLayoutEffect as T, useMemo as E, useRef as D, useState as O } from "react";
|
|
5
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
6
|
+
import { IconCaretDownFilled as j, IconCaretRightFilled as M, IconClock 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 I = typeof window < "u" ?
|
|
8
|
+
var I = typeof window < "u" ? T : S;
|
|
9
9
|
function L(e) {
|
|
10
10
|
if (e !== void 0) switch (typeof e) {
|
|
11
11
|
case "number": return e;
|
|
@@ -14,11 +14,11 @@ function L(e) {
|
|
|
14
14
|
break;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let { styleHeight: s, styleWidth: c } =
|
|
17
|
+
function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
18
|
+
let { styleHeight: s, styleWidth: c } = E(() => ({
|
|
19
19
|
styleHeight: L(o?.height),
|
|
20
20
|
styleWidth: L(o?.width)
|
|
21
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
21
|
+
}), [o?.height, o?.width]), [l, u] = O({
|
|
22
22
|
height: t,
|
|
23
23
|
width: n
|
|
24
24
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
@@ -42,7 +42,7 @@ function R({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
42
42
|
i,
|
|
43
43
|
s,
|
|
44
44
|
c
|
|
45
|
-
]),
|
|
45
|
+
]), E(() => ({
|
|
46
46
|
height: s ?? l.height,
|
|
47
47
|
width: c ?? l.width
|
|
48
48
|
}), [
|
|
@@ -51,13 +51,13 @@ function R({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
51
51
|
c
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
54
|
+
function R(e) {
|
|
55
|
+
let t = D(() => {
|
|
56
56
|
throw Error("Cannot call during render.");
|
|
57
57
|
});
|
|
58
58
|
return I(() => {
|
|
59
59
|
t.current = e;
|
|
60
|
-
}, [e]),
|
|
60
|
+
}, [e]), x((e) => t.current?.(e), [t]);
|
|
61
61
|
}
|
|
62
62
|
var z = null;
|
|
63
63
|
function te(e = !1) {
|
|
@@ -90,7 +90,7 @@ function H(e, t) {
|
|
|
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 ne({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
94
94
|
if (t === 0) return 0;
|
|
95
95
|
if (typeof n == "number") return t * n;
|
|
96
96
|
{
|
|
@@ -98,9 +98,9 @@ function U({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
98
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 U({ 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 = ne({
|
|
104
104
|
cachedBounds: t,
|
|
105
105
|
itemCount: r,
|
|
106
106
|
itemSize: i
|
|
@@ -169,7 +169,7 @@ function G({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
function K({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
172
|
-
return
|
|
172
|
+
return E(() => G({
|
|
173
173
|
itemCount: e,
|
|
174
174
|
itemProps: t,
|
|
175
175
|
itemSize: n
|
|
@@ -179,7 +179,7 @@ function K({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
179
179
|
n
|
|
180
180
|
]);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function q({ containerSize: e, itemSize: t }) {
|
|
183
183
|
let n;
|
|
184
184
|
switch (typeof t) {
|
|
185
185
|
case "string":
|
|
@@ -191,21 +191,21 @@ function re({ containerSize: e, itemSize: t }) {
|
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
let { height: u = n, width: d = n } =
|
|
194
|
+
function J({ 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 } = ee({
|
|
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 = D({
|
|
202
202
|
height: 0,
|
|
203
203
|
width: 0
|
|
204
|
-
}), p = r === "vertical" ? u : d, m =
|
|
204
|
+
}), p = r === "vertical" ? u : d, m = q({
|
|
205
205
|
containerSize: p,
|
|
206
206
|
itemSize: s
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
T(() => {
|
|
209
209
|
if (typeof c == "function") {
|
|
210
210
|
let e = f.current;
|
|
211
211
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -222,18 +222,18 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
222
222
|
itemCount: a,
|
|
223
223
|
itemProps: o,
|
|
224
224
|
itemSize: m
|
|
225
|
-
}), g =
|
|
225
|
+
}), g = x((e) => h.get(e), [h]), [_, v] = O(() => 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: S, 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 = x(() => ne({
|
|
237
237
|
cachedBounds: h,
|
|
238
238
|
itemCount: a,
|
|
239
239
|
itemSize: m
|
|
@@ -241,7 +241,7 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
241
241
|
h,
|
|
242
242
|
a,
|
|
243
243
|
m
|
|
244
|
-
]),
|
|
244
|
+
]), E = x((t) => W({
|
|
245
245
|
cachedBounds: h,
|
|
246
246
|
containerScrollOffset: B({
|
|
247
247
|
containerElement: e,
|
|
@@ -262,11 +262,11 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
262
262
|
l
|
|
263
263
|
]);
|
|
264
264
|
return I(() => {
|
|
265
|
-
v(
|
|
265
|
+
v(E((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
266
266
|
}, [
|
|
267
267
|
e,
|
|
268
268
|
r,
|
|
269
|
-
|
|
269
|
+
E
|
|
270
270
|
]), I(() => {
|
|
271
271
|
if (!e) return;
|
|
272
272
|
let 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: R(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
303
|
+
let s = U({
|
|
304
304
|
align: t,
|
|
305
305
|
cachedBounds: h,
|
|
306
306
|
containerScrollOffset: n,
|
|
@@ -316,7 +316,7 @@ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
316
316
|
isRtl: i,
|
|
317
317
|
scrollOffset: s
|
|
318
318
|
}), typeof e.scrollTo != "function") {
|
|
319
|
-
let e =
|
|
319
|
+
let e = E(s);
|
|
320
320
|
H(_, e) || v(e);
|
|
321
321
|
}
|
|
322
322
|
return s;
|
|
@@ -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: S
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
331
|
+
function re(e) {
|
|
332
|
+
return E(() => e, Object.values(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function ie(e, t) {
|
|
335
335
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
336
336
|
return H(n, a) && H(r, o) && H(i, s);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function ae(e) {
|
|
339
339
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
function
|
|
343
|
-
let m =
|
|
341
|
+
var oe = "data-react-window-index";
|
|
342
|
+
function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
343
|
+
let m = re(u), h = E(() => b(s, ie), [s]), [g, _] = O(null), v = ae(l), { getCellBounds: x, getEstimatedSize: C, scrollToIndex: T, startIndexOverscan: D, startIndexVisible: A, stopIndexOverscan: j, stopIndexVisible: M } = J({
|
|
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: E(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
351
351
|
onResize: i,
|
|
352
352
|
overscanCount: o
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
w(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 = T({
|
|
360
360
|
align: e,
|
|
361
361
|
containerScrollOffset: g?.scrollTop ?? 0,
|
|
362
362
|
index: n
|
|
@@ -366,40 +366,40 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
366
366
|
top: r
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
}), [g,
|
|
369
|
+
}), [g, T]), 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 = `${D + t}`;
|
|
374
|
+
return e.setAttribute(oe, 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
|
+
D,
|
|
382
382
|
j
|
|
383
|
-
]),
|
|
384
|
-
|
|
385
|
-
startIndex:
|
|
383
|
+
]), S(() => {
|
|
384
|
+
D >= 0 && j >= 0 && a && a({
|
|
385
|
+
startIndex: A,
|
|
386
386
|
stopIndex: M
|
|
387
387
|
}, {
|
|
388
|
-
startIndex:
|
|
388
|
+
startIndex: D,
|
|
389
389
|
stopIndex: j
|
|
390
390
|
});
|
|
391
391
|
}, [
|
|
392
392
|
a,
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
D,
|
|
394
|
+
A,
|
|
395
395
|
j,
|
|
396
396
|
M
|
|
397
397
|
]);
|
|
398
|
-
let N =
|
|
398
|
+
let N = E(() => {
|
|
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 = D; t <= j; t++) {
|
|
401
|
+
let n = x(t);
|
|
402
|
+
e.push(/* @__PURE__ */ y(h, {
|
|
403
403
|
...m,
|
|
404
404
|
ariaAttributes: {
|
|
405
405
|
"aria-posinset": t + 1,
|
|
@@ -420,21 +420,21 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
420
420
|
return e;
|
|
421
421
|
}, [
|
|
422
422
|
h,
|
|
423
|
-
|
|
423
|
+
x,
|
|
424
424
|
v,
|
|
425
425
|
c,
|
|
426
426
|
m,
|
|
427
|
-
|
|
427
|
+
D,
|
|
428
428
|
j
|
|
429
|
-
]), P = /* @__PURE__ */
|
|
429
|
+
]), P = /* @__PURE__ */ k("div", {
|
|
430
430
|
"aria-hidden": !0,
|
|
431
431
|
style: {
|
|
432
|
-
height:
|
|
432
|
+
height: C(),
|
|
433
433
|
width: "100%",
|
|
434
434
|
zIndex: -1
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
|
-
return
|
|
437
|
+
return y(d, {
|
|
438
438
|
role: "list",
|
|
439
439
|
...p,
|
|
440
440
|
className: t,
|
|
@@ -450,245 +450,259 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/types/virtual-row.ts
|
|
453
|
-
var
|
|
453
|
+
var Y = /* @__PURE__ */ function(e) {
|
|
454
454
|
return e.Header = "header", e.Item = "item", e;
|
|
455
|
-
}({}),
|
|
455
|
+
}({}), X = /* @__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
|
+
}({}), ce = (e) => `${60 + e * 23 % 35}%`, le = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", ue = (e, t) => t.rows[e].kind === Y.Item ? 36 : e === 0 ? 24 : 56, de = (e) => {
|
|
458
458
|
switch (e) {
|
|
459
|
-
case
|
|
460
|
-
case
|
|
461
|
-
default: return
|
|
459
|
+
case X.Shared: return X.Shared;
|
|
460
|
+
case X.Organization: return X.Organization;
|
|
461
|
+
default: return X.MyChats;
|
|
462
462
|
}
|
|
463
|
-
},
|
|
463
|
+
}, fe = (e, t) => {
|
|
464
464
|
let n = null;
|
|
465
|
-
for (let r of e) if (r.kind ===
|
|
465
|
+
for (let r of e) if (r.kind === Y.Header) n = r.groupKey;
|
|
466
466
|
else if (r.item.id === t) return n;
|
|
467
467
|
return null;
|
|
468
|
-
},
|
|
468
|
+
}, pe = (e, t, n) => {
|
|
469
469
|
let r = /* @__PURE__ */ new Set();
|
|
470
|
-
if (t != null && r.add(t), t ===
|
|
470
|
+
if (t != null && r.add(t), t === X.Pinned) {
|
|
471
471
|
let t = n.find((t) => t.id === e);
|
|
472
|
-
t && r.add(
|
|
473
|
-
} else r.add(
|
|
472
|
+
t && r.add(de(t.source));
|
|
473
|
+
} else r.add(X.Pinned);
|
|
474
474
|
return r;
|
|
475
|
-
},
|
|
475
|
+
}, me = (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;
|
|
479
|
-
for (let e of n) if (e.kind ===
|
|
479
|
+
for (let e of n) if (e.kind === Y.Header) o = e.groupKey === r;
|
|
480
480
|
else if (o) {
|
|
481
481
|
if (e.item.id === t) return a;
|
|
482
482
|
a = e.item.id;
|
|
483
483
|
}
|
|
484
484
|
return null;
|
|
485
|
-
},
|
|
486
|
-
tabContainer: "
|
|
487
|
-
tabActive: "
|
|
488
|
-
},
|
|
485
|
+
}, he = {
|
|
486
|
+
tabContainer: "_tabContainer_153ct_1",
|
|
487
|
+
tabActive: "_tabActive_153ct_13"
|
|
488
|
+
}, ge = b(({ tabs: e, activeTabId: t, onTabChange: r, styles: i }) => {
|
|
489
489
|
let { tabClassName: a = "dial-tiny-semi-text" } = i?.typography ?? {};
|
|
490
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ k("div", {
|
|
491
491
|
className: "flex flex-nowrap gap-1",
|
|
492
|
+
role: "tablist",
|
|
492
493
|
children: e.map((e) => {
|
|
493
494
|
let i = t === e.id;
|
|
494
|
-
return /* @__PURE__ */
|
|
495
|
-
|
|
496
|
-
selected: i,
|
|
497
|
-
onClick: () => n(e.id),
|
|
495
|
+
return /* @__PURE__ */ k("div", {
|
|
496
|
+
role: "tab",
|
|
498
497
|
"aria-selected": i,
|
|
499
|
-
className:
|
|
498
|
+
className: "contents",
|
|
499
|
+
children: /* @__PURE__ */ k(m, {
|
|
500
|
+
label: e.label,
|
|
501
|
+
selected: i,
|
|
502
|
+
onClick: () => r(e.id),
|
|
503
|
+
className: n("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", a, he.tabContainer, i && he.tabActive)
|
|
504
|
+
})
|
|
500
505
|
}, e.id);
|
|
501
506
|
})
|
|
502
507
|
});
|
|
503
|
-
}),
|
|
508
|
+
}), _e = [
|
|
504
509
|
{
|
|
505
|
-
value:
|
|
510
|
+
value: X.All,
|
|
506
511
|
labelKey: "all"
|
|
507
512
|
},
|
|
508
513
|
{
|
|
509
|
-
value:
|
|
514
|
+
value: X.MyChats,
|
|
510
515
|
labelKey: "myChats"
|
|
511
516
|
},
|
|
512
517
|
{
|
|
513
|
-
value:
|
|
518
|
+
value: X.Shared,
|
|
514
519
|
labelKey: "shared"
|
|
515
520
|
},
|
|
516
521
|
{
|
|
517
|
-
value:
|
|
522
|
+
value: X.Organization,
|
|
518
523
|
labelKey: "organization"
|
|
519
524
|
}
|
|
520
|
-
],
|
|
525
|
+
], ve = b(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ k("div", {
|
|
521
526
|
className: "mx-3 my-2",
|
|
522
|
-
children: /* @__PURE__ */
|
|
523
|
-
tabs:
|
|
527
|
+
children: /* @__PURE__ */ k(ge, {
|
|
528
|
+
tabs: _e.map(({ value: e, labelKey: n }) => ({
|
|
524
529
|
id: e,
|
|
525
530
|
label: t[n]
|
|
526
531
|
})),
|
|
527
532
|
activeTabId: e,
|
|
528
533
|
onTabChange: (e) => n(e),
|
|
529
|
-
styles: { typography: { tabClassName:
|
|
534
|
+
styles: { typography: { tabClassName: v(r, "flex-1") } }
|
|
530
535
|
})
|
|
531
|
-
})),
|
|
536
|
+
})), ye = { button: "_button_1g5dd_1" }, be = b(({ label: e, onClick: r, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ k("div", {
|
|
532
537
|
className: "px-3 py-2",
|
|
533
|
-
|
|
534
|
-
|
|
538
|
+
style: t({
|
|
539
|
+
"--cp-new-chat-bg": a?.background,
|
|
540
|
+
"--cp-new-chat-text": a?.text
|
|
541
|
+
}),
|
|
542
|
+
children: /* @__PURE__ */ A("button", {
|
|
543
|
+
onClick: r,
|
|
535
544
|
type: "button",
|
|
536
|
-
className:
|
|
537
|
-
children: [/* @__PURE__ */
|
|
545
|
+
className: n("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1 shadow-sm hover:shadow-md active:shadow-xs", ye.button),
|
|
546
|
+
children: [/* @__PURE__ */ k(F, {
|
|
538
547
|
size: 18,
|
|
539
548
|
stroke: 2,
|
|
540
549
|
className: "shrink-0"
|
|
541
|
-
}), /* @__PURE__ */
|
|
542
|
-
className:
|
|
550
|
+
}), /* @__PURE__ */ k("span", {
|
|
551
|
+
className: i,
|
|
543
552
|
children: e
|
|
544
553
|
})]
|
|
545
554
|
})
|
|
546
|
-
})),
|
|
555
|
+
})), Z = {
|
|
547
556
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-layer-4, #d1dbea))",
|
|
548
|
-
header: "
|
|
549
|
-
item: "
|
|
550
|
-
itemActive: "
|
|
551
|
-
groupHeader: "
|
|
552
|
-
dropZoneActive: "
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
557
|
+
header: "_header_1oif0_1",
|
|
558
|
+
item: "_item_1oif0_5",
|
|
559
|
+
itemActive: "_itemActive_1oif0_11",
|
|
560
|
+
groupHeader: "_groupHeader_1oif0_16",
|
|
561
|
+
dropZoneActive: "_dropZoneActive_1oif0_20",
|
|
562
|
+
triggerActive: "_triggerActive_1oif0_25",
|
|
563
|
+
triggerIcon: "_triggerIcon_1oif0_28"
|
|
564
|
+
}, xe = ({ label: e, isExpanded: t, onToggle: r, listId: i, className: a = "dial-tiny-semi-text uppercase", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
|
|
565
|
+
let f = o != null;
|
|
566
|
+
return /* @__PURE__ */ A("button", {
|
|
567
|
+
type: "button",
|
|
568
|
+
"aria-expanded": t,
|
|
569
|
+
"aria-controls": i,
|
|
570
|
+
onClick: r,
|
|
571
|
+
onDragOver: f ? (e) => {
|
|
572
|
+
f && (e.preventDefault(), c?.(o));
|
|
573
|
+
} : void 0,
|
|
574
|
+
onDragLeave: f ? (e) => {
|
|
575
|
+
f && (e.currentTarget.contains(e.relatedTarget) || l?.());
|
|
576
|
+
} : void 0,
|
|
577
|
+
onDrop: f ? (e) => {
|
|
578
|
+
f && (e.preventDefault(), u?.(o, o, null));
|
|
579
|
+
} : void 0,
|
|
580
|
+
className: n("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
|
|
581
|
+
children: [t ? /* @__PURE__ */ k(j, {
|
|
582
|
+
stroke: .5,
|
|
583
|
+
size: 12,
|
|
584
|
+
className: "shrink-0",
|
|
585
|
+
"aria-hidden": !0
|
|
586
|
+
}) : /* @__PURE__ */ k(M, {
|
|
587
|
+
stroke: .5,
|
|
588
|
+
size: 12,
|
|
589
|
+
className: "shrink-0 rtl:scale-x-[-1]",
|
|
590
|
+
"aria-hidden": !0
|
|
591
|
+
}), /* @__PURE__ */ k(d, { text: e })]
|
|
592
|
+
});
|
|
593
|
+
}, Se = ({ item: t, isActive: r, onSelectConversation: i, searchQuery: a = "", getActions: o, onActionMenuOpen: s, actionsLabel: d = "More actions", itemTitleClassName: m = "dial-small-text", itemIconBadgeClassName: v, taskBadgeClassName: y = "border-tertiary bg-layer-base text-secondary dial-caption-semi-text uppercase tracking-[0.6px]", rowGroupKey: b, rows: S, draggingId: C, dragOverId: w, allowedDropGroups: T, onDragStart: E, onDragEnd: j, onDragOver: M, onDragLeave: F, onDrop: I }) => {
|
|
594
|
+
let [L, ee] = O(!1), R = D(null), z = x((e) => {
|
|
595
|
+
ee(e), e && R.current && s?.(t, R.current);
|
|
596
|
+
}, [t, s]), te = o?.(t) ?? [], B = te.length > 0, V = t.isIconLoading ? /* @__PURE__ */ k(f, {
|
|
597
|
+
variant: p.Circular,
|
|
598
|
+
width: l.LG,
|
|
599
|
+
height: l.LG,
|
|
600
|
+
color: Z.skeletonColor,
|
|
564
601
|
"aria-hidden": !0
|
|
565
|
-
}) : /* @__PURE__ */
|
|
566
|
-
src:
|
|
567
|
-
size:
|
|
568
|
-
initialsName:
|
|
569
|
-
labels: { tooltip:
|
|
570
|
-
styles: { badgeClassName:
|
|
571
|
-
}),
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
602
|
+
}) : /* @__PURE__ */ k(e, {
|
|
603
|
+
src: t.iconUrl,
|
|
604
|
+
size: l.LG,
|
|
605
|
+
initialsName: t.iconTooltip ?? "",
|
|
606
|
+
labels: { tooltip: t.iconTooltip },
|
|
607
|
+
styles: { badgeClassName: v }
|
|
608
|
+
}), H = le(B, L), ne = t.showTaskBadge ? /* @__PURE__ */ A("span", {
|
|
609
|
+
className: n("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", y),
|
|
610
|
+
children: [/* @__PURE__ */ k(N, {
|
|
611
|
+
size: 12,
|
|
612
|
+
"aria-hidden": !0
|
|
613
|
+
}), t.taskBadgeLabel]
|
|
614
|
+
}) : void 0, U = b != null, W = x((e) => {
|
|
615
|
+
e.currentTarget.contains(e.relatedTarget) || F?.();
|
|
616
|
+
}, [F]), G = x((e) => {
|
|
617
|
+
if (!b || !S || !I) return;
|
|
575
618
|
e.preventDefault();
|
|
576
|
-
let
|
|
577
|
-
|
|
619
|
+
let n = me(e, t.id, S, b);
|
|
620
|
+
I(t.id, b, n);
|
|
578
621
|
}, [
|
|
579
|
-
|
|
580
|
-
|
|
622
|
+
t.id,
|
|
623
|
+
S,
|
|
581
624
|
b,
|
|
582
|
-
|
|
583
|
-
]),
|
|
584
|
-
return /* @__PURE__ */
|
|
585
|
-
className:
|
|
586
|
-
draggable:
|
|
587
|
-
onDragStart:
|
|
588
|
-
onDragEnd:
|
|
589
|
-
onDragOver:
|
|
590
|
-
e.preventDefault(), M?.(
|
|
625
|
+
I
|
|
626
|
+
]), K = t.id === C, q = t.id === w, J = b != null && (T?.has(b) ?? !1), re = C != null;
|
|
627
|
+
return /* @__PURE__ */ A("li", {
|
|
628
|
+
className: n("group/conversation relative", K && "cursor-grabbing opacity-50", q && J && "rounded", q && J && Z.dropZoneActive, re && !K && !J && "cursor-not-allowed"),
|
|
629
|
+
draggable: U || void 0,
|
|
630
|
+
onDragStart: U ? () => E?.(t.id) : void 0,
|
|
631
|
+
onDragEnd: U ? j : void 0,
|
|
632
|
+
onDragOver: U ? (e) => {
|
|
633
|
+
e.preventDefault(), M?.(t.id);
|
|
591
634
|
} : void 0,
|
|
592
|
-
onDragLeave:
|
|
593
|
-
onDrop:
|
|
594
|
-
children: [/* @__PURE__ */
|
|
595
|
-
href:
|
|
635
|
+
onDragLeave: U ? W : void 0,
|
|
636
|
+
onDrop: U ? G : void 0,
|
|
637
|
+
children: [/* @__PURE__ */ k("a", {
|
|
638
|
+
href: t.href,
|
|
596
639
|
className: "contents",
|
|
597
640
|
onClick: (e) => {
|
|
598
|
-
|
|
641
|
+
t.href && (e.preventDefault(), i(t.id));
|
|
599
642
|
},
|
|
600
|
-
children: /* @__PURE__ */
|
|
601
|
-
iconBefore:
|
|
602
|
-
label: /* @__PURE__ */
|
|
603
|
-
text:
|
|
604
|
-
query:
|
|
605
|
-
className:
|
|
643
|
+
children: /* @__PURE__ */ k(c, {
|
|
644
|
+
iconBefore: V,
|
|
645
|
+
label: /* @__PURE__ */ k(_, {
|
|
646
|
+
text: t.title,
|
|
647
|
+
query: a,
|
|
648
|
+
className: m,
|
|
606
649
|
maxLines: 1
|
|
607
650
|
}),
|
|
608
|
-
|
|
609
|
-
"
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
651
|
+
iconAfter: ne,
|
|
652
|
+
textClassName: "min-w-0 flex-1",
|
|
653
|
+
"aria-current": r ? "page" : void 0,
|
|
654
|
+
onClick: t.href ? void 0 : () => i(t.id),
|
|
655
|
+
tabIndex: t.href ? -1 : void 0,
|
|
656
|
+
className: n("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-3", H, Z.item, r && Z.itemActive, L && Z.itemActive)
|
|
613
657
|
})
|
|
614
|
-
}),
|
|
615
|
-
className:
|
|
616
|
-
children: /* @__PURE__ */
|
|
617
|
-
items:
|
|
618
|
-
onOpenChange:
|
|
658
|
+
}), B && /* @__PURE__ */ k("div", {
|
|
659
|
+
className: n("absolute inset-y-0 end-1 flex items-center", L ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
660
|
+
children: /* @__PURE__ */ k(u, {
|
|
661
|
+
items: te,
|
|
662
|
+
onOpenChange: z,
|
|
619
663
|
matchReferenceWidth: !1,
|
|
620
664
|
listClassName: "w-[140px] cp-dropdown-overlay",
|
|
621
|
-
children: /* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ k(g, {
|
|
622
666
|
ref: R,
|
|
623
|
-
icon: /* @__PURE__ */
|
|
624
|
-
size:
|
|
625
|
-
className:
|
|
667
|
+
icon: /* @__PURE__ */ k(P, {
|
|
668
|
+
size: l.SM,
|
|
669
|
+
className: Z.triggerIcon,
|
|
626
670
|
"aria-hidden": !0
|
|
627
671
|
}),
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
className: r("flex items-center justify-center rounded", X.trigger, I && X.triggerActive)
|
|
672
|
+
size: h.Small,
|
|
673
|
+
"aria-label": d,
|
|
674
|
+
className: n(L && Z.triggerActive)
|
|
632
675
|
})
|
|
633
676
|
})
|
|
634
677
|
})]
|
|
635
678
|
});
|
|
636
|
-
}, Ce = ({
|
|
637
|
-
let d = o != null;
|
|
638
|
-
return /* @__PURE__ */ j("button", {
|
|
639
|
-
type: "button",
|
|
640
|
-
"aria-expanded": t,
|
|
641
|
-
"aria-controls": i,
|
|
642
|
-
onClick: n,
|
|
643
|
-
onDragOver: d ? (e) => {
|
|
644
|
-
d && (e.preventDefault(), c?.(o));
|
|
645
|
-
} : void 0,
|
|
646
|
-
onDragLeave: d ? (e) => {
|
|
647
|
-
d && (e.currentTarget.contains(e.relatedTarget) || l?.());
|
|
648
|
-
} : void 0,
|
|
649
|
-
onDrop: d ? (e) => {
|
|
650
|
-
d && (e.preventDefault(), u?.(o, o, null));
|
|
651
|
-
} : void 0,
|
|
652
|
-
className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, X.groupHeader, s && X.dropZoneActive),
|
|
653
|
-
children: [t ? /* @__PURE__ */ A(M, {
|
|
654
|
-
stroke: .5,
|
|
655
|
-
size: 12,
|
|
656
|
-
className: "shrink-0",
|
|
657
|
-
"aria-hidden": !0
|
|
658
|
-
}) : /* @__PURE__ */ A(N, {
|
|
659
|
-
stroke: .5,
|
|
660
|
-
size: 12,
|
|
661
|
-
className: "shrink-0 rtl:scale-x-[-1]",
|
|
662
|
-
"aria-hidden": !0
|
|
663
|
-
}), /* @__PURE__ */ A(p, { text: e })]
|
|
664
|
-
});
|
|
665
|
-
}, 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 }) => {
|
|
679
|
+
}, Ce = ({ 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 }) => {
|
|
666
680
|
let x = n[e];
|
|
667
|
-
if (x.kind ===
|
|
668
|
-
let n = x.groupKey ===
|
|
669
|
-
return /* @__PURE__ */
|
|
681
|
+
if (x.kind === Y.Header) {
|
|
682
|
+
let n = x.groupKey === X.Pinned;
|
|
683
|
+
return /* @__PURE__ */ k("div", {
|
|
670
684
|
role: "presentation",
|
|
671
685
|
style: t,
|
|
672
686
|
className: e === 0 ? "pt-0" : "pt-8",
|
|
673
|
-
children: /* @__PURE__ */
|
|
687
|
+
children: /* @__PURE__ */ k(xe, {
|
|
674
688
|
label: x.label,
|
|
675
689
|
isExpanded: r.has(x.groupKey),
|
|
676
690
|
onToggle: () => i(x.groupKey),
|
|
677
691
|
listId: a,
|
|
678
692
|
className: f?.groupHeaderClassName,
|
|
679
|
-
dropZoneGroupKey: n ?
|
|
680
|
-
isDragOver: n && m ===
|
|
693
|
+
dropZoneGroupKey: n ? X.Pinned : void 0,
|
|
694
|
+
isDragOver: n && m === X.Pinned,
|
|
681
695
|
onDragOver: n ? v : void 0,
|
|
682
696
|
onDragLeave: n ? y : void 0,
|
|
683
697
|
onDrop: n ? b : void 0
|
|
684
698
|
})
|
|
685
699
|
});
|
|
686
700
|
}
|
|
687
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ k("div", {
|
|
688
702
|
role: "presentation",
|
|
689
703
|
style: t,
|
|
690
704
|
className: "pt-1",
|
|
691
|
-
children: /* @__PURE__ */
|
|
705
|
+
children: /* @__PURE__ */ k(Se, {
|
|
692
706
|
item: x.item,
|
|
693
707
|
isActive: x.item.id === o,
|
|
694
708
|
searchQuery: s,
|
|
@@ -698,6 +712,7 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
698
712
|
actionsLabel: d,
|
|
699
713
|
itemTitleClassName: f?.itemTitleClassName,
|
|
700
714
|
itemIconBadgeClassName: f?.itemIconBadgeClassName,
|
|
715
|
+
taskBadgeClassName: f?.taskBadgeClassName,
|
|
701
716
|
rowGroupKey: x.groupKey,
|
|
702
717
|
rows: n,
|
|
703
718
|
draggingId: p,
|
|
@@ -710,181 +725,169 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
710
725
|
onDrop: b
|
|
711
726
|
})
|
|
712
727
|
});
|
|
713
|
-
},
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
]),
|
|
719
|
-
let { colors: M, typography: N } =
|
|
720
|
-
|
|
721
|
-
T != null && (
|
|
728
|
+
}, we = (e, t) => t === X.All ? !0 : e.source === t, Te = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ee = new Set([
|
|
729
|
+
X.Pinned,
|
|
730
|
+
X.MyChats,
|
|
731
|
+
X.Shared,
|
|
732
|
+
X.Organization
|
|
733
|
+
]), De = b(({ conversations: e, isLoading: c, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: p, onNewChat: m, styles: h, className: g, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: w, activeFilter: T, onActiveFilterChange: j }) => {
|
|
734
|
+
let { colors: M, typography: N, newChatButton: P } = h ?? {}, { title: F, emptyLabel: I, noResultsLabel: L, loadingLabel: ee = "Loading conversations", newChatLabel: R, searchPlaceholder: z, searchClearLabel: te, filterLabels: B, groupLabels: V, actionsLabel: H, closeAriaLabel: ne } = p, [U, W] = O(""), [G, K] = O(X.All);
|
|
735
|
+
S(() => {
|
|
736
|
+
T != null && K(T);
|
|
722
737
|
}, [T]);
|
|
723
|
-
let [
|
|
724
|
-
|
|
725
|
-
}, []),
|
|
726
|
-
|
|
738
|
+
let [q, J] = O(() => Ee), [re, ie] = O(5), ae = C(), oe = D(null), le = D(null), [de, me] = O(null), [he, ge] = O(null), [_e, ye] = O(null), xe = D(null), Se = D(null), De = x(({ height: e }) => {
|
|
739
|
+
ie(Math.ceil(e / 36 * 2));
|
|
740
|
+
}, []), Oe = x((e) => {
|
|
741
|
+
J((t) => {
|
|
727
742
|
let n = new Set(t);
|
|
728
743
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
729
744
|
});
|
|
730
|
-
}, []),
|
|
731
|
-
|
|
732
|
-
}, []),
|
|
733
|
-
let r =
|
|
734
|
-
|
|
735
|
-
}, [e]),
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
|
|
739
|
-
}, []),
|
|
740
|
-
|
|
741
|
-
}, []),
|
|
742
|
-
let r =
|
|
743
|
-
|
|
745
|
+
}, []), ke = x(() => {
|
|
746
|
+
xe.current = null, Se.current = null, me(null), ge(null), ye(null);
|
|
747
|
+
}, []), Ae = x((t, n) => {
|
|
748
|
+
let r = pe(t, fe(n, t), e);
|
|
749
|
+
xe.current = t, Se.current = r, me(t), ye(r);
|
|
750
|
+
}, [e]), je = x(() => {
|
|
751
|
+
ke();
|
|
752
|
+
}, [ke]), Me = x((e) => {
|
|
753
|
+
ge(e);
|
|
754
|
+
}, []), Ne = x(() => {
|
|
755
|
+
ge(null);
|
|
756
|
+
}, []), Pe = x((e, t, n) => {
|
|
757
|
+
let r = xe.current, i = Se.current;
|
|
758
|
+
ke(), r != null && r !== e && i?.has(t) && w?.({
|
|
744
759
|
draggedId: r,
|
|
745
760
|
targetGroupKey: t,
|
|
746
761
|
afterId: n
|
|
747
762
|
});
|
|
748
|
-
}, [
|
|
763
|
+
}, [ke, w]), Fe = t({
|
|
749
764
|
"--cp-bg": M?.background,
|
|
750
765
|
"--sb-border": M?.border,
|
|
751
766
|
"--cp-item-hover": M?.itemHover,
|
|
752
767
|
"--cp-item-active": M?.itemActive,
|
|
753
768
|
"--cp-text": M?.text,
|
|
754
769
|
"--cp-text-secondary": M?.textSecondary,
|
|
755
|
-
"--cp-new-chat-
|
|
756
|
-
"--cp-new-chat-
|
|
757
|
-
"--cp-new-chat-bg": M?.newChatBackground,
|
|
758
|
-
"--cp-new-chat-text": M?.newChatText,
|
|
759
|
-
"--cp-new-chat-shadow-blue": M?.newChatShadowBlue,
|
|
760
|
-
"--cp-new-chat-shadow-blue-hover": M?.newChatShadowBlueHover,
|
|
761
|
-
"--cp-new-chat-shadow-blue-active": M?.newChatShadowBlueActive,
|
|
762
|
-
"--cp-new-chat-shadow-purple": M?.newChatShadowPurple,
|
|
763
|
-
"--cp-new-chat-shadow-purple-hover": M?.newChatShadowPurpleHover,
|
|
764
|
-
"--cp-new-chat-shadow-purple-active": M?.newChatShadowPurpleActive,
|
|
770
|
+
"--cp-new-chat-bg": P?.background,
|
|
771
|
+
"--cp-new-chat-text": P?.text,
|
|
765
772
|
"--cp-drop-zone-ring": M?.dropZoneRing,
|
|
766
773
|
"--cp-trigger-bg": M?.triggerBackground,
|
|
767
774
|
"--cp-trigger-icon": M?.triggerIcon,
|
|
768
775
|
"--cp-trigger-icon-idle": M?.triggerIconIdle,
|
|
769
776
|
"--cp-skeleton-color": M?.skeletonColor
|
|
770
|
-
}), Q =
|
|
777
|
+
}), Q = E(() => e.filter((e) => we(e, G) && Te(e, U)), [
|
|
771
778
|
e,
|
|
772
|
-
|
|
779
|
+
G,
|
|
773
780
|
U
|
|
774
|
-
]),
|
|
781
|
+
]), Ie = E(() => Q.filter((e) => e.isPinned), [Q]), Le = E(() => Q.filter((e) => !e.isPinned && e.source !== X.Shared && e.source !== X.Organization), [Q]), Re = E(() => Q.filter((e) => !e.isPinned && e.source === X.Shared), [Q]), ze = E(() => Q.filter((e) => !e.isPinned && e.source === X.Organization), [Q]), Be = E(() => [
|
|
775
782
|
{
|
|
776
|
-
key:
|
|
777
|
-
label:
|
|
778
|
-
items:
|
|
783
|
+
key: X.Pinned,
|
|
784
|
+
label: V?.pinned ?? "Pinned",
|
|
785
|
+
items: Ie
|
|
779
786
|
},
|
|
780
787
|
{
|
|
781
|
-
key:
|
|
782
|
-
label:
|
|
783
|
-
items:
|
|
788
|
+
key: X.MyChats,
|
|
789
|
+
label: V?.myChats ?? "My chats",
|
|
790
|
+
items: Le
|
|
784
791
|
},
|
|
785
792
|
{
|
|
786
|
-
key:
|
|
787
|
-
label:
|
|
788
|
-
items:
|
|
793
|
+
key: X.Shared,
|
|
794
|
+
label: V?.shared ?? "Shared",
|
|
795
|
+
items: Re
|
|
789
796
|
},
|
|
790
797
|
{
|
|
791
|
-
key:
|
|
792
|
-
label:
|
|
793
|
-
items:
|
|
798
|
+
key: X.Organization,
|
|
799
|
+
label: V?.organization ?? "Organization",
|
|
800
|
+
items: ze
|
|
794
801
|
}
|
|
795
802
|
], [
|
|
796
|
-
|
|
797
|
-
Pe,
|
|
798
|
-
Fe,
|
|
803
|
+
V,
|
|
799
804
|
Ie,
|
|
800
|
-
Le
|
|
801
|
-
|
|
805
|
+
Le,
|
|
806
|
+
Re,
|
|
807
|
+
ze
|
|
808
|
+
]), $ = E(() => {
|
|
802
809
|
let e = [];
|
|
803
|
-
for (let t of
|
|
804
|
-
kind:
|
|
810
|
+
for (let t of Be) if (t.items.length !== 0 && (e.push({
|
|
811
|
+
kind: Y.Header,
|
|
805
812
|
groupKey: t.key,
|
|
806
813
|
label: t.label
|
|
807
|
-
}),
|
|
808
|
-
kind:
|
|
814
|
+
}), q.has(t.key))) for (let n of t.items) e.push({
|
|
815
|
+
kind: Y.Item,
|
|
809
816
|
item: n,
|
|
810
817
|
groupKey: t.key
|
|
811
818
|
});
|
|
812
819
|
return e;
|
|
813
|
-
}, [
|
|
814
|
-
|
|
815
|
-
if (!d) return;
|
|
816
|
-
let e =
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
if (ce.current === d) return;
|
|
822
|
-
let t = $.findIndex((e) => e.kind === q.Item && e.item.id === d);
|
|
823
|
-
t >= 0 && (se.current?.scrollToRow({
|
|
824
|
-
index: t,
|
|
820
|
+
}, [Be, q]);
|
|
821
|
+
S(() => {
|
|
822
|
+
if (!d || le.current === d) return;
|
|
823
|
+
let e = $.findIndex((e) => e.kind === Y.Item && e.item.id === d);
|
|
824
|
+
e >= 0 && (oe.current?.scrollToRow({
|
|
825
|
+
index: e,
|
|
825
826
|
align: "smart",
|
|
826
827
|
behavior: "smooth"
|
|
827
|
-
}),
|
|
828
|
+
}), le.current = d);
|
|
828
829
|
}, [
|
|
829
830
|
d,
|
|
830
|
-
|
|
831
|
-
|
|
831
|
+
Be,
|
|
832
|
+
q,
|
|
832
833
|
$
|
|
833
834
|
]);
|
|
834
|
-
let
|
|
835
|
+
let Ve = E(() => ({
|
|
835
836
|
rows: $,
|
|
836
|
-
expandedGroups:
|
|
837
|
-
onToggleGroup:
|
|
838
|
-
listId:
|
|
837
|
+
expandedGroups: q,
|
|
838
|
+
onToggleGroup: Oe,
|
|
839
|
+
listId: ae,
|
|
839
840
|
activeConversationId: d,
|
|
840
841
|
searchQuery: U,
|
|
841
842
|
onSelectConversation: u,
|
|
842
843
|
getActions: _,
|
|
843
844
|
onActionMenuOpen: v,
|
|
844
|
-
actionsLabel:
|
|
845
|
+
actionsLabel: H,
|
|
845
846
|
styles: {
|
|
846
847
|
groupHeaderClassName: N?.groupHeaderClassName,
|
|
847
848
|
itemTitleClassName: N?.itemTitleClassName,
|
|
848
|
-
itemIconBadgeClassName:
|
|
849
|
+
itemIconBadgeClassName: h?.itemIconBadgeClassName,
|
|
850
|
+
taskBadgeClassName: h?.taskBadgeClassName
|
|
849
851
|
},
|
|
850
852
|
draggingId: de,
|
|
851
|
-
dragOverId:
|
|
853
|
+
dragOverId: he,
|
|
852
854
|
allowedDropGroups: _e,
|
|
853
|
-
onDragStart: (e) =>
|
|
854
|
-
onDragEnd:
|
|
855
|
-
onDragOver:
|
|
856
|
-
onDragLeave:
|
|
857
|
-
onDrop:
|
|
855
|
+
onDragStart: (e) => Ae(e, $),
|
|
856
|
+
onDragEnd: je,
|
|
857
|
+
onDragOver: Me,
|
|
858
|
+
onDragLeave: Ne,
|
|
859
|
+
onDrop: Pe
|
|
858
860
|
}), [
|
|
859
861
|
$,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
862
|
+
q,
|
|
863
|
+
Oe,
|
|
864
|
+
ae,
|
|
863
865
|
d,
|
|
864
866
|
U,
|
|
865
867
|
u,
|
|
866
868
|
_,
|
|
867
869
|
v,
|
|
868
|
-
|
|
870
|
+
H,
|
|
869
871
|
N?.groupHeaderClassName,
|
|
870
872
|
N?.itemTitleClassName,
|
|
871
|
-
|
|
873
|
+
h?.itemIconBadgeClassName,
|
|
874
|
+
h?.taskBadgeClassName,
|
|
872
875
|
de,
|
|
873
|
-
|
|
876
|
+
he,
|
|
874
877
|
_e,
|
|
875
|
-
Oe,
|
|
876
|
-
ke,
|
|
877
878
|
Ae,
|
|
878
879
|
je,
|
|
879
|
-
Me
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
Me,
|
|
881
|
+
Ne,
|
|
882
|
+
Pe
|
|
883
|
+
]), He = e.length === 0, Ue = e.length > 0 && Q.length === 0;
|
|
884
|
+
return /* @__PURE__ */ A(s, {
|
|
882
885
|
isOpen: l,
|
|
883
|
-
orientation:
|
|
884
|
-
title:
|
|
886
|
+
orientation: o.Left,
|
|
887
|
+
title: F,
|
|
885
888
|
labels: {
|
|
886
|
-
ariaLabel:
|
|
887
|
-
closeLabel:
|
|
889
|
+
ariaLabel: F,
|
|
890
|
+
closeLabel: ne
|
|
888
891
|
},
|
|
889
892
|
onClose: y,
|
|
890
893
|
styles: {
|
|
@@ -894,66 +897,67 @@ var q = /* @__PURE__ */ function(e) {
|
|
|
894
897
|
},
|
|
895
898
|
typography: { fontClassName: N?.fontClassName },
|
|
896
899
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
897
|
-
cssVars:
|
|
900
|
+
cssVars: Fe,
|
|
898
901
|
titleClassName: N?.fontClassName,
|
|
899
902
|
headerClassName: "h-[64px]",
|
|
900
|
-
className:
|
|
903
|
+
className: n(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
|
|
901
904
|
},
|
|
902
905
|
rightActions: b,
|
|
903
906
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ k(be, {
|
|
905
908
|
label: R,
|
|
906
|
-
onClick:
|
|
907
|
-
labelClassName: N?.newChatLabelClassName
|
|
909
|
+
onClick: m,
|
|
910
|
+
labelClassName: N?.newChatLabelClassName,
|
|
911
|
+
colors: P
|
|
908
912
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ k(a, {
|
|
910
914
|
value: U,
|
|
911
|
-
onChange:
|
|
915
|
+
onChange: W,
|
|
912
916
|
labels: {
|
|
913
|
-
placeholder:
|
|
914
|
-
clearLabel:
|
|
917
|
+
placeholder: z,
|
|
918
|
+
clearLabel: te
|
|
915
919
|
}
|
|
916
920
|
}),
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
activeTab:
|
|
919
|
-
labels:
|
|
921
|
+
/* @__PURE__ */ k(ve, {
|
|
922
|
+
activeTab: G,
|
|
923
|
+
labels: B,
|
|
920
924
|
onChange: (e) => {
|
|
921
|
-
|
|
925
|
+
K(e), j?.(e);
|
|
922
926
|
},
|
|
923
927
|
tabClassName: N?.tabClassName
|
|
924
928
|
}),
|
|
925
|
-
/* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ k("span", {
|
|
926
930
|
role: "status",
|
|
927
931
|
"aria-live": "polite",
|
|
928
932
|
className: "sr-only",
|
|
929
|
-
children:
|
|
933
|
+
children: c ? ee : He ? I : Ue ? L : ""
|
|
930
934
|
}),
|
|
931
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ k("div", {
|
|
932
936
|
className: "flex-1 overflow-hidden px-2 py-1",
|
|
933
|
-
children:
|
|
937
|
+
children: c ? /* @__PURE__ */ k("div", {
|
|
934
938
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
935
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
939
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ k(f, {
|
|
936
940
|
avatar: { size: 24 },
|
|
937
|
-
showTitle: { width:
|
|
941
|
+
showTitle: { width: ce(t) },
|
|
938
942
|
paragraph: !1,
|
|
939
943
|
active: !0,
|
|
940
|
-
color:
|
|
944
|
+
color: Z.skeletonColor
|
|
941
945
|
}, t))
|
|
942
|
-
}) :
|
|
943
|
-
listRef:
|
|
944
|
-
id:
|
|
946
|
+
}) : He ? /* @__PURE__ */ k(r, { label: I }) : Ue ? /* @__PURE__ */ k(i, { label: L }) : /* @__PURE__ */ k(se, {
|
|
947
|
+
listRef: oe,
|
|
948
|
+
id: ae,
|
|
945
949
|
role: "list",
|
|
946
950
|
style: { height: "100%" },
|
|
947
|
-
rowComponent:
|
|
951
|
+
rowComponent: Ce,
|
|
948
952
|
rowCount: $.length,
|
|
949
|
-
rowHeight:
|
|
950
|
-
overscanCount:
|
|
951
|
-
onResize:
|
|
952
|
-
rowProps:
|
|
953
|
+
rowHeight: ue,
|
|
954
|
+
overscanCount: re,
|
|
955
|
+
onResize: De,
|
|
956
|
+
rowProps: Ve
|
|
953
957
|
})
|
|
954
958
|
})
|
|
955
959
|
]
|
|
956
960
|
});
|
|
957
961
|
});
|
|
958
962
|
//#endregion
|
|
959
|
-
export {
|
|
963
|
+
export { De as ConversationPanel, X as FilterTab };
|