@epam/ai-dial-conversation-panel 1.1.0-dev.290 → 1.1.0-dev.294
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/ImportExportQueue/ImportExportQueue.d.ts +6 -0
- package/components/ImportExportQueue/ImportExportQueue.d.ts.map +1 -0
- package/components/RenameConversationPopup/RenameConversationPopup.d.ts +6 -0
- package/components/RenameConversationPopup/RenameConversationPopup.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js +686 -439
- package/models/import-export-queue.d.ts +88 -0
- package/models/import-export-queue.d.ts.map +1 -0
- package/models/rename-conversation-popup.d.ts +47 -0
- package/models/rename-conversation-popup.d.ts.map +1 -0
- package/package.json +3 -3
- package/types/conversation-classification.d.ts +1 -8
- package/types/conversation-classification.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PanelEmpty as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { IconCaretDownFilled as
|
|
1
|
+
import { ConversationTransferJobStatus as e, ConversationTransferSubjectKind as t, DeploymentIcon as n, FilterTab as r, buildCssVars as i, getUtf8ByteLength as a, mergeClasses as o, sanitizeConversationName as s, stripTrailingDots as c } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { PanelEmpty as l, PanelNoResults as u, SidebarOrientation as d, SidebarPanel as f } from "@epam/ai-dial-sidebar";
|
|
3
|
+
import { Button as p, ButtonVariant as m, ConfirmationPopup as h, ConfirmationPopupVariant as g, DIAL_ICON_SIZE as _, Dropdown as v, ElementSize as y, EllipsisTooltip as b, GhostIconButton as x, Highlight as S, Input as C, Popup as w, PopupSize as T, ProgressBar as E, Search as D, Skeleton as ee, SkeletonVariant as O, Spinner as k, Tag as A, TagAppearance as te, mergeClasses as ne } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { createElement as j, memo as M, useCallback as N, useEffect as P, useId as re, useImperativeHandle as ie, useLayoutEffect as F, useMemo as I, useRef as L, useState as R } from "react";
|
|
5
|
+
import { Fragment as ae, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
6
|
+
import { IconAlertCircleFilled as V, IconCaretDownFilled as oe, IconCaretRightFilled as H, IconChevronDown as se, IconChevronUp as ce, IconCircleCheckFilled as U, IconClock as W, IconDotsVertical as le, IconPlus as ue, IconRefresh as de, IconSparkles as fe, IconX as pe } from "@tabler/icons-react";
|
|
7
7
|
//#region ../../node_modules/react-window/dist/react-window.js
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var G = typeof window < "u" ? F : P;
|
|
9
|
+
function me(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 R(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 he({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
18
|
+
let { styleHeight: s, styleWidth: c } = I(() => ({
|
|
19
|
+
styleHeight: me(o?.height),
|
|
20
|
+
styleWidth: me(o?.width)
|
|
21
|
+
}), [o?.height, o?.width]), [l, u] = R({
|
|
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 G(() => {
|
|
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 te({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
42
42
|
i,
|
|
43
43
|
s,
|
|
44
44
|
c
|
|
45
|
-
]),
|
|
45
|
+
]), I(() => ({
|
|
46
46
|
height: s ?? l.height,
|
|
47
47
|
width: c ?? l.width
|
|
48
48
|
}), [
|
|
@@ -51,26 +51,26 @@ function te({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
51
51
|
c
|
|
52
52
|
]);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
let t =
|
|
54
|
+
function ge(e) {
|
|
55
|
+
let t = L(() => {
|
|
56
56
|
throw Error("Cannot call during render.");
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return G(() => {
|
|
59
59
|
t.current = e;
|
|
60
|
-
}, [e]),
|
|
60
|
+
}, [e]), N((e) => t.current?.(e), [t]);
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
62
|
+
var K = null;
|
|
63
|
+
function _e(e = !1) {
|
|
64
|
+
if (K === 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 ? K = "positive-descending" : (e.scrollLeft = 1, K = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), K;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return K;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
if (t === "horizontal" && n) switch (
|
|
72
|
+
function ve({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
73
|
+
if (t === "horizontal" && n) switch (_e()) {
|
|
74
74
|
case "negative": return -r;
|
|
75
75
|
case "positive-descending":
|
|
76
76
|
if (e) {
|
|
@@ -81,26 +81,26 @@ function V({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
81
81
|
}
|
|
82
82
|
return r;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function q(e, t = "Assertion error") {
|
|
85
85
|
if (!e) throw console.error(t), Error(t);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function J(e, t) {
|
|
88
88
|
if (e === t) return !0;
|
|
89
|
-
if (!!e != !!t || (
|
|
89
|
+
if (!!e != !!t || (q(e !== void 0), q(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 ye({ 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 q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function be({ 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 = ye({
|
|
104
104
|
cachedBounds: t,
|
|
105
105
|
itemCount: r,
|
|
106
106
|
itemSize: i
|
|
@@ -112,7 +112,7 @@ function W({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, con
|
|
|
112
112
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function xe({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
116
116
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
117
117
|
for (; u < a;) {
|
|
118
118
|
let n = e.get(u);
|
|
@@ -131,11 +131,11 @@ function G({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
|
|
|
131
131
|
stopIndexOverscan: l
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Se({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
135
135
|
let r = /* @__PURE__ */ new Map();
|
|
136
136
|
return {
|
|
137
137
|
get(i) {
|
|
138
|
-
for (
|
|
138
|
+
for (q(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 K({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
151
151
|
});
|
|
152
152
|
else {
|
|
153
153
|
let t = r.get(e - 1);
|
|
154
|
-
|
|
154
|
+
q(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 q(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 K({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
171
|
+
function Ce({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
172
|
+
return I(() => Se({
|
|
173
173
|
itemCount: e,
|
|
174
174
|
itemProps: t,
|
|
175
175
|
itemSize: n
|
|
@@ -179,11 +179,11 @@ function ie({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
179
179
|
n
|
|
180
180
|
]);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function we({ containerSize: e, itemSize: t }) {
|
|
183
183
|
let n;
|
|
184
184
|
switch (typeof t) {
|
|
185
185
|
case "string":
|
|
186
|
-
|
|
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;
|
|
187
187
|
break;
|
|
188
188
|
default:
|
|
189
189
|
n = t;
|
|
@@ -191,21 +191,21 @@ function q({ containerSize: e, itemSize: t }) {
|
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
let { height: u = n, width: d = n } =
|
|
194
|
+
function Te({ 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 } = he({
|
|
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 = L({
|
|
202
202
|
height: 0,
|
|
203
203
|
width: 0
|
|
204
|
-
}), p = r === "vertical" ? u : d, m =
|
|
204
|
+
}), p = r === "vertical" ? u : d, m = we({
|
|
205
205
|
containerSize: p,
|
|
206
206
|
itemSize: s
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
F(() => {
|
|
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 ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
218
218
|
c,
|
|
219
219
|
d
|
|
220
220
|
]);
|
|
221
|
-
let h =
|
|
221
|
+
let h = Ce({
|
|
222
222
|
itemCount: a,
|
|
223
223
|
itemProps: o,
|
|
224
224
|
itemSize: m
|
|
225
|
-
}), g =
|
|
225
|
+
}), g = N((e) => h.get(e), [h]), [_, v] = R(() => xe({
|
|
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: x, stopIndexOverscan:
|
|
231
|
+
})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: S } = {
|
|
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
|
-
},
|
|
236
|
+
}, C = N(() => ye({
|
|
237
237
|
cachedBounds: h,
|
|
238
238
|
itemCount: a,
|
|
239
239
|
itemSize: m
|
|
@@ -241,9 +241,9 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
241
241
|
h,
|
|
242
242
|
a,
|
|
243
243
|
m
|
|
244
|
-
]),
|
|
244
|
+
]), w = N((t) => xe({
|
|
245
245
|
cachedBounds: h,
|
|
246
|
-
containerScrollOffset:
|
|
246
|
+
containerScrollOffset: ve({
|
|
247
247
|
containerElement: e,
|
|
248
248
|
direction: r,
|
|
249
249
|
isRtl: i,
|
|
@@ -261,19 +261,19 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
261
261
|
a,
|
|
262
262
|
l
|
|
263
263
|
]);
|
|
264
|
-
return
|
|
265
|
-
v(
|
|
264
|
+
return G(() => {
|
|
265
|
+
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
266
266
|
}, [
|
|
267
267
|
e,
|
|
268
268
|
r,
|
|
269
|
-
|
|
270
|
-
]),
|
|
269
|
+
w
|
|
270
|
+
]), G(() => {
|
|
271
271
|
if (!e) return;
|
|
272
272
|
let t = () => {
|
|
273
273
|
v((t) => {
|
|
274
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
274
|
+
let { scrollLeft: n, scrollTop: o } = e, s = xe({
|
|
275
275
|
cachedBounds: h,
|
|
276
|
-
containerScrollOffset:
|
|
276
|
+
containerScrollOffset: ve({
|
|
277
277
|
containerElement: e,
|
|
278
278
|
direction: r,
|
|
279
279
|
isRtl: i,
|
|
@@ -283,7 +283,7 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
283
283
|
itemCount: a,
|
|
284
284
|
overscanCount: l
|
|
285
285
|
});
|
|
286
|
-
return
|
|
286
|
+
return J(s, t) ? t : s;
|
|
287
287
|
});
|
|
288
288
|
};
|
|
289
289
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -298,9 +298,9 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
298
298
|
l
|
|
299
299
|
]), {
|
|
300
300
|
getCellBounds: g,
|
|
301
|
-
getEstimatedSize:
|
|
302
|
-
scrollToIndex:
|
|
303
|
-
let s =
|
|
301
|
+
getEstimatedSize: C,
|
|
302
|
+
scrollToIndex: ge(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
303
|
+
let s = be({
|
|
304
304
|
align: t,
|
|
305
305
|
cachedBounds: h,
|
|
306
306
|
containerScrollOffset: n,
|
|
@@ -310,53 +310,53 @@ function ae({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
310
310
|
itemSize: m
|
|
311
311
|
});
|
|
312
312
|
if (e) {
|
|
313
|
-
if (s =
|
|
313
|
+
if (s = ve({
|
|
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 = w(s);
|
|
320
|
+
J(_, e) || v(e);
|
|
321
321
|
}
|
|
322
322
|
return s;
|
|
323
323
|
}
|
|
324
324
|
}),
|
|
325
325
|
startIndexOverscan: b,
|
|
326
326
|
startIndexVisible: y,
|
|
327
|
-
stopIndexOverscan:
|
|
327
|
+
stopIndexOverscan: S,
|
|
328
328
|
stopIndexVisible: x
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
331
|
+
function Ee(e) {
|
|
332
|
+
return I(() => e, Object.values(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function De(e, t) {
|
|
335
335
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
336
|
-
return
|
|
336
|
+
return J(n, a) && J(r, o) && J(i, s);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Oe(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 Y = "data-react-window-index";
|
|
342
|
+
function ke({ 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 = Ee(u), h = I(() => M(s, De), [s]), [g, _] = R(null), v = Oe(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Te({
|
|
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: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
351
351
|
onResize: i,
|
|
352
352
|
overscanCount: o
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
ie(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 = x({
|
|
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, x]), G(() => {
|
|
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 = `${S + t}`;
|
|
374
|
+
return e.setAttribute(Y, n), !0;
|
|
375
375
|
});
|
|
376
376
|
if (v) return l.observeRowElements(e);
|
|
377
377
|
}, [
|
|
378
378
|
g,
|
|
379
379
|
v,
|
|
380
380
|
l,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
]),
|
|
384
|
-
|
|
385
|
-
startIndex:
|
|
386
|
-
stopIndex:
|
|
381
|
+
S,
|
|
382
|
+
w
|
|
383
|
+
]), P(() => {
|
|
384
|
+
S >= 0 && w >= 0 && a && a({
|
|
385
|
+
startIndex: C,
|
|
386
|
+
stopIndex: T
|
|
387
387
|
}, {
|
|
388
|
-
startIndex:
|
|
389
|
-
stopIndex:
|
|
388
|
+
startIndex: S,
|
|
389
|
+
stopIndex: w
|
|
390
390
|
});
|
|
391
391
|
}, [
|
|
392
392
|
a,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
393
|
+
S,
|
|
394
|
+
C,
|
|
395
|
+
w,
|
|
396
|
+
T
|
|
397
397
|
]);
|
|
398
|
-
let
|
|
398
|
+
let E = I(() => {
|
|
399
399
|
let e = [];
|
|
400
|
-
if (c > 0) for (let t =
|
|
400
|
+
if (c > 0) for (let t = S; t <= w; t++) {
|
|
401
401
|
let n = y(t);
|
|
402
|
-
e.push(/* @__PURE__ */
|
|
402
|
+
e.push(/* @__PURE__ */ j(h, {
|
|
403
403
|
...m,
|
|
404
404
|
ariaAttributes: {
|
|
405
405
|
"aria-posinset": t + 1,
|
|
@@ -424,17 +424,17 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
424
424
|
v,
|
|
425
425
|
c,
|
|
426
426
|
m,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
]),
|
|
427
|
+
S,
|
|
428
|
+
w
|
|
429
|
+
]), D = /* @__PURE__ */ z("div", {
|
|
430
430
|
"aria-hidden": !0,
|
|
431
431
|
style: {
|
|
432
|
-
height:
|
|
432
|
+
height: b(),
|
|
433
433
|
width: "100%",
|
|
434
434
|
zIndex: -1
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
|
-
return
|
|
437
|
+
return j(d, {
|
|
438
438
|
role: "list",
|
|
439
439
|
...p,
|
|
440
440
|
className: t,
|
|
@@ -446,87 +446,85 @@ function le({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
446
446
|
overflowY: "auto",
|
|
447
447
|
...f
|
|
448
448
|
}
|
|
449
|
-
},
|
|
449
|
+
}, E, e, D);
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region src/types/virtual-row.ts
|
|
453
|
-
var
|
|
453
|
+
var X = /* @__PURE__ */ function(e) {
|
|
454
454
|
return e.Header = "header", e.Item = "item", e;
|
|
455
|
-
}({}),
|
|
456
|
-
return e.All = "all", e.Pinned = "pinned", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
|
|
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 === Y.Item ? 36 : e === 0 ? 24 : 56, pe = (e) => {
|
|
455
|
+
}({}), Ae = (e) => `${60 + e * 23 % 35}%`, je = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", Me = (e, t) => t.rows[e].kind === X.Item ? 36 : e === 0 ? 24 : 56, Ne = (e) => {
|
|
458
456
|
switch (e) {
|
|
459
|
-
case
|
|
460
|
-
case
|
|
461
|
-
default: return
|
|
457
|
+
case r.Shared: return r.Shared;
|
|
458
|
+
case r.Organization: return r.Organization;
|
|
459
|
+
default: return r.MyChats;
|
|
462
460
|
}
|
|
463
|
-
},
|
|
461
|
+
}, Pe = (e, t) => {
|
|
464
462
|
let n = null;
|
|
465
|
-
for (let r of e) if (r.kind ===
|
|
463
|
+
for (let r of e) if (r.kind === X.Header) n = r.groupKey;
|
|
466
464
|
else if (r.item.id === t) return n;
|
|
467
465
|
return null;
|
|
468
|
-
},
|
|
469
|
-
let
|
|
470
|
-
if (t != null &&
|
|
466
|
+
}, Fe = (e, t, n) => {
|
|
467
|
+
let i = /* @__PURE__ */ new Set();
|
|
468
|
+
if (t != null && i.add(t), t === r.Pinned) {
|
|
471
469
|
let t = n.find((t) => t.id === e);
|
|
472
|
-
t &&
|
|
473
|
-
} else
|
|
474
|
-
return
|
|
475
|
-
},
|
|
470
|
+
t && i.add(Ne(t.source));
|
|
471
|
+
} else i.add(r.Pinned);
|
|
472
|
+
return i;
|
|
473
|
+
}, Ie = (e, t, n, r) => {
|
|
476
474
|
let i = e.currentTarget.getBoundingClientRect();
|
|
477
475
|
if (e.clientY >= i.top + i.height / 2) return t;
|
|
478
476
|
let a = null, o = !1;
|
|
479
|
-
for (let e of n) if (e.kind ===
|
|
477
|
+
for (let e of n) if (e.kind === X.Header) o = e.groupKey === r;
|
|
480
478
|
else if (o) {
|
|
481
479
|
if (e.item.id === t) return a;
|
|
482
480
|
a = e.item.id;
|
|
483
481
|
}
|
|
484
482
|
return null;
|
|
485
|
-
},
|
|
483
|
+
}, Le = [
|
|
486
484
|
{
|
|
487
|
-
value:
|
|
485
|
+
value: r.All,
|
|
488
486
|
labelKey: "all"
|
|
489
487
|
},
|
|
490
488
|
{
|
|
491
|
-
value:
|
|
489
|
+
value: r.MyChats,
|
|
492
490
|
labelKey: "myChats"
|
|
493
491
|
},
|
|
494
492
|
{
|
|
495
|
-
value:
|
|
493
|
+
value: r.Shared,
|
|
496
494
|
labelKey: "shared"
|
|
497
495
|
},
|
|
498
496
|
{
|
|
499
|
-
value:
|
|
497
|
+
value: r.Organization,
|
|
500
498
|
labelKey: "organization"
|
|
501
499
|
}
|
|
502
|
-
],
|
|
500
|
+
], Re = M(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text" }) => /* @__PURE__ */ z("div", {
|
|
503
501
|
role: "group",
|
|
504
502
|
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
505
503
|
className: "flex flex-nowrap gap-1 px-3 py-2",
|
|
506
|
-
children:
|
|
504
|
+
children: Le.map(({ value: i, labelKey: a }) => /* @__PURE__ */ z(A, {
|
|
507
505
|
label: t[a],
|
|
508
|
-
appearance:
|
|
506
|
+
appearance: te.Selectable,
|
|
509
507
|
selected: e === i,
|
|
510
508
|
onClick: () => n(i),
|
|
511
|
-
className:
|
|
509
|
+
className: ne("flex-1 justify-center rounded-full", r)
|
|
512
510
|
}, i))
|
|
513
|
-
})),
|
|
511
|
+
})), ze = { button: "_button_8xsgo_1" }, Be = M(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: r }) => /* @__PURE__ */ z("div", {
|
|
514
512
|
className: "px-3 py-2",
|
|
515
|
-
style:
|
|
516
|
-
"--cp-new-chat-bg":
|
|
517
|
-
"--cp-new-chat-text":
|
|
518
|
-
"--cp-new-chat-focus-outline":
|
|
513
|
+
style: i({
|
|
514
|
+
"--cp-new-chat-bg": r?.background,
|
|
515
|
+
"--cp-new-chat-text": r?.text,
|
|
516
|
+
"--cp-new-chat-focus-outline": r?.focusOutline
|
|
519
517
|
}),
|
|
520
|
-
children: /* @__PURE__ */
|
|
521
|
-
onClick:
|
|
518
|
+
children: /* @__PURE__ */ B("button", {
|
|
519
|
+
onClick: t,
|
|
522
520
|
type: "button",
|
|
523
|
-
className:
|
|
524
|
-
children: [/* @__PURE__ */
|
|
521
|
+
className: o("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1 shadow-sm hover:shadow-xs active:shadow-xs", ze.button),
|
|
522
|
+
children: [/* @__PURE__ */ z(ue, {
|
|
525
523
|
size: 18,
|
|
526
524
|
stroke: 2,
|
|
527
525
|
className: "shrink-0"
|
|
528
|
-
}), /* @__PURE__ */
|
|
529
|
-
className:
|
|
526
|
+
}), /* @__PURE__ */ z("span", {
|
|
527
|
+
className: n,
|
|
530
528
|
children: e
|
|
531
529
|
})]
|
|
532
530
|
})
|
|
@@ -540,427 +538,676 @@ var Y = /* @__PURE__ */ function(e) {
|
|
|
540
538
|
triggerActive: "_triggerActive_1rnkj_27",
|
|
541
539
|
triggerIcon: "_triggerIcon_1rnkj_30",
|
|
542
540
|
unreadDot: "_unreadDot_1rnkj_38"
|
|
543
|
-
},
|
|
544
|
-
let
|
|
545
|
-
return /* @__PURE__ */
|
|
541
|
+
}, Q = ({ label: e, isExpanded: t, onToggle: n, listId: r, className: i = "dial-tiny-lead-text", dropZoneGroupKey: a, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
|
|
542
|
+
let d = a != null;
|
|
543
|
+
return /* @__PURE__ */ B("button", {
|
|
546
544
|
type: "button",
|
|
547
545
|
"aria-expanded": t,
|
|
548
|
-
"aria-controls":
|
|
549
|
-
onClick:
|
|
550
|
-
onDragOver:
|
|
551
|
-
|
|
546
|
+
"aria-controls": r,
|
|
547
|
+
onClick: n,
|
|
548
|
+
onDragOver: d ? (e) => {
|
|
549
|
+
d && (e.preventDefault(), c?.(a));
|
|
552
550
|
} : void 0,
|
|
553
|
-
onDragLeave:
|
|
554
|
-
|
|
551
|
+
onDragLeave: d ? (e) => {
|
|
552
|
+
d && (e.currentTarget.contains(e.relatedTarget) || l?.());
|
|
555
553
|
} : void 0,
|
|
556
|
-
onDrop:
|
|
557
|
-
|
|
554
|
+
onDrop: d ? (e) => {
|
|
555
|
+
d && (e.preventDefault(), u?.(a, a, null));
|
|
558
556
|
} : void 0,
|
|
559
|
-
className:
|
|
560
|
-
children: [t ? /* @__PURE__ */
|
|
557
|
+
className: o("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Z.groupHeader, s && Z.dropZoneActive),
|
|
558
|
+
children: [t ? /* @__PURE__ */ z(oe, {
|
|
561
559
|
stroke: .5,
|
|
562
560
|
size: 12,
|
|
563
561
|
className: "shrink-0",
|
|
564
562
|
"aria-hidden": !0
|
|
565
|
-
}) : /* @__PURE__ */
|
|
563
|
+
}) : /* @__PURE__ */ z(H, {
|
|
566
564
|
stroke: .5,
|
|
567
565
|
size: 12,
|
|
568
566
|
className: "shrink-0 rtl:scale-x-[-1]",
|
|
569
567
|
"aria-hidden": !0
|
|
570
|
-
}), /* @__PURE__ */
|
|
568
|
+
}), /* @__PURE__ */ z(b, { text: e })]
|
|
571
569
|
});
|
|
572
|
-
},
|
|
573
|
-
let [
|
|
574
|
-
te(
|
|
575
|
-
}, [
|
|
576
|
-
variant:
|
|
577
|
-
width:
|
|
578
|
-
height:
|
|
570
|
+
}, Ve = ({ item: e, isActive: t, onSelectConversation: r, searchQuery: i = "", getActions: a, onActionMenuOpen: s, actionsLabel: c = "More actions", itemTitleClassName: l = "dial-small-text", itemIconBadgeClassName: u, taskBadgeClassName: d = "dial-caption-lead-semi-text", unreadIndicatorLabel: f = "Unread", rowGroupKey: m, rows: h, draggingId: g, dragOverId: b, allowedDropGroups: C, onDragStart: w, onDragEnd: T, onDragOver: E, onDragLeave: D, onDrop: k }) => {
|
|
571
|
+
let [A, te] = R(!1), ne = L(null), j = N((t) => {
|
|
572
|
+
te(t), t && ne.current && s?.(e, ne.current);
|
|
573
|
+
}, [e, s]), M = a?.(e) ?? [], P = M.length > 0, re = e.isIconLoading ? /* @__PURE__ */ z(ee, {
|
|
574
|
+
variant: O.Circular,
|
|
575
|
+
width: _.LG,
|
|
576
|
+
height: _.LG,
|
|
579
577
|
color: Z.skeletonColor,
|
|
580
578
|
"aria-hidden": !0
|
|
581
|
-
}) : /* @__PURE__ */
|
|
582
|
-
src:
|
|
583
|
-
size:
|
|
584
|
-
initialsName:
|
|
585
|
-
labels: { tooltip:
|
|
586
|
-
styles: { badgeClassName:
|
|
587
|
-
}),
|
|
579
|
+
}) : /* @__PURE__ */ z(n, {
|
|
580
|
+
src: e.iconUrl,
|
|
581
|
+
size: _.LG,
|
|
582
|
+
initialsName: e.iconTooltip ?? "",
|
|
583
|
+
labels: { tooltip: e.iconTooltip },
|
|
584
|
+
styles: { badgeClassName: u }
|
|
585
|
+
}), ie = /* @__PURE__ */ B("span", {
|
|
588
586
|
className: "flex shrink-0 items-center",
|
|
589
|
-
children: [/* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ z("span", {
|
|
590
588
|
className: "relative flex size-3 shrink-0 items-center justify-center",
|
|
591
|
-
children:
|
|
592
|
-
className:
|
|
589
|
+
children: e.isUnread && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z("span", {
|
|
590
|
+
className: o("size-[5.33px] rounded-full", Z.unreadDot),
|
|
593
591
|
"aria-hidden": !0
|
|
594
|
-
}), /* @__PURE__ */
|
|
592
|
+
}), /* @__PURE__ */ z("span", {
|
|
595
593
|
className: "sr-only",
|
|
596
|
-
children:
|
|
594
|
+
children: f
|
|
597
595
|
})] })
|
|
598
|
-
}),
|
|
599
|
-
}),
|
|
600
|
-
className:
|
|
601
|
-
children: [/* @__PURE__ */
|
|
596
|
+
}), re]
|
|
597
|
+
}), F = je(P, A), I = e.showTaskBadge ? /* @__PURE__ */ B("span", {
|
|
598
|
+
className: o("flex h-5 shrink-0 items-center justify-center gap-0.5 rounded-full border pe-2 ps-1", Z.taskBadge, d),
|
|
599
|
+
children: [/* @__PURE__ */ z(W, {
|
|
602
600
|
size: 12,
|
|
603
601
|
"aria-hidden": !0
|
|
604
|
-
}),
|
|
605
|
-
}) : void 0,
|
|
606
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
607
|
-
}, [
|
|
608
|
-
if (!
|
|
609
|
-
|
|
610
|
-
let n =
|
|
611
|
-
|
|
602
|
+
}), e.taskBadgeLabel]
|
|
603
|
+
}) : void 0, V = m != null, oe = N((e) => {
|
|
604
|
+
e.currentTarget.contains(e.relatedTarget) || D?.();
|
|
605
|
+
}, [D]), H = N((t) => {
|
|
606
|
+
if (!m || !h || !k) return;
|
|
607
|
+
t.preventDefault();
|
|
608
|
+
let n = Ie(t, e.id, h, m);
|
|
609
|
+
k(e.id, m, n);
|
|
612
610
|
}, [
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
]),
|
|
618
|
-
return /* @__PURE__ */
|
|
619
|
-
className:
|
|
620
|
-
draggable:
|
|
621
|
-
onDragStart:
|
|
622
|
-
onDragEnd:
|
|
623
|
-
onDragOver:
|
|
624
|
-
|
|
611
|
+
e.id,
|
|
612
|
+
h,
|
|
613
|
+
m,
|
|
614
|
+
k
|
|
615
|
+
]), se = e.id === g, ce = e.id === b, U = m != null && (C?.has(m) ?? !1), ue = g != null;
|
|
616
|
+
return /* @__PURE__ */ B("li", {
|
|
617
|
+
className: o("group/conversation relative", se && "cursor-grabbing opacity-50", ce && U && "rounded", ce && U && Z.dropZoneActive, ue && !se && !U && "cursor-not-allowed"),
|
|
618
|
+
draggable: V || void 0,
|
|
619
|
+
onDragStart: V ? () => w?.(e.id) : void 0,
|
|
620
|
+
onDragEnd: V ? T : void 0,
|
|
621
|
+
onDragOver: V ? (t) => {
|
|
622
|
+
t.preventDefault(), E?.(e.id);
|
|
625
623
|
} : void 0,
|
|
626
|
-
onDragLeave:
|
|
627
|
-
onDrop:
|
|
628
|
-
children: [/* @__PURE__ */
|
|
629
|
-
href:
|
|
624
|
+
onDragLeave: V ? oe : void 0,
|
|
625
|
+
onDrop: V ? H : void 0,
|
|
626
|
+
children: [/* @__PURE__ */ z("a", {
|
|
627
|
+
href: e.href,
|
|
630
628
|
className: "contents",
|
|
631
|
-
onClick: (
|
|
632
|
-
|
|
629
|
+
onClick: (t) => {
|
|
630
|
+
e.href && (t.preventDefault(), r(e.id));
|
|
633
631
|
},
|
|
634
|
-
children: /* @__PURE__ */
|
|
635
|
-
iconBefore:
|
|
636
|
-
label: /* @__PURE__ */
|
|
637
|
-
text:
|
|
638
|
-
query:
|
|
639
|
-
className:
|
|
632
|
+
children: /* @__PURE__ */ z(p, {
|
|
633
|
+
iconBefore: ie,
|
|
634
|
+
label: /* @__PURE__ */ z(S, {
|
|
635
|
+
text: e.title,
|
|
636
|
+
query: i,
|
|
637
|
+
className: l,
|
|
640
638
|
maxLines: 1
|
|
641
639
|
}),
|
|
642
|
-
iconAfter:
|
|
640
|
+
iconAfter: I,
|
|
643
641
|
textClassName: "min-w-0 flex-1",
|
|
644
|
-
"aria-current":
|
|
645
|
-
onClick:
|
|
646
|
-
tabIndex:
|
|
647
|
-
className:
|
|
642
|
+
"aria-current": t ? "page" : void 0,
|
|
643
|
+
onClick: e.href ? void 0 : () => r(e.id),
|
|
644
|
+
tabIndex: e.href ? -1 : void 0,
|
|
645
|
+
className: o("h-8 w-full justify-start gap-2 rounded-xl py-2 ps-0", F, Z.item, t && Z.itemActive, A && Z.itemActive)
|
|
648
646
|
})
|
|
649
|
-
}),
|
|
650
|
-
className:
|
|
651
|
-
children: /* @__PURE__ */
|
|
652
|
-
items:
|
|
653
|
-
onOpenChange:
|
|
647
|
+
}), P && /* @__PURE__ */ z("div", {
|
|
648
|
+
className: o("absolute inset-y-0 end-1 flex items-center", A ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
|
|
649
|
+
children: /* @__PURE__ */ z(v, {
|
|
650
|
+
items: M,
|
|
651
|
+
onOpenChange: j,
|
|
654
652
|
matchReferenceWidth: !1,
|
|
655
653
|
listClassName: "w-[200px]",
|
|
656
|
-
children: /* @__PURE__ */
|
|
657
|
-
ref:
|
|
658
|
-
icon: /* @__PURE__ */
|
|
659
|
-
size:
|
|
654
|
+
children: /* @__PURE__ */ z(x, {
|
|
655
|
+
ref: ne,
|
|
656
|
+
icon: /* @__PURE__ */ z(le, {
|
|
657
|
+
size: _.SM,
|
|
660
658
|
className: Z.triggerIcon,
|
|
661
659
|
"aria-hidden": !0
|
|
662
660
|
}),
|
|
663
|
-
size:
|
|
664
|
-
"aria-label":
|
|
665
|
-
className:
|
|
661
|
+
size: y.Small,
|
|
662
|
+
"aria-label": c,
|
|
663
|
+
className: o(A && Z.triggerActive)
|
|
666
664
|
})
|
|
667
665
|
})
|
|
668
666
|
})]
|
|
669
667
|
});
|
|
670
|
-
},
|
|
671
|
-
let
|
|
672
|
-
if (
|
|
673
|
-
let n =
|
|
674
|
-
return /* @__PURE__ */
|
|
668
|
+
}, He = ({ index: e, style: t, rows: n, 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 }) => {
|
|
669
|
+
let C = n[e];
|
|
670
|
+
if (C.kind === X.Header) {
|
|
671
|
+
let n = C.groupKey === r.Pinned;
|
|
672
|
+
return /* @__PURE__ */ z("div", {
|
|
675
673
|
role: "presentation",
|
|
676
674
|
style: t,
|
|
677
675
|
className: e === 0 ? "pt-0" : "pt-8",
|
|
678
|
-
children: /* @__PURE__ */
|
|
679
|
-
label:
|
|
680
|
-
isExpanded:
|
|
681
|
-
onToggle: () =>
|
|
682
|
-
listId:
|
|
683
|
-
className:
|
|
684
|
-
dropZoneGroupKey: n ?
|
|
685
|
-
isDragOver: n &&
|
|
686
|
-
onDragOver: n ?
|
|
687
|
-
onDragLeave: n ?
|
|
688
|
-
onDrop: n ?
|
|
676
|
+
children: /* @__PURE__ */ z(Q, {
|
|
677
|
+
label: C.label,
|
|
678
|
+
isExpanded: i.has(C.groupKey),
|
|
679
|
+
onToggle: () => a(C.groupKey),
|
|
680
|
+
listId: o,
|
|
681
|
+
className: m?.groupHeaderClassName,
|
|
682
|
+
dropZoneGroupKey: n ? r.Pinned : void 0,
|
|
683
|
+
isDragOver: n && g === r.Pinned,
|
|
684
|
+
onDragOver: n ? b : void 0,
|
|
685
|
+
onDragLeave: n ? x : void 0,
|
|
686
|
+
onDrop: n ? S : void 0
|
|
689
687
|
})
|
|
690
688
|
});
|
|
691
689
|
}
|
|
692
|
-
return /* @__PURE__ */
|
|
690
|
+
return /* @__PURE__ */ z("div", {
|
|
693
691
|
role: "presentation",
|
|
694
692
|
style: t,
|
|
695
693
|
className: "pt-1",
|
|
696
|
-
children: /* @__PURE__ */
|
|
697
|
-
item:
|
|
698
|
-
isActive:
|
|
699
|
-
searchQuery:
|
|
700
|
-
onSelectConversation:
|
|
701
|
-
getActions:
|
|
702
|
-
onActionMenuOpen:
|
|
703
|
-
actionsLabel:
|
|
704
|
-
unreadIndicatorLabel:
|
|
705
|
-
itemTitleClassName:
|
|
706
|
-
itemIconBadgeClassName:
|
|
707
|
-
taskBadgeClassName:
|
|
708
|
-
rowGroupKey:
|
|
694
|
+
children: /* @__PURE__ */ z(Ve, {
|
|
695
|
+
item: C.item,
|
|
696
|
+
isActive: C.item.id === s,
|
|
697
|
+
searchQuery: c,
|
|
698
|
+
onSelectConversation: l,
|
|
699
|
+
getActions: u,
|
|
700
|
+
onActionMenuOpen: d,
|
|
701
|
+
actionsLabel: f,
|
|
702
|
+
unreadIndicatorLabel: p,
|
|
703
|
+
itemTitleClassName: m?.itemTitleClassName,
|
|
704
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
705
|
+
taskBadgeClassName: m?.taskBadgeClassName,
|
|
706
|
+
rowGroupKey: C.groupKey,
|
|
709
707
|
rows: n,
|
|
710
|
-
draggingId:
|
|
711
|
-
dragOverId:
|
|
712
|
-
allowedDropGroups:
|
|
713
|
-
onDragStart:
|
|
714
|
-
onDragEnd:
|
|
715
|
-
onDragOver:
|
|
716
|
-
onDragLeave:
|
|
717
|
-
onDrop:
|
|
708
|
+
draggingId: h,
|
|
709
|
+
dragOverId: g,
|
|
710
|
+
allowedDropGroups: _,
|
|
711
|
+
onDragStart: v,
|
|
712
|
+
onDragEnd: y,
|
|
713
|
+
onDragOver: b,
|
|
714
|
+
onDragLeave: x,
|
|
715
|
+
onDrop: S
|
|
718
716
|
})
|
|
719
717
|
});
|
|
720
|
-
},
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
]),
|
|
726
|
-
let { colors:
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}, [
|
|
730
|
-
let [
|
|
731
|
-
|
|
732
|
-
}, []),
|
|
733
|
-
|
|
734
|
-
}, []),
|
|
735
|
-
|
|
718
|
+
}, Ue = (e, t) => t === r.All ? !0 : e.source === t, We = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Ge = new Set([
|
|
719
|
+
r.Pinned,
|
|
720
|
+
r.MyChats,
|
|
721
|
+
r.Shared,
|
|
722
|
+
r.Organization
|
|
723
|
+
]), Ke = M(({ conversations: e, isLoading: t, isOpen: n, onSelectConversation: a, activeConversationId: s, labels: c, onNewChat: p, styles: m, className: h, getActions: g, onActionMenuOpen: _, onToggle: v, headerActions: y, onMoveConversation: b, activeFilter: x, onActiveFilterChange: S, isFilterTabsHidden: C = !1 }) => {
|
|
724
|
+
let { colors: w, typography: T, newChatButton: E } = m ?? {}, { title: O, emptyLabel: k, noResultsLabel: A, loadingLabel: te = "Loading conversations", newChatLabel: ne, searchPlaceholder: j, searchClearLabel: M, filterLabels: ie, groupLabels: F, actionsLabel: ae, unreadIndicatorLabel: V, closeAriaLabel: oe } = c, [H, se] = R(""), [ce, U] = R(r.All);
|
|
725
|
+
P(() => {
|
|
726
|
+
x != null && U(x);
|
|
727
|
+
}, [x]);
|
|
728
|
+
let [W, le] = R(() => Ge), [ue, de] = R(5), fe = re(), pe = L(null), G = L(null), [me, he] = R(null), [ge, K] = R(null), [_e, ve] = R(null), q = L(null), J = L(null), ye = N(({ height: e }) => {
|
|
729
|
+
de(Math.ceil(e / 36 * 2));
|
|
730
|
+
}, []), be = N((e) => {
|
|
731
|
+
se(e ?? "");
|
|
732
|
+
}, []), xe = N((e) => {
|
|
733
|
+
le((t) => {
|
|
736
734
|
let n = new Set(t);
|
|
737
735
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
738
736
|
});
|
|
739
|
-
}, []),
|
|
740
|
-
|
|
741
|
-
}, []),
|
|
742
|
-
let r =
|
|
743
|
-
|
|
744
|
-
}, [e]),
|
|
745
|
-
|
|
746
|
-
}, [
|
|
747
|
-
|
|
748
|
-
}, []),
|
|
749
|
-
|
|
750
|
-
}, []),
|
|
751
|
-
let r =
|
|
752
|
-
|
|
737
|
+
}, []), Se = N(() => {
|
|
738
|
+
q.current = null, J.current = null, he(null), K(null), ve(null);
|
|
739
|
+
}, []), Ce = N((t, n) => {
|
|
740
|
+
let r = Fe(t, Pe(n, t), e);
|
|
741
|
+
q.current = t, J.current = r, he(t), ve(r);
|
|
742
|
+
}, [e]), we = N(() => {
|
|
743
|
+
Se();
|
|
744
|
+
}, [Se]), Te = N((e) => {
|
|
745
|
+
K(e);
|
|
746
|
+
}, []), Ee = N(() => {
|
|
747
|
+
K(null);
|
|
748
|
+
}, []), De = N((e, t, n) => {
|
|
749
|
+
let r = q.current, i = J.current;
|
|
750
|
+
Se(), r != null && r !== e && i?.has(t) && b?.({
|
|
753
751
|
draggedId: r,
|
|
754
752
|
targetGroupKey: t,
|
|
755
753
|
afterId: n
|
|
756
754
|
});
|
|
757
|
-
}, [
|
|
758
|
-
"--cp-item-hover":
|
|
759
|
-
"--cp-item-active":
|
|
760
|
-
"--cp-text":
|
|
761
|
-
"--cp-text-secondary":
|
|
762
|
-
"--cp-new-chat-bg":
|
|
763
|
-
"--cp-new-chat-text":
|
|
764
|
-
"--cp-new-chat-focus-outline":
|
|
765
|
-
"--cp-drop-zone-ring":
|
|
766
|
-
"--cp-trigger-bg":
|
|
767
|
-
"--cp-trigger-icon":
|
|
768
|
-
"--cp-trigger-icon-idle":
|
|
769
|
-
"--cp-skeleton-color":
|
|
770
|
-
"--cp-task-badge-border":
|
|
771
|
-
"--cp-task-badge-bg":
|
|
772
|
-
"--cp-task-badge-text":
|
|
773
|
-
"--cp-unread-dot":
|
|
774
|
-
}),
|
|
755
|
+
}, [Se, b]), Oe = i({
|
|
756
|
+
"--cp-item-hover": w?.itemHover,
|
|
757
|
+
"--cp-item-active": w?.itemActive,
|
|
758
|
+
"--cp-text": w?.text,
|
|
759
|
+
"--cp-text-secondary": w?.textSecondary,
|
|
760
|
+
"--cp-new-chat-bg": E?.background,
|
|
761
|
+
"--cp-new-chat-text": E?.text,
|
|
762
|
+
"--cp-new-chat-focus-outline": E?.focusOutline,
|
|
763
|
+
"--cp-drop-zone-ring": w?.dropZoneRing,
|
|
764
|
+
"--cp-trigger-bg": w?.triggerBackground,
|
|
765
|
+
"--cp-trigger-icon": w?.triggerIcon,
|
|
766
|
+
"--cp-trigger-icon-idle": w?.triggerIconIdle,
|
|
767
|
+
"--cp-skeleton-color": w?.skeletonColor,
|
|
768
|
+
"--cp-task-badge-border": w?.taskBadgeBorder,
|
|
769
|
+
"--cp-task-badge-bg": w?.taskBadgeBackground,
|
|
770
|
+
"--cp-task-badge-text": w?.taskBadgeText,
|
|
771
|
+
"--cp-unread-dot": w?.unreadDot
|
|
772
|
+
}), Y = I(() => e.filter((e) => Ue(e, ce) && We(e, H)), [
|
|
775
773
|
e,
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
]),
|
|
774
|
+
ce,
|
|
775
|
+
H
|
|
776
|
+
]), je = I(() => Y.filter((e) => e.isPinned), [Y]), Ne = I(() => Y.filter((e) => !e.isPinned && e.source !== r.Shared && e.source !== r.Organization), [Y]), Ie = I(() => Y.filter((e) => !e.isPinned && e.source === r.Shared), [Y]), Le = I(() => Y.filter((e) => !e.isPinned && e.source === r.Organization), [Y]), ze = I(() => [
|
|
779
777
|
{
|
|
780
|
-
key:
|
|
781
|
-
label:
|
|
782
|
-
items:
|
|
778
|
+
key: r.Pinned,
|
|
779
|
+
label: F?.pinned ?? "Pinned",
|
|
780
|
+
items: je
|
|
783
781
|
},
|
|
784
782
|
{
|
|
785
|
-
key:
|
|
786
|
-
label:
|
|
787
|
-
items:
|
|
783
|
+
key: r.MyChats,
|
|
784
|
+
label: F?.myChats ?? "My chats",
|
|
785
|
+
items: Ne
|
|
788
786
|
},
|
|
789
787
|
{
|
|
790
|
-
key:
|
|
791
|
-
label:
|
|
792
|
-
items:
|
|
788
|
+
key: r.Shared,
|
|
789
|
+
label: F?.shared ?? "Shared",
|
|
790
|
+
items: Ie
|
|
793
791
|
},
|
|
794
792
|
{
|
|
795
|
-
key:
|
|
796
|
-
label:
|
|
797
|
-
items:
|
|
793
|
+
key: r.Organization,
|
|
794
|
+
label: F?.organization ?? "Organization",
|
|
795
|
+
items: Le
|
|
798
796
|
}
|
|
799
797
|
], [
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
]),
|
|
798
|
+
F,
|
|
799
|
+
je,
|
|
800
|
+
Ne,
|
|
801
|
+
Ie,
|
|
802
|
+
Le
|
|
803
|
+
]), Q = I(() => {
|
|
806
804
|
let e = [];
|
|
807
|
-
for (let t of
|
|
808
|
-
kind:
|
|
805
|
+
for (let t of ze) if (t.items.length !== 0 && (e.push({
|
|
806
|
+
kind: X.Header,
|
|
809
807
|
groupKey: t.key,
|
|
810
808
|
label: t.label
|
|
811
|
-
}),
|
|
812
|
-
kind:
|
|
809
|
+
}), W.has(t.key))) for (let n of t.items) e.push({
|
|
810
|
+
kind: X.Item,
|
|
813
811
|
item: n,
|
|
814
812
|
groupKey: t.key
|
|
815
813
|
});
|
|
816
814
|
return e;
|
|
817
|
-
}, [
|
|
818
|
-
|
|
819
|
-
if (!
|
|
820
|
-
let e =
|
|
821
|
-
e >= 0 && (
|
|
815
|
+
}, [ze, W]);
|
|
816
|
+
P(() => {
|
|
817
|
+
if (!s || G.current === s) return;
|
|
818
|
+
let e = Q.findIndex((e) => e.kind === X.Item && e.item.id === s);
|
|
819
|
+
e >= 0 && (pe.current?.scrollToRow({
|
|
822
820
|
index: e,
|
|
823
821
|
align: "smart",
|
|
824
822
|
behavior: "smooth"
|
|
825
|
-
}),
|
|
823
|
+
}), G.current = s);
|
|
826
824
|
}, [
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
825
|
+
s,
|
|
826
|
+
ze,
|
|
827
|
+
W,
|
|
828
|
+
Q
|
|
831
829
|
]);
|
|
832
|
-
let
|
|
833
|
-
rows:
|
|
834
|
-
expandedGroups:
|
|
835
|
-
onToggleGroup:
|
|
836
|
-
listId:
|
|
837
|
-
activeConversationId:
|
|
838
|
-
searchQuery:
|
|
839
|
-
onSelectConversation:
|
|
840
|
-
getActions:
|
|
841
|
-
onActionMenuOpen:
|
|
842
|
-
actionsLabel:
|
|
843
|
-
unreadIndicatorLabel:
|
|
830
|
+
let Ve = I(() => ({
|
|
831
|
+
rows: Q,
|
|
832
|
+
expandedGroups: W,
|
|
833
|
+
onToggleGroup: xe,
|
|
834
|
+
listId: fe,
|
|
835
|
+
activeConversationId: s,
|
|
836
|
+
searchQuery: H,
|
|
837
|
+
onSelectConversation: a,
|
|
838
|
+
getActions: g,
|
|
839
|
+
onActionMenuOpen: _,
|
|
840
|
+
actionsLabel: ae,
|
|
841
|
+
unreadIndicatorLabel: V,
|
|
844
842
|
styles: {
|
|
845
|
-
groupHeaderClassName:
|
|
846
|
-
itemTitleClassName:
|
|
847
|
-
itemIconBadgeClassName:
|
|
848
|
-
taskBadgeClassName:
|
|
843
|
+
groupHeaderClassName: T?.groupHeaderClassName,
|
|
844
|
+
itemTitleClassName: T?.itemTitleClassName,
|
|
845
|
+
itemIconBadgeClassName: m?.itemIconBadgeClassName,
|
|
846
|
+
taskBadgeClassName: m?.taskBadgeClassName
|
|
849
847
|
},
|
|
850
|
-
draggingId:
|
|
851
|
-
dragOverId:
|
|
852
|
-
allowedDropGroups:
|
|
853
|
-
onDragStart: (e) =>
|
|
854
|
-
onDragEnd:
|
|
855
|
-
onDragOver:
|
|
856
|
-
onDragLeave:
|
|
857
|
-
onDrop:
|
|
848
|
+
draggingId: me,
|
|
849
|
+
dragOverId: ge,
|
|
850
|
+
allowedDropGroups: _e,
|
|
851
|
+
onDragStart: (e) => Ce(e, Q),
|
|
852
|
+
onDragEnd: we,
|
|
853
|
+
onDragOver: Te,
|
|
854
|
+
onDragLeave: Ee,
|
|
855
|
+
onDrop: De
|
|
858
856
|
}), [
|
|
859
|
-
|
|
860
|
-
q,
|
|
861
|
-
je,
|
|
862
|
-
se,
|
|
863
|
-
u,
|
|
857
|
+
Q,
|
|
864
858
|
W,
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
859
|
+
xe,
|
|
860
|
+
fe,
|
|
861
|
+
s,
|
|
868
862
|
H,
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
863
|
+
a,
|
|
864
|
+
g,
|
|
865
|
+
_,
|
|
866
|
+
ae,
|
|
867
|
+
V,
|
|
868
|
+
T?.groupHeaderClassName,
|
|
869
|
+
T?.itemTitleClassName,
|
|
870
|
+
m?.itemIconBadgeClassName,
|
|
871
|
+
m?.taskBadgeClassName,
|
|
872
|
+
me,
|
|
873
|
+
ge,
|
|
875
874
|
_e,
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
title: ee,
|
|
875
|
+
Ce,
|
|
876
|
+
we,
|
|
877
|
+
Te,
|
|
878
|
+
Ee,
|
|
879
|
+
De
|
|
880
|
+
]), Ke = e.length === 0, $ = e.length > 0 && Y.length === 0;
|
|
881
|
+
return /* @__PURE__ */ B(f, {
|
|
882
|
+
isOpen: n,
|
|
883
|
+
orientation: d.Left,
|
|
884
|
+
title: O,
|
|
887
885
|
labels: {
|
|
888
|
-
ariaLabel:
|
|
889
|
-
closeLabel:
|
|
886
|
+
ariaLabel: O,
|
|
887
|
+
closeLabel: oe
|
|
890
888
|
},
|
|
891
|
-
onClose:
|
|
889
|
+
onClose: v,
|
|
892
890
|
styles: {
|
|
893
891
|
colors: {
|
|
894
|
-
background:
|
|
895
|
-
border:
|
|
892
|
+
background: w?.background,
|
|
893
|
+
border: w?.border
|
|
896
894
|
},
|
|
897
|
-
typography: { fontClassName:
|
|
895
|
+
typography: { fontClassName: T?.fontClassName },
|
|
898
896
|
bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
|
|
899
|
-
cssVars:
|
|
900
|
-
titleClassName:
|
|
897
|
+
cssVars: Oe,
|
|
898
|
+
titleClassName: T?.fontClassName,
|
|
901
899
|
headerClassName: "h-[64px]",
|
|
902
|
-
className: n
|
|
900
|
+
className: o(n ? "w-[324px] mobile:w-full" : "w-0", h)
|
|
903
901
|
},
|
|
904
|
-
rightActions:
|
|
902
|
+
rightActions: y,
|
|
905
903
|
children: [
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
label:
|
|
908
|
-
onClick:
|
|
909
|
-
labelClassName:
|
|
910
|
-
colors:
|
|
904
|
+
/* @__PURE__ */ z(Be, {
|
|
905
|
+
label: ne,
|
|
906
|
+
onClick: p,
|
|
907
|
+
labelClassName: T?.newChatLabelClassName,
|
|
908
|
+
colors: E
|
|
911
909
|
}),
|
|
912
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ z("div", {
|
|
913
911
|
role: "search",
|
|
914
912
|
className: "px-3 py-2",
|
|
915
|
-
children: /* @__PURE__ */
|
|
913
|
+
children: /* @__PURE__ */ z(D, {
|
|
916
914
|
wrapperClassName: "rounded-full",
|
|
917
|
-
value:
|
|
918
|
-
onChange:
|
|
919
|
-
placeholder:
|
|
920
|
-
clearLabel:
|
|
921
|
-
"aria-label":
|
|
915
|
+
value: H,
|
|
916
|
+
onChange: be,
|
|
917
|
+
placeholder: j,
|
|
918
|
+
clearLabel: M,
|
|
919
|
+
"aria-label": j
|
|
922
920
|
})
|
|
923
921
|
}),
|
|
924
|
-
!
|
|
925
|
-
activeTab:
|
|
926
|
-
labels:
|
|
922
|
+
!C && /* @__PURE__ */ z(Re, {
|
|
923
|
+
activeTab: ce,
|
|
924
|
+
labels: ie,
|
|
927
925
|
onChange: (e) => {
|
|
928
|
-
|
|
926
|
+
U(e), S?.(e);
|
|
929
927
|
},
|
|
930
|
-
tabClassName:
|
|
928
|
+
tabClassName: T?.tabClassName
|
|
931
929
|
}),
|
|
932
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ z("span", {
|
|
933
931
|
role: "status",
|
|
934
932
|
"aria-live": "polite",
|
|
935
933
|
className: "sr-only",
|
|
936
|
-
children:
|
|
934
|
+
children: t ? te : Ke ? k : $ ? A : ""
|
|
937
935
|
}),
|
|
938
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ z("div", {
|
|
939
937
|
className: "flex-1 overflow-hidden px-2 py-1",
|
|
940
|
-
children:
|
|
938
|
+
children: t ? /* @__PURE__ */ z("div", {
|
|
941
939
|
className: "flex flex-col gap-3 px-2 py-3",
|
|
942
|
-
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */
|
|
940
|
+
children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ z(ee, {
|
|
943
941
|
avatar: { size: 24 },
|
|
944
|
-
showTitle: { width:
|
|
942
|
+
showTitle: { width: Ae(t) },
|
|
945
943
|
paragraph: !1,
|
|
946
944
|
active: !0,
|
|
947
945
|
color: Z.skeletonColor
|
|
948
946
|
}, t))
|
|
949
|
-
}) :
|
|
950
|
-
listRef:
|
|
951
|
-
id:
|
|
947
|
+
}) : Ke ? /* @__PURE__ */ z(l, { label: k }) : $ ? /* @__PURE__ */ z(u, { label: A }) : /* @__PURE__ */ z(ke, {
|
|
948
|
+
listRef: pe,
|
|
949
|
+
id: fe,
|
|
952
950
|
role: "list",
|
|
953
951
|
style: { height: "100%" },
|
|
954
|
-
rowComponent:
|
|
955
|
-
rowCount:
|
|
956
|
-
rowHeight:
|
|
957
|
-
overscanCount:
|
|
958
|
-
onResize:
|
|
959
|
-
rowProps:
|
|
952
|
+
rowComponent: He,
|
|
953
|
+
rowCount: Q.length,
|
|
954
|
+
rowHeight: Me,
|
|
955
|
+
overscanCount: ue,
|
|
956
|
+
onResize: ye,
|
|
957
|
+
rowProps: Ve
|
|
958
|
+
})
|
|
959
|
+
})
|
|
960
|
+
]
|
|
961
|
+
});
|
|
962
|
+
}), $ = {
|
|
963
|
+
root: "_root_fgzx8_1",
|
|
964
|
+
text: "_text_fgzx8_5",
|
|
965
|
+
textSecondary: "_textSecondary_fgzx8_9",
|
|
966
|
+
successIcon: "_successIcon_fgzx8_13",
|
|
967
|
+
errorIcon: "_errorIcon_fgzx8_17",
|
|
968
|
+
failureCount: "_failureCount_fgzx8_21"
|
|
969
|
+
}, qe = 8e3, Je = "flex size-7 shrink-0 items-center justify-center", Ye = (e, n) => e.subject.kind === t.Single ? e.subject.title : n, Xe = (e) => e.subject.kind === t.Single ? e.subject.sourceBreadcrumb : void 0, Ze = (e, t, n) => e && t ? n.closeQueueConfirmDescriptionMixed : t ? n.closeQueueConfirmDescriptionFailed : n.closeQueueConfirmDescriptionInProgress, Qe = ({ job: t, labels: n, onDismiss: r, onRetry: i, styles: a }) => {
|
|
970
|
+
let s = Ye(t, n.allConversationsJobLabel), c = Xe(t), l = a?.typography;
|
|
971
|
+
return /* @__PURE__ */ B("div", {
|
|
972
|
+
className: "flex items-center gap-2 px-3 py-2",
|
|
973
|
+
children: [/* @__PURE__ */ B("div", {
|
|
974
|
+
className: "min-w-0 flex-1",
|
|
975
|
+
children: [c && /* @__PURE__ */ z(b, {
|
|
976
|
+
text: c,
|
|
977
|
+
className: o($.textSecondary, l?.jobDescriptionClassName || "dial-caption-text"),
|
|
978
|
+
contentClassName: "!z-[80]"
|
|
979
|
+
}), /* @__PURE__ */ z(b, {
|
|
980
|
+
text: s,
|
|
981
|
+
className: o($.text, l?.jobLabelClassName || "dial-small-text"),
|
|
982
|
+
contentClassName: "!z-[80]"
|
|
983
|
+
})]
|
|
984
|
+
}), /* @__PURE__ */ B("div", {
|
|
985
|
+
className: "flex shrink-0 items-center gap-1",
|
|
986
|
+
children: [
|
|
987
|
+
t.status === e.Success && /* @__PURE__ */ z("span", {
|
|
988
|
+
className: Je,
|
|
989
|
+
children: /* @__PURE__ */ z(U, {
|
|
990
|
+
size: 16,
|
|
991
|
+
className: $.successIcon
|
|
992
|
+
})
|
|
993
|
+
}),
|
|
994
|
+
t.status === e.Failed && /* @__PURE__ */ B(ae, { children: [/* @__PURE__ */ z(x, {
|
|
995
|
+
"aria-label": n.retryJobAriaLabel(s),
|
|
996
|
+
icon: /* @__PURE__ */ z(de, {
|
|
997
|
+
size: _.SM,
|
|
998
|
+
className: $.textSecondary
|
|
999
|
+
}),
|
|
1000
|
+
onClick: () => i(t.id)
|
|
1001
|
+
}), /* @__PURE__ */ z("span", {
|
|
1002
|
+
className: Je,
|
|
1003
|
+
children: /* @__PURE__ */ z(V, {
|
|
1004
|
+
size: 16,
|
|
1005
|
+
className: $.errorIcon
|
|
1006
|
+
})
|
|
1007
|
+
})] }),
|
|
1008
|
+
t.status === e.InProgress && /* @__PURE__ */ z(x, {
|
|
1009
|
+
"aria-label": n.closeJobAriaLabel(s),
|
|
1010
|
+
size: y.Small,
|
|
1011
|
+
icon: /* @__PURE__ */ z(pe, {
|
|
1012
|
+
size: _.SM,
|
|
1013
|
+
className: $.textSecondary
|
|
1014
|
+
}),
|
|
1015
|
+
onClick: () => r(t.id),
|
|
1016
|
+
className: Je
|
|
1017
|
+
})
|
|
1018
|
+
]
|
|
1019
|
+
})]
|
|
1020
|
+
});
|
|
1021
|
+
}, $e = M(({ title: t, jobs: n, onClose: r, onDismiss: a, onRetry: s, labels: c, styles: l }) => {
|
|
1022
|
+
let [u, d] = R(!1), [f, p] = R(!1), m = l?.colors, v = l?.typography, b = {
|
|
1023
|
+
...i({
|
|
1024
|
+
"--cp-transfer-queue-bg": m?.background,
|
|
1025
|
+
"--cp-transfer-queue-text": m?.text,
|
|
1026
|
+
"--cp-transfer-queue-text-secondary": m?.textSecondary,
|
|
1027
|
+
"--cp-transfer-queue-success-icon": m?.successIcon,
|
|
1028
|
+
"--cp-transfer-queue-error-icon": m?.errorIcon,
|
|
1029
|
+
"--cp-transfer-queue-failure-count-bg": m?.failureCountBackground,
|
|
1030
|
+
"--cp-transfer-queue-failure-count-text": m?.failureCountText
|
|
1031
|
+
}),
|
|
1032
|
+
...l?.cssVars
|
|
1033
|
+
}, S = n.some((t) => t.status === e.InProgress), C = n.some((t) => t.status === e.Failed), w = n.length > 0 && !S && !C, T = N(() => {
|
|
1034
|
+
S || C ? p(!0) : r();
|
|
1035
|
+
}, [
|
|
1036
|
+
S,
|
|
1037
|
+
C,
|
|
1038
|
+
r
|
|
1039
|
+
]), D = N(() => {
|
|
1040
|
+
p(!1), r();
|
|
1041
|
+
}, [r]);
|
|
1042
|
+
if (P(() => {
|
|
1043
|
+
if (!w) return;
|
|
1044
|
+
let e = setTimeout(r, qe);
|
|
1045
|
+
return () => clearTimeout(e);
|
|
1046
|
+
}, [w, r]), n.length === 0) return null;
|
|
1047
|
+
let ee = n.filter((t) => t.status !== e.InProgress).length, O = n.filter((t) => t.status === e.Failed).length, k = Math.round(ee / n.length * 100);
|
|
1048
|
+
return /* @__PURE__ */ B("div", {
|
|
1049
|
+
role: "status",
|
|
1050
|
+
"aria-live": "polite",
|
|
1051
|
+
style: b,
|
|
1052
|
+
className: o($.root, "w-[320px] rounded-lg shadow-lg", l?.rootClassName),
|
|
1053
|
+
children: [
|
|
1054
|
+
/* @__PURE__ */ B("div", {
|
|
1055
|
+
className: "flex items-center justify-between px-3 py-2",
|
|
1056
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1057
|
+
className: "flex items-center gap-2",
|
|
1058
|
+
children: [/* @__PURE__ */ z("span", {
|
|
1059
|
+
className: o($.text, v?.titleClassName || "dial-small-semi-text"),
|
|
1060
|
+
children: t
|
|
1061
|
+
}), O > 0 && /* @__PURE__ */ z("span", {
|
|
1062
|
+
className: o($.failureCount, "inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1", v?.failureCountClassName || "dial-small-semi-text"),
|
|
1063
|
+
children: O
|
|
1064
|
+
})]
|
|
1065
|
+
}), /* @__PURE__ */ B("div", {
|
|
1066
|
+
className: "flex items-center gap-1",
|
|
1067
|
+
children: [/* @__PURE__ */ z(x, {
|
|
1068
|
+
"aria-label": u ? c.expandQueueAriaLabel : c.collapseQueueAriaLabel,
|
|
1069
|
+
size: y.Small,
|
|
1070
|
+
icon: z(u ? ce : se, {
|
|
1071
|
+
size: _.SM,
|
|
1072
|
+
className: $.textSecondary
|
|
1073
|
+
}),
|
|
1074
|
+
onClick: () => d((e) => !e),
|
|
1075
|
+
className: Je
|
|
1076
|
+
}), /* @__PURE__ */ z(x, {
|
|
1077
|
+
"aria-label": c.closeQueueAriaLabel,
|
|
1078
|
+
size: y.Small,
|
|
1079
|
+
icon: /* @__PURE__ */ z(pe, {
|
|
1080
|
+
size: _.SM,
|
|
1081
|
+
className: $.textSecondary
|
|
1082
|
+
}),
|
|
1083
|
+
onClick: T,
|
|
1084
|
+
className: Je
|
|
1085
|
+
})]
|
|
1086
|
+
})]
|
|
1087
|
+
}),
|
|
1088
|
+
/* @__PURE__ */ z("div", {
|
|
1089
|
+
className: "px-3 pb-2",
|
|
1090
|
+
children: /* @__PURE__ */ z(E, {
|
|
1091
|
+
value: k,
|
|
1092
|
+
size: y.Small,
|
|
1093
|
+
"aria-label": t,
|
|
1094
|
+
className: "w-full"
|
|
960
1095
|
})
|
|
1096
|
+
}),
|
|
1097
|
+
!u && /* @__PURE__ */ z("div", {
|
|
1098
|
+
className: o("flex max-h-[40vh] flex-col overflow-y-auto", l?.bodyClassName),
|
|
1099
|
+
children: n.map((e) => /* @__PURE__ */ z(Qe, {
|
|
1100
|
+
job: e,
|
|
1101
|
+
labels: c,
|
|
1102
|
+
onDismiss: a,
|
|
1103
|
+
onRetry: s,
|
|
1104
|
+
styles: l
|
|
1105
|
+
}, e.id))
|
|
1106
|
+
}),
|
|
1107
|
+
/* @__PURE__ */ z(h, {
|
|
1108
|
+
open: f,
|
|
1109
|
+
header: c.closeQueueConfirmHeader,
|
|
1110
|
+
description: Ze(S, C, c),
|
|
1111
|
+
confirmLabel: c.closeLabel,
|
|
1112
|
+
cancelLabel: c.cancelLabel,
|
|
1113
|
+
variant: g.Danger,
|
|
1114
|
+
onConfirm: D,
|
|
1115
|
+
onClose: () => p(!1)
|
|
961
1116
|
})
|
|
962
1117
|
]
|
|
963
1118
|
});
|
|
964
1119
|
});
|
|
1120
|
+
$e.displayName = "ImportExportQueue";
|
|
1121
|
+
//#endregion
|
|
1122
|
+
//#region src/components/RenameConversationPopup/RenameConversationPopup.tsx
|
|
1123
|
+
var et = M(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: i, onCancel: o, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
1124
|
+
let [f, p] = R(t), [h, g] = R(!1), [v, y] = R(null), b = L(null), S = L(!1), E = L(0);
|
|
1125
|
+
P(() => {
|
|
1126
|
+
let n = e && !S.current;
|
|
1127
|
+
if (S.current = e, !e) {
|
|
1128
|
+
E.current += 1, g(!1);
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
if (!n) return;
|
|
1132
|
+
E.current += 1, p(t), y(null), g(!1);
|
|
1133
|
+
let r = setTimeout(() => b.current?.focus(), 0);
|
|
1134
|
+
return () => clearTimeout(r);
|
|
1135
|
+
}, [e, t]), P(() => () => {
|
|
1136
|
+
E.current += 1;
|
|
1137
|
+
}, []);
|
|
1138
|
+
let D = c(f.trim()), ee = a(D) > 255, O = n || D === "" || D === t.trim() || ee, A = N(() => {
|
|
1139
|
+
O || i(D);
|
|
1140
|
+
}, [
|
|
1141
|
+
O,
|
|
1142
|
+
i,
|
|
1143
|
+
D
|
|
1144
|
+
]), te = N((e) => {
|
|
1145
|
+
e.key === "Enter" && A();
|
|
1146
|
+
}, [A]), ne = N(async () => {
|
|
1147
|
+
if (h) return;
|
|
1148
|
+
let e = ++E.current;
|
|
1149
|
+
g(!0), y(null);
|
|
1150
|
+
try {
|
|
1151
|
+
let t = await l();
|
|
1152
|
+
if (e !== E.current) return;
|
|
1153
|
+
p(s(t));
|
|
1154
|
+
} catch {
|
|
1155
|
+
if (e !== E.current) return;
|
|
1156
|
+
y(u.renameWithAiError);
|
|
1157
|
+
} finally {
|
|
1158
|
+
e === E.current && g(!1);
|
|
1159
|
+
}
|
|
1160
|
+
}, [
|
|
1161
|
+
h,
|
|
1162
|
+
l,
|
|
1163
|
+
u.renameWithAiError
|
|
1164
|
+
]), j;
|
|
1165
|
+
return j = ee ? u.nameTooLongError : v ?? r ?? void 0, /* @__PURE__ */ z(w, {
|
|
1166
|
+
open: e,
|
|
1167
|
+
header: u.popupTitle,
|
|
1168
|
+
size: T.Sm,
|
|
1169
|
+
onClose: o,
|
|
1170
|
+
mainButtons: n ? void 0 : [{
|
|
1171
|
+
label: u.cancelLabel,
|
|
1172
|
+
onClick: o
|
|
1173
|
+
}, {
|
|
1174
|
+
label: u.saveLabel,
|
|
1175
|
+
variant: m.Primary,
|
|
1176
|
+
disabled: O,
|
|
1177
|
+
onClick: A
|
|
1178
|
+
}],
|
|
1179
|
+
children: /* @__PURE__ */ z("div", {
|
|
1180
|
+
className: d?.bodyClassName,
|
|
1181
|
+
style: d?.cssVars,
|
|
1182
|
+
children: n ? /* @__PURE__ */ z("div", {
|
|
1183
|
+
className: "h-[120px] px-6 py-4",
|
|
1184
|
+
children: /* @__PURE__ */ z(k, { size: 50 })
|
|
1185
|
+
}) : /* @__PURE__ */ B("div", {
|
|
1186
|
+
className: "flex items-start gap-2 px-6 py-3",
|
|
1187
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1188
|
+
className: "min-w-0 flex-1",
|
|
1189
|
+
children: /* @__PURE__ */ z(C, {
|
|
1190
|
+
inputRef: b,
|
|
1191
|
+
value: f,
|
|
1192
|
+
placeholder: u.inputPlaceholder,
|
|
1193
|
+
error: j,
|
|
1194
|
+
onChange: (e) => p(s(e ?? "")),
|
|
1195
|
+
onKeyDown: te
|
|
1196
|
+
})
|
|
1197
|
+
}), /* @__PURE__ */ z(x, {
|
|
1198
|
+
"aria-label": u.renameWithAiLabel,
|
|
1199
|
+
tooltipProps: { tooltip: u.renameWithAiLabel },
|
|
1200
|
+
disabled: h || n,
|
|
1201
|
+
onClick: ne,
|
|
1202
|
+
icon: h ? /* @__PURE__ */ z(k, { size: _.MD }) : /* @__PURE__ */ z(fe, {
|
|
1203
|
+
size: _.MD,
|
|
1204
|
+
stroke: 1.5
|
|
1205
|
+
})
|
|
1206
|
+
})]
|
|
1207
|
+
})
|
|
1208
|
+
})
|
|
1209
|
+
});
|
|
1210
|
+
});
|
|
1211
|
+
et.displayName = "RenameConversationPopup";
|
|
965
1212
|
//#endregion
|
|
966
|
-
export {
|
|
1213
|
+
export { Ke as ConversationPanel, r as FilterTab, $e as ImportExportQueue, et as RenameConversationPopup };
|