@epam/ai-dial-conversation-input 1.3.0-dev.305 → 1.3.0-dev.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts +1 -1
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/components/Input/ModelSelectorControl.d.ts.map +1 -1
- package/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.d.ts +4 -0
- package/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.d.ts.map +1 -1
- package/hooks/useModelSelector.d.ts +4 -0
- package/hooks/useModelSelector.d.ts.map +1 -1
- package/index.js +1044 -1008
- package/models/ConversationInput.d.ts +2 -0
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +2 -0
- package/models/Input.d.ts.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as
|
|
3
|
-
import { Fragment as le, jsx as
|
|
1
|
+
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d, useIsPhone as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { BASE_ICON_SIZE as p, BottomSheet as m, Button as h, ButtonVariant as g, CloseButton as _, DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, Dropdown as b, ElementSize as x, ErrorText as S, GhostIconButton as C, Highlight as w, LiveRegion as T, LiveRegionElement as E, LiveRegionPoliteness as D, MenuItemMark as ee, NeutralButton as O, NeutralIconButton as k, Notification as A, NotificationType as j, NotificationVariant as M, Popup as N, PopupSize as te, PrimaryButton as ne, PrimaryIconButton as P, RadioGroup as F, RadioGroupOrientation as I, Search as L, Skeleton as R, SkeletonVariant as re, Slider as z, Spinner as ie, Textarea as ae, TextareaResize as oe, ToggleChip as se, Tooltip as ce } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as le, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
4
4
|
import { AttachmentTray as ue, MAX_UPLOADS_PER_MINUTE as de, generateAttachmentId as fe, useClipboardPaste as pe } from "@epam/ai-dial-attachment-input";
|
|
5
5
|
import { IconArrowNarrowRight as me, IconCheck as he, IconChevronDown as ge, IconChevronRight as _e, IconFile as ve, IconMicrophone as ye, IconPaperclip as be, IconPlayerStop as xe, IconPlus as Se, IconSettings as Ce, IconTool as we, IconX as Te } from "@tabler/icons-react";
|
|
6
|
-
import { Fragment as Ee, createElement as De, forwardRef as Oe, memo as ke, useCallback as
|
|
6
|
+
import { Fragment as Ee, createElement as De, forwardRef as Oe, memo as ke, useCallback as H, useEffect as U, useId as Ae, useImperativeHandle as je, useLayoutEffect as Me, useMemo as W, useRef as G, useState as K, useSyncExternalStore as Ne } from "react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var q = {
|
|
9
9
|
wrapper: "dial-ci-wrapper",
|
|
10
10
|
actionRow: "dial-ci-action-row",
|
|
11
11
|
textareaWrap: "dial-ci-textarea-wrap",
|
|
@@ -25,14 +25,14 @@ var K = {
|
|
|
25
25
|
sheet: "_sheet_1ym62_12",
|
|
26
26
|
title: "_title_1ym62_16",
|
|
27
27
|
divider: "_divider_1ym62_20"
|
|
28
|
-
}, Fe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId:
|
|
28
|
+
}, Fe = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: p, overlayClassName: h, overlayStyle: g, children: _ }) => {
|
|
29
29
|
let v = c({
|
|
30
30
|
"--ci-backdrop": f?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": f?.sheetBg,
|
|
32
32
|
"--ci-sheet-text": f?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": f?.divider
|
|
34
34
|
});
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ B(m, {
|
|
36
36
|
open: e,
|
|
37
37
|
onClose: r,
|
|
38
38
|
title: t,
|
|
@@ -50,7 +50,7 @@ var K = {
|
|
|
50
50
|
},
|
|
51
51
|
className: l(Pe.sheet, d),
|
|
52
52
|
overlayClassName: l(Pe.backdrop, h),
|
|
53
|
-
portalId:
|
|
53
|
+
portalId: p,
|
|
54
54
|
headerClassName: Pe.divider,
|
|
55
55
|
titleClassName: l(Pe.title, u),
|
|
56
56
|
children: _
|
|
@@ -60,15 +60,15 @@ var K = {
|
|
|
60
60
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
61
61
|
await Promise.allSettled(i);
|
|
62
62
|
}, Le = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
|
|
63
|
-
let [g, _] =
|
|
64
|
-
|
|
63
|
+
let [g, _] = K(n), v = G(g);
|
|
64
|
+
U(() => {
|
|
65
65
|
v.current = g;
|
|
66
|
-
}, [g]),
|
|
66
|
+
}, [g]), U(() => () => {
|
|
67
67
|
v.current.forEach((e) => {
|
|
68
68
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
69
69
|
});
|
|
70
70
|
}, []);
|
|
71
|
-
let y =
|
|
71
|
+
let y = H((e) => e.map((e) => {
|
|
72
72
|
let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), i = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
|
|
73
73
|
return {
|
|
74
74
|
id: fe(),
|
|
@@ -80,22 +80,22 @@ var K = {
|
|
|
80
80
|
previewUrl: i,
|
|
81
81
|
playUrl: o
|
|
82
82
|
};
|
|
83
|
-
}), []), b =
|
|
84
|
-
|
|
83
|
+
}), []), b = G(i);
|
|
84
|
+
U(() => {
|
|
85
85
|
b.current = i;
|
|
86
86
|
}, [i]);
|
|
87
|
-
let x =
|
|
87
|
+
let x = G(!0), S = H((e) => {
|
|
88
88
|
_((t) => {
|
|
89
89
|
let n = e(t);
|
|
90
90
|
return n === t ? t : n;
|
|
91
91
|
});
|
|
92
92
|
}, []);
|
|
93
|
-
|
|
93
|
+
U(() => {
|
|
94
94
|
x.current ? x.current = !1 : b.current?.(g);
|
|
95
95
|
}, [g]);
|
|
96
|
-
let C =
|
|
96
|
+
let C = H((e) => {
|
|
97
97
|
_(e);
|
|
98
|
-
}, []), w =
|
|
98
|
+
}, []), w = H(async (t) => {
|
|
99
99
|
if (r) {
|
|
100
100
|
S((e) => e.map((e) => e.id === t.id ? {
|
|
101
101
|
...e,
|
|
@@ -118,7 +118,7 @@ var K = {
|
|
|
118
118
|
} : e));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
}, [r, S]), T =
|
|
121
|
+
}, [r, S]), T = H((e, t = !0) => {
|
|
122
122
|
let n = new Set(v.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
|
|
123
123
|
if (r.length !== 0) {
|
|
124
124
|
if (p != null && p > 0 && Number.isFinite(p)) {
|
|
@@ -149,8 +149,8 @@ var K = {
|
|
|
149
149
|
S,
|
|
150
150
|
w,
|
|
151
151
|
o
|
|
152
|
-
]), E =
|
|
153
|
-
|
|
152
|
+
]), E = G(/* @__PURE__ */ new WeakSet());
|
|
153
|
+
U(() => {
|
|
154
154
|
if (s.length === 0) {
|
|
155
155
|
E.current = /* @__PURE__ */ new WeakSet();
|
|
156
156
|
return;
|
|
@@ -163,13 +163,13 @@ var K = {
|
|
|
163
163
|
l,
|
|
164
164
|
c,
|
|
165
165
|
s
|
|
166
|
-
]),
|
|
166
|
+
]), U(() => {
|
|
167
167
|
u.length !== 0 && (T(u, !1), d?.());
|
|
168
168
|
}, [
|
|
169
169
|
T,
|
|
170
170
|
d,
|
|
171
171
|
u
|
|
172
|
-
]),
|
|
172
|
+
]), U(() => {
|
|
173
173
|
if (!o) return;
|
|
174
174
|
let t = !1, n = [], r = v.current.map((r) => {
|
|
175
175
|
if (r.status === a.Loading) return r;
|
|
@@ -196,7 +196,7 @@ var K = {
|
|
|
196
196
|
S,
|
|
197
197
|
w
|
|
198
198
|
]);
|
|
199
|
-
let D =
|
|
199
|
+
let D = H((e) => {
|
|
200
200
|
S((t) => {
|
|
201
201
|
let n = t.find((t) => t.id === e);
|
|
202
202
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -208,11 +208,11 @@ var K = {
|
|
|
208
208
|
addAttachments: T,
|
|
209
209
|
resetAttachments: C,
|
|
210
210
|
handleRemove: D,
|
|
211
|
-
handleRetry:
|
|
211
|
+
handleRetry: H((e) => {
|
|
212
212
|
let t = g.find((t) => t.id === e);
|
|
213
213
|
t && w(t);
|
|
214
214
|
}, [g, w]),
|
|
215
|
-
handleExpand:
|
|
215
|
+
handleExpand: H(async (e) => {
|
|
216
216
|
let n = g.find((t) => t.id === e);
|
|
217
217
|
if (!n || n.type !== t.Pasted) return;
|
|
218
218
|
let r = await n.file.text();
|
|
@@ -238,17 +238,17 @@ var K = {
|
|
|
238
238
|
}, Be = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Ve = "[role=\"option\"]:not([aria-disabled=\"true\"])", He = /* @__PURE__ */ function(e) {
|
|
239
239
|
return e.Next = "next", e.Previous = "previous", e;
|
|
240
240
|
}({}), Ue = ({ config: e, message: t }) => {
|
|
241
|
-
let [n, r] =
|
|
241
|
+
let [n, r] = K(!1), [i, a] = K(null), [o, s] = K(null), c = G(null);
|
|
242
242
|
c.current = i;
|
|
243
243
|
let l = e != null && i != null && i <= t.length ? (() => {
|
|
244
244
|
let n = t.slice(i, Re(t, i));
|
|
245
245
|
return Be(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
|
|
246
|
-
})() : "", u =
|
|
246
|
+
})() : "", u = H((t, n, i) => {
|
|
247
247
|
if (e == null || i) return;
|
|
248
248
|
let { start: c, end: l } = ze(t, n), u = t.slice(c, l);
|
|
249
249
|
Be(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
|
|
250
250
|
}, [e, o]);
|
|
251
|
-
|
|
251
|
+
U(() => {
|
|
252
252
|
if (e == null) {
|
|
253
253
|
r(!1), s(null), a(null);
|
|
254
254
|
return;
|
|
@@ -258,11 +258,11 @@ var K = {
|
|
|
258
258
|
let i = Math.min(n, t.length);
|
|
259
259
|
Be(t.slice(i, Re(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
|
|
260
260
|
}, [e, t]);
|
|
261
|
-
let d =
|
|
261
|
+
let d = H(() => {
|
|
262
262
|
r(!1), s(i);
|
|
263
|
-
}, [i]), f =
|
|
263
|
+
}, [i]), f = H(() => {
|
|
264
264
|
r(!1);
|
|
265
|
-
}, []), p =
|
|
265
|
+
}, []), p = H((n) => {
|
|
266
266
|
if (e == null) return;
|
|
267
267
|
let { start: i, end: s } = ze(t, n);
|
|
268
268
|
Be(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
|
|
@@ -270,11 +270,11 @@ var K = {
|
|
|
270
270
|
e,
|
|
271
271
|
t,
|
|
272
272
|
o
|
|
273
|
-
]), m = Ae(), h =
|
|
274
|
-
|
|
273
|
+
]), m = Ae(), h = G(null), [g, _] = K(null);
|
|
274
|
+
U(() => {
|
|
275
275
|
_(null);
|
|
276
276
|
}, [n, l]);
|
|
277
|
-
let v =
|
|
277
|
+
let v = H(() => Array.from(h.current?.querySelectorAll(Ve) ?? []), []), y = H((e) => {
|
|
278
278
|
let t = v();
|
|
279
279
|
if (t.length === 0) {
|
|
280
280
|
_(null);
|
|
@@ -282,7 +282,7 @@ var K = {
|
|
|
282
282
|
}
|
|
283
283
|
let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
|
|
284
284
|
_(r.id), r.scrollIntoView?.({ block: "nearest" });
|
|
285
|
-
}, [v, g]), b =
|
|
285
|
+
}, [v, g]), b = H(() => v().find((e) => e.id === g) ?? null, [v, g]);
|
|
286
286
|
return {
|
|
287
287
|
isMenuOpen: n,
|
|
288
288
|
query: l,
|
|
@@ -298,17 +298,17 @@ var K = {
|
|
|
298
298
|
getActiveOption: b
|
|
299
299
|
};
|
|
300
300
|
}, We = (e, t) => !e.slice(0, t).includes("\n"), Ge = (e, t) => !e.slice(t).includes("\n"), Ke = (e) => {
|
|
301
|
-
let t =
|
|
301
|
+
let t = G(e);
|
|
302
302
|
t.current = e;
|
|
303
|
-
let n =
|
|
303
|
+
let n = G(-1), r = G(""), i = H((e, i, a) => {
|
|
304
304
|
let o = t.current;
|
|
305
305
|
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 || !Ge(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
306
|
-
}, []), a =
|
|
306
|
+
}, []), a = H(() => {
|
|
307
307
|
n.current = -1, r.current = "";
|
|
308
|
-
}, []), o =
|
|
308
|
+
}, []), o = H(() => {
|
|
309
309
|
n.current = -1, r.current = "";
|
|
310
310
|
}, []);
|
|
311
|
-
return
|
|
311
|
+
return W(() => ({
|
|
312
312
|
navigate: i,
|
|
313
313
|
notifyChange: a,
|
|
314
314
|
reset: o
|
|
@@ -322,11 +322,11 @@ var K = {
|
|
|
322
322
|
if (n <= t) return;
|
|
323
323
|
let r = t;
|
|
324
324
|
o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
|
|
325
|
-
t.offset > r && s.push(/* @__PURE__ */
|
|
325
|
+
t.offset > r && s.push(/* @__PURE__ */ B("span", {
|
|
326
326
|
"aria-hidden": !0,
|
|
327
327
|
children: e.slice(r, t.offset)
|
|
328
328
|
}, `text-${l++}`)), s.push(t.node), r = t.offset;
|
|
329
|
-
}), r < n && s.push(/* @__PURE__ */
|
|
329
|
+
}), r < n && s.push(/* @__PURE__ */ B("span", {
|
|
330
330
|
"aria-hidden": !0,
|
|
331
331
|
children: e.slice(r, n)
|
|
332
332
|
}, `text-${l++}`));
|
|
@@ -334,10 +334,10 @@ var K = {
|
|
|
334
334
|
return a.forEach((t, n) => {
|
|
335
335
|
if (u(c, t.start), t.start + t.length <= c) return;
|
|
336
336
|
let a = e.slice(t.start, t.start + t.length);
|
|
337
|
-
s.push(t.render ? /* @__PURE__ */
|
|
337
|
+
s.push(t.render ? /* @__PURE__ */ B("span", {
|
|
338
338
|
className: "pointer-events-auto",
|
|
339
339
|
children: t.render()
|
|
340
|
-
}, `range-${n}`) : /* @__PURE__ */
|
|
340
|
+
}, `range-${n}`) : /* @__PURE__ */ B("span", {
|
|
341
341
|
"aria-hidden": !0,
|
|
342
342
|
className: t.isUnsupported ? i : r,
|
|
343
343
|
children: a
|
|
@@ -360,12 +360,12 @@ var K = {
|
|
|
360
360
|
let a = document.createRange();
|
|
361
361
|
return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
|
|
362
362
|
}, Xe = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
|
|
363
|
-
let r =
|
|
363
|
+
let r = G(null), [i, a] = K([]), o = H(() => {
|
|
364
364
|
let t = e.current, n = r.current;
|
|
365
365
|
if (t == null || n == null) return;
|
|
366
366
|
let i = t.offsetWidth > t.clientWidth;
|
|
367
367
|
n.style.scrollbarGutter = i ? "stable" : "", n.scrollTop = t.scrollTop;
|
|
368
|
-
}, [e]), s =
|
|
368
|
+
}, [e]), s = H(() => {
|
|
369
369
|
let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
|
|
370
370
|
if (!n || t == null || i == null || o == null || s == null || o === s) {
|
|
371
371
|
a((e) => e.length === 0 ? e : []);
|
|
@@ -386,7 +386,7 @@ var K = {
|
|
|
386
386
|
o,
|
|
387
387
|
s,
|
|
388
388
|
t
|
|
389
|
-
]),
|
|
389
|
+
]), U(() => {
|
|
390
390
|
if (!n) return;
|
|
391
391
|
let t = e.current;
|
|
392
392
|
if (t == null || typeof ResizeObserver > "u") return;
|
|
@@ -406,8 +406,8 @@ var K = {
|
|
|
406
406
|
syncMirrorToTextarea: o
|
|
407
407
|
};
|
|
408
408
|
}, Ze = ({ messageProp: e, messageRevision: t }) => {
|
|
409
|
-
let [n, r] =
|
|
410
|
-
return
|
|
409
|
+
let [n, r] = K(e), i = G(null);
|
|
410
|
+
return U(() => {
|
|
411
411
|
r(e);
|
|
412
412
|
}, [e, t]), {
|
|
413
413
|
message: n,
|
|
@@ -418,16 +418,16 @@ var K = {
|
|
|
418
418
|
let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
419
419
|
i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
420
420
|
}, $e = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, et = ({ insertion: e, textareaRef: t }) => {
|
|
421
|
-
let n = e?.revision, r =
|
|
421
|
+
let n = e?.revision, r = G(e?.text);
|
|
422
422
|
r.current = e?.text;
|
|
423
|
-
let i =
|
|
424
|
-
return
|
|
423
|
+
let i = G(n), a = G(null), o = G(!1);
|
|
424
|
+
return U(() => {
|
|
425
425
|
document.activeElement === t.current && (o.current = !0);
|
|
426
426
|
let e = (e) => {
|
|
427
427
|
e.target === t.current && (o.current = !0);
|
|
428
428
|
};
|
|
429
429
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
430
|
-
}, [t]),
|
|
430
|
+
}, [t]), U(() => {
|
|
431
431
|
if (n === i.current) return;
|
|
432
432
|
i.current = n;
|
|
433
433
|
let e = r.current;
|
|
@@ -462,7 +462,7 @@ var K = {
|
|
|
462
462
|
"audio/ogg;codecs=opus",
|
|
463
463
|
"audio/webm"
|
|
464
464
|
], it = 100, at = 100, ot = .01, st = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
|
|
465
|
-
let [a, o] =
|
|
465
|
+
let [a, o] = K("idle"), [s, c] = K(null), l = G(null), d = G(null), f = G({
|
|
466
466
|
onAttachAudio: e,
|
|
467
467
|
onTranscribeAudio: t,
|
|
468
468
|
onTranscript: n,
|
|
@@ -474,7 +474,7 @@ var K = {
|
|
|
474
474
|
onTranscript: n,
|
|
475
475
|
errorLabel: i
|
|
476
476
|
};
|
|
477
|
-
let p =
|
|
477
|
+
let p = H((e = "dictation") => {
|
|
478
478
|
if (d.current) return;
|
|
479
479
|
let t = { controller: new AbortController() };
|
|
480
480
|
d.current = t, c(null), o("recording");
|
|
@@ -545,10 +545,10 @@ var K = {
|
|
|
545
545
|
x(e);
|
|
546
546
|
}
|
|
547
547
|
})();
|
|
548
|
-
}, []), m =
|
|
548
|
+
}, []), m = H(() => d.current?.stop?.(), []), h = H(() => {
|
|
549
549
|
d.current?.controller.abort(), d.current = null, c(null), o("idle");
|
|
550
550
|
}, []);
|
|
551
|
-
return
|
|
551
|
+
return U(() => () => {
|
|
552
552
|
d.current?.controller.abort(), d.current = null;
|
|
553
553
|
}, []), {
|
|
554
554
|
state: a,
|
|
@@ -568,13 +568,13 @@ var K = {
|
|
|
568
568
|
}, dt = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
|
|
569
569
|
let p = (e) => {
|
|
570
570
|
e(), r();
|
|
571
|
-
},
|
|
571
|
+
}, m = c({
|
|
572
572
|
"--ci-sheet-text": f?.itemText,
|
|
573
573
|
"--ci-sheet-item-hover": f?.itemHoverBg,
|
|
574
574
|
"--ci-sheet-item-active": f?.itemActiveBg,
|
|
575
575
|
"--ci-sheet-icon": f?.itemIcon
|
|
576
576
|
});
|
|
577
|
-
return /* @__PURE__ */
|
|
577
|
+
return /* @__PURE__ */ B(Fe, {
|
|
578
578
|
isOpen: e,
|
|
579
579
|
title: t,
|
|
580
580
|
closeLabel: n,
|
|
@@ -583,23 +583,23 @@ var K = {
|
|
|
583
583
|
className: o,
|
|
584
584
|
titleClassName: s,
|
|
585
585
|
colors: f?.shell,
|
|
586
|
-
children: /* @__PURE__ */
|
|
586
|
+
children: /* @__PURE__ */ B("ul", {
|
|
587
587
|
role: "list",
|
|
588
588
|
className: "flex flex-col",
|
|
589
|
-
style:
|
|
590
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
589
|
+
style: m,
|
|
590
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(h, {
|
|
591
591
|
type: "button",
|
|
592
592
|
className: l(ut.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
593
|
-
iconBefore: /* @__PURE__ */
|
|
593
|
+
iconBefore: /* @__PURE__ */ B("span", {
|
|
594
594
|
className: ut.itemIcon,
|
|
595
595
|
children: n
|
|
596
596
|
}),
|
|
597
|
-
iconAfter: r ? /* @__PURE__ */
|
|
597
|
+
iconAfter: r ? /* @__PURE__ */ B("span", {
|
|
598
598
|
className: "ms-auto",
|
|
599
599
|
children: r
|
|
600
600
|
}) : null,
|
|
601
601
|
textClassName: d,
|
|
602
|
-
label: /* @__PURE__ */
|
|
602
|
+
label: /* @__PURE__ */ B("span", {
|
|
603
603
|
className: u,
|
|
604
604
|
children: t
|
|
605
605
|
}),
|
|
@@ -608,8 +608,8 @@ var K = {
|
|
|
608
608
|
})
|
|
609
609
|
});
|
|
610
610
|
}, ft = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
611
|
-
let [s, c] =
|
|
612
|
-
|
|
611
|
+
let [s, c] = K(t), [l, u] = K(n), [d, f] = K(r), p = G(o);
|
|
612
|
+
U(() => {
|
|
613
613
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
614
614
|
}, [
|
|
615
615
|
o,
|
|
@@ -626,7 +626,7 @@ var K = {
|
|
|
626
626
|
setResponseFormat: c,
|
|
627
627
|
setSystemPrompt: u,
|
|
628
628
|
setTemperature: f,
|
|
629
|
-
handleSubmit:
|
|
629
|
+
handleSubmit: H(() => {
|
|
630
630
|
if (!m) return;
|
|
631
631
|
let t = {};
|
|
632
632
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -640,17 +640,17 @@ var K = {
|
|
|
640
640
|
a
|
|
641
641
|
])
|
|
642
642
|
};
|
|
643
|
-
}, pt = { label: "_label_14i7c_1" },
|
|
643
|
+
}, pt = { label: "_label_14i7c_1" }, J = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
|
|
644
644
|
"Precise",
|
|
645
645
|
"Neutral",
|
|
646
646
|
"Creative"
|
|
647
647
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
648
648
|
let S = c({ "--csf-label-text": x?.labelText }), C = l(b, pt.label, "gap-1");
|
|
649
|
-
return /* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ V("div", {
|
|
650
650
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
651
651
|
style: S,
|
|
652
652
|
children: [
|
|
653
|
-
e.responseFormat && /* @__PURE__ */
|
|
653
|
+
e.responseFormat && /* @__PURE__ */ B(F, {
|
|
654
654
|
id: "response-format",
|
|
655
655
|
labelProps: {
|
|
656
656
|
label: d,
|
|
@@ -658,7 +658,7 @@ var K = {
|
|
|
658
658
|
caption: f
|
|
659
659
|
},
|
|
660
660
|
optionsClassName: "mb-2",
|
|
661
|
-
orientation:
|
|
661
|
+
orientation: I.Column,
|
|
662
662
|
value: t ?? o.Markdown,
|
|
663
663
|
items: [{
|
|
664
664
|
value: o.Markdown,
|
|
@@ -669,7 +669,7 @@ var K = {
|
|
|
669
669
|
}],
|
|
670
670
|
onChange: (e) => a(e)
|
|
671
671
|
}),
|
|
672
|
-
e.systemPrompt && /* @__PURE__ */
|
|
672
|
+
e.systemPrompt && /* @__PURE__ */ B(ae, {
|
|
673
673
|
value: n,
|
|
674
674
|
placeholder: g,
|
|
675
675
|
className: i,
|
|
@@ -680,7 +680,7 @@ var K = {
|
|
|
680
680
|
},
|
|
681
681
|
onChange: (e) => s(e ?? "")
|
|
682
682
|
}),
|
|
683
|
-
e.temperature && /* @__PURE__ */ z
|
|
683
|
+
e.temperature && /* @__PURE__ */ B(z, {
|
|
684
684
|
labelProps: {
|
|
685
685
|
label: _,
|
|
686
686
|
className: C,
|
|
@@ -698,7 +698,7 @@ var K = {
|
|
|
698
698
|
]
|
|
699
699
|
});
|
|
700
700
|
}, mt = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
701
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat:
|
|
701
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = ft({
|
|
702
702
|
isOpen: e,
|
|
703
703
|
features: o,
|
|
704
704
|
initialResponseFormat: s,
|
|
@@ -707,7 +707,7 @@ var K = {
|
|
|
707
707
|
onSave: d,
|
|
708
708
|
onClose: r
|
|
709
709
|
});
|
|
710
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ V(Fe, {
|
|
711
711
|
isOpen: e,
|
|
712
712
|
title: f,
|
|
713
713
|
closeLabel: i,
|
|
@@ -715,14 +715,14 @@ var K = {
|
|
|
715
715
|
onBack: t,
|
|
716
716
|
backLabel: n,
|
|
717
717
|
style: a,
|
|
718
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ B(J, {
|
|
719
719
|
features: o,
|
|
720
720
|
responseFormat: w,
|
|
721
721
|
systemPrompt: T,
|
|
722
722
|
temperature: E,
|
|
723
|
-
onResponseFormatChange:
|
|
724
|
-
onSystemPromptChange:
|
|
725
|
-
onTemperatureChange:
|
|
723
|
+
onResponseFormatChange: ee,
|
|
724
|
+
onSystemPromptChange: O,
|
|
725
|
+
onTemperatureChange: k,
|
|
726
726
|
responseFormatLabel: p,
|
|
727
727
|
responseFormatHint: m,
|
|
728
728
|
responseFormatMarkdownLabel: h,
|
|
@@ -732,13 +732,13 @@ var K = {
|
|
|
732
732
|
temperatureLabel: y,
|
|
733
733
|
temperatureLabels: b,
|
|
734
734
|
temperatureHint: x
|
|
735
|
-
}), /* @__PURE__ */
|
|
735
|
+
}), /* @__PURE__ */ B("div", {
|
|
736
736
|
className: l("px-6 py-4 mobile:pb-8"),
|
|
737
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ B(ce, {
|
|
738
738
|
tooltip: C,
|
|
739
739
|
hideTooltip: D || !C,
|
|
740
740
|
triggerClassName: "w-full",
|
|
741
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ B(ne, {
|
|
742
742
|
label: S,
|
|
743
743
|
onClick: A,
|
|
744
744
|
disabled: !D,
|
|
@@ -747,8 +747,8 @@ var K = {
|
|
|
747
747
|
})
|
|
748
748
|
})]
|
|
749
749
|
});
|
|
750
|
-
}, ht = { modal: "_modal_kl0h0_1" }, gt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel:
|
|
751
|
-
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt:
|
|
750
|
+
}, ht = { modal: "_modal_kl0h0_1" }, gt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: h, temperatureLabels: _, temperatureHint: v, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = ht.modal, colors: S }) => {
|
|
751
|
+
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: ee, setTemperature: O, handleSubmit: k } = ft({
|
|
752
752
|
features: e,
|
|
753
753
|
initialResponseFormat: t,
|
|
754
754
|
initialSystemPrompt: n,
|
|
@@ -756,39 +756,39 @@ var K = {
|
|
|
756
756
|
onSave: i,
|
|
757
757
|
onClose: a
|
|
758
758
|
});
|
|
759
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ B(N, {
|
|
760
760
|
open: !0,
|
|
761
761
|
header: o,
|
|
762
762
|
titleClassName: s,
|
|
763
|
-
size:
|
|
763
|
+
size: te.Sm,
|
|
764
764
|
onClose: a,
|
|
765
765
|
className: x,
|
|
766
766
|
overlayStyle: c({ "--csm-bg": S?.background }),
|
|
767
767
|
mainButtons: [{
|
|
768
768
|
label: y,
|
|
769
|
-
variant:
|
|
770
|
-
onClick:
|
|
769
|
+
variant: g.Primary,
|
|
770
|
+
onClick: k,
|
|
771
771
|
disabled: !E,
|
|
772
772
|
tooltipProps: b ? {
|
|
773
773
|
tooltip: b,
|
|
774
774
|
hideTooltip: E
|
|
775
775
|
} : void 0
|
|
776
776
|
}],
|
|
777
|
-
children: /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ B(J, {
|
|
778
778
|
features: e,
|
|
779
779
|
responseFormat: C,
|
|
780
780
|
systemPrompt: w,
|
|
781
781
|
temperature: T,
|
|
782
782
|
onResponseFormatChange: D,
|
|
783
|
-
onSystemPromptChange:
|
|
784
|
-
onTemperatureChange:
|
|
783
|
+
onSystemPromptChange: ee,
|
|
784
|
+
onTemperatureChange: O,
|
|
785
785
|
responseFormatLabel: l,
|
|
786
786
|
responseFormatHint: u,
|
|
787
787
|
responseFormatMarkdownLabel: d,
|
|
788
788
|
responseFormatPlainTextLabel: f,
|
|
789
789
|
systemPromptLabel: p,
|
|
790
790
|
systemPromptTooltip: m,
|
|
791
|
-
temperatureLabel:
|
|
791
|
+
temperatureLabel: h,
|
|
792
792
|
temperatureLabels: _,
|
|
793
793
|
temperatureHint: v
|
|
794
794
|
})
|
|
@@ -796,12 +796,12 @@ var K = {
|
|
|
796
796
|
}, _t = {
|
|
797
797
|
icon: "_icon_1fv6z_1",
|
|
798
798
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
799
|
-
}, vt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors:
|
|
800
|
-
let
|
|
801
|
-
"--tbs-icon-text":
|
|
802
|
-
"--tbs-selected-icon-text":
|
|
799
|
+
}, vt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: f }) => {
|
|
800
|
+
let m = c({
|
|
801
|
+
"--tbs-icon-text": f?.iconText,
|
|
802
|
+
"--tbs-selected-icon-text": f?.selectedIconText
|
|
803
803
|
});
|
|
804
|
-
return /* @__PURE__ */
|
|
804
|
+
return /* @__PURE__ */ B(Fe, {
|
|
805
805
|
isOpen: e,
|
|
806
806
|
title: o,
|
|
807
807
|
closeLabel: i,
|
|
@@ -809,30 +809,30 @@ var K = {
|
|
|
809
809
|
onBack: t,
|
|
810
810
|
backLabel: n,
|
|
811
811
|
style: a,
|
|
812
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ B("ul", {
|
|
813
813
|
role: "menu",
|
|
814
814
|
className: "flex flex-col pb-4",
|
|
815
|
-
style:
|
|
816
|
-
children: s.map((e) => /* @__PURE__ */
|
|
815
|
+
style: m,
|
|
816
|
+
children: s.map((e) => /* @__PURE__ */ B("li", {
|
|
817
817
|
role: "none",
|
|
818
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ B(h, {
|
|
819
819
|
type: "button",
|
|
820
820
|
role: "menuitemcheckbox",
|
|
821
821
|
"aria-checked": e.isSelected,
|
|
822
822
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
823
|
-
iconBefore: /* @__PURE__ */
|
|
823
|
+
iconBefore: /* @__PURE__ */ B("span", {
|
|
824
824
|
className: l("flex items-center", _t.icon),
|
|
825
825
|
children: e.icon
|
|
826
826
|
}),
|
|
827
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
827
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ B("span", {
|
|
828
828
|
className: l("ms-auto", _t.selectedIcon),
|
|
829
|
-
children: /* @__PURE__ */
|
|
830
|
-
size:
|
|
829
|
+
children: /* @__PURE__ */ B(he, {
|
|
830
|
+
size: p,
|
|
831
831
|
"aria-hidden": !0,
|
|
832
|
-
stroke:
|
|
832
|
+
stroke: y
|
|
833
833
|
})
|
|
834
834
|
}) : null,
|
|
835
|
-
label: /* @__PURE__ */
|
|
835
|
+
label: /* @__PURE__ */ B("span", {
|
|
836
836
|
className: d,
|
|
837
837
|
children: e.label
|
|
838
838
|
}),
|
|
@@ -844,242 +844,269 @@ var K = {
|
|
|
844
844
|
}, yt = {
|
|
845
845
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
846
846
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
847
|
-
}, bt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName:
|
|
848
|
-
let k = d(), [
|
|
847
|
+
}, bt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: m = "w-[240px]", isDisabled: h = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: x = [], onToolToggle: S, toolsMenuTitle: w = "Tools", toolsBackLabel: T = "Back", menuOverlays: E, getCaretPosition: D, colors: O }) => {
|
|
848
|
+
let k = d(), A = f(), [j, M] = K(!1), N = G(0), [te, ne] = K(!1), [P, F] = K(!1), [I, L] = K(!1), [R, re] = K(null), z = H((e) => {
|
|
849
|
+
e && (N.current = 0), ne(e), e || (L(!1), re(null));
|
|
850
|
+
}, []), ie = G(A);
|
|
851
|
+
U(() => {
|
|
852
|
+
ie.current !== A && (ie.current = A, A ? (M(te && !I && R === null), ne(!1)) : (N.current = I || R !== null ? -1 : 0, ne(j || I || R !== null), M(!1)));
|
|
853
|
+
}, [
|
|
854
|
+
A,
|
|
855
|
+
te,
|
|
856
|
+
j,
|
|
857
|
+
I,
|
|
858
|
+
R
|
|
859
|
+
]);
|
|
860
|
+
let ae = W(() => c({
|
|
849
861
|
"--aab-tool-icon": O?.toolIcon,
|
|
850
862
|
"--aab-chevron-icon": O?.chevronIcon
|
|
851
|
-
}), [O?.toolIcon, O?.chevronIcon]),
|
|
863
|
+
}), [O?.toolIcon, O?.chevronIcon]), oe = x.length > 0 && S != null, se = W(() => x.map((e) => ({
|
|
852
864
|
key: e.id,
|
|
853
865
|
label: e.label,
|
|
854
|
-
icon: /* @__PURE__ */
|
|
855
|
-
style:
|
|
866
|
+
icon: /* @__PURE__ */ B("span", {
|
|
867
|
+
style: ae,
|
|
856
868
|
className: l("flex items-center", yt.toolIcon),
|
|
857
869
|
children: e.icon
|
|
858
870
|
}),
|
|
859
871
|
selectable: !0,
|
|
860
|
-
mark:
|
|
872
|
+
mark: ee.Check,
|
|
861
873
|
checked: e.isSelected,
|
|
862
|
-
onClick: () =>
|
|
874
|
+
onClick: () => S?.(e.id)
|
|
863
875
|
})), [
|
|
864
|
-
b,
|
|
865
876
|
x,
|
|
866
|
-
|
|
867
|
-
|
|
877
|
+
S,
|
|
878
|
+
ae
|
|
879
|
+
]), ce = W(() => [
|
|
868
880
|
...e == null ? [] : [{
|
|
869
881
|
key: "attach",
|
|
870
882
|
label: r,
|
|
871
|
-
icon: /* @__PURE__ */
|
|
872
|
-
size:
|
|
883
|
+
icon: /* @__PURE__ */ B(be, {
|
|
884
|
+
size: p,
|
|
873
885
|
"aria-hidden": !0,
|
|
874
|
-
stroke:
|
|
886
|
+
stroke: y
|
|
875
887
|
}),
|
|
876
888
|
onClick: e
|
|
877
889
|
}],
|
|
878
|
-
...
|
|
879
|
-
...
|
|
890
|
+
..._ ?? [],
|
|
891
|
+
...oe ? [{
|
|
880
892
|
key: "tools",
|
|
881
|
-
label:
|
|
882
|
-
icon: /* @__PURE__ */
|
|
883
|
-
size:
|
|
893
|
+
label: w,
|
|
894
|
+
icon: /* @__PURE__ */ B(we, {
|
|
895
|
+
size: p,
|
|
884
896
|
"aria-hidden": !0,
|
|
885
|
-
stroke:
|
|
897
|
+
stroke: y
|
|
886
898
|
}),
|
|
887
|
-
onClick:
|
|
888
|
-
|
|
899
|
+
onClick: A ? () => {
|
|
900
|
+
L(!0);
|
|
889
901
|
} : () => void 0,
|
|
890
|
-
...
|
|
891
|
-
size:
|
|
892
|
-
stroke:
|
|
893
|
-
style:
|
|
902
|
+
...A ? { iconAfter: /* @__PURE__ */ B(_e, {
|
|
903
|
+
size: p,
|
|
904
|
+
stroke: y,
|
|
905
|
+
style: ae,
|
|
894
906
|
className: l("rtl:scale-x-[-1]", yt.chevronIcon),
|
|
895
907
|
"aria-hidden": !0
|
|
896
|
-
}) } : {
|
|
908
|
+
}) } : {
|
|
909
|
+
children: se,
|
|
910
|
+
subMenuOpen: I,
|
|
911
|
+
onSubMenuOpenChange: (e) => {
|
|
912
|
+
L(e), e && re(null);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
897
915
|
}] : [],
|
|
898
|
-
...(
|
|
916
|
+
...(E ?? []).map((e) => ({
|
|
899
917
|
key: e.key,
|
|
900
918
|
label: e.title,
|
|
901
919
|
icon: e.icon,
|
|
902
|
-
onClick:
|
|
903
|
-
|
|
920
|
+
onClick: A ? () => {
|
|
921
|
+
re(e.key);
|
|
904
922
|
} : () => void 0,
|
|
905
|
-
...
|
|
906
|
-
size:
|
|
907
|
-
stroke:
|
|
908
|
-
style:
|
|
923
|
+
...A ? { iconAfter: /* @__PURE__ */ B(_e, {
|
|
924
|
+
size: p,
|
|
925
|
+
stroke: y,
|
|
926
|
+
style: ae,
|
|
909
927
|
className: l("rtl:scale-x-[-1]", yt.chevronIcon),
|
|
910
928
|
"aria-hidden": !0
|
|
911
929
|
}) } : {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
930
|
+
subMenuOpen: R === e.key,
|
|
931
|
+
onSubMenuOpenChange: (t) => {
|
|
932
|
+
re((n) => t ? e.key : n === e.key ? null : n), t && L(!1);
|
|
933
|
+
},
|
|
934
|
+
renderSubMenu: () => e.renderOverlay(() => z(!1), D?.() ?? 0)
|
|
917
935
|
}
|
|
918
936
|
})),
|
|
919
937
|
...t == null ? [] : [{
|
|
920
938
|
key: "record-voice",
|
|
921
939
|
label: n,
|
|
922
|
-
icon: /* @__PURE__ */
|
|
923
|
-
size:
|
|
940
|
+
icon: /* @__PURE__ */ B(ye, {
|
|
941
|
+
size: p,
|
|
924
942
|
"aria-hidden": !0,
|
|
925
|
-
stroke:
|
|
943
|
+
stroke: y
|
|
926
944
|
}),
|
|
927
945
|
onClick: () => {
|
|
928
|
-
|
|
946
|
+
z(!1), t();
|
|
929
947
|
}
|
|
930
948
|
}],
|
|
931
|
-
...
|
|
949
|
+
...g == null ? [] : [{
|
|
932
950
|
key: "chat-settings",
|
|
933
|
-
label:
|
|
934
|
-
icon: /* @__PURE__ */
|
|
935
|
-
size:
|
|
951
|
+
label: g.menuItemLabel ?? "Chat settings",
|
|
952
|
+
icon: /* @__PURE__ */ B(Ce, {
|
|
953
|
+
size: p,
|
|
936
954
|
"aria-hidden": !0,
|
|
937
|
-
stroke:
|
|
955
|
+
stroke: y
|
|
938
956
|
}),
|
|
939
|
-
iconAfter: k ? /* @__PURE__ */
|
|
940
|
-
size:
|
|
941
|
-
stroke:
|
|
942
|
-
style:
|
|
957
|
+
iconAfter: k ? /* @__PURE__ */ B(_e, {
|
|
958
|
+
size: p,
|
|
959
|
+
stroke: y,
|
|
960
|
+
style: ae,
|
|
943
961
|
className: l("rtl:scale-x-[-1]", yt.chevronIcon),
|
|
944
962
|
"aria-hidden": !0
|
|
945
963
|
}) : null,
|
|
946
|
-
onClick: () =>
|
|
964
|
+
onClick: () => F(!0)
|
|
947
965
|
}]
|
|
948
966
|
], [
|
|
967
|
+
z,
|
|
949
968
|
r,
|
|
950
969
|
e,
|
|
951
970
|
t,
|
|
952
971
|
n,
|
|
953
|
-
h,
|
|
954
972
|
g,
|
|
973
|
+
_,
|
|
955
974
|
k,
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
975
|
+
A,
|
|
976
|
+
oe,
|
|
977
|
+
I,
|
|
978
|
+
R,
|
|
979
|
+
w,
|
|
980
|
+
se,
|
|
960
981
|
E,
|
|
961
|
-
|
|
982
|
+
D,
|
|
983
|
+
ae
|
|
962
984
|
]);
|
|
963
|
-
if (
|
|
964
|
-
let
|
|
985
|
+
if (ce.length === 0) return null;
|
|
986
|
+
let ue = /* @__PURE__ */ B(b, {
|
|
965
987
|
matchReferenceWidth: !1,
|
|
966
988
|
placement: "bottom-start",
|
|
967
|
-
listClassName:
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
989
|
+
listClassName: m,
|
|
990
|
+
initialFocus: N.current,
|
|
991
|
+
overlayAriaLabel: i,
|
|
992
|
+
items: ce,
|
|
993
|
+
disabled: h,
|
|
994
|
+
open: te,
|
|
995
|
+
onOpenChange: z,
|
|
996
|
+
children: /* @__PURE__ */ B(C, {
|
|
997
|
+
icon: /* @__PURE__ */ B(Se, {
|
|
998
|
+
size: v.LG,
|
|
976
999
|
"aria-hidden": !0,
|
|
977
|
-
stroke:
|
|
1000
|
+
stroke: y
|
|
978
1001
|
}),
|
|
979
1002
|
"aria-label": i,
|
|
1003
|
+
"aria-haspopup": "menu",
|
|
980
1004
|
tooltipProps: { tooltip: i },
|
|
981
|
-
disabled:
|
|
1005
|
+
disabled: h
|
|
982
1006
|
})
|
|
983
1007
|
});
|
|
984
|
-
return /* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1008
|
+
return /* @__PURE__ */ V(le, { children: [
|
|
1009
|
+
A ? /* @__PURE__ */ V(le, { children: [
|
|
1010
|
+
/* @__PURE__ */ B(C, {
|
|
1011
|
+
icon: /* @__PURE__ */ B(Se, {
|
|
1012
|
+
size: v.LG,
|
|
1013
|
+
"aria-hidden": !0,
|
|
1014
|
+
stroke: y
|
|
1015
|
+
}),
|
|
1016
|
+
"aria-label": i,
|
|
1017
|
+
tooltipProps: { tooltip: i },
|
|
1018
|
+
disabled: h,
|
|
1019
|
+
onClick: () => M(!0)
|
|
990
1020
|
}),
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1021
|
+
/* @__PURE__ */ B(dt, {
|
|
1022
|
+
isOpen: j,
|
|
1023
|
+
title: a,
|
|
1024
|
+
closeLabel: s,
|
|
1025
|
+
onClose: () => M(!1),
|
|
1026
|
+
style: u,
|
|
1027
|
+
items: ce,
|
|
1028
|
+
className: "pb-4",
|
|
1029
|
+
btnTextClassName: "flex-1"
|
|
1030
|
+
}),
|
|
1031
|
+
oe && /* @__PURE__ */ B(vt, {
|
|
1032
|
+
isOpen: I,
|
|
1033
|
+
onBack: () => {
|
|
1034
|
+
L(!1), M(!0);
|
|
1035
|
+
},
|
|
1036
|
+
backLabel: T,
|
|
1037
|
+
onClose: () => z(!1),
|
|
1038
|
+
closeLabel: s,
|
|
1039
|
+
style: u,
|
|
1040
|
+
title: w,
|
|
1041
|
+
items: x,
|
|
1042
|
+
onToolToggle: S
|
|
1043
|
+
}),
|
|
1044
|
+
E?.map((e) => /* @__PURE__ */ B(Fe, {
|
|
1045
|
+
isOpen: R === e.key,
|
|
1046
|
+
title: e.title,
|
|
1047
|
+
closeLabel: s,
|
|
1048
|
+
onBack: () => {
|
|
1049
|
+
re(null), M(!0);
|
|
1050
|
+
},
|
|
1051
|
+
backLabel: e.backLabel ?? "Back",
|
|
1052
|
+
onClose: () => z(!1),
|
|
1053
|
+
style: u,
|
|
1054
|
+
children: /* @__PURE__ */ B("div", {
|
|
1055
|
+
role: "menu",
|
|
1056
|
+
"aria-label": e.title,
|
|
1057
|
+
children: e.renderOverlay(() => z(!1), D?.() ?? 0)
|
|
1058
|
+
})
|
|
1059
|
+
}, e.key))
|
|
1060
|
+
] }) : /* @__PURE__ */ B(le, { children: ue }),
|
|
1061
|
+
k && g != null && /* @__PURE__ */ B(mt, {
|
|
1062
|
+
isOpen: P,
|
|
1008
1063
|
onBack: () => {
|
|
1009
|
-
|
|
1064
|
+
F(!1), A ? M(!0) : ne(!0);
|
|
1010
1065
|
},
|
|
1011
|
-
backLabel:
|
|
1012
|
-
onClose: () =>
|
|
1066
|
+
backLabel: g.backLabel ?? "Back",
|
|
1067
|
+
onClose: () => F(!1),
|
|
1013
1068
|
closeLabel: s,
|
|
1014
1069
|
style: u,
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1070
|
+
features: g.features,
|
|
1071
|
+
initialResponseFormat: g.responseFormat ?? o.Markdown,
|
|
1072
|
+
initialSystemPrompt: g.systemPrompt,
|
|
1073
|
+
initialTemperature: g.temperature,
|
|
1074
|
+
onSave: g.onSave,
|
|
1075
|
+
title: g.title,
|
|
1076
|
+
responseFormatLabel: g.responseFormatLabel,
|
|
1077
|
+
responseFormatHint: g.responseFormatHint,
|
|
1078
|
+
responseFormatMarkdownLabel: g.responseFormatMarkdownLabel,
|
|
1079
|
+
responseFormatPlainTextLabel: g.responseFormatPlainTextLabel,
|
|
1080
|
+
systemPromptLabel: g.systemPromptLabel,
|
|
1081
|
+
systemPromptTooltip: g.systemPromptTooltip,
|
|
1082
|
+
temperatureLabel: g.temperatureLabel,
|
|
1083
|
+
temperatureLabels: g.temperatureLabels,
|
|
1084
|
+
temperatureHint: g.temperatureHint,
|
|
1085
|
+
saveLabel: g.saveLabel,
|
|
1086
|
+
saveDisabledTooltip: g.saveDisabledTooltip
|
|
1018
1087
|
}),
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
},
|
|
1040
|
-
backLabel: h.backLabel ?? "Back",
|
|
1041
|
-
onClose: () => M(!1),
|
|
1042
|
-
closeLabel: s,
|
|
1043
|
-
style: u,
|
|
1044
|
-
features: h.features,
|
|
1045
|
-
initialResponseFormat: h.responseFormat ?? o.Markdown,
|
|
1046
|
-
initialSystemPrompt: h.systemPrompt,
|
|
1047
|
-
initialTemperature: h.temperature,
|
|
1048
|
-
onSave: h.onSave,
|
|
1049
|
-
title: h.title,
|
|
1050
|
-
responseFormatLabel: h.responseFormatLabel,
|
|
1051
|
-
responseFormatHint: h.responseFormatHint,
|
|
1052
|
-
responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
|
|
1053
|
-
responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
|
|
1054
|
-
systemPromptLabel: h.systemPromptLabel,
|
|
1055
|
-
systemPromptTooltip: h.systemPromptTooltip,
|
|
1056
|
-
temperatureLabel: h.temperatureLabel,
|
|
1057
|
-
temperatureLabels: h.temperatureLabels,
|
|
1058
|
-
temperatureHint: h.temperatureHint,
|
|
1059
|
-
saveLabel: h.saveLabel,
|
|
1060
|
-
saveDisabledTooltip: h.saveDisabledTooltip
|
|
1088
|
+
!k && g != null && P && /* @__PURE__ */ B(gt, {
|
|
1089
|
+
features: g.features,
|
|
1090
|
+
initialResponseFormat: g.responseFormat ?? o.Markdown,
|
|
1091
|
+
initialSystemPrompt: g.systemPrompt,
|
|
1092
|
+
initialTemperature: g.temperature,
|
|
1093
|
+
onSave: g.onSave,
|
|
1094
|
+
onClose: () => F(!1),
|
|
1095
|
+
title: g.title,
|
|
1096
|
+
responseFormatLabel: g.responseFormatLabel,
|
|
1097
|
+
responseFormatHint: g.responseFormatHint,
|
|
1098
|
+
responseFormatMarkdownLabel: g.responseFormatMarkdownLabel,
|
|
1099
|
+
responseFormatPlainTextLabel: g.responseFormatPlainTextLabel,
|
|
1100
|
+
systemPromptLabel: g.systemPromptLabel,
|
|
1101
|
+
systemPromptTooltip: g.systemPromptTooltip,
|
|
1102
|
+
temperatureLabel: g.temperatureLabel,
|
|
1103
|
+
temperatureLabels: g.temperatureLabels,
|
|
1104
|
+
temperatureHint: g.temperatureHint,
|
|
1105
|
+
saveLabel: g.saveLabel,
|
|
1106
|
+
saveDisabledTooltip: g.saveDisabledTooltip,
|
|
1107
|
+
colors: g.modalColors
|
|
1061
1108
|
})
|
|
1062
|
-
] })
|
|
1063
|
-
features: h.features,
|
|
1064
|
-
initialResponseFormat: h.responseFormat ?? o.Markdown,
|
|
1065
|
-
initialSystemPrompt: h.systemPrompt,
|
|
1066
|
-
initialTemperature: h.temperature,
|
|
1067
|
-
onSave: h.onSave,
|
|
1068
|
-
onClose: () => M(!1),
|
|
1069
|
-
title: h.title,
|
|
1070
|
-
responseFormatLabel: h.responseFormatLabel,
|
|
1071
|
-
responseFormatHint: h.responseFormatHint,
|
|
1072
|
-
responseFormatMarkdownLabel: h.responseFormatMarkdownLabel,
|
|
1073
|
-
responseFormatPlainTextLabel: h.responseFormatPlainTextLabel,
|
|
1074
|
-
systemPromptLabel: h.systemPromptLabel,
|
|
1075
|
-
systemPromptTooltip: h.systemPromptTooltip,
|
|
1076
|
-
temperatureLabel: h.temperatureLabel,
|
|
1077
|
-
temperatureLabels: h.temperatureLabels,
|
|
1078
|
-
temperatureHint: h.temperatureHint,
|
|
1079
|
-
saveLabel: h.saveLabel,
|
|
1080
|
-
saveDisabledTooltip: h.saveDisabledTooltip,
|
|
1081
|
-
colors: h.modalColors
|
|
1082
|
-
})] }) });
|
|
1109
|
+
] });
|
|
1083
1110
|
}, xt = {
|
|
1084
1111
|
chip: "_chip_1lvv5_1",
|
|
1085
1112
|
chipSelected: "_chipSelected_1lvv5_9",
|
|
@@ -1103,50 +1130,50 @@ var K = {
|
|
|
1103
1130
|
"--ci-chip-state-text": u?.chipStateText,
|
|
1104
1131
|
"--ci-chip-close": u?.chipClose,
|
|
1105
1132
|
"--ci-chip-close-hover": u?.chipCloseHover
|
|
1106
|
-
}), p = (e) => /* @__PURE__ */
|
|
1133
|
+
}), p = (e) => /* @__PURE__ */ B("span", {
|
|
1107
1134
|
className: l(xt.chipIcon, "flex shrink-0"),
|
|
1108
1135
|
children: e.icon
|
|
1109
|
-
}), m = (e) => /* @__PURE__ */
|
|
1136
|
+
}), m = (e) => /* @__PURE__ */ V("span", {
|
|
1110
1137
|
className: "flex min-w-0 items-center",
|
|
1111
|
-
children: [/* @__PURE__ */
|
|
1138
|
+
children: [/* @__PURE__ */ V("span", {
|
|
1112
1139
|
className: l(xt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
1113
|
-
children: [e.label, d && /* @__PURE__ */
|
|
1140
|
+
children: [e.label, d && /* @__PURE__ */ B("span", {
|
|
1114
1141
|
"aria-hidden": !0,
|
|
1115
1142
|
children: ":"
|
|
1116
1143
|
})]
|
|
1117
|
-
}), d && /* @__PURE__ */
|
|
1144
|
+
}), d && /* @__PURE__ */ B("span", {
|
|
1118
1145
|
className: l(xt.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
|
|
1119
1146
|
"aria-hidden": !0,
|
|
1120
1147
|
children: e.isSelected ? a : o
|
|
1121
1148
|
})]
|
|
1122
1149
|
});
|
|
1123
|
-
return /* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ B("div", {
|
|
1124
1151
|
className: "flex flex-wrap items-center gap-2",
|
|
1125
1152
|
style: f,
|
|
1126
|
-
children: e.map((e) => r ? /* @__PURE__ */
|
|
1153
|
+
children: e.map((e) => r ? /* @__PURE__ */ V("div", {
|
|
1127
1154
|
className: l(xt.chip, e.isSelected && xt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
|
|
1128
|
-
children: [/* @__PURE__ */
|
|
1155
|
+
children: [/* @__PURE__ */ V("button", {
|
|
1129
1156
|
type: "button",
|
|
1130
1157
|
onClick: () => t(e.id),
|
|
1131
1158
|
"aria-pressed": e.isSelected,
|
|
1132
1159
|
className: "flex min-w-0 items-center gap-1.5",
|
|
1133
|
-
children: [/* @__PURE__ */
|
|
1160
|
+
children: [/* @__PURE__ */ B("span", {
|
|
1134
1161
|
className: "flex shrink-0",
|
|
1135
1162
|
"aria-hidden": !0,
|
|
1136
1163
|
children: p(e)
|
|
1137
1164
|
}), m(e)]
|
|
1138
|
-
}), /* @__PURE__ */
|
|
1165
|
+
}), /* @__PURE__ */ B("button", {
|
|
1139
1166
|
type: "button",
|
|
1140
1167
|
onClick: () => n(e.id),
|
|
1141
1168
|
"aria-label": i(e.label),
|
|
1142
1169
|
className: l(xt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
1143
|
-
children: /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ B(Te, {
|
|
1144
1171
|
size: 12,
|
|
1145
1172
|
"aria-hidden": !0,
|
|
1146
|
-
stroke:
|
|
1173
|
+
stroke: y
|
|
1147
1174
|
})
|
|
1148
1175
|
})]
|
|
1149
|
-
}, e.id) : /* @__PURE__ */
|
|
1176
|
+
}, e.id) : /* @__PURE__ */ B(se, {
|
|
1150
1177
|
icon: p(e),
|
|
1151
1178
|
label: m(e),
|
|
1152
1179
|
isSelected: e.isSelected,
|
|
@@ -1154,7 +1181,7 @@ var K = {
|
|
|
1154
1181
|
className: l(xt.chip, e.isSelected && xt.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
|
|
1155
1182
|
}, e.id))
|
|
1156
1183
|
});
|
|
1157
|
-
},
|
|
1184
|
+
}, Y = {
|
|
1158
1185
|
wrapper: "_wrapper_13067_2",
|
|
1159
1186
|
wrapperDisabled: "_wrapperDisabled_13067_9",
|
|
1160
1187
|
textarea: "_textarea_13067_13",
|
|
@@ -1174,7 +1201,7 @@ var K = {
|
|
|
1174
1201
|
recordingDot: "_recordingDot_18zb5_15",
|
|
1175
1202
|
"recording-pulse": "_recording-pulse_18zb5_1"
|
|
1176
1203
|
}, Tt = 3, Et = 4, Dt = 200, Ot = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
|
|
1177
|
-
let f =
|
|
1204
|
+
let f = G(null), p = G(new Float32Array(Dt)), m = G(0), h = G(0), g = e === tt.Recording, _ = e === tt.Processing, b = H((e) => {
|
|
1178
1205
|
let t = e.getContext("2d");
|
|
1179
1206
|
if (!t) return;
|
|
1180
1207
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
@@ -1188,7 +1215,7 @@ var K = {
|
|
|
1188
1215
|
}
|
|
1189
1216
|
t.restore();
|
|
1190
1217
|
}, []);
|
|
1191
|
-
|
|
1218
|
+
U(() => {
|
|
1192
1219
|
if (!g) return;
|
|
1193
1220
|
let e = f.current;
|
|
1194
1221
|
if (!e) return;
|
|
@@ -1217,7 +1244,7 @@ var K = {
|
|
|
1217
1244
|
g,
|
|
1218
1245
|
t,
|
|
1219
1246
|
b
|
|
1220
|
-
]),
|
|
1247
|
+
]), U(() => {
|
|
1221
1248
|
let e = f.current;
|
|
1222
1249
|
if (!e) return;
|
|
1223
1250
|
let t = new ResizeObserver(() => {
|
|
@@ -1225,104 +1252,104 @@ var K = {
|
|
|
1225
1252
|
});
|
|
1226
1253
|
return t.observe(e), () => t.disconnect();
|
|
1227
1254
|
}, [b]);
|
|
1228
|
-
let x = /* @__PURE__ */
|
|
1255
|
+
let x = /* @__PURE__ */ V("div", {
|
|
1229
1256
|
className: "flex shrink-0 items-center justify-end gap-1",
|
|
1230
1257
|
children: [
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
icon: /* @__PURE__ */
|
|
1233
|
-
size:
|
|
1258
|
+
/* @__PURE__ */ B(k, {
|
|
1259
|
+
icon: /* @__PURE__ */ B(Te, {
|
|
1260
|
+
size: v.LG,
|
|
1234
1261
|
"aria-hidden": !0,
|
|
1235
|
-
stroke:
|
|
1262
|
+
stroke: y
|
|
1236
1263
|
}),
|
|
1237
1264
|
"aria-label": o,
|
|
1238
1265
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
1239
1266
|
onClick: r
|
|
1240
1267
|
}),
|
|
1241
|
-
g && /* @__PURE__ */
|
|
1242
|
-
icon: /* @__PURE__ */
|
|
1243
|
-
size:
|
|
1268
|
+
g && /* @__PURE__ */ B(P, {
|
|
1269
|
+
icon: /* @__PURE__ */ B(he, {
|
|
1270
|
+
size: v.LG,
|
|
1244
1271
|
"aria-hidden": !0,
|
|
1245
|
-
stroke:
|
|
1272
|
+
stroke: y
|
|
1246
1273
|
}),
|
|
1247
1274
|
onClick: () => n?.(),
|
|
1248
1275
|
autoFocus: !0,
|
|
1249
1276
|
"aria-label": a,
|
|
1250
1277
|
className: "mobile:min-h-11 mobile:min-w-11"
|
|
1251
1278
|
}),
|
|
1252
|
-
|
|
1279
|
+
_ && /* @__PURE__ */ B("span", {
|
|
1253
1280
|
className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
1254
|
-
children: /* @__PURE__ */
|
|
1281
|
+
children: /* @__PURE__ */ B(ie, {
|
|
1255
1282
|
size: 20,
|
|
1256
1283
|
ariaLabel: s
|
|
1257
1284
|
})
|
|
1258
1285
|
})
|
|
1259
1286
|
]
|
|
1260
1287
|
});
|
|
1261
|
-
return /* @__PURE__ */
|
|
1288
|
+
return /* @__PURE__ */ B("div", {
|
|
1262
1289
|
className: u,
|
|
1263
|
-
children: /* @__PURE__ */
|
|
1290
|
+
children: /* @__PURE__ */ V("div", {
|
|
1264
1291
|
style: c,
|
|
1265
|
-
className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d &&
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1292
|
+
className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && Y.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
|
|
1293
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1267
1294
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1268
|
-
children: [g && /* @__PURE__ */
|
|
1295
|
+
children: [g && /* @__PURE__ */ B("span", {
|
|
1269
1296
|
className: l(wt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1270
1297
|
"aria-hidden": !0
|
|
1271
|
-
}), /* @__PURE__ */
|
|
1298
|
+
}), /* @__PURE__ */ B("canvas", {
|
|
1272
1299
|
ref: f,
|
|
1273
1300
|
height: 26,
|
|
1274
1301
|
"aria-hidden": !0,
|
|
1275
1302
|
className: l(wt.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
1276
1303
|
})]
|
|
1277
|
-
}), /* @__PURE__ */
|
|
1304
|
+
}), /* @__PURE__ */ V("div", {
|
|
1278
1305
|
className: "flex items-center justify-between gap-2",
|
|
1279
|
-
children: [i ?? /* @__PURE__ */
|
|
1306
|
+
children: [i ?? /* @__PURE__ */ B("span", { "aria-hidden": !0 }), x]
|
|
1280
1307
|
})]
|
|
1281
1308
|
})
|
|
1282
1309
|
});
|
|
1283
|
-
}, kt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */
|
|
1310
|
+
}, kt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ B(P, {
|
|
1284
1311
|
"aria-label": n,
|
|
1285
1312
|
onClick: () => e?.(),
|
|
1286
1313
|
disabled: t,
|
|
1287
1314
|
tooltipProps: r ? { tooltip: r } : void 0,
|
|
1288
|
-
icon: /* @__PURE__ */
|
|
1289
|
-
size:
|
|
1315
|
+
icon: /* @__PURE__ */ B(me, {
|
|
1316
|
+
size: v.LG,
|
|
1290
1317
|
className: "rtl:scale-x-[-1]",
|
|
1291
|
-
stroke:
|
|
1318
|
+
stroke: y
|
|
1292
1319
|
})
|
|
1293
|
-
}), At = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */
|
|
1294
|
-
icon: /* @__PURE__ */
|
|
1295
|
-
size:
|
|
1296
|
-
stroke:
|
|
1320
|
+
}), At = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B(k, {
|
|
1321
|
+
icon: /* @__PURE__ */ B(xe, {
|
|
1322
|
+
size: v.LG,
|
|
1323
|
+
stroke: y
|
|
1297
1324
|
}),
|
|
1298
1325
|
onClick: () => e?.(),
|
|
1299
1326
|
"aria-label": t
|
|
1300
|
-
}), jt = ({ size: e = 20 }) => /* @__PURE__ */
|
|
1301
|
-
variant:
|
|
1327
|
+
}), jt = ({ size: e = 20 }) => /* @__PURE__ */ B(R, {
|
|
1328
|
+
variant: re.Circular,
|
|
1302
1329
|
width: e,
|
|
1303
1330
|
height: e,
|
|
1304
1331
|
active: !0
|
|
1305
|
-
}), Mt = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1332
|
+
}), Mt = ({ loadingLabel: e }) => /* @__PURE__ */ V("span", {
|
|
1306
1333
|
className: "flex min-w-0 flex-1 items-center",
|
|
1307
|
-
children: [/* @__PURE__ */
|
|
1308
|
-
variant:
|
|
1334
|
+
children: [/* @__PURE__ */ B(R, {
|
|
1335
|
+
variant: re.Text,
|
|
1309
1336
|
width: "100%",
|
|
1310
1337
|
height: 16,
|
|
1311
1338
|
active: !0
|
|
1312
|
-
}), e && /* @__PURE__ */
|
|
1339
|
+
}), e && /* @__PURE__ */ B("span", {
|
|
1313
1340
|
className: "sr-only",
|
|
1314
1341
|
children: e
|
|
1315
1342
|
})]
|
|
1316
|
-
}), Nt = () => /* @__PURE__ */
|
|
1343
|
+
}), Nt = () => /* @__PURE__ */ B("div", {
|
|
1317
1344
|
"aria-hidden": "true",
|
|
1318
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1345
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ V("div", {
|
|
1319
1346
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1320
|
-
children: [/* @__PURE__ */
|
|
1347
|
+
children: [/* @__PURE__ */ B(jt, {}), /* @__PURE__ */ B(Mt, {})]
|
|
1321
1348
|
}, t))
|
|
1322
1349
|
}), Pt = (e) => e.displayName ?? e.id, Ft = (e, t) => {
|
|
1323
1350
|
let n = t.trim().toLowerCase();
|
|
1324
1351
|
return n ? e.filter((e) => Pt(e).toLowerCase().includes(n)) : e;
|
|
1325
|
-
}, It = (e, t, r, i = 18, a) => /* @__PURE__ */
|
|
1352
|
+
}, It = (e, t, r, i = 18, a) => /* @__PURE__ */ B(n, {
|
|
1326
1353
|
src: e,
|
|
1327
1354
|
size: i,
|
|
1328
1355
|
labels: { tooltip: a },
|
|
@@ -1335,16 +1362,16 @@ var K = {
|
|
|
1335
1362
|
selectedItemText: "_selectedItemText_1u7db_26",
|
|
1336
1363
|
checkIcon: "_checkIcon_1u7db_30"
|
|
1337
1364
|
}, Rt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
|
|
1338
|
-
let [a, o] =
|
|
1365
|
+
let [a, o] = K(""), s = W(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = W(() => u ? /* @__PURE__ */ B(jt, { size: v.LG }) : It(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", v.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1339
1366
|
u,
|
|
1340
1367
|
s,
|
|
1341
1368
|
d,
|
|
1342
1369
|
r?.unavailableTooltip
|
|
1343
|
-
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g =
|
|
1370
|
+
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = W(() => {
|
|
1344
1371
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
1345
1372
|
key: `__loading-${t}`,
|
|
1346
|
-
icon: /* @__PURE__ */
|
|
1347
|
-
label: /* @__PURE__ */
|
|
1373
|
+
icon: /* @__PURE__ */ B(jt, {}),
|
|
1374
|
+
label: /* @__PURE__ */ B(Mt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1348
1375
|
disabled: !0
|
|
1349
1376
|
}));
|
|
1350
1377
|
if (!e || e.length === 0) {
|
|
@@ -1360,15 +1387,15 @@ var K = {
|
|
|
1360
1387
|
let r = e.id === t;
|
|
1361
1388
|
return {
|
|
1362
1389
|
key: e.id,
|
|
1363
|
-
label: /* @__PURE__ */
|
|
1390
|
+
label: /* @__PURE__ */ B(w, {
|
|
1364
1391
|
text: Pt(e),
|
|
1365
1392
|
query: a,
|
|
1366
1393
|
maxLines: 1
|
|
1367
1394
|
}),
|
|
1368
1395
|
icon: It(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1369
|
-
mark:
|
|
1396
|
+
mark: ee.Check,
|
|
1370
1397
|
checked: r,
|
|
1371
|
-
className: l(o?.itemText && Lt.itemText, o?.itemHoverBackground && Lt.itemHover, r && o?.selectedItemBackground && Lt.selectedItemBackground, r && o?.selectedItemText && Lt.selectedItemText, r && o?.checkIcon && Lt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName,
|
|
1398
|
+
className: l(o?.itemText && Lt.itemText, o?.itemHoverBackground && Lt.itemHover, r && o?.selectedItemBackground && Lt.selectedItemBackground, r && o?.selectedItemText && Lt.selectedItemText, r && o?.checkIcon && Lt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, q.modelMenuItem, r && q.modelMenuItemSelected),
|
|
1372
1399
|
onClick: () => n?.(e.id)
|
|
1373
1400
|
};
|
|
1374
1401
|
});
|
|
@@ -1382,7 +1409,7 @@ var K = {
|
|
|
1382
1409
|
i?.itemClassName,
|
|
1383
1410
|
i?.selectedItemClassName,
|
|
1384
1411
|
i?.colors
|
|
1385
|
-
]),
|
|
1412
|
+
]), _ = W(() => c({
|
|
1386
1413
|
"--ms-item-text": i?.colors?.itemText,
|
|
1387
1414
|
"--ms-item-hover-bg": i?.colors?.itemHoverBackground,
|
|
1388
1415
|
"--ms-selected-item-bg": i?.colors?.selectedItemBackground,
|
|
@@ -1390,18 +1417,20 @@ var K = {
|
|
|
1390
1417
|
"--ms-check-icon": i?.colors?.checkIcon
|
|
1391
1418
|
}), [i?.colors]);
|
|
1392
1419
|
return {
|
|
1420
|
+
searchQuery: a,
|
|
1421
|
+
onSearchQueryChange: o,
|
|
1393
1422
|
selectorIcon: f,
|
|
1394
1423
|
selectorAriaLabel: h,
|
|
1395
1424
|
selectedLabel: p,
|
|
1396
1425
|
selectedVersion: m,
|
|
1397
1426
|
menuItems: g,
|
|
1398
|
-
menuHeader:
|
|
1427
|
+
menuHeader: W(() => !u && e && e.length > 0 ? /* @__PURE__ */ B("div", {
|
|
1399
1428
|
style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
|
|
1400
|
-
className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", Lt.searchHeader, i?.searchHeaderClassName,
|
|
1401
|
-
children: /* @__PURE__ */
|
|
1429
|
+
className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", Lt.searchHeader, i?.searchHeaderClassName, q.modelMenuSearch),
|
|
1430
|
+
children: /* @__PURE__ */ B(L, {
|
|
1402
1431
|
value: a,
|
|
1403
1432
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1404
|
-
size:
|
|
1433
|
+
size: x.Small,
|
|
1405
1434
|
wrapperClassName: "border-0",
|
|
1406
1435
|
onChange: (e) => o(e ?? "")
|
|
1407
1436
|
})
|
|
@@ -1413,12 +1442,12 @@ var K = {
|
|
|
1413
1442
|
i?.searchHeaderClassName,
|
|
1414
1443
|
i?.colors?.searchHeaderBackground
|
|
1415
1444
|
]),
|
|
1416
|
-
menuStyle:
|
|
1445
|
+
menuStyle: _,
|
|
1417
1446
|
onOpenChange: (e) => {
|
|
1418
1447
|
e || o("");
|
|
1419
1448
|
}
|
|
1420
1449
|
};
|
|
1421
|
-
},
|
|
1450
|
+
}, X = typeof window < "u" ? Me : U;
|
|
1422
1451
|
function zt(e) {
|
|
1423
1452
|
let t = e;
|
|
1424
1453
|
for (; t;) {
|
|
@@ -1427,35 +1456,35 @@ function zt(e) {
|
|
|
1427
1456
|
}
|
|
1428
1457
|
return !1;
|
|
1429
1458
|
}
|
|
1430
|
-
function
|
|
1459
|
+
function Bt() {
|
|
1431
1460
|
return () => {};
|
|
1432
1461
|
}
|
|
1433
|
-
function
|
|
1434
|
-
return Ne(
|
|
1462
|
+
function Vt() {
|
|
1463
|
+
return Ne(Bt, () => !1, () => !0);
|
|
1435
1464
|
}
|
|
1436
|
-
function
|
|
1465
|
+
function Ht(e) {
|
|
1437
1466
|
return e?.ownerDocument.defaultView ?? window;
|
|
1438
1467
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return
|
|
1468
|
+
function Z(e) {
|
|
1469
|
+
return Ht(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
1441
1470
|
}
|
|
1442
|
-
function
|
|
1471
|
+
function Q(e) {
|
|
1443
1472
|
if (e !== void 0) switch (typeof e) {
|
|
1444
1473
|
case "number": return e;
|
|
1445
1474
|
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
1446
1475
|
}
|
|
1447
1476
|
}
|
|
1448
|
-
function
|
|
1449
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1450
|
-
styleHeight:
|
|
1451
|
-
styleWidth:
|
|
1452
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1477
|
+
function $({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1478
|
+
let { styleHeight: s, styleWidth: c } = W(() => ({
|
|
1479
|
+
styleHeight: Q(o?.height),
|
|
1480
|
+
styleWidth: Q(o?.width)
|
|
1481
|
+
}), [o?.height, o?.width]), [l, u] = K({
|
|
1453
1482
|
height: t,
|
|
1454
1483
|
width: n
|
|
1455
1484
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1456
|
-
return
|
|
1485
|
+
return X(() => {
|
|
1457
1486
|
if (i === null || d) return;
|
|
1458
|
-
let t =
|
|
1487
|
+
let t = Z(i);
|
|
1459
1488
|
if (!t) return;
|
|
1460
1489
|
let n = new t((e) => {
|
|
1461
1490
|
for (let t of e) {
|
|
@@ -1475,7 +1504,7 @@ function Ht({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1475
1504
|
i,
|
|
1476
1505
|
s,
|
|
1477
1506
|
c
|
|
1478
|
-
]),
|
|
1507
|
+
]), W(() => ({
|
|
1479
1508
|
height: s ?? l.height,
|
|
1480
1509
|
width: c ?? l.width
|
|
1481
1510
|
}), [
|
|
@@ -1485,26 +1514,26 @@ function Ht({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1485
1514
|
]);
|
|
1486
1515
|
}
|
|
1487
1516
|
function Ut(e) {
|
|
1488
|
-
let t =
|
|
1517
|
+
let t = G(() => {
|
|
1489
1518
|
throw Error("Cannot call an event handler while rendering.");
|
|
1490
1519
|
});
|
|
1491
|
-
return
|
|
1520
|
+
return X(() => {
|
|
1492
1521
|
t.current = e;
|
|
1493
|
-
}, [e]),
|
|
1522
|
+
}, [e]), H((...e) => t.current?.(...e), [t]);
|
|
1494
1523
|
}
|
|
1495
|
-
var
|
|
1496
|
-
function
|
|
1497
|
-
let n =
|
|
1524
|
+
var Wt = /* @__PURE__ */ new WeakMap();
|
|
1525
|
+
function Gt(e = !1, t = document) {
|
|
1526
|
+
let n = Wt.get(t);
|
|
1498
1527
|
if (n === void 0 || e) {
|
|
1499
1528
|
let e = t.createElement("div"), r = e.style;
|
|
1500
1529
|
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
1501
1530
|
let i = t.createElement("div"), a = i.style;
|
|
1502
|
-
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e),
|
|
1531
|
+
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), Wt.set(t, n);
|
|
1503
1532
|
}
|
|
1504
1533
|
return n;
|
|
1505
1534
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (t === "horizontal" && n) switch (
|
|
1535
|
+
function Kt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1536
|
+
if (t === "horizontal" && n) switch (Gt(!1, e?.ownerDocument ?? document)) {
|
|
1508
1537
|
case "negative": return -r;
|
|
1509
1538
|
case "positive-descending": if (e) {
|
|
1510
1539
|
let { clientWidth: t, scrollWidth: n } = e;
|
|
@@ -1513,8 +1542,8 @@ function Gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1513
1542
|
}
|
|
1514
1543
|
return r;
|
|
1515
1544
|
}
|
|
1516
|
-
function
|
|
1517
|
-
let r =
|
|
1545
|
+
function qt({ container: e, element: t, onChange: n }) {
|
|
1546
|
+
let r = Ht(t), i = Z(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
|
|
1518
1547
|
e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
|
|
1519
1548
|
}) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
|
|
1520
1549
|
for (let e of l) o?.unobserve(e);
|
|
@@ -1531,33 +1560,33 @@ function Kt({ container: e, element: t, onChange: n }) {
|
|
|
1531
1560
|
o?.disconnect(), c?.disconnect();
|
|
1532
1561
|
};
|
|
1533
1562
|
}
|
|
1534
|
-
function
|
|
1563
|
+
function Jt(e) {
|
|
1535
1564
|
return e.window === e;
|
|
1536
1565
|
}
|
|
1537
|
-
function Jt(e, t) {
|
|
1538
|
-
return t === "window" ? e ? Q(e) : null : t ?? null;
|
|
1539
|
-
}
|
|
1540
1566
|
function Yt(e, t) {
|
|
1541
|
-
return
|
|
1567
|
+
return t === "window" ? e ? Ht(e) : null : t ?? null;
|
|
1542
1568
|
}
|
|
1543
1569
|
function Xt(e, t) {
|
|
1544
|
-
|
|
1545
|
-
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
1570
|
+
return Jt(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
1546
1571
|
}
|
|
1547
1572
|
function Zt(e, t) {
|
|
1548
|
-
let
|
|
1573
|
+
let n = Jt(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
|
|
1574
|
+
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
1575
|
+
}
|
|
1576
|
+
function Qt(e, t) {
|
|
1577
|
+
let { overflowX: n, overflowY: r } = Ht(e).getComputedStyle(e), i = t === "vertical" ? r : n;
|
|
1549
1578
|
return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
1550
1579
|
}
|
|
1551
|
-
function
|
|
1580
|
+
function $t({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
1552
1581
|
let i = t === "vertical", a, o;
|
|
1553
|
-
if (
|
|
1582
|
+
if (Jt(r)) {
|
|
1554
1583
|
let { documentElement: e } = r.document;
|
|
1555
1584
|
a = 0, o = i ? e.clientHeight : e.clientWidth;
|
|
1556
1585
|
} else {
|
|
1557
1586
|
let e = r.getBoundingClientRect();
|
|
1558
1587
|
a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
|
|
1559
1588
|
}
|
|
1560
|
-
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f =
|
|
1589
|
+
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = Kt({
|
|
1561
1590
|
containerElement: e,
|
|
1562
1591
|
direction: t,
|
|
1563
1592
|
isRtl: n,
|
|
@@ -1570,8 +1599,8 @@ function Qt({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
|
1570
1599
|
viewportSize: o
|
|
1571
1600
|
};
|
|
1572
1601
|
}
|
|
1573
|
-
function
|
|
1574
|
-
let i =
|
|
1602
|
+
function en({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
1603
|
+
let i = Jt(n) ? n.document.documentElement : n, a = Ht(i).getComputedStyle(i), o = (e) => {
|
|
1575
1604
|
let t = parseFloat(e ?? "");
|
|
1576
1605
|
return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
|
|
1577
1606
|
};
|
|
@@ -1588,26 +1617,26 @@ function $t({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
|
1588
1617
|
start: s
|
|
1589
1618
|
};
|
|
1590
1619
|
}
|
|
1591
|
-
function
|
|
1620
|
+
function tn(e, t = "Assertion error") {
|
|
1592
1621
|
if (!e) throw console.error(t), Error(t);
|
|
1593
1622
|
}
|
|
1594
|
-
function
|
|
1623
|
+
function nn(e, t) {
|
|
1595
1624
|
if (e === t) return !0;
|
|
1596
|
-
if (!!e != !!t || (
|
|
1625
|
+
if (!!e != !!t || (tn(e !== void 0), tn(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1597
1626
|
for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
|
|
1598
1627
|
return !0;
|
|
1599
1628
|
}
|
|
1600
|
-
function
|
|
1629
|
+
function rn({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1601
1630
|
if (t === 0) return 0;
|
|
1602
1631
|
if (typeof n == "number") return t * n;
|
|
1603
1632
|
{
|
|
1604
1633
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1605
|
-
return
|
|
1634
|
+
return tn(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1606
1635
|
}
|
|
1607
1636
|
}
|
|
1608
|
-
function
|
|
1637
|
+
function an({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
|
|
1609
1638
|
if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
|
|
1610
|
-
let c = t.get(r), l =
|
|
1639
|
+
let c = t.get(r), l = rn({
|
|
1611
1640
|
cachedBounds: t,
|
|
1612
1641
|
itemCount: i,
|
|
1613
1642
|
itemSize: a
|
|
@@ -1619,7 +1648,7 @@ function rn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i,
|
|
|
1619
1648
|
default: return p ? o : o < f ? f : d;
|
|
1620
1649
|
}
|
|
1621
1650
|
}
|
|
1622
|
-
function
|
|
1651
|
+
function on({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1623
1652
|
let a = r - 1;
|
|
1624
1653
|
if (r === 0) return {
|
|
1625
1654
|
startIndexVisible: 0,
|
|
@@ -1653,12 +1682,12 @@ function an({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1653
1682
|
stopIndexOverscan: Math.min(a, s + i)
|
|
1654
1683
|
};
|
|
1655
1684
|
}
|
|
1656
|
-
function
|
|
1685
|
+
function sn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1657
1686
|
let r = /* @__PURE__ */ new Map();
|
|
1658
1687
|
return {
|
|
1659
1688
|
itemSize: typeof n == "number" ? n : void 0,
|
|
1660
1689
|
get(i) {
|
|
1661
|
-
if (
|
|
1690
|
+
if (tn(i < e, `Invalid index ${i}`), typeof n == "number") return tn(i >= 0, `Invalid index ${i}`), {
|
|
1662
1691
|
size: n,
|
|
1663
1692
|
scrollOffset: i * n
|
|
1664
1693
|
};
|
|
@@ -1670,14 +1699,14 @@ function on({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1670
1699
|
});
|
|
1671
1700
|
else {
|
|
1672
1701
|
let t = r.get(e - 1);
|
|
1673
|
-
|
|
1702
|
+
tn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1674
1703
|
scrollOffset: t.scrollOffset + t.size,
|
|
1675
1704
|
size: a
|
|
1676
1705
|
});
|
|
1677
1706
|
}
|
|
1678
1707
|
}
|
|
1679
1708
|
let a = r.get(i);
|
|
1680
|
-
return
|
|
1709
|
+
return tn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1681
1710
|
},
|
|
1682
1711
|
set(e, t) {
|
|
1683
1712
|
r.set(e, t);
|
|
@@ -1687,8 +1716,8 @@ function on({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1687
1716
|
}
|
|
1688
1717
|
};
|
|
1689
1718
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return
|
|
1719
|
+
function cn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1720
|
+
return W(() => sn({
|
|
1692
1721
|
itemCount: e,
|
|
1693
1722
|
itemProps: t,
|
|
1694
1723
|
itemSize: n
|
|
@@ -1698,31 +1727,31 @@ function sn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1698
1727
|
n
|
|
1699
1728
|
]);
|
|
1700
1729
|
}
|
|
1701
|
-
function
|
|
1730
|
+
function ln({ containerSize: e, itemSize: t }) {
|
|
1702
1731
|
let n;
|
|
1703
1732
|
switch (typeof t) {
|
|
1704
1733
|
case "string":
|
|
1705
|
-
|
|
1734
|
+
tn(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), tn(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
|
|
1706
1735
|
break;
|
|
1707
1736
|
default: n = t;
|
|
1708
1737
|
}
|
|
1709
1738
|
return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
|
|
1710
1739
|
}
|
|
1711
|
-
function
|
|
1712
|
-
let f = d !== void 0, p = f ?
|
|
1740
|
+
function un({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
|
|
1741
|
+
let f = d !== void 0, p = f ? Yt(e, d) : e, { height: m = n, width: h = n } = $({
|
|
1713
1742
|
defaultHeight: i === "vertical" ? n : void 0,
|
|
1714
1743
|
defaultWidth: i === "horizontal" ? n : void 0,
|
|
1715
1744
|
element: e,
|
|
1716
1745
|
mode: i === "vertical" ? "only-height" : "only-width",
|
|
1717
1746
|
style: t
|
|
1718
|
-
}), g =
|
|
1747
|
+
}), g = G({
|
|
1719
1748
|
height: 0,
|
|
1720
1749
|
width: 0
|
|
1721
|
-
}), [_, v] =
|
|
1750
|
+
}), [_, v] = K(n), y = f ? _ : i === "vertical" ? m : h, b = ln({
|
|
1722
1751
|
containerSize: y,
|
|
1723
1752
|
itemSize: c
|
|
1724
1753
|
});
|
|
1725
|
-
|
|
1754
|
+
X(() => {
|
|
1726
1755
|
if (typeof l == "function") {
|
|
1727
1756
|
let e = g.current;
|
|
1728
1757
|
(e.height !== m || e.width !== h) && (l({
|
|
@@ -1735,22 +1764,22 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1735
1764
|
l,
|
|
1736
1765
|
h
|
|
1737
1766
|
]);
|
|
1738
|
-
let x =
|
|
1767
|
+
let x = cn({
|
|
1739
1768
|
itemCount: o,
|
|
1740
1769
|
itemProps: s,
|
|
1741
1770
|
itemSize: b
|
|
1742
|
-
}), S =
|
|
1771
|
+
}), S = Vt(), [C] = K(() => S || f ? 0 : r), w = H((e) => x.get(e), [x]), [T, E] = K(() => on({
|
|
1743
1772
|
cachedBounds: x,
|
|
1744
1773
|
containerScrollOffset: C,
|
|
1745
1774
|
containerSize: y,
|
|
1746
1775
|
itemCount: o,
|
|
1747
1776
|
overscanCount: u
|
|
1748
|
-
})), { startIndexVisible: D, startIndexOverscan:
|
|
1777
|
+
})), { startIndexVisible: D, startIndexOverscan: ee, stopIndexVisible: O, stopIndexOverscan: k } = {
|
|
1749
1778
|
startIndexVisible: Math.min(o - 1, T.startIndexVisible),
|
|
1750
1779
|
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
1751
1780
|
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
1752
1781
|
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
1753
|
-
}, A =
|
|
1782
|
+
}, A = H(() => rn({
|
|
1754
1783
|
cachedBounds: x,
|
|
1755
1784
|
itemCount: o,
|
|
1756
1785
|
itemSize: b
|
|
@@ -1758,14 +1787,14 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1758
1787
|
x,
|
|
1759
1788
|
o,
|
|
1760
1789
|
b
|
|
1761
|
-
]), j =
|
|
1762
|
-
let n =
|
|
1790
|
+
]), j = H((t) => {
|
|
1791
|
+
let n = Kt({
|
|
1763
1792
|
containerElement: e,
|
|
1764
1793
|
direction: i,
|
|
1765
1794
|
isRtl: a,
|
|
1766
1795
|
scrollOffset: t
|
|
1767
1796
|
});
|
|
1768
|
-
return
|
|
1797
|
+
return on({
|
|
1769
1798
|
cachedBounds: x,
|
|
1770
1799
|
containerScrollOffset: n,
|
|
1771
1800
|
containerSize: y,
|
|
@@ -1780,17 +1809,17 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1780
1809
|
a,
|
|
1781
1810
|
o,
|
|
1782
1811
|
u
|
|
1783
|
-
]), M =
|
|
1784
|
-
|
|
1812
|
+
]), M = G(!1);
|
|
1813
|
+
X(() => {
|
|
1785
1814
|
if (!e || o === 0 || f || M.current || (M.current = !0, r <= 0)) return;
|
|
1786
1815
|
let t = i === "horizontal" && zt(e);
|
|
1787
|
-
if (
|
|
1816
|
+
if (Kt({
|
|
1788
1817
|
containerElement: e,
|
|
1789
1818
|
direction: i,
|
|
1790
1819
|
isRtl: t,
|
|
1791
1820
|
scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
|
|
1792
1821
|
}) !== 0) return;
|
|
1793
|
-
let n =
|
|
1822
|
+
let n = Kt({
|
|
1794
1823
|
containerElement: e,
|
|
1795
1824
|
direction: i,
|
|
1796
1825
|
isRtl: t,
|
|
@@ -1800,16 +1829,16 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1800
1829
|
behavior: "instant",
|
|
1801
1830
|
[i === "vertical" ? "top" : "left"]: n
|
|
1802
1831
|
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
1803
|
-
}, [e, o]),
|
|
1832
|
+
}, [e, o]), X(() => {
|
|
1804
1833
|
if (f && e && p) return;
|
|
1805
|
-
let t = e && !f ? j(i === "vertical" ? e.scrollTop : e.scrollLeft) :
|
|
1834
|
+
let t = e && !f ? j(i === "vertical" ? e.scrollTop : e.scrollLeft) : on({
|
|
1806
1835
|
cachedBounds: x,
|
|
1807
1836
|
containerScrollOffset: C,
|
|
1808
1837
|
containerSize: y,
|
|
1809
1838
|
itemCount: o,
|
|
1810
1839
|
overscanCount: u
|
|
1811
1840
|
});
|
|
1812
|
-
E((e) =>
|
|
1841
|
+
E((e) => nn(t, e) ? e : t);
|
|
1813
1842
|
}, [
|
|
1814
1843
|
x,
|
|
1815
1844
|
e,
|
|
@@ -1821,23 +1850,23 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1821
1850
|
o,
|
|
1822
1851
|
u,
|
|
1823
1852
|
p
|
|
1824
|
-
]),
|
|
1853
|
+
]), X(() => {
|
|
1825
1854
|
if (!e || f) return;
|
|
1826
1855
|
let t = () => {
|
|
1827
1856
|
E((t) => {
|
|
1828
|
-
let { scrollLeft: n, scrollTop: r } = e, s =
|
|
1857
|
+
let { scrollLeft: n, scrollTop: r } = e, s = Kt({
|
|
1829
1858
|
containerElement: e,
|
|
1830
1859
|
direction: i,
|
|
1831
1860
|
isRtl: a,
|
|
1832
1861
|
scrollOffset: i === "vertical" ? r : n
|
|
1833
|
-
}), c =
|
|
1862
|
+
}), c = on({
|
|
1834
1863
|
cachedBounds: x,
|
|
1835
1864
|
containerScrollOffset: s,
|
|
1836
1865
|
containerSize: y,
|
|
1837
1866
|
itemCount: o,
|
|
1838
1867
|
overscanCount: u
|
|
1839
1868
|
});
|
|
1840
|
-
return
|
|
1869
|
+
return nn(c, t) ? t : c;
|
|
1841
1870
|
});
|
|
1842
1871
|
};
|
|
1843
1872
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1855,32 +1884,32 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1855
1884
|
]);
|
|
1856
1885
|
let N = Ut(() => {
|
|
1857
1886
|
if (!e || !p) return;
|
|
1858
|
-
let { offset: t, size: n, viewportSize: r } =
|
|
1887
|
+
let { offset: t, size: n, viewportSize: r } = $t({
|
|
1859
1888
|
containerElement: e,
|
|
1860
1889
|
direction: i,
|
|
1861
1890
|
isRtl: a,
|
|
1862
1891
|
scrollTarget: p
|
|
1863
1892
|
});
|
|
1864
1893
|
v(r);
|
|
1865
|
-
let s =
|
|
1894
|
+
let s = on({
|
|
1866
1895
|
cachedBounds: x,
|
|
1867
1896
|
containerScrollOffset: t,
|
|
1868
1897
|
containerSize: n,
|
|
1869
1898
|
itemCount: o,
|
|
1870
1899
|
overscanCount: u
|
|
1871
1900
|
});
|
|
1872
|
-
E((e) =>
|
|
1901
|
+
E((e) => nn(s, e) ? e : s);
|
|
1873
1902
|
});
|
|
1874
|
-
return
|
|
1903
|
+
return X(() => {
|
|
1875
1904
|
f && N();
|
|
1876
|
-
}),
|
|
1905
|
+
}), X(() => {
|
|
1877
1906
|
if (!f || !e || !p) return;
|
|
1878
|
-
let t =
|
|
1907
|
+
let t = Ht(e), n = () => N();
|
|
1879
1908
|
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
1880
|
-
let r, i =
|
|
1881
|
-
i && !
|
|
1882
|
-
let a =
|
|
1883
|
-
container:
|
|
1909
|
+
let r, i = Z(e);
|
|
1910
|
+
i && !Jt(p) && (r = new i(n), r.observe(p));
|
|
1911
|
+
let a = qt({
|
|
1912
|
+
container: Jt(p) ? p.document.documentElement : p,
|
|
1884
1913
|
element: e,
|
|
1885
1914
|
onChange: n
|
|
1886
1915
|
});
|
|
@@ -1897,7 +1926,7 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1897
1926
|
getEstimatedSize: A,
|
|
1898
1927
|
getScrollPositionForIndex: Ut(({ align: t = "auto", index: n }) => {
|
|
1899
1928
|
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
1900
|
-
if (a.start === 0 && a.end === 0) return
|
|
1929
|
+
if (a.start === 0 && a.end === 0) return an({
|
|
1901
1930
|
align: t,
|
|
1902
1931
|
cachedBounds: x,
|
|
1903
1932
|
clamp: e,
|
|
@@ -1907,7 +1936,7 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1907
1936
|
itemCount: o,
|
|
1908
1937
|
itemSize: b
|
|
1909
1938
|
});
|
|
1910
|
-
let s =
|
|
1939
|
+
let s = an({
|
|
1911
1940
|
align: t,
|
|
1912
1941
|
cachedBounds: x,
|
|
1913
1942
|
clamp: !1,
|
|
@@ -1919,8 +1948,8 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1919
1948
|
}) - a.start;
|
|
1920
1949
|
return e ? Math.max(0, Math.min(A() - i, s)) : s;
|
|
1921
1950
|
};
|
|
1922
|
-
if (f && e && p && !
|
|
1923
|
-
let { viewportOffset: t, viewportSize: n } =
|
|
1951
|
+
if (f && e && p && !Qt(e, i)) {
|
|
1952
|
+
let { viewportOffset: t, viewportSize: n } = $t({
|
|
1924
1953
|
containerElement: e,
|
|
1925
1954
|
direction: i,
|
|
1926
1955
|
isRtl: a,
|
|
@@ -1929,7 +1958,7 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1929
1958
|
clamp: !1,
|
|
1930
1959
|
containerScrollOffset: t,
|
|
1931
1960
|
containerSize: n,
|
|
1932
|
-
padding:
|
|
1961
|
+
padding: en({
|
|
1933
1962
|
direction: i,
|
|
1934
1963
|
isRtl: a,
|
|
1935
1964
|
scrollTarget: p,
|
|
@@ -1937,20 +1966,20 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1937
1966
|
})
|
|
1938
1967
|
}) - t, s = i === "horizontal" && a ? -o : o;
|
|
1939
1968
|
return {
|
|
1940
|
-
scrollOffset:
|
|
1969
|
+
scrollOffset: Xt(p, i) + s,
|
|
1941
1970
|
scrollTarget: p
|
|
1942
1971
|
};
|
|
1943
1972
|
}
|
|
1944
1973
|
let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
|
|
1945
1974
|
clamp: !0,
|
|
1946
|
-
containerScrollOffset:
|
|
1975
|
+
containerScrollOffset: Kt({
|
|
1947
1976
|
containerElement: e,
|
|
1948
1977
|
direction: i,
|
|
1949
1978
|
isRtl: a,
|
|
1950
1979
|
scrollOffset: s
|
|
1951
1980
|
}),
|
|
1952
1981
|
containerSize: c,
|
|
1953
|
-
padding: e ?
|
|
1982
|
+
padding: e ? en({
|
|
1954
1983
|
direction: i,
|
|
1955
1984
|
isRtl: a,
|
|
1956
1985
|
scrollTarget: e,
|
|
@@ -1961,14 +1990,14 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1961
1990
|
}
|
|
1962
1991
|
});
|
|
1963
1992
|
if (e && (!f || p)) {
|
|
1964
|
-
if (l =
|
|
1993
|
+
if (l = Kt({
|
|
1965
1994
|
containerElement: e,
|
|
1966
1995
|
direction: i,
|
|
1967
1996
|
isRtl: a,
|
|
1968
1997
|
scrollOffset: l
|
|
1969
1998
|
}), !f && typeof e.scrollTo != "function") {
|
|
1970
1999
|
let e = j(l);
|
|
1971
|
-
|
|
2000
|
+
nn(T, e) || E(e);
|
|
1972
2001
|
}
|
|
1973
2002
|
return {
|
|
1974
2003
|
scrollOffset: l,
|
|
@@ -1977,34 +2006,34 @@ function ln({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1977
2006
|
}
|
|
1978
2007
|
}),
|
|
1979
2008
|
scrollTarget: p,
|
|
1980
|
-
startIndexOverscan:
|
|
2009
|
+
startIndexOverscan: ee,
|
|
1981
2010
|
startIndexVisible: D,
|
|
1982
|
-
stopIndexOverscan:
|
|
1983
|
-
stopIndexVisible:
|
|
2011
|
+
stopIndexOverscan: k,
|
|
2012
|
+
stopIndexVisible: O
|
|
1984
2013
|
};
|
|
1985
2014
|
}
|
|
1986
|
-
function
|
|
1987
|
-
let [t, n] =
|
|
1988
|
-
return
|
|
2015
|
+
function dn(e) {
|
|
2016
|
+
let [t, n] = K(e);
|
|
2017
|
+
return nn(t, e) ? t : (n(e), e);
|
|
1989
2018
|
}
|
|
1990
|
-
function
|
|
2019
|
+
function fn(e, t) {
|
|
1991
2020
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1992
|
-
return
|
|
2021
|
+
return nn(n, a) && nn(r, o) && nn(i, s);
|
|
1993
2022
|
}
|
|
1994
|
-
var
|
|
1995
|
-
function
|
|
1996
|
-
let t = e.getAttribute(
|
|
2023
|
+
var pn = "data-react-window-index", mn = "data-index";
|
|
2024
|
+
function hn(e) {
|
|
2025
|
+
let t = e.getAttribute(pn) ?? e.getAttribute(mn);
|
|
1997
2026
|
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
1998
2027
|
}
|
|
1999
|
-
var
|
|
2000
|
-
function
|
|
2028
|
+
var gn = 1e3, _n = 500;
|
|
2029
|
+
function vn(e) {
|
|
2001
2030
|
return 1 - (1 - e) ** 3;
|
|
2002
2031
|
}
|
|
2003
|
-
function
|
|
2004
|
-
let c = e === "vertical", l =
|
|
2032
|
+
function yn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
|
|
2033
|
+
let c = e === "vertical", l = G(null), u = G(void 0), d = Ut(() => {
|
|
2005
2034
|
l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
|
|
2006
2035
|
}), f = Ut(() => {
|
|
2007
|
-
let e =
|
|
2036
|
+
let e = Ht(t);
|
|
2008
2037
|
u.current = {
|
|
2009
2038
|
id: e.requestAnimationFrame(p),
|
|
2010
2039
|
view: e
|
|
@@ -2023,27 +2052,27 @@ function vn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2023
2052
|
index: o.index
|
|
2024
2053
|
});
|
|
2025
2054
|
if (m !== void 0) {
|
|
2026
|
-
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t,
|
|
2055
|
+
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, Zt(r, e)));
|
|
2027
2056
|
o.animation === void 0 && (o.animation = {
|
|
2028
|
-
deadline: p + (o.smooth ?
|
|
2029
|
-
startOffset:
|
|
2057
|
+
deadline: p + (o.smooth ? _n : 0) + gn,
|
|
2058
|
+
startOffset: Xt(r, e),
|
|
2030
2059
|
startTime: p
|
|
2031
2060
|
});
|
|
2032
|
-
let l = o.smooth ? (p - o.animation.startTime) /
|
|
2061
|
+
let l = o.smooth ? (p - o.animation.startTime) / _n : 1;
|
|
2033
2062
|
if (l < 1) {
|
|
2034
2063
|
let { startOffset: e } = o.animation;
|
|
2035
2064
|
o.stableFrames = 0, r.scrollTo({
|
|
2036
2065
|
behavior: "instant",
|
|
2037
|
-
[c ? "top" : "left"]: e + (s - e) *
|
|
2066
|
+
[c ? "top" : "left"]: e + (s - e) * vn(l)
|
|
2038
2067
|
});
|
|
2039
|
-
} else if (Math.abs(s -
|
|
2068
|
+
} else if (Math.abs(s - Xt(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
|
|
2040
2069
|
behavior: "instant",
|
|
2041
2070
|
[c ? "top" : "left"]: s
|
|
2042
2071
|
});
|
|
2043
2072
|
else {
|
|
2044
2073
|
let e = a.current;
|
|
2045
|
-
if (!(e.some((e) =>
|
|
2046
|
-
let t =
|
|
2074
|
+
if (!(e.some((e) => hn(e) === o.index) && e.every((e) => {
|
|
2075
|
+
let t = hn(e);
|
|
2047
2076
|
if (t === void 0 || t >= i) return !0;
|
|
2048
2077
|
let r = c ? e.offsetHeight : e.offsetWidth;
|
|
2049
2078
|
return Math.abs(n(t).size - r) <= 1;
|
|
@@ -2056,7 +2085,7 @@ function vn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2056
2085
|
}
|
|
2057
2086
|
f();
|
|
2058
2087
|
});
|
|
2059
|
-
return
|
|
2088
|
+
return X(() => {
|
|
2060
2089
|
let e = o ?? t;
|
|
2061
2090
|
if (!e) return;
|
|
2062
2091
|
let n = (e) => {
|
|
@@ -2079,13 +2108,13 @@ function vn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2079
2108
|
d,
|
|
2080
2109
|
t,
|
|
2081
2110
|
o
|
|
2082
|
-
]),
|
|
2111
|
+
]), H(({ align: n = "auto", behavior: i = "auto", index: a }) => {
|
|
2083
2112
|
if (r && n === "smart") {
|
|
2084
2113
|
let t = s({
|
|
2085
2114
|
align: "auto",
|
|
2086
2115
|
index: a
|
|
2087
2116
|
});
|
|
2088
|
-
n = t === void 0 || t.scrollOffset ===
|
|
2117
|
+
n = t === void 0 || t.scrollOffset === Xt(t.scrollTarget, e) ? "auto" : "center";
|
|
2089
2118
|
}
|
|
2090
2119
|
let o = s({
|
|
2091
2120
|
align: n,
|
|
@@ -2117,11 +2146,11 @@ function vn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2117
2146
|
s
|
|
2118
2147
|
]);
|
|
2119
2148
|
}
|
|
2120
|
-
function
|
|
2149
|
+
function bn({ callback: e, element: t, enabled: n = !0 }) {
|
|
2121
2150
|
let r = Ut(e);
|
|
2122
|
-
|
|
2151
|
+
U(() => {
|
|
2123
2152
|
if (!n || !t) return;
|
|
2124
|
-
let e =
|
|
2153
|
+
let e = Ht(t), i = e.requestAnimationFrame(() => {
|
|
2125
2154
|
i = e.requestAnimationFrame(r);
|
|
2126
2155
|
});
|
|
2127
2156
|
return () => {
|
|
@@ -2133,7 +2162,7 @@ function yn({ callback: e, element: t, enabled: n = !0 }) {
|
|
|
2133
2162
|
r
|
|
2134
2163
|
]);
|
|
2135
2164
|
}
|
|
2136
|
-
function
|
|
2165
|
+
function xn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
|
|
2137
2166
|
if (r < 0 || i < r) return [];
|
|
2138
2167
|
let a = [], o = /* @__PURE__ */ new Set(), s = !0;
|
|
2139
2168
|
for (let t of e) {
|
|
@@ -2156,20 +2185,20 @@ function bn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopInde
|
|
|
2156
2185
|
index: r + t
|
|
2157
2186
|
}));
|
|
2158
2187
|
}
|
|
2159
|
-
function
|
|
2188
|
+
function Sn(e) {
|
|
2160
2189
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
2161
2190
|
}
|
|
2162
|
-
var
|
|
2163
|
-
function
|
|
2164
|
-
let _ =
|
|
2165
|
-
|
|
2191
|
+
var Cn = "data-react-window-sizer";
|
|
2192
|
+
function wn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
|
|
2193
|
+
let _ = dn(f), v = W(() => ke(c, fn), [c]), [y, b] = K(null), x = Sn(u), S = W(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = Vt(), [w, T] = K(() => C && x), E = G(u);
|
|
2194
|
+
X(() => {
|
|
2166
2195
|
w && E.current !== u && T(!1);
|
|
2167
|
-
}, [w, u]),
|
|
2196
|
+
}, [w, u]), bn({
|
|
2168
2197
|
callback: () => T(!1),
|
|
2169
2198
|
element: y,
|
|
2170
2199
|
enabled: w
|
|
2171
2200
|
});
|
|
2172
|
-
let { getCellBounds: D, getEstimatedSize:
|
|
2201
|
+
let { getCellBounds: D, getEstimatedSize: ee, scrollTarget: O, getScrollPositionForIndex: k, startIndexOverscan: A, startIndexVisible: j, stopIndexOverscan: M, stopIndexVisible: N } = un({
|
|
2173
2202
|
containerElement: y,
|
|
2174
2203
|
containerStyle: h,
|
|
2175
2204
|
defaultContainerSize: n,
|
|
@@ -2181,49 +2210,49 @@ function Cn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2181
2210
|
onResize: a,
|
|
2182
2211
|
overscanCount: s,
|
|
2183
2212
|
scrollElement: p
|
|
2184
|
-
}),
|
|
2213
|
+
}), te = G([]), ne = yn({
|
|
2185
2214
|
direction: "vertical",
|
|
2186
2215
|
element: y,
|
|
2187
2216
|
getCellBounds: D,
|
|
2188
2217
|
isDynamicSize: x,
|
|
2189
2218
|
itemCount: l,
|
|
2190
|
-
itemElements:
|
|
2191
|
-
scrollTarget:
|
|
2192
|
-
getScrollPositionForIndex:
|
|
2219
|
+
itemElements: te,
|
|
2220
|
+
scrollTarget: O,
|
|
2221
|
+
getScrollPositionForIndex: k
|
|
2193
2222
|
});
|
|
2194
2223
|
je(i, () => ({
|
|
2195
2224
|
get element() {
|
|
2196
2225
|
return y;
|
|
2197
2226
|
},
|
|
2198
|
-
scrollToRow:
|
|
2199
|
-
}), [y,
|
|
2200
|
-
let
|
|
2201
|
-
|
|
2227
|
+
scrollToRow: ne
|
|
2228
|
+
}), [y, ne]);
|
|
2229
|
+
let P = w && x && A === 0;
|
|
2230
|
+
X(() => {
|
|
2202
2231
|
if (!y) return;
|
|
2203
|
-
let e = Array.from(y.children).filter((e) => !e.hasAttribute(
|
|
2232
|
+
let e = Array.from(y.children).filter((e) => !e.hasAttribute(Cn)), t = xn({
|
|
2204
2233
|
elements: e,
|
|
2205
|
-
isFlowLayout:
|
|
2234
|
+
isFlowLayout: P,
|
|
2206
2235
|
rowCount: l,
|
|
2207
2236
|
startIndex: A,
|
|
2208
2237
|
stopIndex: M
|
|
2209
2238
|
}), n = t.map(({ element: e }) => e);
|
|
2210
2239
|
if (e.forEach((e) => {
|
|
2211
|
-
n.includes(e) || e.removeAttribute(
|
|
2240
|
+
n.includes(e) || e.removeAttribute(pn);
|
|
2212
2241
|
}), t.forEach(({ element: e, index: t }) => {
|
|
2213
|
-
e.setAttribute(
|
|
2214
|
-
}),
|
|
2242
|
+
e.setAttribute(pn, `${t}`);
|
|
2243
|
+
}), te.current = n, x) return u.observeRowElements(n);
|
|
2215
2244
|
}, [
|
|
2216
2245
|
v,
|
|
2217
2246
|
y,
|
|
2218
2247
|
x,
|
|
2219
|
-
|
|
2248
|
+
P,
|
|
2220
2249
|
l,
|
|
2221
2250
|
u,
|
|
2222
2251
|
d,
|
|
2223
2252
|
_,
|
|
2224
2253
|
A,
|
|
2225
2254
|
M
|
|
2226
|
-
]),
|
|
2255
|
+
]), U(() => {
|
|
2227
2256
|
A >= 0 && M >= 0 && o && o({
|
|
2228
2257
|
startIndex: j,
|
|
2229
2258
|
stopIndex: N
|
|
@@ -2238,7 +2267,7 @@ function Cn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2238
2267
|
M,
|
|
2239
2268
|
N
|
|
2240
2269
|
]);
|
|
2241
|
-
let
|
|
2270
|
+
let F = W(() => {
|
|
2242
2271
|
let e = [];
|
|
2243
2272
|
if (l > 0) for (let t = A; t <= M; t++) {
|
|
2244
2273
|
let n = D(t);
|
|
@@ -2251,7 +2280,7 @@ function Cn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2251
2280
|
},
|
|
2252
2281
|
key: d ? d(t, _) : t,
|
|
2253
2282
|
index: t,
|
|
2254
|
-
style:
|
|
2283
|
+
style: P ? { width: "100%" } : {
|
|
2255
2284
|
position: "absolute",
|
|
2256
2285
|
left: 0,
|
|
2257
2286
|
transform: `translateY(${n.scrollOffset}px)`,
|
|
@@ -2265,23 +2294,23 @@ function Cn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2265
2294
|
v,
|
|
2266
2295
|
D,
|
|
2267
2296
|
x,
|
|
2268
|
-
|
|
2297
|
+
P,
|
|
2269
2298
|
l,
|
|
2270
2299
|
d,
|
|
2271
2300
|
_,
|
|
2272
2301
|
A,
|
|
2273
2302
|
M
|
|
2274
|
-
]),
|
|
2303
|
+
]), I = /* @__PURE__ */ B("div", {
|
|
2275
2304
|
"aria-hidden": !0,
|
|
2276
|
-
[
|
|
2305
|
+
[Cn]: "",
|
|
2277
2306
|
style: {
|
|
2278
|
-
position:
|
|
2279
|
-
top:
|
|
2280
|
-
height:
|
|
2307
|
+
position: P ? "absolute" : void 0,
|
|
2308
|
+
top: P ? 0 : void 0,
|
|
2309
|
+
height: ee(),
|
|
2281
2310
|
width: "100%",
|
|
2282
2311
|
zIndex: -1
|
|
2283
2312
|
}
|
|
2284
|
-
}, "sizer"),
|
|
2313
|
+
}, "sizer"), L = /* @__PURE__ */ B(Ee, { children: e }, "children"), R = /* @__PURE__ */ B(Ee, { children: F }, "rows");
|
|
2285
2314
|
return De(m, {
|
|
2286
2315
|
role: "list",
|
|
2287
2316
|
...g,
|
|
@@ -2296,9 +2325,9 @@ function Cn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2296
2325
|
},
|
|
2297
2326
|
...h
|
|
2298
2327
|
}
|
|
2299
|
-
}, ...
|
|
2328
|
+
}, ...P ? [L, R] : [R, L], I);
|
|
2300
2329
|
}
|
|
2301
|
-
var
|
|
2330
|
+
var Tn = /* @__PURE__ */ Object.assign(wn, { displayName: "List" }), En = {
|
|
2302
2331
|
search: "_search_5skzl_1",
|
|
2303
2332
|
divider: "_divider_5skzl_5",
|
|
2304
2333
|
item: "_item_5skzl_9",
|
|
@@ -2307,108 +2336,110 @@ var wn = /* @__PURE__ */ Object.assign(Cn, { displayName: "List" }), Tn = {
|
|
|
2307
2336
|
stateLabel: "_stateLabel_5skzl_27",
|
|
2308
2337
|
itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
|
|
2309
2338
|
itemSelectedText: "_itemSelectedText_5skzl_41"
|
|
2310
|
-
},
|
|
2311
|
-
let p = r[e],
|
|
2312
|
-
return /* @__PURE__ */
|
|
2339
|
+
}, Dn = 44, On = 8, kn = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
|
|
2340
|
+
let p = r[e], m = It(p.iconUrl, p.type, p.displayName ?? p.id, v.SM), g = p.id === i;
|
|
2341
|
+
return /* @__PURE__ */ B("div", {
|
|
2313
2342
|
style: t,
|
|
2314
2343
|
...n,
|
|
2315
|
-
children: /* @__PURE__ */
|
|
2344
|
+
children: /* @__PURE__ */ B(h, {
|
|
2316
2345
|
type: "button",
|
|
2317
2346
|
"aria-current": g ? "true" : void 0,
|
|
2318
|
-
className: l(
|
|
2319
|
-
iconBefore: /* @__PURE__ */
|
|
2320
|
-
className:
|
|
2321
|
-
children:
|
|
2347
|
+
className: l(En.item, "h-full w-full gap-3 px-4", g && u && En.itemSelectedBackground, g && d && En.itemSelectedText, s, g && c, q.modelMenuItem, g && q.modelMenuItemSelected),
|
|
2348
|
+
iconBefore: /* @__PURE__ */ B("span", {
|
|
2349
|
+
className: En.itemIcon,
|
|
2350
|
+
children: m
|
|
2322
2351
|
}),
|
|
2323
|
-
label: /* @__PURE__ */
|
|
2352
|
+
label: /* @__PURE__ */ V("span", {
|
|
2324
2353
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
2325
|
-
children: [/* @__PURE__ */
|
|
2354
|
+
children: [/* @__PURE__ */ B(w, {
|
|
2326
2355
|
text: p.displayName ?? p.id,
|
|
2327
2356
|
query: o,
|
|
2328
2357
|
maxLines: 1,
|
|
2329
2358
|
className: l(a, "min-w-0 flex-1 text-start")
|
|
2330
|
-
}), g && /* @__PURE__ */
|
|
2331
|
-
size:
|
|
2332
|
-
className:
|
|
2359
|
+
}), g && /* @__PURE__ */ B(he, {
|
|
2360
|
+
size: v.SM,
|
|
2361
|
+
className: En.checkIcon,
|
|
2333
2362
|
"aria-hidden": !0,
|
|
2334
|
-
stroke:
|
|
2363
|
+
stroke: y
|
|
2335
2364
|
})]
|
|
2336
2365
|
}),
|
|
2337
2366
|
onClick: () => f(p.id)
|
|
2338
2367
|
})
|
|
2339
2368
|
});
|
|
2340
|
-
},
|
|
2341
|
-
let [
|
|
2342
|
-
|
|
2343
|
-
e ||
|
|
2369
|
+
}, An = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _, searchQuery: v, onSearchQueryChange: y }) => {
|
|
2370
|
+
let [b, S] = K(""), C = v ?? b, w = y ?? S;
|
|
2371
|
+
U(() => {
|
|
2372
|
+
e || S("");
|
|
2344
2373
|
}, [e]);
|
|
2345
|
-
let
|
|
2374
|
+
let E = a && a.length > 0, D = u !== void 0, ee = !E && !D ? d ?? f : void 0, O = E ? Ft(a, C) : [], k = (e) => {
|
|
2346
2375
|
s(e), i();
|
|
2347
|
-
},
|
|
2376
|
+
}, A = _?.colors, j = c({
|
|
2348
2377
|
"--ci-sheet-divider": g?.divider,
|
|
2349
|
-
"--ci-sheet-text":
|
|
2350
|
-
"--ci-sheet-item-hover":
|
|
2378
|
+
"--ci-sheet-text": A?.itemText ?? g?.itemText,
|
|
2379
|
+
"--ci-sheet-item-hover": A?.itemHoverBackground ?? g?.itemHoverBg,
|
|
2351
2380
|
"--ci-sheet-item-active": g?.itemActiveBg,
|
|
2352
|
-
"--ci-sheet-icon":
|
|
2353
|
-
"--ci-check-icon":
|
|
2354
|
-
"--ci-sheet-selected-bg":
|
|
2355
|
-
"--ci-sheet-selected-text":
|
|
2381
|
+
"--ci-sheet-icon": A?.itemText ?? g?.itemIcon,
|
|
2382
|
+
"--ci-check-icon": A?.checkIcon ?? g?.checkIcon,
|
|
2383
|
+
"--ci-sheet-selected-bg": A?.selectedItemBackground,
|
|
2384
|
+
"--ci-sheet-selected-text": A?.selectedItemText
|
|
2356
2385
|
});
|
|
2357
|
-
return /* @__PURE__ */
|
|
2386
|
+
return /* @__PURE__ */ B(Fe, {
|
|
2358
2387
|
isOpen: e,
|
|
2359
2388
|
title: t,
|
|
2360
2389
|
closeLabel: n,
|
|
2361
2390
|
onClose: i,
|
|
2362
2391
|
style: p,
|
|
2363
2392
|
titleClassName: m,
|
|
2364
|
-
className: l("max-h-[80dvh]", _?.className,
|
|
2393
|
+
className: l("max-h-[80dvh]", _?.className, q.modelMenu),
|
|
2365
2394
|
colors: g?.shell,
|
|
2366
|
-
children: /* @__PURE__ */
|
|
2395
|
+
children: /* @__PURE__ */ V("div", {
|
|
2367
2396
|
className: "contents",
|
|
2368
|
-
style:
|
|
2397
|
+
style: j,
|
|
2369
2398
|
children: [
|
|
2370
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ B(T, {
|
|
2371
2400
|
visuallyHidden: !0,
|
|
2372
|
-
children:
|
|
2401
|
+
children: D ? u : null
|
|
2373
2402
|
}),
|
|
2374
|
-
|
|
2403
|
+
E && !D && /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B("div", {
|
|
2375
2404
|
style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
|
|
2376
|
-
className: l("shrink-0 px-4 py-[10px]",
|
|
2377
|
-
children: /* @__PURE__ */
|
|
2378
|
-
value:
|
|
2405
|
+
className: l("shrink-0 px-4 py-[10px]", En.search, _?.searchHeaderClassName, q.modelMenuSearch),
|
|
2406
|
+
children: /* @__PURE__ */ B(L, {
|
|
2407
|
+
value: C,
|
|
2379
2408
|
placeholder: r,
|
|
2380
|
-
size:
|
|
2381
|
-
onChange: (e) =>
|
|
2409
|
+
size: x.Standard,
|
|
2410
|
+
onChange: (e) => w(e ?? "")
|
|
2382
2411
|
})
|
|
2383
|
-
}), /* @__PURE__ */
|
|
2384
|
-
|
|
2412
|
+
}), /* @__PURE__ */ B("div", { className: l(En.divider, "h-px shrink-0") })] }),
|
|
2413
|
+
D ? /* @__PURE__ */ B(Nt, {}) : ee ? /* @__PURE__ */ B("div", {
|
|
2385
2414
|
role: "list",
|
|
2386
|
-
className: l(
|
|
2387
|
-
children:
|
|
2388
|
-
}) : /* @__PURE__ */
|
|
2415
|
+
className: l(En.stateLabel, h, "px-4 py-4"),
|
|
2416
|
+
children: ee
|
|
2417
|
+
}) : /* @__PURE__ */ B(Tn, {
|
|
2389
2418
|
role: "list",
|
|
2390
2419
|
className: "overflow-y-auto",
|
|
2391
|
-
style: { height: Math.min(
|
|
2392
|
-
rowComponent:
|
|
2393
|
-
rowCount:
|
|
2394
|
-
rowHeight:
|
|
2420
|
+
style: { height: Math.min(O.length, On) * Dn },
|
|
2421
|
+
rowComponent: kn,
|
|
2422
|
+
rowCount: O.length,
|
|
2423
|
+
rowHeight: Dn,
|
|
2395
2424
|
rowProps: {
|
|
2396
|
-
items:
|
|
2425
|
+
items: O,
|
|
2397
2426
|
selectedDeploymentId: o,
|
|
2398
2427
|
labelClassName: h,
|
|
2399
|
-
query:
|
|
2428
|
+
query: C,
|
|
2400
2429
|
itemClassName: _?.itemClassName,
|
|
2401
2430
|
selectedItemClassName: _?.selectedItemClassName,
|
|
2402
|
-
hasSelectedBackground: !!
|
|
2403
|
-
hasSelectedText: !!
|
|
2404
|
-
onSelect:
|
|
2431
|
+
hasSelectedBackground: !!A?.selectedItemBackground,
|
|
2432
|
+
hasSelectedText: !!A?.selectedItemText,
|
|
2433
|
+
onSelect: k
|
|
2405
2434
|
}
|
|
2406
2435
|
})
|
|
2407
2436
|
]
|
|
2408
2437
|
})
|
|
2409
2438
|
});
|
|
2410
|
-
},
|
|
2411
|
-
let [
|
|
2439
|
+
}, jn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: u, isMobile: d, isDisabled: f = !1, style: p, modelPickerOverlay: m, isPickerOpen: g, onPickerToggle: _, onPickerOpenChange: x }) => {
|
|
2440
|
+
let [S, w] = K(!1), T = g ?? S, E = (e) => {
|
|
2441
|
+
w(e), x?.(e), ne(e);
|
|
2442
|
+
}, { searchQuery: D, onSearchQueryChange: ee, selectorIcon: O, selectorAriaLabel: k, selectedLabel: A, selectedVersion: j, menuItems: M, menuHeader: N, menuStyle: te, onOpenChange: ne } = Rt({
|
|
2412
2443
|
deployments: e,
|
|
2413
2444
|
selectedDeploymentId: t,
|
|
2414
2445
|
onDeploymentChange: n,
|
|
@@ -2416,41 +2447,43 @@ var wn = /* @__PURE__ */ Object.assign(Cn, { displayName: "List" }), Tn = {
|
|
|
2416
2447
|
styles: i
|
|
2417
2448
|
});
|
|
2418
2449
|
if (!e) return null;
|
|
2419
|
-
let
|
|
2420
|
-
size:
|
|
2421
|
-
className: l(
|
|
2450
|
+
let P = u || f, F = P ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, I = /* @__PURE__ */ B(ge, {
|
|
2451
|
+
size: v.SM,
|
|
2452
|
+
className: l(Y.modelSelectorCaret, q.modelSelectorCaret),
|
|
2422
2453
|
"aria-hidden": !0,
|
|
2423
|
-
stroke:
|
|
2424
|
-
}),
|
|
2425
|
-
className: l("flex shrink-0 items-center",
|
|
2426
|
-
children:
|
|
2454
|
+
stroke: y
|
|
2455
|
+
}), L = /* @__PURE__ */ B("span", {
|
|
2456
|
+
className: l("flex shrink-0 items-center", q.modelSelectorIcon),
|
|
2457
|
+
children: O
|
|
2427
2458
|
});
|
|
2428
|
-
if (d) return /* @__PURE__ */
|
|
2429
|
-
tooltipProps: { tooltip:
|
|
2430
|
-
icon: /* @__PURE__ */
|
|
2459
|
+
if (d) return /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B(C, {
|
|
2460
|
+
tooltipProps: { tooltip: A },
|
|
2461
|
+
icon: /* @__PURE__ */ V("div", {
|
|
2431
2462
|
className: "flex items-center gap-1",
|
|
2432
|
-
children: [
|
|
2463
|
+
children: [L, I]
|
|
2433
2464
|
}),
|
|
2434
|
-
"aria-label":
|
|
2435
|
-
"aria-disabled":
|
|
2465
|
+
"aria-label": k,
|
|
2466
|
+
"aria-disabled": P || void 0,
|
|
2436
2467
|
onClick: () => {
|
|
2437
|
-
|
|
2468
|
+
P || E(!0);
|
|
2438
2469
|
},
|
|
2439
|
-
className: l("w-[50px]",
|
|
2440
|
-
}),
|
|
2441
|
-
isOpen:
|
|
2470
|
+
className: l("w-[50px]", Y.modelSelectorButton, F, q.modelSelectorButton)
|
|
2471
|
+
}), m ? /* @__PURE__ */ B(Fe, {
|
|
2472
|
+
isOpen: T,
|
|
2442
2473
|
title: r?.ariaLabel ?? "Select model",
|
|
2443
2474
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2444
|
-
onClose: () =>
|
|
2475
|
+
onClose: () => E(!1),
|
|
2445
2476
|
style: p,
|
|
2446
|
-
className: l(i?.className,
|
|
2447
|
-
children:
|
|
2448
|
-
}) : /* @__PURE__ */
|
|
2449
|
-
|
|
2477
|
+
className: l(i?.className, q.modelMenu),
|
|
2478
|
+
children: m(() => E(!1))
|
|
2479
|
+
}) : /* @__PURE__ */ B(An, {
|
|
2480
|
+
searchQuery: D,
|
|
2481
|
+
onSearchQueryChange: ee,
|
|
2482
|
+
isOpen: T,
|
|
2450
2483
|
title: r?.ariaLabel ?? "Select model",
|
|
2451
2484
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2452
2485
|
searchPlaceholder: r?.searchPlaceholder ?? "Search",
|
|
2453
|
-
onClose: () =>
|
|
2486
|
+
onClose: () => E(!1),
|
|
2454
2487
|
deployments: e,
|
|
2455
2488
|
selectedDeploymentId: t,
|
|
2456
2489
|
onSelect: (e) => n?.(e),
|
|
@@ -2460,275 +2493,278 @@ var wn = /* @__PURE__ */ Object.assign(Cn, { displayName: "List" }), Tn = {
|
|
|
2460
2493
|
style: p,
|
|
2461
2494
|
menuStyles: i
|
|
2462
2495
|
})] });
|
|
2463
|
-
if (
|
|
2464
|
-
let e =
|
|
2465
|
-
return /* @__PURE__ */
|
|
2496
|
+
if (m) {
|
|
2497
|
+
let e = j ? `${A} · ${j}` : A;
|
|
2498
|
+
return /* @__PURE__ */ B(b, {
|
|
2466
2499
|
placement: "top-end",
|
|
2467
2500
|
matchReferenceWidth: !1,
|
|
2468
|
-
open:
|
|
2469
|
-
onOpenChange:
|
|
2501
|
+
open: T,
|
|
2502
|
+
onOpenChange: E,
|
|
2470
2503
|
trigger: [],
|
|
2471
2504
|
outsideClosable: !0,
|
|
2472
|
-
renderOverlay: () =>
|
|
2473
|
-
listClassName: l("w-[368px]!",
|
|
2505
|
+
renderOverlay: () => m(() => E(!1)),
|
|
2506
|
+
listClassName: l("w-[368px]!", Y.modelOverlayPanel, i?.className, q.modelMenu),
|
|
2474
2507
|
listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
|
|
2475
|
-
children: /* @__PURE__ */
|
|
2476
|
-
"aria-label":
|
|
2477
|
-
"aria-disabled":
|
|
2508
|
+
children: /* @__PURE__ */ B(h, {
|
|
2509
|
+
"aria-label": k,
|
|
2510
|
+
"aria-disabled": P || void 0,
|
|
2478
2511
|
tooltipProps: { tooltip: e },
|
|
2479
|
-
className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2",
|
|
2512
|
+
className: l("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Y.modelSelectorButton, F, P && Y.modelSelectorButtonDisabled, q.modelSelectorButton),
|
|
2480
2513
|
onClick: () => {
|
|
2481
|
-
|
|
2514
|
+
P || (_ ? _() : E(!T));
|
|
2482
2515
|
},
|
|
2483
|
-
iconBefore:
|
|
2484
|
-
iconAfter:
|
|
2516
|
+
iconBefore: L,
|
|
2517
|
+
iconAfter: I,
|
|
2485
2518
|
textClassName: "min-w-0",
|
|
2486
|
-
label: /* @__PURE__ */
|
|
2519
|
+
label: /* @__PURE__ */ V("span", {
|
|
2487
2520
|
className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
|
|
2488
|
-
children: [/* @__PURE__ */
|
|
2489
|
-
className: l("max-w-[180px] shrink-0 truncate", a,
|
|
2490
|
-
children:
|
|
2491
|
-
}),
|
|
2492
|
-
className: l("min-w-0 truncate", o,
|
|
2493
|
-
children:
|
|
2521
|
+
children: [/* @__PURE__ */ B("span", {
|
|
2522
|
+
className: l("max-w-[180px] shrink-0 truncate", a, Y.modelSelectorName),
|
|
2523
|
+
children: A
|
|
2524
|
+
}), j && /* @__PURE__ */ B("span", {
|
|
2525
|
+
className: l("min-w-0 truncate", o, Y.modelSelectorVersion),
|
|
2526
|
+
children: j
|
|
2494
2527
|
})]
|
|
2495
2528
|
})
|
|
2496
2529
|
})
|
|
2497
2530
|
});
|
|
2498
2531
|
}
|
|
2499
|
-
return /* @__PURE__ */
|
|
2500
|
-
className: l(
|
|
2501
|
-
"aria-disabled":
|
|
2502
|
-
children: /* @__PURE__ */
|
|
2503
|
-
items:
|
|
2504
|
-
menuHeader:
|
|
2532
|
+
return /* @__PURE__ */ B("div", {
|
|
2533
|
+
className: l(F),
|
|
2534
|
+
"aria-disabled": P || void 0,
|
|
2535
|
+
children: /* @__PURE__ */ B(b, {
|
|
2536
|
+
items: M,
|
|
2537
|
+
menuHeader: N,
|
|
2505
2538
|
placement: "bottom-end",
|
|
2506
2539
|
matchReferenceWidth: !1,
|
|
2507
2540
|
maxDropdownHeight: s,
|
|
2508
|
-
listClassName: l("w-[240px]!", i?.className,
|
|
2509
|
-
listStyle:
|
|
2510
|
-
disabled:
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
"aria-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2541
|
+
listClassName: l("w-[240px]!", i?.className, q.modelMenu),
|
|
2542
|
+
listStyle: te,
|
|
2543
|
+
disabled: P,
|
|
2544
|
+
open: T,
|
|
2545
|
+
onOpenChange: P ? void 0 : E,
|
|
2546
|
+
children: /* @__PURE__ */ B(h, {
|
|
2547
|
+
"aria-label": k,
|
|
2548
|
+
"aria-disabled": P || void 0,
|
|
2549
|
+
tooltipProps: { tooltip: A },
|
|
2550
|
+
iconBefore: L,
|
|
2551
|
+
iconAfter: I,
|
|
2552
|
+
className: l("h-auto gap-1 rounded-full! border-0! p-1.5", Y.modelSelectorButton, P && Y.modelSelectorButtonDisabled, q.modelSelectorButton)
|
|
2519
2553
|
})
|
|
2520
2554
|
})
|
|
2521
2555
|
});
|
|
2522
|
-
},
|
|
2523
|
-
let
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
"--ci-
|
|
2527
|
-
"--ci-
|
|
2528
|
-
"--ci-
|
|
2529
|
-
"--ci-
|
|
2530
|
-
"--ci-
|
|
2531
|
-
"--ci-
|
|
2532
|
-
"--ci-model-selector-
|
|
2533
|
-
"--ci-model-selector-
|
|
2534
|
-
"--ci-model-selector-
|
|
2535
|
-
"--ci-
|
|
2536
|
-
"--ci-
|
|
2537
|
-
"--ci-
|
|
2538
|
-
"--ci-
|
|
2539
|
-
"--ci-mention-highlight-
|
|
2540
|
-
"--ci-mention-highlight-
|
|
2541
|
-
"--ci-
|
|
2542
|
-
|
|
2556
|
+
}, Mn = Oe(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: m, placeholder: h = "Type a message...", ariaLabel: g, attachLabel: _ = "Attach file", fileAccept: x, addMenuTitle: w = "Add", menuTitle: ee = "Menu", menuCloseLabel: O = "Close", removeLabel: k, retryLabel: A, uploadingLabel: j, expandLabel: M, clickLabel: N, sendLabel: te, sendTooltip: ne, emptyMessageTooltip: P, stopLabel: F, micLabel: I = "Dictate", recordVoiceLabel: L = "Record voice", stopRecordingLabel: R, discardRecordingLabel: re, colors: z, typography: ie, attachmentTray: ae, modelMenu: oe, className: se, pendingDropFiles: ce = [], onDropFilesConsumed: de, pendingAttachments: fe = [], onPendingAttachmentsConsumed: me, pasteTextThreshold: he = 4e3, maxMessageLength: ge = 5e4, deployments: _e, selectedDeploymentId: be, onDeploymentChange: xe, modelSelectorLabels: Se, initialAttachments: Ce = [], hideAddButton: we = !1, hideAttachFile: Te = !1, hideActionBar: Ee = !1, actionRowLayout: De = lt.Stacked, isInlineActionRowAllowedBelowDesktop: Oe = !1, renderFooterActions: ke, isInputDisabled: Ae = !1, isModelSelectorDisabled: Ne = !1, isSendDisabled: Pe = !1, isAudioMessageSupported: Fe = !1, isVoiceRecordingSupported: Ie = Fe, onTranscribeAudio: Re, transcribingLabel: ze, voiceErrorLabel: Be, sendOnEnter: Ve = ct.Enter, prefixAttachments: We = [], onRemovePrefixAttachment: Ge, chatSettings: Je, toolsMenuItems: Ye, onToolToggle: $e, canRemoveTools: rt = !0, toolsMenuTitle: it, toolsBackLabel: at, toolsChipLabels: ot, menuOverlays: ut, activeMentions: dt, onBackspaceAtCaret: ft, caretPositionOverride: pt, commandMenu: J, autoFocus: mt = !1, messageHistory: ht, onDialFileSystemClick: gt, dialFileSystemLabel: _t, validateAttachment: vt, onAttachmentClick: yt, modelPickerOverlay: xt, onModelPickerOpenChange: St, maximumAttachmentsAmount: wt, onAttachmentsLimitExceeded: Tt, isAttachmentsEnabled: Et = !0, isTextAttachmentsAllowed: Dt = !0, usageLimitsSlot: jt, onMessageTooLong: Mt }, Nt) => {
|
|
2557
|
+
let Pt = d(), Ft = f(), [It, Lt] = K(!1), Rt = (e) => {
|
|
2558
|
+
Lt(e), St?.(e);
|
|
2559
|
+
}, X = Ke(ht), zt = dt ?? [], Bt = zt.length > 0, Vt = W(() => c({
|
|
2560
|
+
"--ci-bg": z?.background,
|
|
2561
|
+
"--ci-text": z?.text,
|
|
2562
|
+
"--ci-border": z?.border,
|
|
2563
|
+
"--ci-border-focus": z?.borderFocus,
|
|
2564
|
+
"--ci-placeholder": z?.placeholder,
|
|
2565
|
+
"--ci-text-disabled": z?.textDisabled,
|
|
2566
|
+
"--ci-model-selector-caret-color": z?.modelSelectorCaret,
|
|
2567
|
+
"--ci-model-selector-hover-bg": z?.modelSelectorHoverBg,
|
|
2568
|
+
"--ci-model-selector-disabled-color": z?.modelSelectorDisabled,
|
|
2569
|
+
"--ci-model-selector-name-color": z?.modelSelectorName,
|
|
2570
|
+
"--ci-model-selector-version-color": z?.modelSelectorVersion,
|
|
2571
|
+
"--ci-voice-waveform": z?.voiceWaveform,
|
|
2572
|
+
"--ci-voice-accent": z?.voiceAccent,
|
|
2573
|
+
"--ci-mention-highlight-bg": z?.mentionHighlightBg,
|
|
2574
|
+
"--ci-mention-highlight-text": z?.mentionHighlightText,
|
|
2575
|
+
"--ci-mention-highlight-unsupported-bg": z?.mentionHighlightUnsupportedBg,
|
|
2576
|
+
"--ci-mention-highlight-unsupported-text": z?.mentionHighlightUnsupportedText,
|
|
2577
|
+
"--ci-selection-highlight-bg": z?.selectionHighlightBg
|
|
2578
|
+
}), [z]), Ht = W(() => gt ? [{
|
|
2543
2579
|
key: "dial-fs",
|
|
2544
2580
|
label: _t ?? "DIAL file system",
|
|
2545
|
-
icon: /* @__PURE__ */
|
|
2546
|
-
size:
|
|
2581
|
+
icon: /* @__PURE__ */ B(ve, {
|
|
2582
|
+
size: p,
|
|
2547
2583
|
"aria-hidden": !0,
|
|
2548
|
-
stroke:
|
|
2584
|
+
stroke: y
|
|
2549
2585
|
}),
|
|
2550
2586
|
onClick: gt
|
|
2551
|
-
}] : [], [gt, _t]), { message:
|
|
2587
|
+
}] : [], [gt, _t]), { message: Z, setMessage: Q, textareaRef: $ } = Ze({
|
|
2552
2588
|
messageProp: e,
|
|
2553
2589
|
messageRevision: t
|
|
2554
2590
|
});
|
|
2555
|
-
|
|
2556
|
-
let e =
|
|
2591
|
+
U(() => {
|
|
2592
|
+
let e = $.current;
|
|
2557
2593
|
e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
|
|
2558
|
-
}, [
|
|
2559
|
-
n !== void 0 &&
|
|
2560
|
-
}, [n,
|
|
2561
|
-
let { handleUndoKeyDown:
|
|
2594
|
+
}, [$]), U(() => {
|
|
2595
|
+
n !== void 0 && $.current?.focus();
|
|
2596
|
+
}, [n, $]), je(Nt, () => ({ getCaretPosition: () => $.current?.selectionStart ?? Z.length }), [Z, $]);
|
|
2597
|
+
let { handleUndoKeyDown: Ut, markCaretPlaced: Wt } = et({
|
|
2562
2598
|
insertion: r,
|
|
2563
|
-
textareaRef:
|
|
2564
|
-
}), { isMenuOpen:
|
|
2565
|
-
config:
|
|
2566
|
-
message:
|
|
2567
|
-
}),
|
|
2568
|
-
|
|
2569
|
-
let
|
|
2570
|
-
|
|
2571
|
-
},
|
|
2572
|
-
|
|
2573
|
-
let e =
|
|
2574
|
-
|
|
2599
|
+
textareaRef: $
|
|
2600
|
+
}), { isMenuOpen: Gt, query: Kt, activeWordStart: qt, dismiss: Jt, closeOnOutsidePress: Yt, handleCaretMove: Xt, handleValueChange: Zt, listboxId: Qt, overlayRef: $t, activeOptionId: en, moveActiveOption: tn, getActiveOption: nn } = Ue({
|
|
2601
|
+
config: J,
|
|
2602
|
+
message: Z
|
|
2603
|
+
}), rn = G(Xt);
|
|
2604
|
+
rn.current = Xt;
|
|
2605
|
+
let an = () => {
|
|
2606
|
+
Xt($.current?.selectionStart ?? Z.length);
|
|
2607
|
+
}, on = G(!1), sn = () => {
|
|
2608
|
+
on.current ? on.current = !1 : requestAnimationFrame(() => {
|
|
2609
|
+
let e = $.current;
|
|
2610
|
+
rn.current(e?.selectionStart ?? e?.value.length ?? 0);
|
|
2575
2611
|
});
|
|
2576
|
-
},
|
|
2577
|
-
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") &&
|
|
2578
|
-
},
|
|
2579
|
-
let e =
|
|
2612
|
+
}, cn = (e) => {
|
|
2613
|
+
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Xt(e.currentTarget.selectionStart ?? Z.length);
|
|
2614
|
+
}, ln = J?.emptyQueryHint != null, un = J != null && qt != null ? qt + J.triggerPrefix.length : null, dn = un != null && Z.slice(un).split("\n", 1)[0] !== "", fn = ln && Gt && Kt === "" && un != null && !dn, pn = J != null && Gt ? qt ?? 0 : null, mn = G(null), hn = G(null), [gn, _n] = K(null), vn = H(() => {
|
|
2615
|
+
let e = mn.current, t = hn.current;
|
|
2580
2616
|
if (e == null || t == null) {
|
|
2581
|
-
|
|
2617
|
+
_n(null);
|
|
2582
2618
|
return;
|
|
2583
2619
|
}
|
|
2584
2620
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
2585
|
-
|
|
2621
|
+
_n({
|
|
2586
2622
|
left: n.left - r.left,
|
|
2587
2623
|
top: n.top - r.top
|
|
2588
2624
|
});
|
|
2589
2625
|
}, []);
|
|
2590
|
-
|
|
2591
|
-
if (
|
|
2592
|
-
let e =
|
|
2626
|
+
U(() => {
|
|
2627
|
+
if (pn == null) return;
|
|
2628
|
+
let e = $.current;
|
|
2593
2629
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
2594
|
-
let t = new ResizeObserver(
|
|
2630
|
+
let t = new ResizeObserver(vn);
|
|
2595
2631
|
return t.observe(e), () => t.disconnect();
|
|
2596
2632
|
}, [
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2633
|
+
pn,
|
|
2634
|
+
$,
|
|
2635
|
+
vn
|
|
2600
2636
|
]);
|
|
2601
|
-
let
|
|
2602
|
-
if (
|
|
2603
|
-
let t = `${
|
|
2604
|
-
if (
|
|
2605
|
-
let r =
|
|
2606
|
-
|
|
2637
|
+
let yn = H((e) => {
|
|
2638
|
+
if (J == null || (Jt(), !e?.consumeQuery) || (e.returnFocus !== !1 && $.current?.focus(), qt == null)) return;
|
|
2639
|
+
let t = `${J.triggerPrefix}${Kt}`, n = qt + t.length;
|
|
2640
|
+
if (Z.slice(qt, n) !== t) return;
|
|
2641
|
+
let r = Z.slice(0, qt) + Z.slice(n);
|
|
2642
|
+
Q(r), X.notifyChange(), u?.(r);
|
|
2607
2643
|
}, [
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
X,
|
|
2612
|
-
$,
|
|
2644
|
+
J,
|
|
2645
|
+
Jt,
|
|
2646
|
+
Kt,
|
|
2613
2647
|
Z,
|
|
2614
|
-
|
|
2648
|
+
qt,
|
|
2649
|
+
Q,
|
|
2650
|
+
X,
|
|
2615
2651
|
u,
|
|
2616
|
-
|
|
2617
|
-
]),
|
|
2618
|
-
|
|
2619
|
-
pt != null &&
|
|
2620
|
-
}, [
|
|
2621
|
-
let
|
|
2622
|
-
|
|
2623
|
-
let { attachments:
|
|
2652
|
+
$
|
|
2653
|
+
]), bn = G(void 0);
|
|
2654
|
+
U(() => {
|
|
2655
|
+
pt != null && bn.current !== t && (bn.current = t, $.current?.setSelectionRange(pt, pt), Wt(), Xt(pt));
|
|
2656
|
+
}, [Z]);
|
|
2657
|
+
let xn = G(Z);
|
|
2658
|
+
xn.current = Z;
|
|
2659
|
+
let { attachments: Sn, buildAttachments: Cn, addAttachments: wn, resetAttachments: Tn, handleRemove: En, handleRetry: Dn, handleExpand: On, hasBlockedAttachments: kn } = Le({
|
|
2624
2660
|
initialAttachments: Ce,
|
|
2625
2661
|
onUploadAttachment: a,
|
|
2626
|
-
onAttachmentsChange:
|
|
2662
|
+
onAttachmentsChange: m,
|
|
2627
2663
|
validateAttachment: vt,
|
|
2628
2664
|
pendingDropFiles: ce,
|
|
2629
2665
|
onDropFilesConsumed: de,
|
|
2630
2666
|
isDropDisabled: Ae,
|
|
2631
2667
|
pendingAttachments: fe,
|
|
2632
2668
|
onPendingAttachmentsConsumed: me,
|
|
2633
|
-
onExpandPastedText:
|
|
2634
|
-
let t =
|
|
2635
|
-
|
|
2636
|
-
}, [
|
|
2637
|
-
maximumAttachmentsAmount:
|
|
2669
|
+
onExpandPastedText: H((e) => {
|
|
2670
|
+
let t = xn.current, n = t ? `${t}\n${e}` : e;
|
|
2671
|
+
xn.current = n, Q(n), u?.(n);
|
|
2672
|
+
}, [Q, u]),
|
|
2673
|
+
maximumAttachmentsAmount: wt,
|
|
2638
2674
|
baseAttachmentsAmount: We.length,
|
|
2639
|
-
onAttachmentsLimitExceeded:
|
|
2640
|
-
}),
|
|
2641
|
-
|
|
2642
|
-
}, [
|
|
2675
|
+
onAttachmentsLimitExceeded: Tt
|
|
2676
|
+
}), An = H((e) => {
|
|
2677
|
+
wn(Cn([e]));
|
|
2678
|
+
}, [wn, Cn]), Mn = G(!1), [Nn, Pn] = K({
|
|
2643
2679
|
text: "",
|
|
2644
2680
|
revision: 0
|
|
2645
|
-
}), { state:
|
|
2646
|
-
onAttachAudio:
|
|
2681
|
+
}), { state: Fn, analyserNodeRef: In, errorMessage: Ln, startRecording: Rn, stopRecording: zn, discardRecording: Bn } = st({
|
|
2682
|
+
onAttachAudio: An,
|
|
2647
2683
|
onTranscribeAudio: Re,
|
|
2648
|
-
onTranscript:
|
|
2684
|
+
onTranscript: H((e) => {
|
|
2649
2685
|
let t = e.trim();
|
|
2650
2686
|
if (t) {
|
|
2651
|
-
let e =
|
|
2652
|
-
|
|
2687
|
+
let e = xn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2688
|
+
xn.current = n, Q(n), Pn((e) => ({
|
|
2653
2689
|
text: t,
|
|
2654
2690
|
revision: e.revision + 1
|
|
2655
|
-
})),
|
|
2691
|
+
})), X.notifyChange(), u?.(n);
|
|
2656
2692
|
}
|
|
2657
|
-
|
|
2693
|
+
Mn.current = !0;
|
|
2658
2694
|
}, [
|
|
2659
|
-
|
|
2660
|
-
|
|
2695
|
+
Q,
|
|
2696
|
+
X,
|
|
2661
2697
|
u
|
|
2662
2698
|
]),
|
|
2663
2699
|
errorLabel: Be
|
|
2664
|
-
}),
|
|
2665
|
-
|
|
2666
|
-
if (
|
|
2667
|
-
|
|
2668
|
-
let e =
|
|
2700
|
+
}), Vn = Fn === tt.Recording || Fn === tt.Processing;
|
|
2701
|
+
U(() => {
|
|
2702
|
+
if (Fn === tt.Error || Fn === tt.Idle && Mn.current) {
|
|
2703
|
+
Mn.current = !1;
|
|
2704
|
+
let e = $.current;
|
|
2669
2705
|
if (e != null) {
|
|
2670
|
-
|
|
2706
|
+
on.current = document.activeElement !== e, e.focus();
|
|
2671
2707
|
let t = e.value.length;
|
|
2672
2708
|
e.setSelectionRange(t, t);
|
|
2673
2709
|
}
|
|
2674
2710
|
}
|
|
2675
|
-
}, [
|
|
2676
|
-
let
|
|
2677
|
-
if (!
|
|
2711
|
+
}, [Fn, $]);
|
|
2712
|
+
let Hn = G(null), Un = G(null), Wn = Et && Dt, { handlePaste: Gn } = pe(wn, Wn ? he : Infinity), Kn = H((e) => {
|
|
2713
|
+
if (!Wn) {
|
|
2678
2714
|
let t = e.clipboardData.getData("text/plain");
|
|
2679
|
-
t.length >= ge &&
|
|
2715
|
+
t.length >= ge && Mt?.(t.length, ge);
|
|
2680
2716
|
}
|
|
2681
|
-
if (
|
|
2717
|
+
if (Gn(e), e.defaultPrevented) return;
|
|
2682
2718
|
let t = e.clipboardData.getData("text/plain").replace(/\r\n?/g, "\n");
|
|
2683
|
-
t !== "" &&
|
|
2719
|
+
t !== "" && J?.onTextPaste?.(t);
|
|
2684
2720
|
}, [
|
|
2685
|
-
|
|
2721
|
+
Wn,
|
|
2686
2722
|
ge,
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
]),
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
}, [
|
|
2694
|
-
let
|
|
2723
|
+
Mt,
|
|
2724
|
+
Gn,
|
|
2725
|
+
J
|
|
2726
|
+
]), qn = Z.trim().length > 0 || Sn.length > 0, Jn = qn && !kn && !Pe && !Vn, [Yn, Xn] = K([]), Zn = (Ye ?? []).map((e) => e.id).join("|");
|
|
2727
|
+
U(() => {
|
|
2728
|
+
Xn([]);
|
|
2729
|
+
}, [Zn]);
|
|
2730
|
+
let Qn = W(() => {
|
|
2695
2731
|
let e = Ye ?? [];
|
|
2696
|
-
return rt ? e.filter((e) => e.isSelected || !
|
|
2732
|
+
return rt ? e.filter((e) => e.isSelected || !Yn.includes(e.id)) : e;
|
|
2697
2733
|
}, [
|
|
2698
2734
|
Ye,
|
|
2699
|
-
|
|
2735
|
+
Yn,
|
|
2700
2736
|
rt
|
|
2701
|
-
]),
|
|
2702
|
-
|
|
2703
|
-
}, [Ye, $e]),
|
|
2704
|
-
if (Pe ||
|
|
2705
|
-
if (
|
|
2706
|
-
|
|
2737
|
+
]), $n = H((e) => {
|
|
2738
|
+
Xn((t) => t.includes(e) ? t : [...t, e]), Ye?.find((t) => t.id === e)?.isSelected && $e?.(e);
|
|
2739
|
+
}, [Ye, $e]), er = _e === void 0 || be != null, tr = Fe && !s, nr = async () => {
|
|
2740
|
+
if (Pe || Vn) return;
|
|
2741
|
+
if (Z.length >= ge) {
|
|
2742
|
+
Mt?.(Z.length, ge);
|
|
2707
2743
|
return;
|
|
2708
2744
|
}
|
|
2709
|
-
let e =
|
|
2710
|
-
|
|
2745
|
+
let e = Z, t = Sn;
|
|
2746
|
+
Q(""), X.reset();
|
|
2711
2747
|
try {
|
|
2712
2748
|
await i?.(e, t), t.forEach((e) => {
|
|
2713
2749
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2714
|
-
}),
|
|
2750
|
+
}), Tn([]);
|
|
2715
2751
|
} catch {
|
|
2716
|
-
|
|
2752
|
+
Q(e), Tn(t);
|
|
2717
2753
|
}
|
|
2718
|
-
},
|
|
2719
|
-
if (!
|
|
2720
|
-
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(),
|
|
2721
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(),
|
|
2754
|
+
}, rr = (e) => Ve === ct.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, ir = (e) => {
|
|
2755
|
+
if (!Gt || e.nativeEvent.isComposing) return !1;
|
|
2756
|
+
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Jt(), !0;
|
|
2757
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), tn(e.key === "ArrowDown" ? He.Next : He.Previous), !0;
|
|
2722
2758
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
2723
|
-
let t =
|
|
2724
|
-
return t == null ?
|
|
2725
|
-
},
|
|
2726
|
-
if (!
|
|
2759
|
+
let t = nn();
|
|
2760
|
+
return t == null ? rr(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
2761
|
+
}, ar = (e) => {
|
|
2762
|
+
if (!Vn && !Ut(e) && !ir(e)) {
|
|
2727
2763
|
if (!e.nativeEvent.isComposing && !Ae && !s) {
|
|
2728
2764
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2729
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
2765
|
+
let t = e.currentTarget.selectionStart ?? 0, n = X.navigate(e.key === "ArrowUp" ? "up" : "down", Z, t);
|
|
2730
2766
|
if (n !== null) {
|
|
2731
|
-
e.preventDefault(),
|
|
2767
|
+
e.preventDefault(), Q(n);
|
|
2732
2768
|
return;
|
|
2733
2769
|
}
|
|
2734
2770
|
}
|
|
@@ -2737,127 +2773,127 @@ var wn = /* @__PURE__ */ Object.assign(Cn, { displayName: "List" }), Tn = {
|
|
|
2737
2773
|
if (t != null) {
|
|
2738
2774
|
e.preventDefault();
|
|
2739
2775
|
let n = e.currentTarget;
|
|
2740
|
-
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Qe(n,
|
|
2776
|
+
n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Qe(n, Z.slice(0, t.start) + Z.slice(t.start + t.length), t.start);
|
|
2741
2777
|
return;
|
|
2742
2778
|
}
|
|
2743
2779
|
}
|
|
2744
2780
|
}
|
|
2745
|
-
e.key === "Enter" &&
|
|
2781
|
+
e.key === "Enter" && rr(e) && (e.preventDefault(), !s && Jn && er && !Ae && nr());
|
|
2746
2782
|
}
|
|
2747
|
-
},
|
|
2783
|
+
}, or = (e) => {
|
|
2748
2784
|
let t = Array.from(e.target.files ?? []);
|
|
2749
2785
|
if (t.length === 0) return;
|
|
2750
|
-
let n =
|
|
2751
|
-
e.target.value = "",
|
|
2752
|
-
},
|
|
2786
|
+
let n = Cn(t);
|
|
2787
|
+
e.target.value = "", wn(n);
|
|
2788
|
+
}, sr = W(() => {
|
|
2753
2789
|
let e = [];
|
|
2754
|
-
return
|
|
2755
|
-
offset:
|
|
2756
|
-
node: /* @__PURE__ */
|
|
2757
|
-
ref:
|
|
2790
|
+
return pn != null && e.push({
|
|
2791
|
+
offset: pn,
|
|
2792
|
+
node: /* @__PURE__ */ B("span", {
|
|
2793
|
+
ref: mn,
|
|
2758
2794
|
"aria-hidden": !0,
|
|
2759
2795
|
className: "inline-block h-lh w-0 align-text-top"
|
|
2760
2796
|
}, "caret-marker")
|
|
2761
|
-
}),
|
|
2762
|
-
offset:
|
|
2763
|
-
node: /* @__PURE__ */
|
|
2764
|
-
className:
|
|
2797
|
+
}), fn && J != null && un != null && e.push({
|
|
2798
|
+
offset: un,
|
|
2799
|
+
node: /* @__PURE__ */ B("span", {
|
|
2800
|
+
className: Y.commandHint,
|
|
2765
2801
|
"aria-hidden": !0,
|
|
2766
2802
|
"data-mirror-synthetic": !0,
|
|
2767
|
-
children:
|
|
2803
|
+
children: J.emptyQueryHint
|
|
2768
2804
|
}, "command-hint")
|
|
2769
2805
|
}), e;
|
|
2770
2806
|
}, [
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
]),
|
|
2776
|
-
textareaRef:
|
|
2777
|
-
message:
|
|
2778
|
-
isMirrorActive:
|
|
2807
|
+
pn,
|
|
2808
|
+
fn,
|
|
2809
|
+
J,
|
|
2810
|
+
un
|
|
2811
|
+
]), cr = Bt || sr.length > 0, { mirrorRef: lr, selectionRects: ur, updateSelectionRects: dr, syncMirrorToTextarea: fr } = Xe({
|
|
2812
|
+
textareaRef: $,
|
|
2813
|
+
message: Z,
|
|
2814
|
+
isMirrorActive: cr
|
|
2779
2815
|
});
|
|
2780
2816
|
Me(() => {
|
|
2781
|
-
|
|
2817
|
+
vn();
|
|
2782
2818
|
}, [
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2819
|
+
vn,
|
|
2820
|
+
pn,
|
|
2821
|
+
Z
|
|
2786
2822
|
]);
|
|
2787
|
-
let
|
|
2788
|
-
className: l(
|
|
2789
|
-
ref:
|
|
2823
|
+
let pr = /* @__PURE__ */ B("textarea", {
|
|
2824
|
+
className: l(Y.textarea, cr && Y.textareaMentionMode, ie?.fontClassName || "dial-body-paragraph-text", "relative z-0 field-sizing-content max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
|
|
2825
|
+
ref: $,
|
|
2790
2826
|
autoFocus: mt,
|
|
2791
|
-
value:
|
|
2827
|
+
value: Z,
|
|
2792
2828
|
onChange: (e) => {
|
|
2793
|
-
|
|
2829
|
+
Q(e.target.value), X.notifyChange();
|
|
2794
2830
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2795
|
-
|
|
2831
|
+
Zt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
|
|
2796
2832
|
},
|
|
2797
|
-
onSelect:
|
|
2833
|
+
onSelect: dr,
|
|
2798
2834
|
onScroll: () => {
|
|
2799
|
-
|
|
2835
|
+
fr(), pn != null && vn();
|
|
2800
2836
|
},
|
|
2801
|
-
onFocus:
|
|
2802
|
-
onClick:
|
|
2803
|
-
onKeyDown:
|
|
2804
|
-
onKeyUp:
|
|
2805
|
-
onPaste:
|
|
2806
|
-
placeholder:
|
|
2807
|
-
"aria-label":
|
|
2808
|
-
"aria-autocomplete":
|
|
2809
|
-
"aria-controls":
|
|
2810
|
-
"aria-activedescendant":
|
|
2811
|
-
"aria-hidden":
|
|
2837
|
+
onFocus: sn,
|
|
2838
|
+
onClick: an,
|
|
2839
|
+
onKeyDown: ar,
|
|
2840
|
+
onKeyUp: cn,
|
|
2841
|
+
onPaste: Kn,
|
|
2842
|
+
placeholder: h,
|
|
2843
|
+
"aria-label": g,
|
|
2844
|
+
"aria-autocomplete": J == null ? void 0 : "list",
|
|
2845
|
+
"aria-controls": Gt ? Qt : void 0,
|
|
2846
|
+
"aria-activedescendant": en ?? void 0,
|
|
2847
|
+
"aria-hidden": Bt ? !0 : void 0,
|
|
2812
2848
|
disabled: Ae,
|
|
2813
|
-
readOnly:
|
|
2849
|
+
readOnly: Vn,
|
|
2814
2850
|
rows: 1
|
|
2815
|
-
}),
|
|
2851
|
+
}), mr = /* @__PURE__ */ V(le, { children: [pr, J != null && /* @__PURE__ */ B("div", {
|
|
2816
2852
|
"aria-hidden": !0,
|
|
2817
2853
|
className: l("pointer-events-none absolute", ie?.fontClassName || "dial-body-paragraph-text"),
|
|
2818
2854
|
style: {
|
|
2819
|
-
left:
|
|
2820
|
-
top:
|
|
2855
|
+
left: gn?.left ?? 0,
|
|
2856
|
+
top: gn?.top ?? 0
|
|
2821
2857
|
},
|
|
2822
|
-
children: /* @__PURE__ */
|
|
2823
|
-
open:
|
|
2858
|
+
children: /* @__PURE__ */ B(b, {
|
|
2859
|
+
open: Gt,
|
|
2824
2860
|
onOpenChange: (e) => {
|
|
2825
|
-
e ||
|
|
2861
|
+
e || Yt();
|
|
2826
2862
|
},
|
|
2827
2863
|
placement: "top-start",
|
|
2828
2864
|
trigger: [],
|
|
2829
2865
|
initialFocus: -1,
|
|
2830
2866
|
matchReferenceWidth: !1,
|
|
2831
|
-
outsidePressIgnoreRef:
|
|
2867
|
+
outsidePressIgnoreRef: $,
|
|
2832
2868
|
renderOverlay: () => {
|
|
2833
|
-
let e =
|
|
2834
|
-
return /* @__PURE__ */
|
|
2835
|
-
ref:
|
|
2869
|
+
let e = J.menuLabel != null;
|
|
2870
|
+
return /* @__PURE__ */ B("div", {
|
|
2871
|
+
ref: $t,
|
|
2836
2872
|
role: e ? "group" : void 0,
|
|
2837
|
-
"aria-label":
|
|
2838
|
-
children:
|
|
2839
|
-
query:
|
|
2840
|
-
caretPosition:
|
|
2841
|
-
close:
|
|
2842
|
-
listboxId:
|
|
2843
|
-
activeOptionId:
|
|
2873
|
+
"aria-label": J.menuLabel,
|
|
2874
|
+
children: J.renderMenu({
|
|
2875
|
+
query: Kt,
|
|
2876
|
+
caretPosition: qt ?? 0,
|
|
2877
|
+
close: yn,
|
|
2878
|
+
listboxId: Qt,
|
|
2879
|
+
activeOptionId: en
|
|
2844
2880
|
})
|
|
2845
2881
|
});
|
|
2846
2882
|
},
|
|
2847
|
-
children: /* @__PURE__ */
|
|
2883
|
+
children: /* @__PURE__ */ B("span", {
|
|
2848
2884
|
"aria-hidden": !0,
|
|
2849
2885
|
className: "inline-block h-lh w-0"
|
|
2850
2886
|
})
|
|
2851
2887
|
})
|
|
2852
|
-
})] }),
|
|
2853
|
-
ref:
|
|
2888
|
+
})] }), hr = /* @__PURE__ */ V("div", {
|
|
2889
|
+
ref: hn,
|
|
2854
2890
|
className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
|
|
2855
|
-
children: [
|
|
2856
|
-
ref:
|
|
2857
|
-
className: l(
|
|
2858
|
-
children: [qe(
|
|
2891
|
+
children: [cr && /* @__PURE__ */ V("div", {
|
|
2892
|
+
ref: lr,
|
|
2893
|
+
className: l(Y.textarea, ie?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 wrap-anywhere whitespace-pre-wrap"),
|
|
2894
|
+
children: [qe(Z, zt, sr, Y.mentionHighlight, Y.mentionHighlightUnsupported), ur.map((e, t) => /* @__PURE__ */ B("div", {
|
|
2859
2895
|
"aria-hidden": !0,
|
|
2860
|
-
className: l("pointer-events-none absolute rounded-sm",
|
|
2896
|
+
className: l("pointer-events-none absolute rounded-sm", Y.selectionHighlight),
|
|
2861
2897
|
style: {
|
|
2862
2898
|
left: e.left,
|
|
2863
2899
|
top: e.top,
|
|
@@ -2865,117 +2901,117 @@ var wn = /* @__PURE__ */ Object.assign(Cn, { displayName: "List" }), Tn = {
|
|
|
2865
2901
|
height: e.height
|
|
2866
2902
|
}
|
|
2867
2903
|
}, `selection-${t}`))]
|
|
2868
|
-
}),
|
|
2869
|
-
}),
|
|
2870
|
-
onAttachClick: Te ? void 0 : () =>
|
|
2871
|
-
attachLabel:
|
|
2872
|
-
addMenuTitle:
|
|
2873
|
-
menuTitle:
|
|
2904
|
+
}), mr]
|
|
2905
|
+
}), gr = we ? void 0 : /* @__PURE__ */ B(bt, {
|
|
2906
|
+
onAttachClick: Te ? void 0 : () => Hn.current?.click(),
|
|
2907
|
+
attachLabel: _,
|
|
2908
|
+
addMenuTitle: w,
|
|
2909
|
+
menuTitle: ee,
|
|
2874
2910
|
menuCloseLabel: O,
|
|
2875
|
-
style:
|
|
2876
|
-
isDisabled: Ae ||
|
|
2911
|
+
style: Vt,
|
|
2912
|
+
isDisabled: Ae || Vn,
|
|
2877
2913
|
chatSettings: Je,
|
|
2878
|
-
extraMenuItems:
|
|
2879
|
-
onRecordVoice: Ie &&
|
|
2880
|
-
recordVoiceLabel:
|
|
2914
|
+
extraMenuItems: Ht,
|
|
2915
|
+
onRecordVoice: Ie && Et && !s && !Vn ? () => Rn(nt.Attachment) : void 0,
|
|
2916
|
+
recordVoiceLabel: L,
|
|
2881
2917
|
toolsMenuItems: rt ? Ye : void 0,
|
|
2882
2918
|
onToolToggle: $e,
|
|
2883
2919
|
toolsMenuTitle: it,
|
|
2884
2920
|
toolsBackLabel: at,
|
|
2885
2921
|
menuOverlays: ut,
|
|
2886
|
-
getCaretPosition: () =>
|
|
2887
|
-
}),
|
|
2888
|
-
className: l("flex",
|
|
2889
|
-
children:
|
|
2890
|
-
}),
|
|
2891
|
-
className: l("min-w-0",
|
|
2892
|
-
children: /* @__PURE__ */
|
|
2893
|
-
items:
|
|
2922
|
+
getCaretPosition: () => $.current?.selectionStart ?? Z.length
|
|
2923
|
+
}), _r = De === lt.Inline && (!Pt || Oe), vr = gr && /* @__PURE__ */ B("div", {
|
|
2924
|
+
className: l("flex", q.addCluster),
|
|
2925
|
+
children: gr
|
|
2926
|
+
}), yr = Qn.length > 0 && $e != null && /* @__PURE__ */ B("div", {
|
|
2927
|
+
className: l("min-w-0", _r ? "flex-1" : "max-w-full flex-[1_0_auto]", q.toolsChips),
|
|
2928
|
+
children: /* @__PURE__ */ B(Ct, {
|
|
2929
|
+
items: Qn,
|
|
2894
2930
|
onToolToggle: $e,
|
|
2895
|
-
onToolDismiss:
|
|
2931
|
+
onToolDismiss: $n,
|
|
2896
2932
|
canRemove: rt,
|
|
2897
2933
|
removeLabel: ot?.removeLabel,
|
|
2898
2934
|
stateOnLabel: ot?.stateOnLabel,
|
|
2899
2935
|
stateOffLabel: ot?.stateOffLabel
|
|
2900
2936
|
})
|
|
2901
2937
|
});
|
|
2902
|
-
return /* @__PURE__ */
|
|
2903
|
-
ref:
|
|
2904
|
-
style:
|
|
2905
|
-
className: l(
|
|
2938
|
+
return /* @__PURE__ */ V("div", {
|
|
2939
|
+
ref: Un,
|
|
2940
|
+
style: Vt,
|
|
2941
|
+
className: l(Y.wrapper, Ae && Y.wrapperDisabled, Ae && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", se, q.wrapper),
|
|
2906
2942
|
children: [
|
|
2907
|
-
(We.length > 0 ||
|
|
2908
|
-
attachments: [...We, ...
|
|
2943
|
+
(We.length > 0 || Sn.length > 0) && /* @__PURE__ */ B(ue, {
|
|
2944
|
+
attachments: [...We, ...Sn],
|
|
2909
2945
|
onRemove: (e) => {
|
|
2910
|
-
We.some((t) => t.id === e) ? Ge?.(e) :
|
|
2946
|
+
We.some((t) => t.id === e) ? Ge?.(e) : En(e);
|
|
2911
2947
|
},
|
|
2912
|
-
onRetry:
|
|
2913
|
-
onExpand:
|
|
2948
|
+
onRetry: Dn,
|
|
2949
|
+
onExpand: On,
|
|
2914
2950
|
labels: {
|
|
2915
2951
|
removeLabel: k,
|
|
2916
|
-
retryLabel:
|
|
2917
|
-
uploadingLabel:
|
|
2918
|
-
expandLabel:
|
|
2919
|
-
clickLabel:
|
|
2952
|
+
retryLabel: A,
|
|
2953
|
+
uploadingLabel: j,
|
|
2954
|
+
expandLabel: M,
|
|
2955
|
+
clickLabel: N
|
|
2920
2956
|
},
|
|
2921
2957
|
styles: {
|
|
2922
2958
|
...ae,
|
|
2923
|
-
className: l(
|
|
2959
|
+
className: l(Sn.length > 6 && "-me-4", ae?.className)
|
|
2924
2960
|
},
|
|
2925
2961
|
onAttachmentClick: yt == null ? void 0 : (e) => {
|
|
2926
|
-
let t = [...We, ...
|
|
2962
|
+
let t = [...We, ...Sn].find((t) => t.id === e);
|
|
2927
2963
|
t != null && yt(t);
|
|
2928
2964
|
}
|
|
2929
2965
|
}),
|
|
2930
|
-
!we && /* @__PURE__ */
|
|
2931
|
-
ref:
|
|
2966
|
+
!we && /* @__PURE__ */ B("input", {
|
|
2967
|
+
ref: Hn,
|
|
2932
2968
|
type: "file",
|
|
2933
2969
|
multiple: !0,
|
|
2934
|
-
accept:
|
|
2970
|
+
accept: x,
|
|
2935
2971
|
className: "sr-only",
|
|
2936
2972
|
"aria-hidden": !0,
|
|
2937
2973
|
tabIndex: -1,
|
|
2938
|
-
onChange:
|
|
2974
|
+
onChange: or
|
|
2939
2975
|
}),
|
|
2940
|
-
/* @__PURE__ */
|
|
2941
|
-
politeness:
|
|
2976
|
+
/* @__PURE__ */ B(T, {
|
|
2977
|
+
politeness: D.Assertive,
|
|
2942
2978
|
className: "min-w-0 px-1 wrap-break-word",
|
|
2943
|
-
children:
|
|
2979
|
+
children: Ln && /* @__PURE__ */ B(S, { text: Ln })
|
|
2944
2980
|
}),
|
|
2945
|
-
|
|
2981
|
+
Vn && /* @__PURE__ */ B(Ot, {
|
|
2946
2982
|
embedded: !0,
|
|
2947
|
-
state:
|
|
2948
|
-
analyserNodeRef:
|
|
2949
|
-
onStop:
|
|
2950
|
-
onDiscard:
|
|
2951
|
-
attachButton:
|
|
2952
|
-
stopLabel:
|
|
2953
|
-
discardLabel:
|
|
2983
|
+
state: Fn,
|
|
2984
|
+
analyserNodeRef: In,
|
|
2985
|
+
onStop: zn,
|
|
2986
|
+
onDiscard: Bn,
|
|
2987
|
+
attachButton: gr,
|
|
2988
|
+
stopLabel: R,
|
|
2989
|
+
discardLabel: re,
|
|
2954
2990
|
processingLabel: ze
|
|
2955
2991
|
}),
|
|
2956
|
-
!
|
|
2957
|
-
!
|
|
2992
|
+
!Vn && Ee && hr,
|
|
2993
|
+
!Vn && !Ee && _r && yr && /* @__PURE__ */ B("div", {
|
|
2958
2994
|
className: "flex",
|
|
2959
|
-
children:
|
|
2995
|
+
children: yr
|
|
2960
2996
|
}),
|
|
2961
|
-
!
|
|
2962
|
-
className: l("flex items-center gap-2",
|
|
2997
|
+
!Vn && !Ee && /* @__PURE__ */ V("div", {
|
|
2998
|
+
className: l("flex items-center gap-2", _r ? "flex-nowrap" : "flex-wrap", q.actionRow),
|
|
2963
2999
|
children: [
|
|
2964
|
-
|
|
2965
|
-
/* @__PURE__ */
|
|
2966
|
-
className: l("flex min-w-0 items-center self-stretch",
|
|
2967
|
-
children:
|
|
3000
|
+
_r && vr,
|
|
3001
|
+
/* @__PURE__ */ B("div", {
|
|
3002
|
+
className: l("flex min-w-0 items-center self-stretch", _r ? "flex-1" : "w-full", q.textareaWrap),
|
|
3003
|
+
children: hr
|
|
2968
3004
|
}),
|
|
2969
|
-
!
|
|
2970
|
-
!
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
className: l("ms-auto flex shrink-0 items-center gap-2",
|
|
3005
|
+
!_r && vr,
|
|
3006
|
+
!_r && yr,
|
|
3007
|
+
/* @__PURE__ */ B("div", {
|
|
3008
|
+
className: l("ms-auto flex shrink-0 items-center gap-2", q.footerActions),
|
|
2973
3009
|
children: ke ? ke({
|
|
2974
|
-
canSend:
|
|
2975
|
-
onSend:
|
|
2976
|
-
}) : /* @__PURE__ */
|
|
2977
|
-
|
|
2978
|
-
/* @__PURE__ */
|
|
3010
|
+
canSend: Jn,
|
|
3011
|
+
onSend: nr
|
|
3012
|
+
}) : /* @__PURE__ */ V(le, { children: [
|
|
3013
|
+
jt,
|
|
3014
|
+
/* @__PURE__ */ B(jn, {
|
|
2979
3015
|
deployments: _e,
|
|
2980
3016
|
selectedDeploymentId: be,
|
|
2981
3017
|
onDeploymentChange: xe,
|
|
@@ -2984,81 +3020,81 @@ var wn = /* @__PURE__ */ Object.assign(Cn, { displayName: "List" }), Tn = {
|
|
|
2984
3020
|
nameClassName: ie?.modelSelectorNameClassName,
|
|
2985
3021
|
versionClassName: ie?.modelSelectorVersionClassName,
|
|
2986
3022
|
isStreaming: s,
|
|
2987
|
-
isMobile:
|
|
3023
|
+
isMobile: Ft,
|
|
2988
3024
|
isDisabled: Ne,
|
|
2989
|
-
style:
|
|
3025
|
+
style: Vt,
|
|
2990
3026
|
modelPickerOverlay: xt,
|
|
2991
|
-
isPickerOpen:
|
|
2992
|
-
onPickerToggle: () =>
|
|
2993
|
-
onPickerOpenChange:
|
|
3027
|
+
isPickerOpen: It,
|
|
3028
|
+
onPickerToggle: () => Rt(!It),
|
|
3029
|
+
onPickerOpenChange: Rt
|
|
2994
3030
|
}),
|
|
2995
|
-
|
|
2996
|
-
icon: /* @__PURE__ */
|
|
2997
|
-
size:
|
|
2998
|
-
stroke:
|
|
3031
|
+
tr && /* @__PURE__ */ B(C, {
|
|
3032
|
+
icon: /* @__PURE__ */ B(ye, {
|
|
3033
|
+
size: v.LG,
|
|
3034
|
+
stroke: y,
|
|
2999
3035
|
"aria-hidden": !0
|
|
3000
3036
|
}),
|
|
3001
|
-
"aria-label":
|
|
3002
|
-
tooltipProps: { tooltip:
|
|
3037
|
+
"aria-label": I,
|
|
3038
|
+
tooltipProps: { tooltip: I },
|
|
3003
3039
|
className: "shrink-0",
|
|
3004
|
-
onClick: () =>
|
|
3040
|
+
onClick: () => Rn(nt.Dictation),
|
|
3005
3041
|
disabled: Ae || s
|
|
3006
3042
|
}),
|
|
3007
|
-
s && o ? /* @__PURE__ */
|
|
3043
|
+
s && o ? /* @__PURE__ */ B(At, {
|
|
3008
3044
|
onStop: o,
|
|
3009
3045
|
ariaLabel: F
|
|
3010
|
-
}) : !s && /* @__PURE__ */
|
|
3011
|
-
onSend:
|
|
3012
|
-
isDisabled: !
|
|
3013
|
-
ariaLabel:
|
|
3014
|
-
sendTooltip:
|
|
3046
|
+
}) : !s && /* @__PURE__ */ B(kt, {
|
|
3047
|
+
onSend: nr,
|
|
3048
|
+
isDisabled: !er || !Jn,
|
|
3049
|
+
ariaLabel: te,
|
|
3050
|
+
sendTooltip: qn ? ne : P ?? ne
|
|
3015
3051
|
})
|
|
3016
3052
|
] })
|
|
3017
3053
|
})
|
|
3018
3054
|
]
|
|
3019
3055
|
}),
|
|
3020
|
-
/* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ B(T, {
|
|
3021
3057
|
visuallyHidden: !0,
|
|
3022
3058
|
atomic: !0,
|
|
3023
|
-
as:
|
|
3024
|
-
children: /* @__PURE__ */
|
|
3059
|
+
as: E.Span,
|
|
3060
|
+
children: /* @__PURE__ */ B("span", { children: Nn.text }, Nn.revision)
|
|
3025
3061
|
})
|
|
3026
3062
|
]
|
|
3027
3063
|
});
|
|
3028
3064
|
});
|
|
3029
|
-
|
|
3030
|
-
var
|
|
3065
|
+
Mn.displayName = "Input";
|
|
3066
|
+
var Nn = {
|
|
3031
3067
|
welcome: "_welcome_1icyo_1",
|
|
3032
3068
|
description: "_description_1icyo_5"
|
|
3033
|
-
},
|
|
3069
|
+
}, Pn = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
|
|
3034
3070
|
let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
|
|
3035
3071
|
"--ci-welcome-color": p?.welcomeText,
|
|
3036
3072
|
"--ci-description-color": p?.descriptionText
|
|
3037
3073
|
});
|
|
3038
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ V("div", {
|
|
3039
3075
|
style: _,
|
|
3040
3076
|
className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
|
|
3041
3077
|
children: [
|
|
3042
|
-
n && /* @__PURE__ */
|
|
3078
|
+
n && /* @__PURE__ */ V("div", {
|
|
3043
3079
|
className: "flex max-w-full flex-col items-center gap-4 text-center",
|
|
3044
|
-
children: [/* @__PURE__ */
|
|
3045
|
-
className: l(
|
|
3080
|
+
children: [/* @__PURE__ */ B("h1", {
|
|
3081
|
+
className: l(Nn.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
|
|
3046
3082
|
children: n
|
|
3047
|
-
}), r && /* @__PURE__ */
|
|
3048
|
-
className: l(
|
|
3083
|
+
}), r && /* @__PURE__ */ B("p", {
|
|
3084
|
+
className: l(Nn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
|
|
3049
3085
|
children: r
|
|
3050
3086
|
})]
|
|
3051
3087
|
}),
|
|
3052
|
-
i != null && /* @__PURE__ */
|
|
3088
|
+
i != null && /* @__PURE__ */ B("div", {
|
|
3053
3089
|
className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
|
|
3054
3090
|
children: i
|
|
3055
3091
|
}),
|
|
3056
|
-
/* @__PURE__ */
|
|
3092
|
+
/* @__PURE__ */ V("div", {
|
|
3057
3093
|
className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
3058
|
-
children: [a != null && /* @__PURE__ */
|
|
3094
|
+
children: [a != null && /* @__PURE__ */ B("div", {
|
|
3059
3095
|
className: "mb-2",
|
|
3060
3096
|
children: a
|
|
3061
|
-
}), /* @__PURE__ */
|
|
3097
|
+
}), /* @__PURE__ */ B(Mn, {
|
|
3062
3098
|
placeholder: t,
|
|
3063
3099
|
isStreaming: e,
|
|
3064
3100
|
isInputDisabled: d,
|
|
@@ -3072,147 +3108,147 @@ var Mn = {
|
|
|
3072
3108
|
})
|
|
3073
3109
|
]
|
|
3074
3110
|
});
|
|
3075
|
-
},
|
|
3076
|
-
let
|
|
3077
|
-
|
|
3078
|
-
A?.length && (
|
|
3111
|
+
}, Fn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: f, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: ee = "Close", className: k, pendingDropFiles: A, onDropFilesConsumed: j, validateAttachment: M, isAttachmentsEnabled: N, isTextAttachmentsAllowed: te, hideAttachFile: P = !1, fileAccept: F, maximumAttachmentsAmount: I, onAttachmentsLimitExceeded: L, onDialFileSystemClick: R, dialFileSystemLabel: re, pendingAttachments: z, onPendingAttachmentsConsumed: ie, onAttachmentClick: ae, pasteTextThreshold: oe, maxMessageLength: se = 5e4, onMessageTooLong: ce }) => {
|
|
3112
|
+
let le = G(null), ue = G(null), [de, fe] = K([]);
|
|
3113
|
+
U(() => {
|
|
3114
|
+
A?.length && (fe(A), j?.());
|
|
3079
3115
|
}, [A, j]);
|
|
3080
|
-
let [
|
|
3081
|
-
|
|
3082
|
-
},
|
|
3083
|
-
m(e,
|
|
3084
|
-
}, [
|
|
3085
|
-
|
|
3086
|
-
},
|
|
3087
|
-
|
|
3088
|
-
}, [n]),
|
|
3116
|
+
let [pe, me] = K(e ?? ""), [he, ge] = K([]), [_e, ye] = K(d), be = he.some((e) => e.status === a.Loading || e.status === a.Error), xe = (pe.trim().length > 0 || he.length > 0 || _e.length > 0) && !be, Se = (e) => {
|
|
3117
|
+
ye((t) => t.filter((t) => t.id !== e));
|
|
3118
|
+
}, Ce = H((e, t) => {
|
|
3119
|
+
m(e, _e, t);
|
|
3120
|
+
}, [_e, m]), we = () => {
|
|
3121
|
+
xe && (pe.length >= se ? ce?.(pe.length, se) : Ce(pe, he));
|
|
3122
|
+
}, Te = H(() => fe([]), []), Ee = H((e) => {
|
|
3123
|
+
me(e), n?.(e);
|
|
3124
|
+
}, [n]), De = H((e) => {
|
|
3089
3125
|
let t = Array.from(e.target.files ?? []);
|
|
3090
|
-
t.length !== 0 && (e.target.value = "",
|
|
3091
|
-
}, []),
|
|
3126
|
+
t.length !== 0 && (e.target.value = "", fe(t));
|
|
3127
|
+
}, []), Oe = W(() => R ? [{
|
|
3092
3128
|
key: "dial-fs",
|
|
3093
|
-
label:
|
|
3094
|
-
icon: /* @__PURE__ */
|
|
3095
|
-
size:
|
|
3129
|
+
label: re ?? "DIAL file system",
|
|
3130
|
+
icon: /* @__PURE__ */ B(ve, {
|
|
3131
|
+
size: p,
|
|
3096
3132
|
"aria-hidden": !0,
|
|
3097
|
-
stroke:
|
|
3133
|
+
stroke: y
|
|
3098
3134
|
}),
|
|
3099
|
-
onClick:
|
|
3100
|
-
}] : [], [
|
|
3101
|
-
return /* @__PURE__ */
|
|
3102
|
-
className: l("flex w-full flex-col gap-2",
|
|
3103
|
-
children: [/* @__PURE__ */
|
|
3104
|
-
ref:
|
|
3135
|
+
onClick: R
|
|
3136
|
+
}] : [], [R, re]);
|
|
3137
|
+
return /* @__PURE__ */ V("div", {
|
|
3138
|
+
className: l("flex w-full flex-col gap-2", k),
|
|
3139
|
+
children: [/* @__PURE__ */ B(Mn, {
|
|
3140
|
+
ref: ue,
|
|
3105
3141
|
message: e,
|
|
3106
3142
|
messageRevision: t,
|
|
3107
3143
|
activeMentions: r,
|
|
3108
3144
|
onBackspaceAtCaret: i,
|
|
3109
3145
|
caretPositionOverride: o,
|
|
3110
3146
|
commandMenu: s,
|
|
3111
|
-
ariaLabel:
|
|
3147
|
+
ariaLabel: v,
|
|
3112
3148
|
hideActionBar: !0,
|
|
3113
3149
|
sendOnEnter: u,
|
|
3114
|
-
pendingDropFiles:
|
|
3115
|
-
onDropFilesConsumed:
|
|
3116
|
-
onSend:
|
|
3150
|
+
pendingDropFiles: de,
|
|
3151
|
+
onDropFilesConsumed: Te,
|
|
3152
|
+
onSend: Ce,
|
|
3117
3153
|
onUploadAttachment: h,
|
|
3118
|
-
onChange:
|
|
3119
|
-
onAttachmentsChange:
|
|
3154
|
+
onChange: Ee,
|
|
3155
|
+
onAttachmentsChange: ge,
|
|
3120
3156
|
removeLabel: b,
|
|
3121
3157
|
retryLabel: x,
|
|
3122
3158
|
uploadingLabel: S,
|
|
3123
3159
|
expandLabel: C,
|
|
3124
3160
|
clickLabel: w,
|
|
3125
3161
|
className: "max-w-full",
|
|
3126
|
-
prefixAttachments:
|
|
3127
|
-
onRemovePrefixAttachment:
|
|
3162
|
+
prefixAttachments: _e,
|
|
3163
|
+
onRemovePrefixAttachment: Se,
|
|
3128
3164
|
validateAttachment: M,
|
|
3129
3165
|
isAttachmentsEnabled: N,
|
|
3130
3166
|
isTextAttachmentsAllowed: te,
|
|
3131
|
-
maximumAttachmentsAmount:
|
|
3132
|
-
onAttachmentsLimitExceeded:
|
|
3133
|
-
pendingAttachments:
|
|
3134
|
-
onPendingAttachmentsConsumed:
|
|
3135
|
-
onAttachmentClick:
|
|
3136
|
-
pasteTextThreshold:
|
|
3137
|
-
maxMessageLength:
|
|
3138
|
-
onMessageTooLong:
|
|
3139
|
-
}), /* @__PURE__ */
|
|
3167
|
+
maximumAttachmentsAmount: I,
|
|
3168
|
+
onAttachmentsLimitExceeded: L,
|
|
3169
|
+
pendingAttachments: z,
|
|
3170
|
+
onPendingAttachmentsConsumed: ie,
|
|
3171
|
+
onAttachmentClick: ae,
|
|
3172
|
+
pasteTextThreshold: oe,
|
|
3173
|
+
maxMessageLength: se,
|
|
3174
|
+
onMessageTooLong: ce
|
|
3175
|
+
}), /* @__PURE__ */ V("div", {
|
|
3140
3176
|
className: "flex items-center justify-between",
|
|
3141
|
-
children: [/* @__PURE__ */
|
|
3177
|
+
children: [/* @__PURE__ */ V("div", {
|
|
3142
3178
|
className: "flex",
|
|
3143
|
-
children: [!
|
|
3144
|
-
ref:
|
|
3179
|
+
children: [!P && /* @__PURE__ */ B("input", {
|
|
3180
|
+
ref: le,
|
|
3145
3181
|
type: "file",
|
|
3146
3182
|
multiple: !0,
|
|
3147
|
-
accept:
|
|
3183
|
+
accept: F,
|
|
3148
3184
|
className: "sr-only",
|
|
3149
3185
|
"aria-hidden": !0,
|
|
3150
3186
|
tabIndex: -1,
|
|
3151
|
-
onChange:
|
|
3152
|
-
}), (!
|
|
3153
|
-
onAttachClick:
|
|
3187
|
+
onChange: De
|
|
3188
|
+
}), (!P || (c?.length ?? 0) > 0) && /* @__PURE__ */ B(bt, {
|
|
3189
|
+
onAttachClick: P ? void 0 : () => le.current?.click(),
|
|
3154
3190
|
attachLabel: E,
|
|
3155
3191
|
addMenuTitle: T,
|
|
3156
3192
|
menuTitle: D,
|
|
3157
|
-
menuCloseLabel:
|
|
3158
|
-
extraMenuItems:
|
|
3193
|
+
menuCloseLabel: ee,
|
|
3194
|
+
extraMenuItems: Oe,
|
|
3159
3195
|
menuOverlays: c,
|
|
3160
|
-
getCaretPosition: () =>
|
|
3196
|
+
getCaretPosition: () => ue.current?.getCaretPosition() ?? 0
|
|
3161
3197
|
})]
|
|
3162
|
-
}), /* @__PURE__ */
|
|
3198
|
+
}), /* @__PURE__ */ V("div", {
|
|
3163
3199
|
className: "flex gap-2",
|
|
3164
|
-
children: [/* @__PURE__ */
|
|
3200
|
+
children: [/* @__PURE__ */ B(O, {
|
|
3165
3201
|
label: g,
|
|
3166
|
-
onClick:
|
|
3167
|
-
}), /* @__PURE__ */
|
|
3202
|
+
onClick: f
|
|
3203
|
+
}), /* @__PURE__ */ B(ne, {
|
|
3168
3204
|
label: _,
|
|
3169
|
-
onClick:
|
|
3170
|
-
disabled: !
|
|
3205
|
+
onClick: we,
|
|
3206
|
+
disabled: !xe
|
|
3171
3207
|
})]
|
|
3172
3208
|
})]
|
|
3173
3209
|
})]
|
|
3174
3210
|
});
|
|
3175
|
-
},
|
|
3211
|
+
}, In = /* @__PURE__ */ function(e) {
|
|
3176
3212
|
return e.Warning = "warning", e.Reached = "reached", e;
|
|
3177
|
-
}({}),
|
|
3178
|
-
[
|
|
3179
|
-
[
|
|
3180
|
-
},
|
|
3181
|
-
let d = /* @__PURE__ */
|
|
3213
|
+
}({}), Ln = { banner: "_banner_180n6_2" }, Rn = {
|
|
3214
|
+
[In.Warning]: M.Warning,
|
|
3215
|
+
[In.Reached]: M.Error
|
|
3216
|
+
}, zn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", className: s, colors: u }) => {
|
|
3217
|
+
let d = /* @__PURE__ */ B("span", {
|
|
3182
3218
|
className: a,
|
|
3183
3219
|
children: t
|
|
3184
|
-
}), f = n != null && /* @__PURE__ */
|
|
3220
|
+
}), f = n != null && /* @__PURE__ */ V(le, { children: [
|
|
3185
3221
|
" ",
|
|
3186
|
-
/* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ B("time", {
|
|
3187
3223
|
dateTime: n.isoValue,
|
|
3188
3224
|
"aria-hidden": n.ariaLabel != null || void 0,
|
|
3189
3225
|
className: o,
|
|
3190
3226
|
children: n.label
|
|
3191
3227
|
}),
|
|
3192
|
-
n.ariaLabel != null && /* @__PURE__ */
|
|
3228
|
+
n.ariaLabel != null && /* @__PURE__ */ B("span", {
|
|
3193
3229
|
className: "sr-only",
|
|
3194
3230
|
children: n.ariaLabel
|
|
3195
3231
|
})
|
|
3196
3232
|
] });
|
|
3197
|
-
return /* @__PURE__ */
|
|
3233
|
+
return /* @__PURE__ */ B(A, {
|
|
3198
3234
|
role: "status",
|
|
3199
|
-
variant:
|
|
3200
|
-
type:
|
|
3235
|
+
variant: Rn[e],
|
|
3236
|
+
type: j.SectionMessage,
|
|
3201
3237
|
title: f ? d : void 0,
|
|
3202
3238
|
message: f || d,
|
|
3203
|
-
className: l(
|
|
3239
|
+
className: l(Ln.banner, q.usageBanner, s),
|
|
3204
3240
|
style: c({ "--ci-usage-banner-bg": u?.background }),
|
|
3205
|
-
children: r != null && /* @__PURE__ */
|
|
3241
|
+
children: r != null && /* @__PURE__ */ B(_, {
|
|
3206
3242
|
className: "shrink-0 self-start",
|
|
3207
3243
|
ariaLabel: i,
|
|
3208
3244
|
onClose: () => r()
|
|
3209
3245
|
})
|
|
3210
3246
|
});
|
|
3211
|
-
},
|
|
3212
|
-
let [t, n] =
|
|
3247
|
+
}, Bn = (e) => {
|
|
3248
|
+
let [t, n] = K({
|
|
3213
3249
|
text: e?.text,
|
|
3214
3250
|
revision: e?.revision ?? 0
|
|
3215
|
-
}), r =
|
|
3251
|
+
}), r = H((e) => {
|
|
3216
3252
|
n((t) => ({
|
|
3217
3253
|
text: e,
|
|
3218
3254
|
revision: t.revision + 1
|
|
@@ -3223,11 +3259,11 @@ var Mn = {
|
|
|
3223
3259
|
messageRevision: t.revision,
|
|
3224
3260
|
seedMessage: r
|
|
3225
3261
|
};
|
|
3226
|
-
},
|
|
3227
|
-
let n =
|
|
3228
|
-
r.current = t,
|
|
3262
|
+
}, Vn = (e, t) => {
|
|
3263
|
+
let n = G(e), r = G(t);
|
|
3264
|
+
r.current = t, U(() => {
|
|
3229
3265
|
e !== n.current && (n.current = e, r.current());
|
|
3230
3266
|
}, [e]);
|
|
3231
3267
|
};
|
|
3232
3268
|
//#endregion
|
|
3233
|
-
export { lt as ActionRowLayout, Fe as BottomSheetShell,
|
|
3269
|
+
export { lt as ActionRowLayout, Fe as BottomSheetShell, q as CONVERSATION_INPUT_CLASS, gt as ChatSettingsModal, Pn as ConversationInput, Fn as EditMessageInput, Mn as Input, ct as SendOnEnter, In as UsageLimitBannerSeverity, zn as UsageLimitBannerView, Bn as useComposerSeed, Vn as useComposerSeedSource };
|