@epam/ai-dial-conversation-input 1.1.0-dev.294 → 1.1.0-dev.297
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.d.ts +0 -2
- package/index.d.ts.map +1 -1
- package/index.js +528 -528
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RequestStatus as r, ResponseFormat as i, buildCssVars as a, mergeClasses as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, Dropdown as p, ElementSize as m, ErrorText as h, GhostIconButton as g, Highlight as _, NeutralButton as v, Popup as y, PopupSize as b, PrimaryButton as x, PrimaryIconButton as S, RadioGroup as C, RadioGroupOrientation as w, Search as T, Skeleton as E, SkeletonVariant as D, Slider as O, StaticIconButton as k, Textarea as
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import {
|
|
2
|
+
import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, Dropdown as p, ElementSize as m, ErrorText as h, GhostIconButton as g, Highlight as _, NeutralButton as v, Popup as y, PopupSize as b, PrimaryButton as x, PrimaryIconButton as S, RadioGroup as C, RadioGroupOrientation as w, Search as T, Skeleton as E, SkeletonVariant as D, Slider as O, StaticIconButton as k, Textarea as ee, Tooltip as A } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as te, IconArrowNarrowRight as ne, IconCheck as j, IconChevronDown as re, IconChevronRight as M, IconFile as ie, IconMicrophone as ae, IconPaperclip as oe, IconPlayerStopFilled as N, IconPlaystationSquare as P, IconPlus as se, IconPrompt as ce, IconSettings as le, IconTool as ue, IconX as de } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as fe } from "react-dom";
|
|
5
|
+
import { createElement as F, memo as I, useCallback as L, useEffect as R, useImperativeHandle as pe, useLayoutEffect as me, useMemo as z, useRef as B, useState as V } from "react";
|
|
6
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentTray as he, MAX_UPLOADS_PER_MINUTE as ge, generateAttachmentId as _e, useClipboardPaste as ve } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var ye = (e, t) => {
|
|
10
|
+
R(() => {
|
|
11
11
|
if (!e) return;
|
|
12
12
|
let n = (e) => {
|
|
13
13
|
e.key === "Escape" && t();
|
|
14
14
|
};
|
|
15
15
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
16
|
-
}, [e, t]),
|
|
16
|
+
}, [e, t]), R(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
21
|
+
}, be = {
|
|
22
22
|
backdrop: "_backdrop_1d50f_9",
|
|
23
23
|
sheet: "_sheet_1d50f_13",
|
|
24
24
|
"slide-up": "_slide-up_1d50f_1",
|
|
25
25
|
title: "_title_1d50f_18",
|
|
26
26
|
divider: "_divider_1d50f_22"
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
27
|
+
}, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: h, children: _ }) => {
|
|
28
|
+
if (ye(e, r), !e || typeof document > "u") return null;
|
|
29
29
|
let v = a({
|
|
30
30
|
"--ci-backdrop": h?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": h?.sheetBg,
|
|
32
32
|
"--ci-sheet-text": h?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": h?.divider
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
className: o(
|
|
35
|
+
return fe(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
36
|
+
className: o(be.backdrop, "fixed inset-0 z-[55]"),
|
|
37
37
|
style: v,
|
|
38
38
|
onPointerDown: r,
|
|
39
39
|
"aria-hidden": !0
|
|
40
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ W("div", {
|
|
41
41
|
role: "dialog",
|
|
42
42
|
"aria-modal": !0,
|
|
43
43
|
"aria-label": t ?? c,
|
|
@@ -45,14 +45,14 @@ var Se = (e, t) => {
|
|
|
45
45
|
...v,
|
|
46
46
|
...l
|
|
47
47
|
},
|
|
48
|
-
className: o(
|
|
49
|
-
children: [t != null && /* @__PURE__ */
|
|
48
|
+
className: o(be.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
|
|
49
|
+
children: [t != null && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("div", {
|
|
50
50
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
51
51
|
children: [
|
|
52
|
-
i && /* @__PURE__ */
|
|
52
|
+
i && /* @__PURE__ */ U("div", {
|
|
53
53
|
className: "absolute start-4",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
icon: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ U(g, {
|
|
55
|
+
icon: /* @__PURE__ */ U(te, {
|
|
56
56
|
size: d.LG,
|
|
57
57
|
stroke: 1.5,
|
|
58
58
|
className: "rtl:scale-x-[-1]"
|
|
@@ -61,41 +61,41 @@ var Se = (e, t) => {
|
|
|
61
61
|
onClick: i
|
|
62
62
|
})
|
|
63
63
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
className: o(
|
|
64
|
+
/* @__PURE__ */ U("span", {
|
|
65
|
+
className: o(be.title, f),
|
|
66
66
|
children: t
|
|
67
67
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ U("div", {
|
|
69
69
|
className: "absolute end-4 m-2",
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ U(u, {
|
|
71
71
|
ariaLabel: n,
|
|
72
72
|
onClose: r,
|
|
73
73
|
size: m.Standard
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
]
|
|
77
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ U("div", { className: o(be.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
|
|
78
78
|
className: "overflow-y-auto",
|
|
79
79
|
children: _
|
|
80
80
|
})]
|
|
81
81
|
})] }), document.body);
|
|
82
|
-
},
|
|
82
|
+
}, xe = async (e, t, n) => {
|
|
83
83
|
let r = 6e4 / t, i = [];
|
|
84
84
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
85
85
|
await Promise.allSettled(i);
|
|
86
|
-
},
|
|
87
|
-
let [h, g] =
|
|
88
|
-
|
|
86
|
+
}, Se = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
87
|
+
let [h, g] = V(n), _ = B(h);
|
|
88
|
+
R(() => {
|
|
89
89
|
_.current = h;
|
|
90
|
-
}, [h]),
|
|
90
|
+
}, [h]), R(() => () => {
|
|
91
91
|
_.current.forEach((e) => {
|
|
92
92
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
93
93
|
});
|
|
94
94
|
}, []);
|
|
95
|
-
let v =
|
|
95
|
+
let v = L((e) => e.map((e) => {
|
|
96
96
|
let n = e.type.startsWith("image/"), i = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = i ? URL.createObjectURL(e) : void 0;
|
|
97
97
|
return {
|
|
98
|
-
id:
|
|
98
|
+
id: _e(),
|
|
99
99
|
name: e.name,
|
|
100
100
|
contentType: e.type,
|
|
101
101
|
file: e,
|
|
@@ -104,26 +104,26 @@ var Se = (e, t) => {
|
|
|
104
104
|
previewUrl: a,
|
|
105
105
|
playUrl: o
|
|
106
106
|
};
|
|
107
|
-
}), []), y =
|
|
108
|
-
|
|
107
|
+
}), []), y = B(a);
|
|
108
|
+
R(() => {
|
|
109
109
|
y.current = a;
|
|
110
110
|
}, [a]);
|
|
111
|
-
let b =
|
|
111
|
+
let b = B(!0), x = L((e) => {
|
|
112
112
|
g((t) => {
|
|
113
113
|
let n = e(t);
|
|
114
114
|
return n === t ? t : n;
|
|
115
115
|
});
|
|
116
116
|
}, []);
|
|
117
|
-
|
|
117
|
+
R(() => {
|
|
118
118
|
if (b.current) {
|
|
119
119
|
b.current = !1;
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
y.current?.(h);
|
|
123
123
|
}, [h]);
|
|
124
|
-
let S =
|
|
124
|
+
let S = L((e) => {
|
|
125
125
|
g(e);
|
|
126
|
-
}, []), C =
|
|
126
|
+
}, []), C = L(async (t) => {
|
|
127
127
|
if (i) {
|
|
128
128
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
129
129
|
...e,
|
|
@@ -145,7 +145,7 @@ var Se = (e, t) => {
|
|
|
145
145
|
} : e));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}, [i, x]), w =
|
|
148
|
+
}, [i, x]), w = L((e, t = !0) => {
|
|
149
149
|
let n = new Set(_.current.map((e) => e.id)), i = e.filter((e) => !n.has(e.id));
|
|
150
150
|
if (i.length !== 0) {
|
|
151
151
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -166,7 +166,7 @@ var Se = (e, t) => {
|
|
|
166
166
|
status: r.Error,
|
|
167
167
|
errorReason: n
|
|
168
168
|
} : e));
|
|
169
|
-
}),
|
|
169
|
+
}), xe(e, ge, C);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}, [
|
|
@@ -177,20 +177,20 @@ var Se = (e, t) => {
|
|
|
177
177
|
C,
|
|
178
178
|
o
|
|
179
179
|
]);
|
|
180
|
-
|
|
180
|
+
R(() => {
|
|
181
181
|
s.length !== 0 && (w(v(s)), c?.());
|
|
182
182
|
}, [
|
|
183
183
|
w,
|
|
184
184
|
v,
|
|
185
185
|
c,
|
|
186
186
|
s
|
|
187
|
-
]),
|
|
187
|
+
]), R(() => {
|
|
188
188
|
l.length !== 0 && (w(l, !1), u?.());
|
|
189
189
|
}, [
|
|
190
190
|
w,
|
|
191
191
|
u,
|
|
192
192
|
l
|
|
193
|
-
]),
|
|
193
|
+
]), R(() => {
|
|
194
194
|
if (!o) return;
|
|
195
195
|
let t = !1, n = [], i = _.current.map((i) => {
|
|
196
196
|
if (i.status === r.Loading) return i;
|
|
@@ -217,7 +217,7 @@ var Se = (e, t) => {
|
|
|
217
217
|
x,
|
|
218
218
|
C
|
|
219
219
|
]);
|
|
220
|
-
let T =
|
|
220
|
+
let T = L((e) => {
|
|
221
221
|
x((t) => {
|
|
222
222
|
let n = t.find((t) => t.id === e);
|
|
223
223
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -229,11 +229,11 @@ var Se = (e, t) => {
|
|
|
229
229
|
addAttachments: w,
|
|
230
230
|
resetAttachments: S,
|
|
231
231
|
handleRemove: T,
|
|
232
|
-
handleRetry:
|
|
232
|
+
handleRetry: L((e) => {
|
|
233
233
|
let t = h.find((t) => t.id === e);
|
|
234
234
|
t && C(t);
|
|
235
235
|
}, [h, C]),
|
|
236
|
-
handleExpand:
|
|
236
|
+
handleExpand: L(async (e) => {
|
|
237
237
|
let n = h.find((t) => t.id === e);
|
|
238
238
|
if (!n || n.type !== t.Pasted) return;
|
|
239
239
|
let r = await n.file.text();
|
|
@@ -245,9 +245,9 @@ var Se = (e, t) => {
|
|
|
245
245
|
]),
|
|
246
246
|
hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
|
|
247
247
|
};
|
|
248
|
-
},
|
|
249
|
-
let [n, r] =
|
|
250
|
-
return
|
|
248
|
+
}, Ce = (e, t) => {
|
|
249
|
+
let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
|
|
250
|
+
return R(() => {
|
|
251
251
|
if (e) {
|
|
252
252
|
r(!0), a(!1), s((e) => e + 1);
|
|
253
253
|
return;
|
|
@@ -263,18 +263,18 @@ var Se = (e, t) => {
|
|
|
263
263
|
isExiting: i,
|
|
264
264
|
instanceKey: o
|
|
265
265
|
};
|
|
266
|
-
},
|
|
267
|
-
let t =
|
|
266
|
+
}, we = (e, t) => !e.slice(0, t).includes("\n"), Te = (e, t) => !e.slice(t).includes("\n"), Ee = (e) => {
|
|
267
|
+
let t = B(e);
|
|
268
268
|
t.current = e;
|
|
269
|
-
let n =
|
|
269
|
+
let n = B(-1), r = B(""), i = L((e, i, a) => {
|
|
270
270
|
let o = t.current;
|
|
271
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
272
|
-
}, []), a =
|
|
271
|
+
return !o || o.length === 0 ? null : e === "up" ? !we(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !Te(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
272
|
+
}, []), a = L(() => {
|
|
273
273
|
n.current = -1, r.current = "";
|
|
274
|
-
}, []), o =
|
|
274
|
+
}, []), o = L(() => {
|
|
275
275
|
n.current = -1, r.current = "";
|
|
276
276
|
}, []);
|
|
277
|
-
return
|
|
277
|
+
return z(() => ({
|
|
278
278
|
navigate: i,
|
|
279
279
|
notifyChange: a,
|
|
280
280
|
reset: o
|
|
@@ -283,13 +283,13 @@ var Se = (e, t) => {
|
|
|
283
283
|
a,
|
|
284
284
|
o
|
|
285
285
|
]);
|
|
286
|
-
},
|
|
287
|
-
let [n, r] =
|
|
288
|
-
return
|
|
286
|
+
}, De = ({ messageProp: e, messageRevision: t }) => {
|
|
287
|
+
let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
|
|
288
|
+
return R(() => {
|
|
289
289
|
r(e);
|
|
290
|
-
}, [e, t]),
|
|
290
|
+
}, [e, t]), R(() => {
|
|
291
291
|
i.current && (a.current = i.current.offsetHeight);
|
|
292
|
-
}, []),
|
|
292
|
+
}, []), me(() => {
|
|
293
293
|
if (!i.current || a.current === 0) return;
|
|
294
294
|
let e = i.current.offsetHeight > a.current;
|
|
295
295
|
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
@@ -299,18 +299,18 @@ var Se = (e, t) => {
|
|
|
299
299
|
textareaRef: i,
|
|
300
300
|
isMultiLine: o
|
|
301
301
|
};
|
|
302
|
-
},
|
|
302
|
+
}, Oe = /* @__PURE__ */ function(e) {
|
|
303
303
|
return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
|
|
304
|
-
}({}),
|
|
304
|
+
}({}), ke = [
|
|
305
305
|
"audio/webm;codecs=opus",
|
|
306
306
|
"audio/ogg;codecs=opus",
|
|
307
307
|
"audio/webm"
|
|
308
|
-
],
|
|
309
|
-
let [t, n] =
|
|
308
|
+
], Ae = () => ke.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", je = ({ onAttachAudio: e }) => {
|
|
309
|
+
let [t, n] = V("idle"), [r, i] = V(null), a = B(null), o = B(null), s = B(null), c = B(null), l = B([]), u = B(""), d = B(e);
|
|
310
310
|
d.current = e;
|
|
311
|
-
let f =
|
|
311
|
+
let f = L(() => {
|
|
312
312
|
a.current &&= (a.current.getTracks().forEach((e) => e.stop()), null), o.current &&= (o.current.close(), null), s.current = null, c.current = null;
|
|
313
|
-
}, []), p =
|
|
313
|
+
}, []), p = L(() => {
|
|
314
314
|
(async () => {
|
|
315
315
|
try {
|
|
316
316
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -319,7 +319,7 @@ var Se = (e, t) => {
|
|
|
319
319
|
o.current = t;
|
|
320
320
|
let r = t.createAnalyser();
|
|
321
321
|
r.fftSize = 256, s.current = r, t.createMediaStreamSource(e).connect(r);
|
|
322
|
-
let i =
|
|
322
|
+
let i = Ae();
|
|
323
323
|
u.current = i, l.current = [];
|
|
324
324
|
let d = new MediaRecorder(e, i ? { mimeType: i } : void 0);
|
|
325
325
|
c.current = d, d.ondataavailable = (e) => {
|
|
@@ -329,17 +329,17 @@ var Se = (e, t) => {
|
|
|
329
329
|
i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
|
|
330
330
|
}
|
|
331
331
|
})();
|
|
332
|
-
}, []), m =
|
|
332
|
+
}, []), m = L(() => {
|
|
333
333
|
let e = c.current;
|
|
334
334
|
!e || e.state !== "recording" || (e.onstop = () => {
|
|
335
335
|
let e = u.current || "audio/webm", t = new Blob(l.current, { type: e }), r = e.split(";")[0].split("/")[1] ?? "webm", a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), o = new File([t], `voice-${a}.${r}`, { type: e });
|
|
336
336
|
d.current(o), f(), i(null), n("idle");
|
|
337
337
|
}, e.stop());
|
|
338
|
-
}, [f]), h =
|
|
338
|
+
}, [f]), h = L(() => {
|
|
339
339
|
let e = c.current;
|
|
340
340
|
e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), f(), i(null), n("idle");
|
|
341
341
|
}, [f]);
|
|
342
|
-
return
|
|
342
|
+
return R(() => () => {
|
|
343
343
|
f();
|
|
344
344
|
}, [f]), {
|
|
345
345
|
state: t,
|
|
@@ -349,12 +349,12 @@ var Se = (e, t) => {
|
|
|
349
349
|
stopRecording: m,
|
|
350
350
|
discardRecording: h
|
|
351
351
|
};
|
|
352
|
-
},
|
|
352
|
+
}, Me = /* @__PURE__ */ function(e) {
|
|
353
353
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
354
|
-
}({}),
|
|
354
|
+
}({}), Ne = {
|
|
355
355
|
item: "_item_1sr2n_1",
|
|
356
356
|
itemIcon: "_itemIcon_1sr2n_11"
|
|
357
|
-
},
|
|
357
|
+
}, Pe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
|
|
358
358
|
let m = (e) => {
|
|
359
359
|
e(), r();
|
|
360
360
|
}, h = a({
|
|
@@ -363,7 +363,7 @@ var Se = (e, t) => {
|
|
|
363
363
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
364
364
|
"--ci-sheet-icon": p?.itemIcon
|
|
365
365
|
});
|
|
366
|
-
return /* @__PURE__ */ G
|
|
366
|
+
return /* @__PURE__ */ U(G, {
|
|
367
367
|
isOpen: e,
|
|
368
368
|
title: t,
|
|
369
369
|
closeLabel: n,
|
|
@@ -372,23 +372,23 @@ var Se = (e, t) => {
|
|
|
372
372
|
className: c,
|
|
373
373
|
titleClassName: u,
|
|
374
374
|
colors: p?.shell,
|
|
375
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ U("ul", {
|
|
376
376
|
role: "list",
|
|
377
377
|
className: "flex flex-col",
|
|
378
378
|
style: h,
|
|
379
|
-
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
379
|
+
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(l, {
|
|
380
380
|
type: "button",
|
|
381
|
-
className: o(
|
|
382
|
-
iconBefore: /* @__PURE__ */
|
|
383
|
-
className:
|
|
381
|
+
className: o(Ne.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
382
|
+
iconBefore: /* @__PURE__ */ U("span", {
|
|
383
|
+
className: Ne.itemIcon,
|
|
384
384
|
children: n
|
|
385
385
|
}),
|
|
386
|
-
iconAfter: r ? /* @__PURE__ */
|
|
386
|
+
iconAfter: r ? /* @__PURE__ */ U("span", {
|
|
387
387
|
className: "ms-auto",
|
|
388
388
|
children: r
|
|
389
389
|
}) : null,
|
|
390
390
|
textClassName: f,
|
|
391
|
-
label: /* @__PURE__ */
|
|
391
|
+
label: /* @__PURE__ */ U("span", {
|
|
392
392
|
className: d,
|
|
393
393
|
children: t
|
|
394
394
|
}),
|
|
@@ -396,9 +396,9 @@ var Se = (e, t) => {
|
|
|
396
396
|
}) }, e))
|
|
397
397
|
})
|
|
398
398
|
});
|
|
399
|
-
},
|
|
400
|
-
let [s, c] =
|
|
401
|
-
|
|
399
|
+
}, Fe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
400
|
+
let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
|
|
401
|
+
R(() => {
|
|
402
402
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
403
403
|
}, [
|
|
404
404
|
o,
|
|
@@ -415,7 +415,7 @@ var Se = (e, t) => {
|
|
|
415
415
|
setResponseFormat: c,
|
|
416
416
|
setSystemPrompt: u,
|
|
417
417
|
setTemperature: f,
|
|
418
|
-
handleSubmit:
|
|
418
|
+
handleSubmit: L(() => {
|
|
419
419
|
if (!m) return;
|
|
420
420
|
let t = {};
|
|
421
421
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -429,17 +429,17 @@ var Se = (e, t) => {
|
|
|
429
429
|
a
|
|
430
430
|
])
|
|
431
431
|
};
|
|
432
|
-
},
|
|
432
|
+
}, Ie = { label: "_label_14i7c_1" }, Le = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: h = "Enter a prompt", temperatureLabel: g = "Temperature", temperatureLabels: _ = [
|
|
433
433
|
"Precise",
|
|
434
434
|
"Neutral",
|
|
435
435
|
"Creative"
|
|
436
436
|
], temperatureHint: v, labelClassName: y = "!dial-small-semi-text", colors: b }) => {
|
|
437
|
-
let x = a({ "--csf-label-text": b?.labelText }), S = o(y,
|
|
438
|
-
return /* @__PURE__ */
|
|
437
|
+
let x = a({ "--csf-label-text": b?.labelText }), S = o(y, Ie.label, "gap-1");
|
|
438
|
+
return /* @__PURE__ */ W("div", {
|
|
439
439
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
440
440
|
style: x,
|
|
441
441
|
children: [
|
|
442
|
-
e.responseFormat && /* @__PURE__ */
|
|
442
|
+
e.responseFormat && /* @__PURE__ */ U(C, {
|
|
443
443
|
id: "response-format",
|
|
444
444
|
labelProps: {
|
|
445
445
|
label: u,
|
|
@@ -458,7 +458,7 @@ var Se = (e, t) => {
|
|
|
458
458
|
}],
|
|
459
459
|
onChange: (e) => s(e)
|
|
460
460
|
}),
|
|
461
|
-
e.systemPrompt && /* @__PURE__ */
|
|
461
|
+
e.systemPrompt && /* @__PURE__ */ U(ee, {
|
|
462
462
|
value: n,
|
|
463
463
|
placeholder: h,
|
|
464
464
|
resize: !0,
|
|
@@ -468,7 +468,7 @@ var Se = (e, t) => {
|
|
|
468
468
|
},
|
|
469
469
|
onChange: (e) => c(e ?? "")
|
|
470
470
|
}),
|
|
471
|
-
e.temperature && /* @__PURE__ */
|
|
471
|
+
e.temperature && /* @__PURE__ */ U(O, {
|
|
472
472
|
labelProps: {
|
|
473
473
|
label: g,
|
|
474
474
|
className: S,
|
|
@@ -484,8 +484,8 @@ var Se = (e, t) => {
|
|
|
484
484
|
})
|
|
485
485
|
]
|
|
486
486
|
});
|
|
487
|
-
},
|
|
488
|
-
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt:
|
|
487
|
+
}, Re = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
|
|
488
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: te, handleSubmit: ne } = Fe({
|
|
489
489
|
isOpen: e,
|
|
490
490
|
features: s,
|
|
491
491
|
initialResponseFormat: c,
|
|
@@ -494,7 +494,7 @@ var Se = (e, t) => {
|
|
|
494
494
|
onSave: d,
|
|
495
495
|
onClose: r
|
|
496
496
|
});
|
|
497
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ W(G, {
|
|
498
498
|
isOpen: e,
|
|
499
499
|
title: f,
|
|
500
500
|
closeLabel: i,
|
|
@@ -502,14 +502,14 @@ var Se = (e, t) => {
|
|
|
502
502
|
onBack: t,
|
|
503
503
|
backLabel: n,
|
|
504
504
|
style: a,
|
|
505
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ U(Le, {
|
|
506
506
|
features: s,
|
|
507
507
|
responseFormat: T,
|
|
508
508
|
systemPrompt: E,
|
|
509
509
|
temperature: D,
|
|
510
510
|
onResponseFormatChange: k,
|
|
511
|
-
onSystemPromptChange:
|
|
512
|
-
onTemperatureChange:
|
|
511
|
+
onSystemPromptChange: ee,
|
|
512
|
+
onTemperatureChange: te,
|
|
513
513
|
responseFormatLabel: p,
|
|
514
514
|
responseFormatHint: m,
|
|
515
515
|
responseFormatMarkdownLabel: h,
|
|
@@ -519,23 +519,23 @@ var Se = (e, t) => {
|
|
|
519
519
|
temperatureLabel: y,
|
|
520
520
|
temperatureLabels: b,
|
|
521
521
|
temperatureHint: S
|
|
522
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ U("div", {
|
|
523
523
|
className: o("px-6 py-4 mobile:pb-8"),
|
|
524
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ U(A, {
|
|
525
525
|
tooltip: w,
|
|
526
526
|
hideTooltip: O || !w,
|
|
527
527
|
triggerClassName: "w-full",
|
|
528
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ U(x, {
|
|
529
529
|
label: C,
|
|
530
|
-
onClick:
|
|
530
|
+
onClick: ne,
|
|
531
531
|
disabled: !O,
|
|
532
532
|
className: "w-full"
|
|
533
533
|
})
|
|
534
534
|
})
|
|
535
535
|
})]
|
|
536
536
|
});
|
|
537
|
-
},
|
|
538
|
-
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit:
|
|
537
|
+
}, ze = { modal: "_modal_kl0h0_1" }, Be = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: S = ze.modal }) => {
|
|
538
|
+
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = Fe({
|
|
539
539
|
features: e,
|
|
540
540
|
initialResponseFormat: t,
|
|
541
541
|
initialSystemPrompt: n,
|
|
@@ -543,26 +543,26 @@ var Se = (e, t) => {
|
|
|
543
543
|
onSave: i,
|
|
544
544
|
onClose: a
|
|
545
545
|
});
|
|
546
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ U(y, {
|
|
547
547
|
open: !0,
|
|
548
548
|
header: o,
|
|
549
549
|
titleClassName: s,
|
|
550
550
|
size: b.Sm,
|
|
551
551
|
onClose: a,
|
|
552
552
|
className: S,
|
|
553
|
-
footer: /* @__PURE__ */
|
|
553
|
+
footer: /* @__PURE__ */ U("div", {
|
|
554
554
|
className: "flex justify-end px-6 py-4",
|
|
555
|
-
children: /* @__PURE__ */
|
|
555
|
+
children: /* @__PURE__ */ U(A, {
|
|
556
556
|
tooltip: v,
|
|
557
557
|
hideTooltip: E || !v,
|
|
558
|
-
children: /* @__PURE__ */
|
|
558
|
+
children: /* @__PURE__ */ U(x, {
|
|
559
559
|
label: _,
|
|
560
|
-
onClick:
|
|
560
|
+
onClick: ee,
|
|
561
561
|
disabled: !E
|
|
562
562
|
})
|
|
563
563
|
})
|
|
564
564
|
}),
|
|
565
|
-
children: /* @__PURE__ */
|
|
565
|
+
children: /* @__PURE__ */ U(Le, {
|
|
566
566
|
features: e,
|
|
567
567
|
responseFormat: C,
|
|
568
568
|
systemPrompt: w,
|
|
@@ -582,11 +582,11 @@ var Se = (e, t) => {
|
|
|
582
582
|
})
|
|
583
583
|
});
|
|
584
584
|
};
|
|
585
|
-
|
|
586
|
-
var
|
|
585
|
+
I(Be);
|
|
586
|
+
var Ve = {
|
|
587
587
|
icon: "_icon_1fv6z_1",
|
|
588
588
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
589
|
-
},
|
|
589
|
+
}, He = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ U(G, {
|
|
590
590
|
isOpen: e,
|
|
591
591
|
title: u,
|
|
592
592
|
closeLabel: i,
|
|
@@ -594,32 +594,32 @@ var We = {
|
|
|
594
594
|
onBack: t,
|
|
595
595
|
backLabel: n,
|
|
596
596
|
style: s,
|
|
597
|
-
children: /* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ U("ul", {
|
|
598
598
|
role: "menu",
|
|
599
599
|
className: "flex flex-col pb-4",
|
|
600
600
|
style: a({
|
|
601
601
|
"--tbs-icon-text": m?.iconText,
|
|
602
602
|
"--tbs-selected-icon-text": m?.selectedIconText
|
|
603
603
|
}),
|
|
604
|
-
children: d.map((e) => /* @__PURE__ */
|
|
604
|
+
children: d.map((e) => /* @__PURE__ */ U("li", {
|
|
605
605
|
role: "none",
|
|
606
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ U(l, {
|
|
607
607
|
type: "button",
|
|
608
608
|
role: "menuitemcheckbox",
|
|
609
609
|
"aria-checked": e.isSelected,
|
|
610
610
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
611
|
-
iconBefore: /* @__PURE__ */
|
|
612
|
-
className: o("flex items-center",
|
|
611
|
+
iconBefore: /* @__PURE__ */ U("span", {
|
|
612
|
+
className: o("flex items-center", Ve.icon),
|
|
613
613
|
children: e.icon
|
|
614
614
|
}),
|
|
615
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
616
|
-
className: o("ms-auto",
|
|
617
|
-
children: /* @__PURE__ */
|
|
615
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
|
|
616
|
+
className: o("ms-auto", Ve.selectedIcon),
|
|
617
|
+
children: /* @__PURE__ */ U(j, {
|
|
618
618
|
size: c,
|
|
619
619
|
"aria-hidden": !0
|
|
620
620
|
})
|
|
621
621
|
}) : null,
|
|
622
|
-
label: /* @__PURE__ */
|
|
622
|
+
label: /* @__PURE__ */ U("span", {
|
|
623
623
|
className: p,
|
|
624
624
|
children: e.label
|
|
625
625
|
}),
|
|
@@ -627,12 +627,12 @@ var We = {
|
|
|
627
627
|
})
|
|
628
628
|
}, e.id))
|
|
629
629
|
})
|
|
630
|
-
}),
|
|
630
|
+
}), Ue = {
|
|
631
631
|
selectedToolIcon: "_selectedToolIcon_r268y_1",
|
|
632
632
|
toolIcon: "_toolIcon_r268y_5",
|
|
633
633
|
chevronIcon: "_chevronIcon_r268y_9"
|
|
634
|
-
},
|
|
635
|
-
let D = s(), [O, k] =
|
|
634
|
+
}, We = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: h = !1, chatSettings: _, extraMenuItems: v, toolsMenuItems: y = [], onToolToggle: b, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
|
|
635
|
+
let D = s(), [O, k] = V(!1), [ee, A] = V(!1), [te, ne] = V(!1), [re, ie] = V(!1), [ae, N] = V(!1), P = z(() => a({
|
|
636
636
|
"--aab-selected-tool-icon": E?.selectedToolIcon,
|
|
637
637
|
"--aab-tool-icon": E?.toolIcon,
|
|
638
638
|
"--aab-chevron-icon": E?.chevronIcon
|
|
@@ -640,98 +640,98 @@ var We = {
|
|
|
640
640
|
E?.selectedToolIcon,
|
|
641
641
|
E?.toolIcon,
|
|
642
642
|
E?.chevronIcon
|
|
643
|
-
]),
|
|
643
|
+
]), de = y.length > 0 && b != null, fe = z(() => y.map((e) => ({
|
|
644
644
|
key: e.id,
|
|
645
|
-
label: /* @__PURE__ */
|
|
645
|
+
label: /* @__PURE__ */ W("span", {
|
|
646
646
|
className: "flex flex-1 items-center gap-2",
|
|
647
|
-
children: [/* @__PURE__ */
|
|
647
|
+
children: [/* @__PURE__ */ U("span", {
|
|
648
648
|
className: "flex-1",
|
|
649
649
|
children: e.label
|
|
650
|
-
}), e.isSelected && /* @__PURE__ */
|
|
650
|
+
}), e.isSelected && /* @__PURE__ */ U(j, {
|
|
651
651
|
size: c,
|
|
652
|
-
style:
|
|
653
|
-
className:
|
|
652
|
+
style: P,
|
|
653
|
+
className: Ue.selectedToolIcon,
|
|
654
654
|
"aria-hidden": !0
|
|
655
655
|
})]
|
|
656
656
|
}),
|
|
657
|
-
icon: /* @__PURE__ */
|
|
658
|
-
style:
|
|
659
|
-
className: o("flex items-center",
|
|
657
|
+
icon: /* @__PURE__ */ U("span", {
|
|
658
|
+
style: P,
|
|
659
|
+
className: o("flex items-center", Ue.toolIcon),
|
|
660
660
|
children: e.icon
|
|
661
661
|
}),
|
|
662
662
|
onClick: () => b?.(e.id)
|
|
663
663
|
})), [
|
|
664
664
|
y,
|
|
665
665
|
b,
|
|
666
|
-
|
|
667
|
-
]),
|
|
666
|
+
P
|
|
667
|
+
]), F = z(() => [
|
|
668
668
|
...e == null ? [] : [{
|
|
669
669
|
key: "attach",
|
|
670
670
|
label: t,
|
|
671
|
-
icon: /* @__PURE__ */
|
|
671
|
+
icon: /* @__PURE__ */ U(oe, {
|
|
672
672
|
size: c,
|
|
673
673
|
"aria-hidden": !0
|
|
674
674
|
}),
|
|
675
675
|
onClick: e
|
|
676
676
|
}],
|
|
677
677
|
...v ?? [],
|
|
678
|
-
...
|
|
678
|
+
...de ? [{
|
|
679
679
|
key: "tools",
|
|
680
680
|
label: x,
|
|
681
|
-
icon: /* @__PURE__ */
|
|
681
|
+
icon: /* @__PURE__ */ U(ue, {
|
|
682
682
|
size: c,
|
|
683
683
|
"aria-hidden": !0
|
|
684
684
|
}),
|
|
685
685
|
onClick: D ? () => {
|
|
686
|
-
|
|
686
|
+
ne(!0), k(!1);
|
|
687
687
|
} : () => void 0,
|
|
688
|
-
...D ? { iconAfter: /* @__PURE__ */
|
|
688
|
+
...D ? { iconAfter: /* @__PURE__ */ U(M, {
|
|
689
689
|
size: c,
|
|
690
690
|
stroke: 1.5,
|
|
691
|
-
style:
|
|
692
|
-
className: o("rtl:scale-x-[-1]",
|
|
691
|
+
style: P,
|
|
692
|
+
className: o("rtl:scale-x-[-1]", Ue.chevronIcon),
|
|
693
693
|
"aria-hidden": !0
|
|
694
|
-
}) } : { children:
|
|
694
|
+
}) } : { children: fe }
|
|
695
695
|
}] : [],
|
|
696
696
|
...C == null ? [] : [{
|
|
697
697
|
key: "prompts",
|
|
698
698
|
label: w,
|
|
699
|
-
icon: /* @__PURE__ */
|
|
699
|
+
icon: /* @__PURE__ */ U(ce, {
|
|
700
700
|
size: c,
|
|
701
701
|
"aria-hidden": !0
|
|
702
702
|
}),
|
|
703
703
|
onClick: D ? () => {
|
|
704
|
-
|
|
704
|
+
ie(!0), k(!1);
|
|
705
705
|
} : () => void 0,
|
|
706
|
-
...D ? { iconAfter: /* @__PURE__ */
|
|
706
|
+
...D ? { iconAfter: /* @__PURE__ */ U(M, {
|
|
707
707
|
size: c,
|
|
708
708
|
stroke: 1.5,
|
|
709
|
-
style:
|
|
710
|
-
className: o("rtl:scale-x-[-1]",
|
|
709
|
+
style: P,
|
|
710
|
+
className: o("rtl:scale-x-[-1]", Ue.chevronIcon),
|
|
711
711
|
"aria-hidden": !0
|
|
712
712
|
}) } : {
|
|
713
713
|
children: [{
|
|
714
714
|
key: "prompts-panel",
|
|
715
715
|
label: ""
|
|
716
716
|
}],
|
|
717
|
-
renderSubMenu: () => C(() =>
|
|
717
|
+
renderSubMenu: () => C(() => N(!1))
|
|
718
718
|
}
|
|
719
719
|
}],
|
|
720
720
|
..._ == null ? [] : [{
|
|
721
721
|
key: "chat-settings",
|
|
722
722
|
label: _.menuItemLabel ?? "Chat settings",
|
|
723
|
-
icon: /* @__PURE__ */
|
|
723
|
+
icon: /* @__PURE__ */ U(le, {
|
|
724
724
|
size: c,
|
|
725
725
|
"aria-hidden": !0
|
|
726
726
|
}),
|
|
727
|
-
iconAfter: D ? /* @__PURE__ */
|
|
727
|
+
iconAfter: D ? /* @__PURE__ */ U(M, {
|
|
728
728
|
size: c,
|
|
729
729
|
stroke: 1.5,
|
|
730
|
-
style:
|
|
731
|
-
className: o("rtl:scale-x-[-1]",
|
|
730
|
+
style: P,
|
|
731
|
+
className: o("rtl:scale-x-[-1]", Ue.chevronIcon),
|
|
732
732
|
"aria-hidden": !0
|
|
733
733
|
}) : null,
|
|
734
|
-
onClick: () =>
|
|
734
|
+
onClick: () => A(!0)
|
|
735
735
|
}]
|
|
736
736
|
], [
|
|
737
737
|
t,
|
|
@@ -739,23 +739,23 @@ var We = {
|
|
|
739
739
|
_,
|
|
740
740
|
v,
|
|
741
741
|
D,
|
|
742
|
-
|
|
742
|
+
de,
|
|
743
743
|
x,
|
|
744
|
-
|
|
744
|
+
fe,
|
|
745
745
|
C,
|
|
746
746
|
w,
|
|
747
|
-
|
|
747
|
+
P
|
|
748
748
|
]);
|
|
749
|
-
if (
|
|
750
|
-
let
|
|
749
|
+
if (F.length === 0) return null;
|
|
750
|
+
let I = /* @__PURE__ */ U(p, {
|
|
751
751
|
matchReferenceWidth: !1,
|
|
752
752
|
placement: "bottom-start",
|
|
753
753
|
listClassName: f,
|
|
754
|
-
items:
|
|
755
|
-
open: C == null ? void 0 :
|
|
756
|
-
onOpenChange: C == null ? void 0 :
|
|
757
|
-
children: /* @__PURE__ */
|
|
758
|
-
icon: /* @__PURE__ */
|
|
754
|
+
items: F,
|
|
755
|
+
open: C == null ? void 0 : ae,
|
|
756
|
+
onOpenChange: C == null ? void 0 : N,
|
|
757
|
+
children: /* @__PURE__ */ U(g, {
|
|
758
|
+
icon: /* @__PURE__ */ U(se, {
|
|
759
759
|
size: d.LG,
|
|
760
760
|
"aria-hidden": !0
|
|
761
761
|
}),
|
|
@@ -764,9 +764,9 @@ var We = {
|
|
|
764
764
|
disabled: h
|
|
765
765
|
})
|
|
766
766
|
});
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
icon: /* @__PURE__ */
|
|
767
|
+
return /* @__PURE__ */ U(H, { children: D ? /* @__PURE__ */ W(H, { children: [
|
|
768
|
+
/* @__PURE__ */ U(g, {
|
|
769
|
+
icon: /* @__PURE__ */ U(se, {
|
|
770
770
|
size: d.LG,
|
|
771
771
|
"aria-hidden": !0
|
|
772
772
|
}),
|
|
@@ -776,48 +776,48 @@ var We = {
|
|
|
776
776
|
disabled: h,
|
|
777
777
|
onClick: () => k(!0)
|
|
778
778
|
}),
|
|
779
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ U(Pe, {
|
|
780
780
|
isOpen: O,
|
|
781
781
|
title: r,
|
|
782
782
|
closeLabel: l,
|
|
783
783
|
onClose: () => k(!1),
|
|
784
784
|
style: u,
|
|
785
|
-
items:
|
|
785
|
+
items: F,
|
|
786
786
|
className: "pb-4",
|
|
787
787
|
btnTextClassName: "flex-1"
|
|
788
788
|
}),
|
|
789
|
-
|
|
790
|
-
isOpen:
|
|
789
|
+
de && /* @__PURE__ */ U(He, {
|
|
790
|
+
isOpen: te,
|
|
791
791
|
onBack: () => {
|
|
792
|
-
|
|
792
|
+
ne(!1), k(!0);
|
|
793
793
|
},
|
|
794
794
|
backLabel: S,
|
|
795
|
-
onClose: () =>
|
|
795
|
+
onClose: () => ne(!1),
|
|
796
796
|
closeLabel: l,
|
|
797
797
|
style: u,
|
|
798
798
|
title: x,
|
|
799
799
|
items: y,
|
|
800
800
|
onToolToggle: b
|
|
801
801
|
}),
|
|
802
|
-
C != null && /* @__PURE__ */ G
|
|
803
|
-
isOpen:
|
|
802
|
+
C != null && /* @__PURE__ */ U(G, {
|
|
803
|
+
isOpen: re,
|
|
804
804
|
title: w,
|
|
805
805
|
closeLabel: l,
|
|
806
806
|
onBack: () => {
|
|
807
|
-
|
|
807
|
+
ie(!1), k(!0);
|
|
808
808
|
},
|
|
809
809
|
backLabel: T,
|
|
810
|
-
onClose: () =>
|
|
810
|
+
onClose: () => ie(!1),
|
|
811
811
|
style: u,
|
|
812
|
-
children: C(() =>
|
|
812
|
+
children: C(() => ie(!1))
|
|
813
813
|
}),
|
|
814
|
-
_ != null && /* @__PURE__ */
|
|
815
|
-
isOpen:
|
|
814
|
+
_ != null && /* @__PURE__ */ U(Re, {
|
|
815
|
+
isOpen: ee,
|
|
816
816
|
onBack: () => {
|
|
817
|
-
|
|
817
|
+
A(!1), k(!0);
|
|
818
818
|
},
|
|
819
819
|
backLabel: _.backLabel ?? "Back",
|
|
820
|
-
onClose: () =>
|
|
820
|
+
onClose: () => A(!1),
|
|
821
821
|
closeLabel: l,
|
|
822
822
|
style: u,
|
|
823
823
|
features: _.features,
|
|
@@ -838,13 +838,13 @@ var We = {
|
|
|
838
838
|
saveLabel: _.saveLabel,
|
|
839
839
|
saveDisabledTooltip: _.saveDisabledTooltip
|
|
840
840
|
})
|
|
841
|
-
] }) : /* @__PURE__ */
|
|
841
|
+
] }) : /* @__PURE__ */ W(H, { children: [I, _ != null && ee && /* @__PURE__ */ U(Be, {
|
|
842
842
|
features: _.features,
|
|
843
843
|
initialResponseFormat: _.responseFormat ?? i.Markdown,
|
|
844
844
|
initialSystemPrompt: _.systemPrompt,
|
|
845
845
|
initialTemperature: _.temperature,
|
|
846
846
|
onSave: _.onSave,
|
|
847
|
-
onClose: () =>
|
|
847
|
+
onClose: () => A(!1),
|
|
848
848
|
title: _.title,
|
|
849
849
|
responseFormatLabel: _.responseFormatLabel,
|
|
850
850
|
responseFormatHint: _.responseFormatHint,
|
|
@@ -858,13 +858,13 @@ var We = {
|
|
|
858
858
|
saveLabel: _.saveLabel,
|
|
859
859
|
saveDisabledTooltip: _.saveDisabledTooltip
|
|
860
860
|
})] }) });
|
|
861
|
-
},
|
|
861
|
+
}, K = {
|
|
862
862
|
chip: "_chip_ydmd8_1",
|
|
863
863
|
chipSelected: "_chipSelected_ydmd8_9",
|
|
864
864
|
chipIcon: "_chipIcon_ydmd8_16",
|
|
865
865
|
chipText: "_chipText_ydmd8_19",
|
|
866
866
|
chipClose: "_chipClose_ydmd8_22"
|
|
867
|
-
},
|
|
867
|
+
}, Ge = (e) => `Remove ${e}`, Ke = ({ items: e, onToolToggle: t, onToolDismiss: n, removeLabel: r = Ge, typography: i, colors: s }) => e.length === 0 ? null : /* @__PURE__ */ U("div", {
|
|
868
868
|
className: "flex flex-wrap items-center gap-2",
|
|
869
869
|
style: a({
|
|
870
870
|
"--ci-chip-bg": s?.chipBg,
|
|
@@ -879,67 +879,67 @@ var We = {
|
|
|
879
879
|
"--ci-chip-close": s?.chipClose,
|
|
880
880
|
"--ci-chip-close-hover": s?.chipCloseHover
|
|
881
881
|
}),
|
|
882
|
-
children: e.map((e) => /* @__PURE__ */
|
|
883
|
-
className: o(
|
|
884
|
-
children: [/* @__PURE__ */
|
|
882
|
+
children: e.map((e) => /* @__PURE__ */ W("div", {
|
|
883
|
+
className: o(K.chip, e.isSelected && K.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 pe-1 ps-2 transition-colors"),
|
|
884
|
+
children: [/* @__PURE__ */ W("button", {
|
|
885
885
|
type: "button",
|
|
886
886
|
onClick: () => t(e.id),
|
|
887
887
|
"aria-pressed": e.isSelected,
|
|
888
888
|
className: "flex min-w-0 items-center gap-1.5",
|
|
889
|
-
children: [/* @__PURE__ */
|
|
890
|
-
className: o(
|
|
889
|
+
children: [/* @__PURE__ */ U("span", {
|
|
890
|
+
className: o(K.chipIcon, "shrink-0"),
|
|
891
891
|
"aria-hidden": !0,
|
|
892
892
|
children: e.icon
|
|
893
|
-
}), /* @__PURE__ */
|
|
894
|
-
className: o(
|
|
893
|
+
}), /* @__PURE__ */ U("span", {
|
|
894
|
+
className: o(K.chipText, i?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
895
895
|
children: e.label
|
|
896
896
|
})]
|
|
897
|
-
}), /* @__PURE__ */
|
|
897
|
+
}), /* @__PURE__ */ U("button", {
|
|
898
898
|
type: "button",
|
|
899
899
|
onClick: () => n(e.id),
|
|
900
900
|
"aria-label": r(e.label),
|
|
901
|
-
className: o(
|
|
902
|
-
children: /* @__PURE__ */
|
|
901
|
+
className: o(K.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
902
|
+
children: /* @__PURE__ */ U(de, {
|
|
903
903
|
size: 12,
|
|
904
904
|
"aria-hidden": !0
|
|
905
905
|
})
|
|
906
906
|
})]
|
|
907
907
|
}, e.id))
|
|
908
|
-
}),
|
|
908
|
+
}), q = {
|
|
909
909
|
wrapper: "_wrapper_10e5r_1",
|
|
910
910
|
wrapperDisabled: "_wrapperDisabled_10e5r_8",
|
|
911
911
|
textarea: "_textarea_10e5r_13",
|
|
912
912
|
modelSelectorButton: "_modelSelectorButton_10e5r_24",
|
|
913
913
|
modelSelectorCaret: "_modelSelectorCaret_10e5r_24",
|
|
914
914
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_10e5r_33"
|
|
915
|
-
},
|
|
915
|
+
}, qe = {
|
|
916
916
|
wrapperError: "_wrapperError_129ri_1",
|
|
917
917
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
918
918
|
recordingDot: "_recordingDot_129ri_19",
|
|
919
919
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
920
|
-
},
|
|
921
|
-
let u =
|
|
920
|
+
}, Je = 3, Ye = 4, J = 200, Xe = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
|
|
921
|
+
let u = B(null), f = B(new Float32Array(J)), p = B(0), m = B(0), _ = e === Oe.Recording, v = e === Oe.Error, y = L((e) => {
|
|
922
922
|
let t = e.getContext("2d");
|
|
923
923
|
if (!t) return;
|
|
924
924
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
925
925
|
let { width: n, height: r } = e;
|
|
926
926
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
927
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
927
|
+
let i = Math.min(Math.max(1, Math.floor(n / Ye)), J - 1), a = p.current, o = m.current;
|
|
928
928
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
929
929
|
for (let e = 0; e <= i; e++) {
|
|
930
|
-
let n = ((a - i + e) %
|
|
931
|
-
t.fillRect(e *
|
|
930
|
+
let n = ((a - i + e) % J + J) % J, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
931
|
+
t.fillRect(e * Ye, (r - c) / 2, Je, c);
|
|
932
932
|
}
|
|
933
933
|
t.restore();
|
|
934
934
|
}, []);
|
|
935
|
-
|
|
935
|
+
R(() => {
|
|
936
936
|
if (!_) return;
|
|
937
937
|
let e = u.current;
|
|
938
938
|
if (!e) return;
|
|
939
939
|
f.current.fill(0), p.current = 0, m.current = 0;
|
|
940
940
|
let n, r = () => {
|
|
941
|
-
if (m.current += 1, m.current >=
|
|
942
|
-
m.current -=
|
|
941
|
+
if (m.current += 1, m.current >= Ye) {
|
|
942
|
+
m.current -= Ye;
|
|
943
943
|
let e = t.current;
|
|
944
944
|
if (e) {
|
|
945
945
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -949,7 +949,7 @@ var We = {
|
|
|
949
949
|
let r = (t[e] - 128) / 128;
|
|
950
950
|
n += r * r;
|
|
951
951
|
}
|
|
952
|
-
f.current[p.current %
|
|
952
|
+
f.current[p.current % J] = Math.sqrt(n / t.length), p.current++;
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
y(e), n = requestAnimationFrame(r);
|
|
@@ -961,7 +961,7 @@ var We = {
|
|
|
961
961
|
_,
|
|
962
962
|
t,
|
|
963
963
|
y
|
|
964
|
-
]),
|
|
964
|
+
]), R(() => {
|
|
965
965
|
let e = u.current;
|
|
966
966
|
if (!e) return;
|
|
967
967
|
let t = new ResizeObserver(() => {
|
|
@@ -969,17 +969,17 @@ var We = {
|
|
|
969
969
|
});
|
|
970
970
|
return t.observe(e), () => t.disconnect();
|
|
971
971
|
}, [y]);
|
|
972
|
-
let b = /* @__PURE__ */
|
|
972
|
+
let b = /* @__PURE__ */ W("div", {
|
|
973
973
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
974
|
-
children: [/* @__PURE__ */
|
|
975
|
-
icon: /* @__PURE__ */
|
|
974
|
+
children: [/* @__PURE__ */ U(g, {
|
|
975
|
+
icon: /* @__PURE__ */ U(de, {
|
|
976
976
|
size: d.LG,
|
|
977
977
|
"aria-hidden": !0
|
|
978
978
|
}),
|
|
979
979
|
"aria-label": s,
|
|
980
980
|
onClick: i
|
|
981
|
-
}), _ && /* @__PURE__ */
|
|
982
|
-
icon: /* @__PURE__ */
|
|
981
|
+
}), _ && /* @__PURE__ */ U(S, {
|
|
982
|
+
icon: /* @__PURE__ */ U(N, {
|
|
983
983
|
size: d.LG,
|
|
984
984
|
"aria-hidden": !0
|
|
985
985
|
}),
|
|
@@ -987,78 +987,78 @@ var We = {
|
|
|
987
987
|
"aria-label": a
|
|
988
988
|
})]
|
|
989
989
|
});
|
|
990
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ W("div", {
|
|
991
991
|
className: l,
|
|
992
|
-
children: [/* @__PURE__ */
|
|
992
|
+
children: [/* @__PURE__ */ W("div", {
|
|
993
993
|
style: c,
|
|
994
|
-
className: o(
|
|
995
|
-
children: [/* @__PURE__ */
|
|
994
|
+
className: o(q.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", v && qe.wrapperError),
|
|
995
|
+
children: [/* @__PURE__ */ W("div", {
|
|
996
996
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
997
|
-
children: [_ && /* @__PURE__ */
|
|
998
|
-
className: o(
|
|
997
|
+
children: [_ && /* @__PURE__ */ U("span", {
|
|
998
|
+
className: o(qe.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
999
999
|
"aria-hidden": !0
|
|
1000
|
-
}), /* @__PURE__ */
|
|
1000
|
+
}), /* @__PURE__ */ U("canvas", {
|
|
1001
1001
|
ref: u,
|
|
1002
1002
|
height: 32,
|
|
1003
|
-
className: o(
|
|
1003
|
+
className: o(qe.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
1004
1004
|
})]
|
|
1005
1005
|
}), b]
|
|
1006
|
-
}), v && n && /* @__PURE__ */
|
|
1006
|
+
}), v && n && /* @__PURE__ */ U(h, {
|
|
1007
1007
|
text: n,
|
|
1008
1008
|
className: "mt-1 px-1"
|
|
1009
1009
|
})]
|
|
1010
1010
|
});
|
|
1011
|
-
},
|
|
1011
|
+
}, Ze = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(S, {
|
|
1012
1012
|
"aria-label": n,
|
|
1013
1013
|
onClick: () => e?.(),
|
|
1014
1014
|
disabled: t,
|
|
1015
1015
|
"aria-hidden": r,
|
|
1016
|
-
icon: /* @__PURE__ */
|
|
1016
|
+
icon: /* @__PURE__ */ U(ne, {
|
|
1017
1017
|
size: d.LG,
|
|
1018
1018
|
className: "rtl:scale-x-[-1]"
|
|
1019
1019
|
})
|
|
1020
|
-
}),
|
|
1021
|
-
icon: /* @__PURE__ */
|
|
1020
|
+
}), Qe = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(k, {
|
|
1021
|
+
icon: /* @__PURE__ */ U(P, { size: d.LG }),
|
|
1022
1022
|
onClick: () => e?.(),
|
|
1023
1023
|
"aria-label": t
|
|
1024
|
-
}),
|
|
1024
|
+
}), $e = ({ size: e = 20 }) => /* @__PURE__ */ U(E, {
|
|
1025
1025
|
variant: D.Circular,
|
|
1026
1026
|
width: e,
|
|
1027
1027
|
height: e,
|
|
1028
1028
|
active: !0
|
|
1029
|
-
}),
|
|
1029
|
+
}), et = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
|
|
1030
1030
|
className: "flex min-w-0 flex-1 items-center",
|
|
1031
|
-
children: [/* @__PURE__ */
|
|
1031
|
+
children: [/* @__PURE__ */ U(E, {
|
|
1032
1032
|
variant: D.Text,
|
|
1033
1033
|
width: "100%",
|
|
1034
1034
|
height: 16,
|
|
1035
1035
|
active: !0
|
|
1036
|
-
}), e && /* @__PURE__ */
|
|
1036
|
+
}), e && /* @__PURE__ */ U("span", {
|
|
1037
1037
|
className: "sr-only",
|
|
1038
1038
|
children: e
|
|
1039
1039
|
})]
|
|
1040
|
-
}),
|
|
1040
|
+
}), tt = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
|
|
1041
1041
|
role: "status",
|
|
1042
1042
|
"aria-label": e,
|
|
1043
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1043
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
|
|
1044
1044
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1045
1045
|
"aria-hidden": "true",
|
|
1046
|
-
children: [/* @__PURE__ */
|
|
1046
|
+
children: [/* @__PURE__ */ U($e, {}), /* @__PURE__ */ U(et, {})]
|
|
1047
1047
|
}, t))
|
|
1048
|
-
}),
|
|
1048
|
+
}), Y = (e) => e.displayName ?? e.id, X = (e, t) => {
|
|
1049
1049
|
let n = t.trim().toLowerCase();
|
|
1050
|
-
return n ? e.filter((e) =>
|
|
1051
|
-
},
|
|
1050
|
+
return n ? e.filter((e) => Y(e).toLowerCase().includes(n)) : e;
|
|
1051
|
+
}, nt = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
|
|
1052
1052
|
src: e,
|
|
1053
1053
|
size: i,
|
|
1054
1054
|
labels: { tooltip: a },
|
|
1055
1055
|
initialsName: r
|
|
1056
|
-
}),
|
|
1056
|
+
}), rt = {
|
|
1057
1057
|
searchHeader: "_searchHeader_1tt5t_1",
|
|
1058
1058
|
selectedItem: "_selectedItem_1tt5t_5",
|
|
1059
1059
|
selectedItemCheck: "_selectedItemCheck_1tt5t_9"
|
|
1060
|
-
},
|
|
1061
|
-
let [u, f] =
|
|
1060
|
+
}, it = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = rt.searchHeader, selectedItemClassName: s = rt.selectedItem, selectedItemCheckClassName: c = rt.selectedItemCheck, colors: l }) => {
|
|
1061
|
+
let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = !h && !p && !!t, v = z(() => h ? /* @__PURE__ */ U($e, { size: d.LG }) : nt(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG, g ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1062
1062
|
h,
|
|
1063
1063
|
p,
|
|
1064
1064
|
g,
|
|
@@ -1068,11 +1068,11 @@ var We = {
|
|
|
1068
1068
|
selectorIcon: v,
|
|
1069
1069
|
selectorAriaLabel: y ? `${r?.ariaLabel ?? "Select model"}: ${y}` : r?.ariaLabel ?? "Select model",
|
|
1070
1070
|
selectedLabel: y,
|
|
1071
|
-
menuItems:
|
|
1071
|
+
menuItems: z(() => {
|
|
1072
1072
|
if (h) return Array.from({ length: 7 }, (e, t) => ({
|
|
1073
1073
|
key: `__loading-${t}`,
|
|
1074
|
-
icon: /* @__PURE__ */
|
|
1075
|
-
label: /* @__PURE__ */
|
|
1074
|
+
icon: /* @__PURE__ */ U($e, {}),
|
|
1075
|
+
label: /* @__PURE__ */ U(et, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1076
1076
|
disabled: !0
|
|
1077
1077
|
}));
|
|
1078
1078
|
if (!e || e.length === 0) {
|
|
@@ -1083,25 +1083,25 @@ var We = {
|
|
|
1083
1083
|
disabled: !0
|
|
1084
1084
|
}] : [];
|
|
1085
1085
|
}
|
|
1086
|
-
return
|
|
1086
|
+
return X(e, u).map((e) => {
|
|
1087
1087
|
let r = e.id === t;
|
|
1088
1088
|
return {
|
|
1089
1089
|
key: e.id,
|
|
1090
|
-
label: /* @__PURE__ */
|
|
1090
|
+
label: /* @__PURE__ */ W("span", {
|
|
1091
1091
|
className: "flex w-full items-center justify-between gap-2",
|
|
1092
1092
|
style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
|
|
1093
|
-
children: [/* @__PURE__ */
|
|
1094
|
-
text:
|
|
1093
|
+
children: [/* @__PURE__ */ U(_, {
|
|
1094
|
+
text: Y(e),
|
|
1095
1095
|
query: u,
|
|
1096
1096
|
maxLines: 1
|
|
1097
|
-
}), r && /* @__PURE__ */
|
|
1097
|
+
}), r && /* @__PURE__ */ U(j, {
|
|
1098
1098
|
size: d.SM,
|
|
1099
1099
|
stroke: 2,
|
|
1100
1100
|
className: c,
|
|
1101
1101
|
"aria-hidden": !0
|
|
1102
1102
|
})]
|
|
1103
1103
|
}),
|
|
1104
|
-
icon:
|
|
1104
|
+
icon: nt(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1105
1105
|
onClick: () => n?.(e.id),
|
|
1106
1106
|
className: r ? s : void 0
|
|
1107
1107
|
};
|
|
@@ -1117,10 +1117,10 @@ var We = {
|
|
|
1117
1117
|
c,
|
|
1118
1118
|
l?.selectedItemCheck
|
|
1119
1119
|
]),
|
|
1120
|
-
menuHeader:
|
|
1120
|
+
menuHeader: z(() => !h && e && e.length > 0 ? /* @__PURE__ */ U("div", {
|
|
1121
1121
|
style: a({ "--ms-search-header-bg": l?.searchHeaderBackground }),
|
|
1122
1122
|
className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1123
|
+
children: /* @__PURE__ */ U(T, {
|
|
1124
1124
|
value: u,
|
|
1125
1125
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1126
1126
|
size: m.Small,
|
|
@@ -1139,8 +1139,8 @@ var We = {
|
|
|
1139
1139
|
e || f("");
|
|
1140
1140
|
}
|
|
1141
1141
|
};
|
|
1142
|
-
},
|
|
1143
|
-
function
|
|
1142
|
+
}, Z = typeof window < "u" ? me : R;
|
|
1143
|
+
function at(e) {
|
|
1144
1144
|
if (e !== void 0) switch (typeof e) {
|
|
1145
1145
|
case "number": return e;
|
|
1146
1146
|
case "string":
|
|
@@ -1148,15 +1148,15 @@ function ut(e) {
|
|
|
1148
1148
|
break;
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1152
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1153
|
-
styleHeight:
|
|
1154
|
-
styleWidth:
|
|
1155
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1151
|
+
function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1152
|
+
let { styleHeight: s, styleWidth: c } = z(() => ({
|
|
1153
|
+
styleHeight: at(o?.height),
|
|
1154
|
+
styleWidth: at(o?.width)
|
|
1155
|
+
}), [o?.height, o?.width]), [l, u] = V({
|
|
1156
1156
|
height: t,
|
|
1157
1157
|
width: n
|
|
1158
1158
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1159
|
-
return
|
|
1159
|
+
return Z(() => {
|
|
1160
1160
|
if (i === null || d) return;
|
|
1161
1161
|
let t = new ResizeObserver((e) => {
|
|
1162
1162
|
for (let t of e) {
|
|
@@ -1176,7 +1176,7 @@ function dt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1176
1176
|
i,
|
|
1177
1177
|
s,
|
|
1178
1178
|
c
|
|
1179
|
-
]),
|
|
1179
|
+
]), z(() => ({
|
|
1180
1180
|
height: s ?? l.height,
|
|
1181
1181
|
width: c ?? l.width
|
|
1182
1182
|
}), [
|
|
@@ -1185,26 +1185,26 @@ function dt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1185
1185
|
c
|
|
1186
1186
|
]);
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1189
|
-
let t =
|
|
1188
|
+
function st(e) {
|
|
1189
|
+
let t = B(() => {
|
|
1190
1190
|
throw Error("Cannot call during render.");
|
|
1191
1191
|
});
|
|
1192
|
-
return
|
|
1192
|
+
return Z(() => {
|
|
1193
1193
|
t.current = e;
|
|
1194
|
-
}, [e]),
|
|
1194
|
+
}, [e]), L((e) => t.current?.(e), [t]);
|
|
1195
1195
|
}
|
|
1196
|
-
var
|
|
1197
|
-
function
|
|
1198
|
-
if (
|
|
1196
|
+
var ct = null;
|
|
1197
|
+
function lt(e = !1) {
|
|
1198
|
+
if (ct === null || e) {
|
|
1199
1199
|
let e = document.createElement("div"), t = e.style;
|
|
1200
1200
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1201
1201
|
let n = document.createElement("div"), r = n.style;
|
|
1202
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1202
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? ct = "positive-descending" : (e.scrollLeft = 1, ct = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), ct;
|
|
1203
1203
|
}
|
|
1204
|
-
return
|
|
1204
|
+
return ct;
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1207
|
-
if (t === "horizontal" && n) switch (
|
|
1206
|
+
function ut({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1207
|
+
if (t === "horizontal" && n) switch (lt()) {
|
|
1208
1208
|
case "negative": return -r;
|
|
1209
1209
|
case "positive-descending":
|
|
1210
1210
|
if (e) {
|
|
@@ -1218,13 +1218,13 @@ function ht({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1218
1218
|
function Q(e, t = "Assertion error") {
|
|
1219
1219
|
if (!e) throw console.error(t), Error(t);
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function dt(e, t) {
|
|
1222
1222
|
if (e === t) return !0;
|
|
1223
1223
|
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1224
1224
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1225
1225
|
return !0;
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function ft({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1228
1228
|
if (t === 0) return 0;
|
|
1229
1229
|
if (typeof n == "number") return t * n;
|
|
1230
1230
|
{
|
|
@@ -1232,9 +1232,9 @@ function _t({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
1232
1232
|
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function pt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1236
1236
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1237
|
-
let s =
|
|
1237
|
+
let s = ft({
|
|
1238
1238
|
cachedBounds: t,
|
|
1239
1239
|
itemCount: r,
|
|
1240
1240
|
itemSize: i
|
|
@@ -1246,7 +1246,7 @@ function vt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1246
1246
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function mt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1250
1250
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1251
1251
|
for (; u < a;) {
|
|
1252
1252
|
let n = e.get(u);
|
|
@@ -1265,7 +1265,7 @@ function yt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1265
1265
|
stopIndexOverscan: l
|
|
1266
1266
|
};
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function ht({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1269
1269
|
let r = /* @__PURE__ */ new Map();
|
|
1270
1270
|
return {
|
|
1271
1271
|
get(i) {
|
|
@@ -1302,8 +1302,8 @@ function bt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1302
1302
|
}
|
|
1303
1303
|
};
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1306
|
-
return
|
|
1305
|
+
function gt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1306
|
+
return z(() => ht({
|
|
1307
1307
|
itemCount: e,
|
|
1308
1308
|
itemProps: t,
|
|
1309
1309
|
itemSize: n
|
|
@@ -1313,7 +1313,7 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1313
1313
|
n
|
|
1314
1314
|
]);
|
|
1315
1315
|
}
|
|
1316
|
-
function
|
|
1316
|
+
function _t({ containerSize: e, itemSize: t }) {
|
|
1317
1317
|
let n;
|
|
1318
1318
|
switch (typeof t) {
|
|
1319
1319
|
case "string":
|
|
@@ -1325,21 +1325,21 @@ function St({ containerSize: e, itemSize: t }) {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
return n;
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1329
|
-
let { height: u = n, width: d = n } =
|
|
1328
|
+
function vt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1329
|
+
let { height: u = n, width: d = n } = ot({
|
|
1330
1330
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1331
1331
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1332
1332
|
element: e,
|
|
1333
1333
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1334
1334
|
style: t
|
|
1335
|
-
}), f =
|
|
1335
|
+
}), f = B({
|
|
1336
1336
|
height: 0,
|
|
1337
1337
|
width: 0
|
|
1338
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1338
|
+
}), p = r === "vertical" ? u : d, m = _t({
|
|
1339
1339
|
containerSize: p,
|
|
1340
1340
|
itemSize: s
|
|
1341
1341
|
});
|
|
1342
|
-
|
|
1342
|
+
me(() => {
|
|
1343
1343
|
if (typeof c == "function") {
|
|
1344
1344
|
let e = f.current;
|
|
1345
1345
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1352,11 +1352,11 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1352
1352
|
c,
|
|
1353
1353
|
d
|
|
1354
1354
|
]);
|
|
1355
|
-
let h =
|
|
1355
|
+
let h = gt({
|
|
1356
1356
|
itemCount: a,
|
|
1357
1357
|
itemProps: o,
|
|
1358
1358
|
itemSize: m
|
|
1359
|
-
}), g =
|
|
1359
|
+
}), g = L((e) => h.get(e), [h]), [_, v] = V(() => mt({
|
|
1360
1360
|
cachedBounds: h,
|
|
1361
1361
|
containerScrollOffset: 0,
|
|
1362
1362
|
containerSize: p,
|
|
@@ -1367,7 +1367,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1367
1367
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1368
1368
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1369
1369
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1370
|
-
}, C =
|
|
1370
|
+
}, C = L(() => ft({
|
|
1371
1371
|
cachedBounds: h,
|
|
1372
1372
|
itemCount: a,
|
|
1373
1373
|
itemSize: m
|
|
@@ -1375,9 +1375,9 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1375
1375
|
h,
|
|
1376
1376
|
a,
|
|
1377
1377
|
m
|
|
1378
|
-
]), w =
|
|
1378
|
+
]), w = L((t) => mt({
|
|
1379
1379
|
cachedBounds: h,
|
|
1380
|
-
containerScrollOffset:
|
|
1380
|
+
containerScrollOffset: ut({
|
|
1381
1381
|
containerElement: e,
|
|
1382
1382
|
direction: r,
|
|
1383
1383
|
isRtl: i,
|
|
@@ -1395,19 +1395,19 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1395
1395
|
a,
|
|
1396
1396
|
l
|
|
1397
1397
|
]);
|
|
1398
|
-
return
|
|
1398
|
+
return Z(() => {
|
|
1399
1399
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1400
1400
|
}, [
|
|
1401
1401
|
e,
|
|
1402
1402
|
r,
|
|
1403
1403
|
w
|
|
1404
|
-
]),
|
|
1404
|
+
]), Z(() => {
|
|
1405
1405
|
if (!e) return;
|
|
1406
1406
|
let t = () => {
|
|
1407
1407
|
v((t) => {
|
|
1408
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1408
|
+
let { scrollLeft: n, scrollTop: o } = e, s = mt({
|
|
1409
1409
|
cachedBounds: h,
|
|
1410
|
-
containerScrollOffset:
|
|
1410
|
+
containerScrollOffset: ut({
|
|
1411
1411
|
containerElement: e,
|
|
1412
1412
|
direction: r,
|
|
1413
1413
|
isRtl: i,
|
|
@@ -1417,7 +1417,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1417
1417
|
itemCount: a,
|
|
1418
1418
|
overscanCount: l
|
|
1419
1419
|
});
|
|
1420
|
-
return
|
|
1420
|
+
return dt(s, t) ? t : s;
|
|
1421
1421
|
});
|
|
1422
1422
|
};
|
|
1423
1423
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1433,8 +1433,8 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1433
1433
|
]), {
|
|
1434
1434
|
getCellBounds: g,
|
|
1435
1435
|
getEstimatedSize: C,
|
|
1436
|
-
scrollToIndex:
|
|
1437
|
-
let s =
|
|
1436
|
+
scrollToIndex: st(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1437
|
+
let s = pt({
|
|
1438
1438
|
align: t,
|
|
1439
1439
|
cachedBounds: h,
|
|
1440
1440
|
containerScrollOffset: n,
|
|
@@ -1444,14 +1444,14 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1444
1444
|
itemSize: m
|
|
1445
1445
|
});
|
|
1446
1446
|
if (e) {
|
|
1447
|
-
if (s =
|
|
1447
|
+
if (s = ut({
|
|
1448
1448
|
containerElement: e,
|
|
1449
1449
|
direction: r,
|
|
1450
1450
|
isRtl: i,
|
|
1451
1451
|
scrollOffset: s
|
|
1452
1452
|
}), typeof e.scrollTo != "function") {
|
|
1453
1453
|
let e = w(s);
|
|
1454
|
-
|
|
1454
|
+
dt(_, e) || v(e);
|
|
1455
1455
|
}
|
|
1456
1456
|
return s;
|
|
1457
1457
|
}
|
|
@@ -1462,30 +1462,30 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1462
1462
|
stopIndexVisible: x
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1466
|
-
return
|
|
1465
|
+
function yt(e) {
|
|
1466
|
+
return z(() => e, Object.values(e));
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function bt(e, t) {
|
|
1469
1469
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1470
|
-
return
|
|
1470
|
+
return dt(n, a) && dt(r, o) && dt(i, s);
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function xt(e) {
|
|
1473
1473
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1474
1474
|
}
|
|
1475
|
-
var
|
|
1476
|
-
function
|
|
1477
|
-
let m =
|
|
1475
|
+
var St = "data-react-window-index";
|
|
1476
|
+
function Ct({ 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 }) {
|
|
1477
|
+
let m = yt(u), h = z(() => I(s, bt), [s]), [g, _] = V(null), v = xt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = vt({
|
|
1478
1478
|
containerElement: g,
|
|
1479
1479
|
containerStyle: f,
|
|
1480
1480
|
defaultContainerSize: n,
|
|
1481
1481
|
direction: "vertical",
|
|
1482
1482
|
itemCount: c,
|
|
1483
1483
|
itemProps: m,
|
|
1484
|
-
itemSize:
|
|
1484
|
+
itemSize: z(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1485
1485
|
onResize: i,
|
|
1486
1486
|
overscanCount: o
|
|
1487
1487
|
});
|
|
1488
|
-
|
|
1488
|
+
pe(r, () => ({
|
|
1489
1489
|
get element() {
|
|
1490
1490
|
return g;
|
|
1491
1491
|
},
|
|
@@ -1500,12 +1500,12 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1500
1500
|
top: r
|
|
1501
1501
|
});
|
|
1502
1502
|
}
|
|
1503
|
-
}), [g, x]),
|
|
1503
|
+
}), [g, x]), Z(() => {
|
|
1504
1504
|
if (!g) return;
|
|
1505
1505
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1506
1506
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1507
1507
|
let n = `${S + t}`;
|
|
1508
|
-
return e.setAttribute(
|
|
1508
|
+
return e.setAttribute(St, n), !0;
|
|
1509
1509
|
});
|
|
1510
1510
|
if (v) return l.observeRowElements(e);
|
|
1511
1511
|
}, [
|
|
@@ -1514,7 +1514,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1514
1514
|
l,
|
|
1515
1515
|
S,
|
|
1516
1516
|
w
|
|
1517
|
-
]),
|
|
1517
|
+
]), R(() => {
|
|
1518
1518
|
S >= 0 && w >= 0 && a && a({
|
|
1519
1519
|
startIndex: C,
|
|
1520
1520
|
stopIndex: T
|
|
@@ -1529,11 +1529,11 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1529
1529
|
w,
|
|
1530
1530
|
T
|
|
1531
1531
|
]);
|
|
1532
|
-
let E =
|
|
1532
|
+
let E = z(() => {
|
|
1533
1533
|
let e = [];
|
|
1534
1534
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1535
1535
|
let n = y(t);
|
|
1536
|
-
e.push(/* @__PURE__ */
|
|
1536
|
+
e.push(/* @__PURE__ */ F(h, {
|
|
1537
1537
|
...m,
|
|
1538
1538
|
ariaAttributes: {
|
|
1539
1539
|
"aria-posinset": t + 1,
|
|
@@ -1560,7 +1560,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1560
1560
|
m,
|
|
1561
1561
|
S,
|
|
1562
1562
|
w
|
|
1563
|
-
]), D = /* @__PURE__ */
|
|
1563
|
+
]), D = /* @__PURE__ */ U("div", {
|
|
1564
1564
|
"aria-hidden": !0,
|
|
1565
1565
|
style: {
|
|
1566
1566
|
height: b(),
|
|
@@ -1568,7 +1568,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1568
1568
|
zIndex: -1
|
|
1569
1569
|
}
|
|
1570
1570
|
});
|
|
1571
|
-
return
|
|
1571
|
+
return F(d, {
|
|
1572
1572
|
role: "list",
|
|
1573
1573
|
...p,
|
|
1574
1574
|
className: t,
|
|
@@ -1582,46 +1582,46 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1582
1582
|
}
|
|
1583
1583
|
}, E, e, D);
|
|
1584
1584
|
}
|
|
1585
|
-
var
|
|
1585
|
+
var wt = {
|
|
1586
1586
|
divider: "_divider_1tiyp_1",
|
|
1587
1587
|
item: "_item_1tiyp_5",
|
|
1588
1588
|
itemIcon: "_itemIcon_1tiyp_15",
|
|
1589
1589
|
checkIcon: "_checkIcon_1tiyp_19",
|
|
1590
1590
|
stateLabel: "_stateLabel_1tiyp_23"
|
|
1591
|
-
},
|
|
1592
|
-
let u = r[e], f =
|
|
1593
|
-
return /* @__PURE__ */
|
|
1591
|
+
}, Tt = 44, Et = 8, Dt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1592
|
+
let u = r[e], f = nt(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
|
|
1593
|
+
return /* @__PURE__ */ U("div", {
|
|
1594
1594
|
style: t,
|
|
1595
1595
|
...n,
|
|
1596
|
-
children: /* @__PURE__ */
|
|
1596
|
+
children: /* @__PURE__ */ U(l, {
|
|
1597
1597
|
type: "button",
|
|
1598
|
-
className: o(
|
|
1599
|
-
iconBefore: /* @__PURE__ */
|
|
1600
|
-
className:
|
|
1598
|
+
className: o(wt.item, "h-full w-full gap-3 px-4"),
|
|
1599
|
+
iconBefore: /* @__PURE__ */ U("span", {
|
|
1600
|
+
className: wt.itemIcon,
|
|
1601
1601
|
children: f
|
|
1602
1602
|
}),
|
|
1603
|
-
label: /* @__PURE__ */
|
|
1603
|
+
label: /* @__PURE__ */ W("span", {
|
|
1604
1604
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1605
|
-
children: [/* @__PURE__ */
|
|
1605
|
+
children: [/* @__PURE__ */ U(_, {
|
|
1606
1606
|
text: u.displayName ?? u.id,
|
|
1607
1607
|
query: s,
|
|
1608
1608
|
maxLines: 1,
|
|
1609
1609
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1610
|
-
}), p && /* @__PURE__ */
|
|
1610
|
+
}), p && /* @__PURE__ */ U(j, {
|
|
1611
1611
|
size: d.SM,
|
|
1612
|
-
className:
|
|
1612
|
+
className: wt.checkIcon,
|
|
1613
1613
|
"aria-hidden": !0
|
|
1614
1614
|
})]
|
|
1615
1615
|
}),
|
|
1616
1616
|
onClick: () => c(u.id)
|
|
1617
1617
|
})
|
|
1618
1618
|
});
|
|
1619
|
-
},
|
|
1620
|
-
let [v, y] =
|
|
1621
|
-
|
|
1619
|
+
}, Ot = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
|
|
1620
|
+
let [v, y] = V("");
|
|
1621
|
+
R(() => {
|
|
1622
1622
|
e || y("");
|
|
1623
1623
|
}, [e]);
|
|
1624
|
-
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1624
|
+
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? X(s, v) : [], w = (e) => {
|
|
1625
1625
|
l(e), i();
|
|
1626
1626
|
}, E = a({
|
|
1627
1627
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1631,7 +1631,7 @@ var kt = {
|
|
|
1631
1631
|
"--ci-sheet-icon": _?.itemIcon,
|
|
1632
1632
|
"--ci-check-icon": _?.checkIcon
|
|
1633
1633
|
});
|
|
1634
|
-
return /* @__PURE__ */ G
|
|
1634
|
+
return /* @__PURE__ */ U(G, {
|
|
1635
1635
|
isOpen: e,
|
|
1636
1636
|
title: t,
|
|
1637
1637
|
closeLabel: n,
|
|
@@ -1640,28 +1640,28 @@ var kt = {
|
|
|
1640
1640
|
titleClassName: h,
|
|
1641
1641
|
className: "max-h-[80dvh]",
|
|
1642
1642
|
colors: _?.shell,
|
|
1643
|
-
children: /* @__PURE__ */
|
|
1643
|
+
children: /* @__PURE__ */ W("div", {
|
|
1644
1644
|
className: "contents",
|
|
1645
1645
|
style: E,
|
|
1646
|
-
children: [b && !x && /* @__PURE__ */
|
|
1646
|
+
children: [b && !x && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
1647
1647
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1648
|
-
children: /* @__PURE__ */
|
|
1648
|
+
children: /* @__PURE__ */ U(T, {
|
|
1649
1649
|
value: v,
|
|
1650
1650
|
placeholder: r,
|
|
1651
1651
|
size: m.Standard,
|
|
1652
1652
|
onChange: (e) => y(e ?? "")
|
|
1653
1653
|
})
|
|
1654
|
-
}), /* @__PURE__ */
|
|
1654
|
+
}), /* @__PURE__ */ U("div", { className: o(wt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ U(tt, { loadingLabel: u }) : S ? /* @__PURE__ */ U("div", {
|
|
1655
1655
|
role: "list",
|
|
1656
|
-
className: o(
|
|
1656
|
+
className: o(wt.stateLabel, g, "px-4 py-4"),
|
|
1657
1657
|
children: S
|
|
1658
|
-
}) : /* @__PURE__ */
|
|
1658
|
+
}) : /* @__PURE__ */ U(Ct, {
|
|
1659
1659
|
role: "list",
|
|
1660
1660
|
className: "overflow-y-auto",
|
|
1661
|
-
style: { height: Math.min(C.length,
|
|
1662
|
-
rowComponent:
|
|
1661
|
+
style: { height: Math.min(C.length, Et) * Tt },
|
|
1662
|
+
rowComponent: Dt,
|
|
1663
1663
|
rowCount: C.length,
|
|
1664
|
-
rowHeight:
|
|
1664
|
+
rowHeight: Tt,
|
|
1665
1665
|
rowProps: {
|
|
1666
1666
|
items: C,
|
|
1667
1667
|
selectedDeploymentId: c,
|
|
@@ -1672,23 +1672,23 @@ var kt = {
|
|
|
1672
1672
|
})]
|
|
1673
1673
|
})
|
|
1674
1674
|
});
|
|
1675
|
-
},
|
|
1676
|
-
let [v, y] =
|
|
1675
|
+
}, kt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: h, onPickerOpenChange: _ }) => {
|
|
1676
|
+
let [v, y] = V(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = it({
|
|
1677
1677
|
deployments: e,
|
|
1678
1678
|
selectedDeploymentId: t,
|
|
1679
1679
|
onDeploymentChange: n,
|
|
1680
1680
|
modelSelectorLabels: r
|
|
1681
1681
|
});
|
|
1682
1682
|
if (!e) return null;
|
|
1683
|
-
let E = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */
|
|
1683
|
+
let E = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ U(re, {
|
|
1684
1684
|
size: d.SM,
|
|
1685
|
-
className:
|
|
1685
|
+
className: q.modelSelectorCaret,
|
|
1686
1686
|
"aria-hidden": !0
|
|
1687
1687
|
});
|
|
1688
|
-
return a ? /* @__PURE__ */
|
|
1688
|
+
return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(A, {
|
|
1689
1689
|
tooltip: S,
|
|
1690
|
-
children: /* @__PURE__ */
|
|
1691
|
-
icon: /* @__PURE__ */
|
|
1690
|
+
children: /* @__PURE__ */ U(g, {
|
|
1691
|
+
icon: /* @__PURE__ */ W("div", {
|
|
1692
1692
|
className: "flex items-center gap-1",
|
|
1693
1693
|
children: [b, D]
|
|
1694
1694
|
}),
|
|
@@ -1696,16 +1696,16 @@ var kt = {
|
|
|
1696
1696
|
onClick: () => {
|
|
1697
1697
|
s || y(!0);
|
|
1698
1698
|
},
|
|
1699
|
-
className: o("w-[50px]",
|
|
1699
|
+
className: o("w-[50px]", q.modelSelectorButton, E)
|
|
1700
1700
|
})
|
|
1701
|
-
}), l ? /* @__PURE__ */ G
|
|
1701
|
+
}), l ? /* @__PURE__ */ U(G, {
|
|
1702
1702
|
isOpen: v,
|
|
1703
1703
|
title: r?.ariaLabel ?? "Select model",
|
|
1704
1704
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1705
1705
|
onClose: () => y(!1),
|
|
1706
1706
|
style: c,
|
|
1707
1707
|
children: l(() => y(!1))
|
|
1708
|
-
}) : /* @__PURE__ */
|
|
1708
|
+
}) : /* @__PURE__ */ U(Ot, {
|
|
1709
1709
|
isOpen: v,
|
|
1710
1710
|
title: r?.ariaLabel ?? "Select model",
|
|
1711
1711
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1718,7 +1718,7 @@ var kt = {
|
|
|
1718
1718
|
errorLabel: r?.error,
|
|
1719
1719
|
emptyLabel: r?.empty,
|
|
1720
1720
|
style: c
|
|
1721
|
-
})] }) : l ? /* @__PURE__ */
|
|
1721
|
+
})] }) : l ? /* @__PURE__ */ U(p, {
|
|
1722
1722
|
placement: "top-end",
|
|
1723
1723
|
matchReferenceWidth: !1,
|
|
1724
1724
|
open: u,
|
|
@@ -1727,25 +1727,25 @@ var kt = {
|
|
|
1727
1727
|
outsideClosable: !0,
|
|
1728
1728
|
renderOverlay: () => l(() => _?.(!1)),
|
|
1729
1729
|
listClassName: "!w-[368px] !bg-layer-raised",
|
|
1730
|
-
children: /* @__PURE__ */
|
|
1730
|
+
children: /* @__PURE__ */ U(A, {
|
|
1731
1731
|
tooltip: S,
|
|
1732
|
-
children: /* @__PURE__ */
|
|
1732
|
+
children: /* @__PURE__ */ W("button", {
|
|
1733
1733
|
type: "button",
|
|
1734
1734
|
"aria-label": x,
|
|
1735
1735
|
"aria-disabled": s || void 0,
|
|
1736
|
-
className: o("flex items-center justify-center gap-1 rounded-full p-2",
|
|
1736
|
+
className: o("flex items-center justify-center gap-1 rounded-full p-2", q.modelSelectorButton, E, s && q.modelSelectorButtonDisabled),
|
|
1737
1737
|
onClick: () => {
|
|
1738
1738
|
!i && !s && h?.();
|
|
1739
1739
|
},
|
|
1740
1740
|
children: [b, D]
|
|
1741
1741
|
})
|
|
1742
1742
|
})
|
|
1743
|
-
}) : /* @__PURE__ */
|
|
1743
|
+
}) : /* @__PURE__ */ U("div", {
|
|
1744
1744
|
className: o(s && E),
|
|
1745
1745
|
"aria-disabled": s || void 0,
|
|
1746
|
-
children: /* @__PURE__ */
|
|
1746
|
+
children: /* @__PURE__ */ U(A, {
|
|
1747
1747
|
tooltip: S,
|
|
1748
|
-
children: /* @__PURE__ */
|
|
1748
|
+
children: /* @__PURE__ */ U(f, {
|
|
1749
1749
|
icon: b,
|
|
1750
1750
|
ariaLabel: x,
|
|
1751
1751
|
items: C,
|
|
@@ -1757,12 +1757,12 @@ var kt = {
|
|
|
1757
1757
|
size: m.Standard,
|
|
1758
1758
|
caretIcon: D,
|
|
1759
1759
|
iconClassName: s ? E : void 0,
|
|
1760
|
-
buttonClassName: o("bg-transparent",
|
|
1760
|
+
buttonClassName: o("bg-transparent", q.modelSelectorButton, s && q.modelSelectorButtonDisabled)
|
|
1761
1761
|
})
|
|
1762
1762
|
})
|
|
1763
1763
|
});
|
|
1764
|
-
},
|
|
1765
|
-
let
|
|
1764
|
+
}, At = 160, jt = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: ee, pendingDropFiles: A = [], onDropFilesConsumed: te, pendingAttachments: ne = [], onPendingAttachmentsConsumed: j, pasteTextThreshold: re = 4e3, maxMessageLength: M = 5e4, deployments: oe, selectedDeploymentId: N, onDeploymentChange: P, modelSelectorLabels: se, initialAttachments: ce = [], isStacked: le = !1, hideAddButton: ue = !1, hideAttachFile: de = !1, hideActionBar: fe = !1, renderFooterActions: F, isInputDisabled: I = !1, isModelSelectorDisabled: pe = !1, isSendDisabled: me = !1, isAudioMessageSupported: ge = !1, sendOnEnter: _e = Me.Enter, prefixAttachments: ye = [], onRemovePrefixAttachment: be, chatSettings: G, toolsMenuItems: xe, onToolToggle: we, toolsMenuTitle: Te, toolsBackLabel: Oe, toolsChipLabels: ke, promptsMenuOverlay: Ae, promptsMenuTitle: Ne, promptsBackLabel: Pe, autoFocus: Fe = !1, messageHistory: Ie, onDialFileSystemClick: Le, dialFileSystemLabel: Re, validateAttachment: ze, onAttachmentClick: Be, modelPickerOverlay: Ve, maximumAttachmentsAmount: He, onAttachmentsLimitExceeded: Ue, isAttachmentsEnabled: K = !0, usageLimitsSlot: Ge, onMessageTooLong: qe }) => {
|
|
1765
|
+
let Je = s(), [Ye, J] = V(!1), $e = Ee(Ie), et = z(() => a({
|
|
1766
1766
|
"--ci-bg": D?.background,
|
|
1767
1767
|
"--ci-text": D?.text,
|
|
1768
1768
|
"--ci-border": D?.border,
|
|
@@ -1775,119 +1775,119 @@ var kt = {
|
|
|
1775
1775
|
"--ci-voice-error": D?.voiceError,
|
|
1776
1776
|
"--ci-voice-waveform": D?.voiceWaveform,
|
|
1777
1777
|
"--ci-voice-accent": D?.voiceAccent
|
|
1778
|
-
}), [D]),
|
|
1778
|
+
}), [D]), tt = z(() => Le ? [{
|
|
1779
1779
|
key: "dial-fs",
|
|
1780
|
-
label:
|
|
1781
|
-
icon: /* @__PURE__ */
|
|
1780
|
+
label: Re ?? "DIAL file system",
|
|
1781
|
+
icon: /* @__PURE__ */ U(ie, {
|
|
1782
1782
|
size: c,
|
|
1783
1783
|
"aria-hidden": !0
|
|
1784
1784
|
}),
|
|
1785
|
-
onClick:
|
|
1786
|
-
}] : [], [
|
|
1785
|
+
onClick: Le
|
|
1786
|
+
}] : [], [Le, Re]), { message: Y, setMessage: X, textareaRef: nt, isMultiLine: rt } = De({
|
|
1787
1787
|
messageProp: e,
|
|
1788
1788
|
messageRevision: t
|
|
1789
|
-
}), { attachments:
|
|
1790
|
-
initialAttachments:
|
|
1789
|
+
}), { attachments: it, buildAttachments: Z, addAttachments: at, resetAttachments: ot, handleRemove: st, handleRetry: ct, handleExpand: lt, hasBlockedAttachments: ut } = Se({
|
|
1790
|
+
initialAttachments: ce,
|
|
1791
1791
|
onUploadAttachment: r,
|
|
1792
1792
|
onAttachmentsChange: f,
|
|
1793
|
-
validateAttachment:
|
|
1794
|
-
pendingDropFiles:
|
|
1795
|
-
onDropFilesConsumed:
|
|
1796
|
-
pendingAttachments:
|
|
1797
|
-
onPendingAttachmentsConsumed:
|
|
1798
|
-
onExpandPastedText:
|
|
1799
|
-
|
|
1800
|
-
}, [
|
|
1801
|
-
maximumAttachmentsAmount:
|
|
1802
|
-
baseAttachmentsAmount:
|
|
1803
|
-
onAttachmentsLimitExceeded:
|
|
1804
|
-
}), { state:
|
|
1805
|
-
at(
|
|
1806
|
-
}, [at,
|
|
1807
|
-
if (!
|
|
1793
|
+
validateAttachment: ze,
|
|
1794
|
+
pendingDropFiles: A,
|
|
1795
|
+
onDropFilesConsumed: te,
|
|
1796
|
+
pendingAttachments: ne,
|
|
1797
|
+
onPendingAttachmentsConsumed: j,
|
|
1798
|
+
onExpandPastedText: L((e) => {
|
|
1799
|
+
X((t) => t ? `${t}\n${e}` : e);
|
|
1800
|
+
}, [X]),
|
|
1801
|
+
maximumAttachmentsAmount: He,
|
|
1802
|
+
baseAttachmentsAmount: ye.length,
|
|
1803
|
+
onAttachmentsLimitExceeded: Ue
|
|
1804
|
+
}), { state: Q, analyserNodeRef: dt, errorMessage: ft, startRecording: pt, stopRecording: mt, discardRecording: ht } = je({ onAttachAudio: L((e) => {
|
|
1805
|
+
at(Z([e]));
|
|
1806
|
+
}, [at, Z]) }), gt = B(null), _t = B(null), { handlePaste: vt } = ve(at, K ? re : Infinity), yt = L((e) => {
|
|
1807
|
+
if (!K) {
|
|
1808
1808
|
let t = e.clipboardData.getData("text/plain");
|
|
1809
|
-
t.length >=
|
|
1809
|
+
t.length >= M && qe?.(t.length, M);
|
|
1810
1810
|
}
|
|
1811
1811
|
vt(e);
|
|
1812
1812
|
}, [
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1813
|
+
K,
|
|
1814
|
+
M,
|
|
1815
|
+
qe,
|
|
1816
1816
|
vt
|
|
1817
|
-
]), bt =
|
|
1818
|
-
|
|
1817
|
+
]), bt = Y.trim().length > 0 || it.length > 0, xt = bt && !ut && !me, { shouldRender: St, isExiting: Ct, instanceKey: wt } = Ce(!l && bt, At), [Tt, Et] = V([]);
|
|
1818
|
+
R(() => {
|
|
1819
1819
|
Et([]);
|
|
1820
|
-
}, [(
|
|
1821
|
-
let Dt =
|
|
1822
|
-
Et((t) => t.includes(e) ? t : [...t, e]),
|
|
1823
|
-
}, [
|
|
1824
|
-
|
|
1820
|
+
}, [(xe ?? []).map((e) => e.id).join("|")]);
|
|
1821
|
+
let Dt = z(() => (xe ?? []).filter((e) => e.isSelected || !Tt.includes(e.id)), [xe, Tt]), Ot = L((e) => {
|
|
1822
|
+
Et((t) => t.includes(e) ? t : [...t, e]), xe?.find((t) => t.id === e)?.isSelected && we?.(e);
|
|
1823
|
+
}, [xe, we]), jt = Dt.length > 0 && we != null, $ = le || Y.includes("\n") || rt || jt, Mt = oe === void 0 || N != null, Nt = z(() => ge && !Ct && !l, [
|
|
1824
|
+
ge,
|
|
1825
1825
|
Ct,
|
|
1826
1826
|
l
|
|
1827
|
-
]),
|
|
1828
|
-
if (
|
|
1829
|
-
if (!
|
|
1830
|
-
|
|
1827
|
+
]), Pt = async () => {
|
|
1828
|
+
if (me) return;
|
|
1829
|
+
if (!K && Y.length >= M) {
|
|
1830
|
+
qe?.(Y.length, M);
|
|
1831
1831
|
return;
|
|
1832
1832
|
}
|
|
1833
|
-
let e =
|
|
1834
|
-
|
|
1833
|
+
let e = Y, t = it;
|
|
1834
|
+
X(""), $e.reset();
|
|
1835
1835
|
try {
|
|
1836
1836
|
await n?.(e, t), t.forEach((e) => {
|
|
1837
1837
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1838
1838
|
}), ot([]);
|
|
1839
1839
|
} catch {
|
|
1840
|
-
|
|
1840
|
+
X(e), ot(t);
|
|
1841
1841
|
}
|
|
1842
1842
|
}, Ft = (e) => {
|
|
1843
|
-
if (!e.nativeEvent.isComposing && !
|
|
1844
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1843
|
+
if (!e.nativeEvent.isComposing && !I && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1844
|
+
let t = e.currentTarget.selectionStart ?? 0, n = $e.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
|
|
1845
1845
|
if (n !== null) {
|
|
1846
|
-
e.preventDefault(),
|
|
1846
|
+
e.preventDefault(), X(n);
|
|
1847
1847
|
return;
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
|
-
e.key === "Enter" && (
|
|
1850
|
+
e.key === "Enter" && (_e === Me.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && xt && Mt && !I && Pt());
|
|
1851
1851
|
}, It = (e) => {
|
|
1852
1852
|
let t = Array.from(e.target.files ?? []);
|
|
1853
1853
|
if (t.length === 0) return;
|
|
1854
|
-
let n =
|
|
1854
|
+
let n = Z(t);
|
|
1855
1855
|
e.target.value = "", at(n);
|
|
1856
1856
|
};
|
|
1857
|
-
if (
|
|
1858
|
-
state:
|
|
1859
|
-
analyserNodeRef:
|
|
1860
|
-
errorMessage:
|
|
1861
|
-
onStop:
|
|
1862
|
-
onDiscard:
|
|
1857
|
+
if (Q !== "idle") return /* @__PURE__ */ U(Xe, {
|
|
1858
|
+
state: Q,
|
|
1859
|
+
analyserNodeRef: dt,
|
|
1860
|
+
errorMessage: ft,
|
|
1861
|
+
onStop: mt,
|
|
1862
|
+
onDiscard: ht,
|
|
1863
1863
|
stopLabel: T,
|
|
1864
1864
|
discardLabel: E,
|
|
1865
|
-
style:
|
|
1866
|
-
className:
|
|
1865
|
+
style: et,
|
|
1866
|
+
className: ee
|
|
1867
1867
|
});
|
|
1868
|
-
let Lt = /* @__PURE__ */
|
|
1869
|
-
className: o(
|
|
1870
|
-
ref:
|
|
1871
|
-
autoFocus:
|
|
1872
|
-
value:
|
|
1868
|
+
let Lt = /* @__PURE__ */ U("textarea", {
|
|
1869
|
+
className: o(q.textarea, O?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1870
|
+
ref: nt,
|
|
1871
|
+
autoFocus: Fe,
|
|
1872
|
+
value: Y,
|
|
1873
1873
|
onChange: (e) => {
|
|
1874
|
-
|
|
1874
|
+
X(e.target.value), $e.notifyChange(), u?.(e.target.value);
|
|
1875
1875
|
},
|
|
1876
1876
|
onKeyDown: Ft,
|
|
1877
1877
|
onPaste: yt,
|
|
1878
1878
|
placeholder: p,
|
|
1879
1879
|
"aria-label": m,
|
|
1880
|
-
disabled:
|
|
1880
|
+
disabled: I,
|
|
1881
1881
|
rows: 1
|
|
1882
1882
|
});
|
|
1883
|
-
return /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ W("div", {
|
|
1884
1884
|
ref: _t,
|
|
1885
|
-
style:
|
|
1886
|
-
className: o(
|
|
1887
|
-
children: [(
|
|
1888
|
-
attachments: [...
|
|
1885
|
+
style: et,
|
|
1886
|
+
className: o(q.wrapper, I && q.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", it.length > 6 ? "py-3 ps-3" : "p-3", ee),
|
|
1887
|
+
children: [(ye.length > 0 || it.length > 0) && /* @__PURE__ */ U(he, {
|
|
1888
|
+
attachments: [...ye, ...it],
|
|
1889
1889
|
onRemove: (e) => {
|
|
1890
|
-
|
|
1890
|
+
ye.some((t) => t.id === e) ? be?.(e) : st(e);
|
|
1891
1891
|
},
|
|
1892
1892
|
onRetry: ct,
|
|
1893
1893
|
onExpand: lt,
|
|
@@ -1895,16 +1895,16 @@ var kt = {
|
|
|
1895
1895
|
removeLabel: b,
|
|
1896
1896
|
retryLabel: x
|
|
1897
1897
|
},
|
|
1898
|
-
onAttachmentClick:
|
|
1899
|
-
let t = [...
|
|
1900
|
-
t != null &&
|
|
1898
|
+
onAttachmentClick: Be == null ? void 0 : (e) => {
|
|
1899
|
+
let t = [...ye, ...it].find((t) => t.id === e);
|
|
1900
|
+
t != null && Be(t);
|
|
1901
1901
|
}
|
|
1902
|
-
}),
|
|
1902
|
+
}), fe ? $ && Lt : /* @__PURE__ */ W("div", {
|
|
1903
1903
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1904
1904
|
children: [
|
|
1905
|
-
!
|
|
1905
|
+
!ue && /* @__PURE__ */ W("div", {
|
|
1906
1906
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1907
|
-
children: [/* @__PURE__ */
|
|
1907
|
+
children: [/* @__PURE__ */ U("input", {
|
|
1908
1908
|
ref: gt,
|
|
1909
1909
|
type: "file",
|
|
1910
1910
|
multiple: !0,
|
|
@@ -1913,93 +1913,93 @@ var kt = {
|
|
|
1913
1913
|
"aria-hidden": !0,
|
|
1914
1914
|
tabIndex: -1,
|
|
1915
1915
|
onChange: It
|
|
1916
|
-
}), /* @__PURE__ */
|
|
1917
|
-
onAttachClick:
|
|
1916
|
+
}), /* @__PURE__ */ U(We, {
|
|
1917
|
+
onAttachClick: de ? void 0 : () => gt.current?.click(),
|
|
1918
1918
|
attachLabel: h,
|
|
1919
1919
|
addMenuTitle: _,
|
|
1920
1920
|
menuTitle: v,
|
|
1921
1921
|
menuCloseLabel: y,
|
|
1922
|
-
style:
|
|
1923
|
-
isDisabled:
|
|
1924
|
-
chatSettings:
|
|
1925
|
-
extraMenuItems:
|
|
1926
|
-
toolsMenuItems:
|
|
1927
|
-
onToolToggle:
|
|
1928
|
-
toolsMenuTitle:
|
|
1929
|
-
toolsBackLabel:
|
|
1930
|
-
promptsMenuOverlay:
|
|
1931
|
-
promptsMenuTitle:
|
|
1932
|
-
promptsBackLabel:
|
|
1922
|
+
style: et,
|
|
1923
|
+
isDisabled: I,
|
|
1924
|
+
chatSettings: G,
|
|
1925
|
+
extraMenuItems: tt,
|
|
1926
|
+
toolsMenuItems: xe,
|
|
1927
|
+
onToolToggle: we,
|
|
1928
|
+
toolsMenuTitle: Te,
|
|
1929
|
+
toolsBackLabel: Oe,
|
|
1930
|
+
promptsMenuOverlay: Ae,
|
|
1931
|
+
promptsMenuTitle: Ne,
|
|
1932
|
+
promptsBackLabel: Pe
|
|
1933
1933
|
})]
|
|
1934
1934
|
}),
|
|
1935
|
-
$ && Dt.length > 0 &&
|
|
1935
|
+
$ && Dt.length > 0 && we != null && /* @__PURE__ */ U("div", {
|
|
1936
1936
|
className: "order-3 min-w-0 flex-1",
|
|
1937
|
-
children: /* @__PURE__ */
|
|
1937
|
+
children: /* @__PURE__ */ U(Ke, {
|
|
1938
1938
|
items: Dt,
|
|
1939
|
-
onToolToggle:
|
|
1939
|
+
onToolToggle: we,
|
|
1940
1940
|
onToolDismiss: Ot,
|
|
1941
|
-
removeLabel:
|
|
1941
|
+
removeLabel: ke?.removeLabel
|
|
1942
1942
|
})
|
|
1943
1943
|
}),
|
|
1944
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ U("div", {
|
|
1945
1945
|
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1946
1946
|
children: Lt
|
|
1947
1947
|
}),
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
className: o("flex flex-shrink-0 items-center gap-2", $ &&
|
|
1950
|
-
children: [
|
|
1948
|
+
/* @__PURE__ */ W("div", {
|
|
1949
|
+
className: o("flex flex-shrink-0 items-center gap-2", $ && jt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1950
|
+
children: [F ? F({
|
|
1951
1951
|
canSend: xt,
|
|
1952
|
-
onSend:
|
|
1953
|
-
}) : /* @__PURE__ */
|
|
1954
|
-
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
deployments:
|
|
1957
|
-
selectedDeploymentId:
|
|
1958
|
-
onDeploymentChange:
|
|
1959
|
-
modelSelectorLabels:
|
|
1952
|
+
onSend: Pt
|
|
1953
|
+
}) : /* @__PURE__ */ W(H, { children: [
|
|
1954
|
+
Ge,
|
|
1955
|
+
/* @__PURE__ */ U(kt, {
|
|
1956
|
+
deployments: oe,
|
|
1957
|
+
selectedDeploymentId: N,
|
|
1958
|
+
onDeploymentChange: P,
|
|
1959
|
+
modelSelectorLabels: se,
|
|
1960
1960
|
isStreaming: l,
|
|
1961
|
-
isMobile:
|
|
1962
|
-
isDisabled:
|
|
1963
|
-
style:
|
|
1964
|
-
modelPickerOverlay:
|
|
1965
|
-
isPickerOpen:
|
|
1961
|
+
isMobile: Je,
|
|
1962
|
+
isDisabled: pe,
|
|
1963
|
+
style: et,
|
|
1964
|
+
modelPickerOverlay: Ve,
|
|
1965
|
+
isPickerOpen: Ye,
|
|
1966
1966
|
onPickerToggle: () => J((e) => !e),
|
|
1967
1967
|
onPickerOpenChange: J
|
|
1968
1968
|
}),
|
|
1969
|
-
l && i ? /* @__PURE__ */
|
|
1969
|
+
l && i ? /* @__PURE__ */ U(Qe, {
|
|
1970
1970
|
onStop: i,
|
|
1971
1971
|
ariaLabel: C
|
|
1972
|
-
}) : !l && St && /* @__PURE__ */
|
|
1973
|
-
onSend:
|
|
1974
|
-
isDisabled: !
|
|
1972
|
+
}) : !l && St && /* @__PURE__ */ U(Ze, {
|
|
1973
|
+
onSend: Pt,
|
|
1974
|
+
isDisabled: !Mt || ut || me,
|
|
1975
1975
|
ariaLabel: S,
|
|
1976
1976
|
isExiting: Ct
|
|
1977
1977
|
}, wt)
|
|
1978
|
-
] }),
|
|
1979
|
-
icon: /* @__PURE__ */
|
|
1978
|
+
] }), Nt && /* @__PURE__ */ U(k, {
|
|
1979
|
+
icon: /* @__PURE__ */ U(ae, {
|
|
1980
1980
|
size: d.LG,
|
|
1981
1981
|
"aria-hidden": !0
|
|
1982
1982
|
}),
|
|
1983
1983
|
"aria-label": w,
|
|
1984
1984
|
className: "size-8 flex-shrink-0",
|
|
1985
|
-
onClick:
|
|
1986
|
-
disabled:
|
|
1985
|
+
onClick: pt,
|
|
1986
|
+
disabled: I || l
|
|
1987
1987
|
})]
|
|
1988
1988
|
})
|
|
1989
1989
|
]
|
|
1990
1990
|
})]
|
|
1991
1991
|
});
|
|
1992
|
-
},
|
|
1992
|
+
}, $ = { welcome: "_welcome_n2ph8_1" }, Mt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
|
|
1993
1993
|
let { colors: u, typography: d } = r ?? {};
|
|
1994
|
-
return /* @__PURE__ */
|
|
1994
|
+
return /* @__PURE__ */ W("div", {
|
|
1995
1995
|
style: a({ "--ci-welcome-color": u?.welcomeText }),
|
|
1996
1996
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1997
|
-
children: [n && /* @__PURE__ */
|
|
1998
|
-
className: o(
|
|
1997
|
+
children: [n && /* @__PURE__ */ U("h1", {
|
|
1998
|
+
className: o($.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
|
|
1999
1999
|
children: n
|
|
2000
|
-
}), /* @__PURE__ */
|
|
2000
|
+
}), /* @__PURE__ */ U("div", {
|
|
2001
2001
|
className: "relative w-full max-w-[748px]",
|
|
2002
|
-
children: /* @__PURE__ */
|
|
2002
|
+
children: /* @__PURE__ */ U(jt, {
|
|
2003
2003
|
placeholder: t,
|
|
2004
2004
|
isStreaming: e,
|
|
2005
2005
|
isInputDisabled: c,
|
|
@@ -2010,97 +2010,97 @@ var kt = {
|
|
|
2010
2010
|
})
|
|
2011
2011
|
})]
|
|
2012
2012
|
});
|
|
2013
|
-
},
|
|
2014
|
-
let
|
|
2015
|
-
|
|
2016
|
-
y?.length && (
|
|
2013
|
+
}, Nt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: y, onDropFilesConsumed: b, validateAttachment: S, isAttachmentsEnabled: C, hideAttachFile: w = !1, fileAccept: T, maximumAttachmentsAmount: E, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: ee, onPendingAttachmentsConsumed: A, onAttachmentClick: te, pasteTextThreshold: ne, maxMessageLength: j = 5e4, onMessageTooLong: re }) => {
|
|
2014
|
+
let M = B(null), [ae, oe] = V([]);
|
|
2015
|
+
R(() => {
|
|
2016
|
+
y?.length && (oe(y), b?.());
|
|
2017
2017
|
}, [y, b]);
|
|
2018
|
-
let [
|
|
2019
|
-
|
|
2020
|
-
},
|
|
2021
|
-
i(e,
|
|
2022
|
-
}, [
|
|
2023
|
-
if (
|
|
2024
|
-
if (!C &&
|
|
2025
|
-
|
|
2018
|
+
let [N, P] = V(e ?? ""), [se, ce] = V([]), [le, ue] = V(t), de = se.some((e) => e.status === r.Loading || e.status === r.Error), fe = (N.trim().length > 0 || se.length > 0 || le.length > 0) && !de, F = (e) => {
|
|
2019
|
+
ue((t) => t.filter((t) => t.id !== e));
|
|
2020
|
+
}, I = L((e, t) => {
|
|
2021
|
+
i(e, le, t);
|
|
2022
|
+
}, [le, i]), pe = () => {
|
|
2023
|
+
if (fe) {
|
|
2024
|
+
if (!C && N.length >= j) {
|
|
2025
|
+
re?.(N.length, j);
|
|
2026
2026
|
return;
|
|
2027
2027
|
}
|
|
2028
|
-
|
|
2028
|
+
I(N, se);
|
|
2029
2029
|
}
|
|
2030
|
-
},
|
|
2030
|
+
}, me = L(() => oe([]), []), he = L((e) => {
|
|
2031
2031
|
let t = Array.from(e.target.files ?? []);
|
|
2032
|
-
t.length !== 0 && (e.target.value = "",
|
|
2033
|
-
}, []),
|
|
2032
|
+
t.length !== 0 && (e.target.value = "", oe(t));
|
|
2033
|
+
}, []), ge = z(() => O ? [{
|
|
2034
2034
|
key: "dial-fs",
|
|
2035
2035
|
label: k ?? "DIAL file system",
|
|
2036
|
-
icon: /* @__PURE__ */
|
|
2036
|
+
icon: /* @__PURE__ */ U(ie, {
|
|
2037
2037
|
size: c,
|
|
2038
2038
|
"aria-hidden": !0
|
|
2039
2039
|
}),
|
|
2040
2040
|
onClick: O
|
|
2041
2041
|
}] : [], [O, k]);
|
|
2042
|
-
return /* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ W("div", {
|
|
2043
2043
|
className: o("flex w-full flex-col gap-2", _),
|
|
2044
|
-
children: [/* @__PURE__ */
|
|
2044
|
+
children: [/* @__PURE__ */ U(jt, {
|
|
2045
2045
|
message: e,
|
|
2046
2046
|
ariaLabel: u,
|
|
2047
2047
|
isStacked: !0,
|
|
2048
2048
|
hideActionBar: !0,
|
|
2049
|
-
pendingDropFiles:
|
|
2050
|
-
onDropFilesConsumed:
|
|
2051
|
-
onSend:
|
|
2049
|
+
pendingDropFiles: ae,
|
|
2050
|
+
onDropFilesConsumed: me,
|
|
2051
|
+
onSend: I,
|
|
2052
2052
|
onUploadAttachment: a,
|
|
2053
|
-
onChange:
|
|
2054
|
-
onAttachmentsChange:
|
|
2053
|
+
onChange: P,
|
|
2054
|
+
onAttachmentsChange: ce,
|
|
2055
2055
|
removeLabel: d,
|
|
2056
2056
|
retryLabel: f,
|
|
2057
2057
|
className: "max-w-full",
|
|
2058
|
-
prefixAttachments:
|
|
2059
|
-
onRemovePrefixAttachment:
|
|
2058
|
+
prefixAttachments: le,
|
|
2059
|
+
onRemovePrefixAttachment: F,
|
|
2060
2060
|
validateAttachment: S,
|
|
2061
2061
|
isAttachmentsEnabled: C,
|
|
2062
2062
|
maximumAttachmentsAmount: E,
|
|
2063
2063
|
onAttachmentsLimitExceeded: D,
|
|
2064
|
-
pendingAttachments:
|
|
2065
|
-
onPendingAttachmentsConsumed:
|
|
2066
|
-
onAttachmentClick:
|
|
2067
|
-
pasteTextThreshold:
|
|
2068
|
-
maxMessageLength:
|
|
2069
|
-
onMessageTooLong:
|
|
2070
|
-
}), /* @__PURE__ */
|
|
2064
|
+
pendingAttachments: ee,
|
|
2065
|
+
onPendingAttachmentsConsumed: A,
|
|
2066
|
+
onAttachmentClick: te,
|
|
2067
|
+
pasteTextThreshold: ne,
|
|
2068
|
+
maxMessageLength: j,
|
|
2069
|
+
onMessageTooLong: re
|
|
2070
|
+
}), /* @__PURE__ */ W("div", {
|
|
2071
2071
|
className: "flex items-center justify-between",
|
|
2072
|
-
children: [/* @__PURE__ */
|
|
2072
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2073
2073
|
className: "flex",
|
|
2074
|
-
children: !w && /* @__PURE__ */
|
|
2075
|
-
ref:
|
|
2074
|
+
children: !w && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
|
|
2075
|
+
ref: M,
|
|
2076
2076
|
type: "file",
|
|
2077
2077
|
multiple: !0,
|
|
2078
2078
|
accept: T,
|
|
2079
2079
|
className: "sr-only",
|
|
2080
2080
|
"aria-hidden": !0,
|
|
2081
2081
|
tabIndex: -1,
|
|
2082
|
-
onChange:
|
|
2083
|
-
}), /* @__PURE__ */
|
|
2084
|
-
onAttachClick: () =>
|
|
2082
|
+
onChange: he
|
|
2083
|
+
}), /* @__PURE__ */ U(We, {
|
|
2084
|
+
onAttachClick: () => M.current?.click(),
|
|
2085
2085
|
attachLabel: m,
|
|
2086
2086
|
addMenuTitle: p,
|
|
2087
2087
|
menuTitle: h,
|
|
2088
2088
|
menuCloseLabel: g,
|
|
2089
|
-
extraMenuItems:
|
|
2089
|
+
extraMenuItems: ge
|
|
2090
2090
|
})] })
|
|
2091
|
-
}), /* @__PURE__ */
|
|
2091
|
+
}), /* @__PURE__ */ W("div", {
|
|
2092
2092
|
className: "flex gap-2",
|
|
2093
|
-
children: [/* @__PURE__ */
|
|
2093
|
+
children: [/* @__PURE__ */ U(v, {
|
|
2094
2094
|
label: s,
|
|
2095
2095
|
onClick: n
|
|
2096
|
-
}), /* @__PURE__ */
|
|
2096
|
+
}), /* @__PURE__ */ U(x, {
|
|
2097
2097
|
label: l,
|
|
2098
|
-
onClick:
|
|
2099
|
-
disabled: !
|
|
2098
|
+
onClick: pe,
|
|
2099
|
+
disabled: !fe
|
|
2100
2100
|
})]
|
|
2101
2101
|
})]
|
|
2102
2102
|
})]
|
|
2103
2103
|
});
|
|
2104
2104
|
};
|
|
2105
2105
|
//#endregion
|
|
2106
|
-
export {
|
|
2106
|
+
export { G as BottomSheetShell, Be as ChatSettingsModal, Mt as ConversationInput, Nt as EditMessageInput, jt as Input, Me as SendOnEnter };
|