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