@epam/ai-dial-conversation-input 1.1.0-dev.178 → 1.1.0-dev.179
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 +12 -0
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/index.js +425 -374
- package/models/ConversationInput.d.ts +12 -0
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +12 -0
- package/models/Input.d.ts.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RequestStatus as r, ResponseFormat as i, buildCssVars as a, mergeClasses as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, DialRadioGroup as p, DialSearch as m, DialSlider as h, DialTooltip as g, Dropdown as _, ElementSize as v, ErrorText as y, GhostIconButton as b, Highlight as x, Input as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, PrimaryIconButton as D, RadioGroupOrientation as O, Skeleton as k, SkeletonVariant as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
3
|
+
import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as te, IconChevronDown as N, IconChevronRight as ne, IconFile as re, IconMicrophone as ie, IconPaperclip as ae, IconPlayerStopFilled as oe, IconPlaystationSquare as se, IconPlus as ce, IconPrompt as le, IconSettings as ue, IconTool as de, IconX as P } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as F } from "react-dom";
|
|
5
|
+
import { createElement as I, memo as fe, useCallback as L, useEffect as R, useImperativeHandle as pe, useLayoutEffect as me, useMemo as z, useRef as B, useState as V } from "react";
|
|
6
6
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
|
-
import { AttachmentCard as
|
|
7
|
+
import { AttachmentCard as he, AttachmentGroup as ge, AttachmentTray as _e, AttachmentTray as ve, FileDndOverlay as ye, MAX_UPLOADS_PER_MINUTE as be, generateAttachmentId as xe, getAttachmentIcon as Se, useClipboardPaste as Ce } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
9
|
+
var we = (e, t) => {
|
|
10
10
|
R(() => {
|
|
11
11
|
if (!e) return;
|
|
12
12
|
let n = (e) => {
|
|
@@ -18,22 +18,22 @@ var Se = (e, t) => {
|
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
21
|
+
}, Te = {
|
|
22
22
|
backdrop: "_backdrop_1d50f_9",
|
|
23
23
|
sheet: "_sheet_1d50f_13",
|
|
24
24
|
"slide-up": "_slide-up_1d50f_1",
|
|
25
25
|
title: "_title_1d50f_18",
|
|
26
26
|
divider: "_divider_1d50f_22"
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
27
|
+
}, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: m, children: h }) => {
|
|
28
|
+
if (we(e, r), !e || typeof document > "u") return null;
|
|
29
29
|
let g = a({
|
|
30
30
|
"--ci-backdrop": m?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": m?.sheetBg,
|
|
32
32
|
"--ci-sheet-text": m?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": m?.divider
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
className: o(
|
|
35
|
+
return F(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
36
|
+
className: o(Te.backdrop, "fixed inset-0 z-[55]"),
|
|
37
37
|
style: g,
|
|
38
38
|
onPointerDown: r,
|
|
39
39
|
"aria-hidden": !0
|
|
@@ -45,14 +45,14 @@ var Se = (e, t) => {
|
|
|
45
45
|
...g,
|
|
46
46
|
...l
|
|
47
47
|
},
|
|
48
|
-
className: o(
|
|
48
|
+
className: o(Te.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
|
|
49
49
|
children: [t != null && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("div", {
|
|
50
50
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
51
51
|
children: [
|
|
52
52
|
i && /* @__PURE__ */ U("div", {
|
|
53
53
|
className: "absolute start-4",
|
|
54
54
|
children: /* @__PURE__ */ U(b, {
|
|
55
|
-
icon: /* @__PURE__ */ U(
|
|
55
|
+
icon: /* @__PURE__ */ U(ee, {
|
|
56
56
|
size: d.LG,
|
|
57
57
|
stroke: 1.5,
|
|
58
58
|
className: "rtl:scale-x-[-1]"
|
|
@@ -62,7 +62,7 @@ var Se = (e, t) => {
|
|
|
62
62
|
})
|
|
63
63
|
}),
|
|
64
64
|
/* @__PURE__ */ U("span", {
|
|
65
|
-
className: o(
|
|
65
|
+
className: o(Te.title, f),
|
|
66
66
|
children: t
|
|
67
67
|
}),
|
|
68
68
|
/* @__PURE__ */ U("div", {
|
|
@@ -74,16 +74,16 @@ var Se = (e, t) => {
|
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
]
|
|
77
|
-
}), /* @__PURE__ */ U("div", { className: o(
|
|
77
|
+
}), /* @__PURE__ */ U("div", { className: o(Te.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
|
|
78
78
|
className: "overflow-y-auto",
|
|
79
79
|
children: h
|
|
80
80
|
})]
|
|
81
81
|
})] }), document.body);
|
|
82
|
-
},
|
|
82
|
+
}, Ee = async (e, t, n) => {
|
|
83
83
|
let r = 6e4 / t, i = [];
|
|
84
84
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
85
85
|
await Promise.allSettled(i);
|
|
86
|
-
},
|
|
86
|
+
}, De = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
87
87
|
let [h, g] = V(n), _ = B(h);
|
|
88
88
|
R(() => {
|
|
89
89
|
_.current = h;
|
|
@@ -95,7 +95,7 @@ var Se = (e, t) => {
|
|
|
95
95
|
let v = L((e) => e.map((e) => {
|
|
96
96
|
let n = e.type.startsWith("image/"), i = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = i ? URL.createObjectURL(e) : void 0;
|
|
97
97
|
return {
|
|
98
|
-
id:
|
|
98
|
+
id: xe(),
|
|
99
99
|
name: e.name,
|
|
100
100
|
contentType: e.type,
|
|
101
101
|
file: e,
|
|
@@ -166,7 +166,7 @@ var Se = (e, t) => {
|
|
|
166
166
|
status: r.Error,
|
|
167
167
|
errorReason: n
|
|
168
168
|
} : e));
|
|
169
|
-
}),
|
|
169
|
+
}), Ee(e, be, C);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}, [
|
|
@@ -245,7 +245,7 @@ var Se = (e, t) => {
|
|
|
245
245
|
]),
|
|
246
246
|
hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
|
|
247
247
|
};
|
|
248
|
-
},
|
|
248
|
+
}, Oe = (e, t) => {
|
|
249
249
|
let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
|
|
250
250
|
return R(() => {
|
|
251
251
|
if (e) {
|
|
@@ -263,12 +263,12 @@ var Se = (e, t) => {
|
|
|
263
263
|
isExiting: i,
|
|
264
264
|
instanceKey: o
|
|
265
265
|
};
|
|
266
|
-
},
|
|
266
|
+
}, ke = (e, t) => !e.slice(0, t).includes("\n"), Ae = (e, t) => !e.slice(t).includes("\n"), je = (e) => {
|
|
267
267
|
let t = B(e);
|
|
268
268
|
t.current = e;
|
|
269
269
|
let n = B(-1), r = B(""), i = L((e, i, a) => {
|
|
270
270
|
let o = t.current;
|
|
271
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
271
|
+
return !o || o.length === 0 ? null : e === "up" ? !ke(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 || !Ae(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
272
272
|
}, []), a = L(() => {
|
|
273
273
|
n.current = -1, r.current = "";
|
|
274
274
|
}, []), o = L(() => {
|
|
@@ -283,13 +283,13 @@ var Se = (e, t) => {
|
|
|
283
283
|
a,
|
|
284
284
|
o
|
|
285
285
|
]);
|
|
286
|
-
},
|
|
286
|
+
}, Me = ({ messageProp: e, messageRevision: t }) => {
|
|
287
287
|
let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
|
|
288
288
|
return R(() => {
|
|
289
289
|
r(e);
|
|
290
290
|
}, [e, t]), R(() => {
|
|
291
291
|
i.current && (a.current = i.current.offsetHeight);
|
|
292
|
-
}, []),
|
|
292
|
+
}, []), me(() => {
|
|
293
293
|
if (!i.current || a.current === 0) return;
|
|
294
294
|
let e = i.current.offsetHeight > a.current;
|
|
295
295
|
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
@@ -299,13 +299,13 @@ var Se = (e, t) => {
|
|
|
299
299
|
textareaRef: i,
|
|
300
300
|
isMultiLine: o
|
|
301
301
|
};
|
|
302
|
-
},
|
|
302
|
+
}, Ne = /* @__PURE__ */ function(e) {
|
|
303
303
|
return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
|
|
304
|
-
}({}),
|
|
304
|
+
}({}), Pe = [
|
|
305
305
|
"audio/webm;codecs=opus",
|
|
306
306
|
"audio/ogg;codecs=opus",
|
|
307
307
|
"audio/webm"
|
|
308
|
-
],
|
|
308
|
+
], Fe = () => Pe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Ie = ({ onAttachAudio: e }) => {
|
|
309
309
|
let [t, n] = V("idle"), [r, i] = V(null), a = B(null), o = B(null), s = B(null), c = B(null), l = B([]), u = B(""), d = B(e);
|
|
310
310
|
d.current = e;
|
|
311
311
|
let f = L(() => {
|
|
@@ -319,7 +319,7 @@ var Se = (e, t) => {
|
|
|
319
319
|
o.current = t;
|
|
320
320
|
let r = t.createAnalyser();
|
|
321
321
|
r.fftSize = 256, s.current = r, t.createMediaStreamSource(e).connect(r);
|
|
322
|
-
let i =
|
|
322
|
+
let i = Fe();
|
|
323
323
|
u.current = i, l.current = [];
|
|
324
324
|
let d = new MediaRecorder(e, i ? { mimeType: i } : void 0);
|
|
325
325
|
c.current = d, d.ondataavailable = (e) => {
|
|
@@ -349,12 +349,12 @@ var Se = (e, t) => {
|
|
|
349
349
|
stopRecording: m,
|
|
350
350
|
discardRecording: h
|
|
351
351
|
};
|
|
352
|
-
},
|
|
352
|
+
}, Le = /* @__PURE__ */ function(e) {
|
|
353
353
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
354
|
-
}({}),
|
|
354
|
+
}({}), Re = {
|
|
355
355
|
item: "_item_5iycw_1",
|
|
356
356
|
itemIcon: "_itemIcon_5iycw_11"
|
|
357
|
-
},
|
|
357
|
+
}, ze = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
|
|
358
358
|
let m = (e) => {
|
|
359
359
|
e(), r();
|
|
360
360
|
}, h = a({
|
|
@@ -363,7 +363,7 @@ var Se = (e, t) => {
|
|
|
363
363
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
364
364
|
"--ci-sheet-icon": p?.itemIcon
|
|
365
365
|
});
|
|
366
|
-
return /* @__PURE__ */ U(
|
|
366
|
+
return /* @__PURE__ */ U(G, {
|
|
367
367
|
isOpen: e,
|
|
368
368
|
title: t,
|
|
369
369
|
closeLabel: n,
|
|
@@ -378,9 +378,9 @@ var Se = (e, t) => {
|
|
|
378
378
|
style: h,
|
|
379
379
|
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(l, {
|
|
380
380
|
type: "button",
|
|
381
|
-
className: o(
|
|
381
|
+
className: o(Re.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
382
382
|
iconBefore: /* @__PURE__ */ U("span", {
|
|
383
|
-
className:
|
|
383
|
+
className: Re.itemIcon,
|
|
384
384
|
children: n
|
|
385
385
|
}),
|
|
386
386
|
iconAfter: r ? /* @__PURE__ */ U("span", {
|
|
@@ -396,7 +396,7 @@ var Se = (e, t) => {
|
|
|
396
396
|
}) }, e))
|
|
397
397
|
})
|
|
398
398
|
});
|
|
399
|
-
},
|
|
399
|
+
}, Be = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
400
400
|
let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
|
|
401
401
|
R(() => {
|
|
402
402
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
@@ -429,12 +429,12 @@ var Se = (e, t) => {
|
|
|
429
429
|
a
|
|
430
430
|
])
|
|
431
431
|
};
|
|
432
|
-
},
|
|
432
|
+
}, Ve = { label: "_label_14i7c_1" }, He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
|
|
433
433
|
"Precise",
|
|
434
434
|
"Neutral",
|
|
435
435
|
"Creative"
|
|
436
436
|
], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: C }) => {
|
|
437
|
-
let w = a({ "--csf-label-text": C?.labelText }), T = o(x,
|
|
437
|
+
let w = a({ "--csf-label-text": C?.labelText }), T = o(x, Ve.label, "gap-1");
|
|
438
438
|
return /* @__PURE__ */ W("div", {
|
|
439
439
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
440
440
|
style: w,
|
|
@@ -479,8 +479,8 @@ var Se = (e, t) => {
|
|
|
479
479
|
})
|
|
480
480
|
]
|
|
481
481
|
});
|
|
482
|
-
},
|
|
483
|
-
let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature:
|
|
482
|
+
}, Ue = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
|
|
483
|
+
let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: ee, handleSubmit: M } = Be({
|
|
484
484
|
isOpen: e,
|
|
485
485
|
features: s,
|
|
486
486
|
initialResponseFormat: c,
|
|
@@ -489,7 +489,7 @@ var Se = (e, t) => {
|
|
|
489
489
|
onSave: d,
|
|
490
490
|
onClose: r
|
|
491
491
|
});
|
|
492
|
-
return /* @__PURE__ */ W(
|
|
492
|
+
return /* @__PURE__ */ W(G, {
|
|
493
493
|
isOpen: e,
|
|
494
494
|
title: f,
|
|
495
495
|
closeLabel: i,
|
|
@@ -497,14 +497,14 @@ var Se = (e, t) => {
|
|
|
497
497
|
onBack: t,
|
|
498
498
|
backLabel: n,
|
|
499
499
|
style: a,
|
|
500
|
-
children: [/* @__PURE__ */ U(
|
|
500
|
+
children: [/* @__PURE__ */ U(He, {
|
|
501
501
|
features: s,
|
|
502
502
|
responseFormat: T,
|
|
503
503
|
systemPrompt: D,
|
|
504
504
|
temperature: O,
|
|
505
505
|
onResponseFormatChange: A,
|
|
506
506
|
onSystemPromptChange: j,
|
|
507
|
-
onTemperatureChange:
|
|
507
|
+
onTemperatureChange: ee,
|
|
508
508
|
responseFormatLabel: p,
|
|
509
509
|
responseFormatHint: m,
|
|
510
510
|
responseFormatMarkdownLabel: h,
|
|
@@ -522,15 +522,15 @@ var Se = (e, t) => {
|
|
|
522
522
|
triggerClassName: "w-full",
|
|
523
523
|
children: /* @__PURE__ */ U(E, {
|
|
524
524
|
label: C,
|
|
525
|
-
onClick:
|
|
525
|
+
onClick: M,
|
|
526
526
|
disabled: !k,
|
|
527
527
|
className: "w-full"
|
|
528
528
|
})
|
|
529
529
|
})
|
|
530
530
|
})]
|
|
531
531
|
});
|
|
532
|
-
},
|
|
533
|
-
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } =
|
|
532
|
+
}, We = { modal: "_modal_od073_1" }, Ge = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = We.modal }) => {
|
|
533
|
+
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Be({
|
|
534
534
|
features: e,
|
|
535
535
|
initialResponseFormat: t,
|
|
536
536
|
initialSystemPrompt: n,
|
|
@@ -556,7 +556,7 @@ var Se = (e, t) => {
|
|
|
556
556
|
})
|
|
557
557
|
})
|
|
558
558
|
}),
|
|
559
|
-
children: /* @__PURE__ */ U(
|
|
559
|
+
children: /* @__PURE__ */ U(He, {
|
|
560
560
|
features: e,
|
|
561
561
|
responseFormat: b,
|
|
562
562
|
systemPrompt: x,
|
|
@@ -576,11 +576,11 @@ var Se = (e, t) => {
|
|
|
576
576
|
})
|
|
577
577
|
});
|
|
578
578
|
};
|
|
579
|
-
|
|
580
|
-
var
|
|
579
|
+
fe(Ge);
|
|
580
|
+
var Ke = {
|
|
581
581
|
icon: "_icon_1fv6z_1",
|
|
582
582
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
583
|
-
},
|
|
583
|
+
}, qe = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ U(G, {
|
|
584
584
|
isOpen: e,
|
|
585
585
|
title: u,
|
|
586
586
|
closeLabel: i,
|
|
@@ -603,12 +603,12 @@ var We = {
|
|
|
603
603
|
"aria-checked": e.isSelected,
|
|
604
604
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
605
605
|
iconBefore: /* @__PURE__ */ U("span", {
|
|
606
|
-
className: o("flex items-center",
|
|
606
|
+
className: o("flex items-center", Ke.icon),
|
|
607
607
|
children: e.icon
|
|
608
608
|
}),
|
|
609
609
|
iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
|
|
610
|
-
className: o("ms-auto",
|
|
611
|
-
children: /* @__PURE__ */ U(
|
|
610
|
+
className: o("ms-auto", Ke.selectedIcon),
|
|
611
|
+
children: /* @__PURE__ */ U(te, {
|
|
612
612
|
size: c,
|
|
613
613
|
"aria-hidden": !0
|
|
614
614
|
})
|
|
@@ -621,102 +621,142 @@ var We = {
|
|
|
621
621
|
})
|
|
622
622
|
}, e.id))
|
|
623
623
|
})
|
|
624
|
-
}),
|
|
624
|
+
}), K = {
|
|
625
625
|
selectedToolIcon: "_selectedToolIcon_r268y_1",
|
|
626
626
|
toolIcon: "_toolIcon_r268y_5",
|
|
627
627
|
chevronIcon: "_chevronIcon_r268y_9"
|
|
628
|
-
},
|
|
629
|
-
let
|
|
630
|
-
"--aab-selected-tool-icon":
|
|
631
|
-
"--aab-tool-icon":
|
|
632
|
-
"--aab-chevron-icon":
|
|
628
|
+
}, Je = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
|
|
629
|
+
let D = s(), [O, k] = V(!1), [A, j] = V(!1), [ee, M] = V(!1), [N, re] = V(!1), [ie, oe] = V(!1), [se, P] = V(!1), F = z(() => a({
|
|
630
|
+
"--aab-selected-tool-icon": E?.selectedToolIcon,
|
|
631
|
+
"--aab-tool-icon": E?.toolIcon,
|
|
632
|
+
"--aab-chevron-icon": E?.chevronIcon
|
|
633
633
|
}), [
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
]),
|
|
634
|
+
E?.selectedToolIcon,
|
|
635
|
+
E?.toolIcon,
|
|
636
|
+
E?.chevronIcon
|
|
637
|
+
]), I = g.length > 0 && y != null, fe = z(() => g.map((e) => ({
|
|
638
638
|
key: e.id,
|
|
639
639
|
label: /* @__PURE__ */ W("span", {
|
|
640
640
|
className: "flex flex-1 items-center gap-2",
|
|
641
641
|
children: [/* @__PURE__ */ U("span", {
|
|
642
642
|
className: "flex-1",
|
|
643
643
|
children: e.label
|
|
644
|
-
}), e.isSelected && /* @__PURE__ */ U(
|
|
644
|
+
}), e.isSelected && /* @__PURE__ */ U(te, {
|
|
645
645
|
size: c,
|
|
646
|
-
style:
|
|
647
|
-
className:
|
|
646
|
+
style: F,
|
|
647
|
+
className: K.selectedToolIcon,
|
|
648
648
|
"aria-hidden": !0
|
|
649
649
|
})]
|
|
650
650
|
}),
|
|
651
651
|
icon: /* @__PURE__ */ U("span", {
|
|
652
|
-
style:
|
|
653
|
-
className: o("flex items-center",
|
|
652
|
+
style: F,
|
|
653
|
+
className: o("flex items-center", K.toolIcon),
|
|
654
654
|
children: e.icon
|
|
655
655
|
}),
|
|
656
656
|
onClick: () => y?.(e.id)
|
|
657
657
|
})), [
|
|
658
658
|
g,
|
|
659
659
|
y,
|
|
660
|
-
|
|
661
|
-
]),
|
|
660
|
+
F
|
|
661
|
+
]), L = z(() => [
|
|
662
662
|
...e == null ? [] : [{
|
|
663
663
|
key: "attach",
|
|
664
664
|
label: t,
|
|
665
|
-
icon: /* @__PURE__ */ U(
|
|
665
|
+
icon: /* @__PURE__ */ U(ae, {
|
|
666
666
|
size: c,
|
|
667
667
|
"aria-hidden": !0
|
|
668
668
|
}),
|
|
669
669
|
onClick: e
|
|
670
670
|
}],
|
|
671
671
|
...h ?? [],
|
|
672
|
-
...
|
|
672
|
+
...I ? [{
|
|
673
673
|
key: "tools",
|
|
674
674
|
label: x,
|
|
675
|
-
icon: /* @__PURE__ */ U(
|
|
675
|
+
icon: /* @__PURE__ */ U(de, {
|
|
676
676
|
size: c,
|
|
677
677
|
"aria-hidden": !0
|
|
678
678
|
}),
|
|
679
|
-
onClick:
|
|
680
|
-
|
|
679
|
+
onClick: D ? () => {
|
|
680
|
+
M(!0), k(!1);
|
|
681
681
|
} : () => void 0,
|
|
682
|
-
...
|
|
682
|
+
...D ? { iconAfter: /* @__PURE__ */ U(ne, {
|
|
683
683
|
size: c,
|
|
684
684
|
stroke: 1.5,
|
|
685
|
-
style:
|
|
686
|
-
className: o("rtl:scale-x-[-1]",
|
|
685
|
+
style: F,
|
|
686
|
+
className: o("rtl:scale-x-[-1]", K.chevronIcon),
|
|
687
687
|
"aria-hidden": !0
|
|
688
|
-
}) } : { children:
|
|
688
|
+
}) } : { children: fe }
|
|
689
689
|
}] : [],
|
|
690
|
+
...C == null ? [] : [{
|
|
691
|
+
key: "prompts",
|
|
692
|
+
label: w,
|
|
693
|
+
icon: /* @__PURE__ */ U(le, {
|
|
694
|
+
size: c,
|
|
695
|
+
"aria-hidden": !0
|
|
696
|
+
}),
|
|
697
|
+
onClick: D ? () => {
|
|
698
|
+
re(!0), k(!1);
|
|
699
|
+
} : () => {
|
|
700
|
+
oe(!1), P(!0);
|
|
701
|
+
},
|
|
702
|
+
iconAfter: D ? /* @__PURE__ */ U(ne, {
|
|
703
|
+
size: c,
|
|
704
|
+
stroke: 1.5,
|
|
705
|
+
style: F,
|
|
706
|
+
className: o("rtl:scale-x-[-1]", K.chevronIcon),
|
|
707
|
+
"aria-hidden": !0
|
|
708
|
+
}) : null
|
|
709
|
+
}],
|
|
690
710
|
...m == null ? [] : [{
|
|
691
711
|
key: "chat-settings",
|
|
692
712
|
label: m.menuItemLabel ?? "Chat settings",
|
|
693
|
-
icon: /* @__PURE__ */ U(
|
|
713
|
+
icon: /* @__PURE__ */ U(ue, {
|
|
694
714
|
size: c,
|
|
695
715
|
"aria-hidden": !0
|
|
696
716
|
}),
|
|
697
|
-
iconAfter:
|
|
717
|
+
iconAfter: D ? /* @__PURE__ */ U(ne, {
|
|
698
718
|
size: c,
|
|
699
719
|
stroke: 1.5,
|
|
700
|
-
style:
|
|
701
|
-
className: o("rtl:scale-x-[-1]",
|
|
720
|
+
style: F,
|
|
721
|
+
className: o("rtl:scale-x-[-1]", K.chevronIcon),
|
|
702
722
|
"aria-hidden": !0
|
|
703
723
|
}) : null,
|
|
704
|
-
onClick: () =>
|
|
724
|
+
onClick: () => j(!0)
|
|
705
725
|
}]
|
|
706
726
|
], [
|
|
707
727
|
t,
|
|
708
728
|
e,
|
|
709
729
|
m,
|
|
710
730
|
h,
|
|
711
|
-
|
|
712
|
-
|
|
731
|
+
D,
|
|
732
|
+
I,
|
|
713
733
|
x,
|
|
714
|
-
|
|
715
|
-
|
|
734
|
+
fe,
|
|
735
|
+
C,
|
|
736
|
+
w,
|
|
737
|
+
F
|
|
716
738
|
]);
|
|
717
|
-
|
|
739
|
+
if (L.length === 0) return null;
|
|
740
|
+
let R = /* @__PURE__ */ U(_, {
|
|
741
|
+
matchReferenceWidth: !1,
|
|
742
|
+
placement: "bottom-start",
|
|
743
|
+
listClassName: f,
|
|
744
|
+
items: L,
|
|
745
|
+
open: C == null ? void 0 : ie,
|
|
746
|
+
onOpenChange: C == null ? void 0 : oe,
|
|
747
|
+
children: /* @__PURE__ */ U(b, {
|
|
748
|
+
icon: /* @__PURE__ */ U(ce, {
|
|
749
|
+
size: d.LG,
|
|
750
|
+
"aria-hidden": !0
|
|
751
|
+
}),
|
|
752
|
+
"aria-label": n,
|
|
753
|
+
tooltipProps: { tooltip: n },
|
|
754
|
+
disabled: p
|
|
755
|
+
})
|
|
756
|
+
});
|
|
757
|
+
return /* @__PURE__ */ U(H, { children: D ? /* @__PURE__ */ W(H, { children: [
|
|
718
758
|
/* @__PURE__ */ U(b, {
|
|
719
|
-
icon: /* @__PURE__ */ U(
|
|
759
|
+
icon: /* @__PURE__ */ U(ce, {
|
|
720
760
|
size: d.LG,
|
|
721
761
|
"aria-hidden": !0
|
|
722
762
|
}),
|
|
@@ -724,38 +764,50 @@ var We = {
|
|
|
724
764
|
size: v.Large,
|
|
725
765
|
tooltipProps: { tooltip: n },
|
|
726
766
|
disabled: p,
|
|
727
|
-
onClick: () =>
|
|
767
|
+
onClick: () => k(!0)
|
|
728
768
|
}),
|
|
729
|
-
/* @__PURE__ */ U(
|
|
730
|
-
isOpen:
|
|
769
|
+
/* @__PURE__ */ U(ze, {
|
|
770
|
+
isOpen: O,
|
|
731
771
|
title: r,
|
|
732
772
|
closeLabel: l,
|
|
733
|
-
onClose: () =>
|
|
773
|
+
onClose: () => k(!1),
|
|
734
774
|
style: u,
|
|
735
|
-
items:
|
|
775
|
+
items: L,
|
|
736
776
|
className: "pb-4",
|
|
737
777
|
btnTextClassName: "flex-1"
|
|
738
778
|
}),
|
|
739
|
-
|
|
740
|
-
isOpen:
|
|
779
|
+
I && /* @__PURE__ */ U(qe, {
|
|
780
|
+
isOpen: ee,
|
|
741
781
|
onBack: () => {
|
|
742
|
-
|
|
782
|
+
M(!1), k(!0);
|
|
743
783
|
},
|
|
744
784
|
backLabel: S,
|
|
745
|
-
onClose: () =>
|
|
785
|
+
onClose: () => M(!1),
|
|
746
786
|
closeLabel: l,
|
|
747
787
|
style: u,
|
|
748
788
|
title: x,
|
|
749
789
|
items: g,
|
|
750
790
|
onToolToggle: y
|
|
751
791
|
}),
|
|
752
|
-
|
|
753
|
-
isOpen:
|
|
792
|
+
C != null && /* @__PURE__ */ U(G, {
|
|
793
|
+
isOpen: N,
|
|
794
|
+
title: w,
|
|
795
|
+
closeLabel: l,
|
|
796
|
+
onBack: () => {
|
|
797
|
+
re(!1), k(!0);
|
|
798
|
+
},
|
|
799
|
+
backLabel: T,
|
|
800
|
+
onClose: () => re(!1),
|
|
801
|
+
style: u,
|
|
802
|
+
children: C(() => re(!1))
|
|
803
|
+
}),
|
|
804
|
+
m != null && /* @__PURE__ */ U(Ue, {
|
|
805
|
+
isOpen: A,
|
|
754
806
|
onBack: () => {
|
|
755
|
-
|
|
807
|
+
j(!1), k(!0);
|
|
756
808
|
},
|
|
757
809
|
backLabel: m.backLabel ?? "Back",
|
|
758
|
-
onClose: () =>
|
|
810
|
+
onClose: () => j(!1),
|
|
759
811
|
closeLabel: l,
|
|
760
812
|
style: u,
|
|
761
813
|
features: m.features,
|
|
@@ -776,27 +828,23 @@ var We = {
|
|
|
776
828
|
saveLabel: m.saveLabel,
|
|
777
829
|
saveDisabledTooltip: m.saveDisabledTooltip
|
|
778
830
|
})
|
|
779
|
-
] }) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(_, {
|
|
831
|
+
] }) : /* @__PURE__ */ W(H, { children: [C == null ? R : /* @__PURE__ */ U(_, {
|
|
780
832
|
matchReferenceWidth: !1,
|
|
781
833
|
placement: "bottom-start",
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
tooltipProps: { tooltip: n },
|
|
791
|
-
disabled: p
|
|
792
|
-
})
|
|
793
|
-
}), m != null && D && /* @__PURE__ */ U(Ue, {
|
|
834
|
+
trigger: [],
|
|
835
|
+
open: se,
|
|
836
|
+
onOpenChange: P,
|
|
837
|
+
renderOverlay: () => C(() => P(!1), () => {
|
|
838
|
+
P(!1), oe(!0);
|
|
839
|
+
}),
|
|
840
|
+
children: R
|
|
841
|
+
}), m != null && A && /* @__PURE__ */ U(Ge, {
|
|
794
842
|
features: m.features,
|
|
795
843
|
initialResponseFormat: m.responseFormat ?? i.Markdown,
|
|
796
844
|
initialSystemPrompt: m.systemPrompt,
|
|
797
845
|
initialTemperature: m.temperature,
|
|
798
846
|
onSave: m.onSave,
|
|
799
|
-
onClose: () =>
|
|
847
|
+
onClose: () => j(!1),
|
|
800
848
|
title: m.title,
|
|
801
849
|
responseFormatLabel: m.responseFormatLabel,
|
|
802
850
|
responseFormatHint: m.responseFormatHint,
|
|
@@ -815,7 +863,7 @@ var We = {
|
|
|
815
863
|
chipIcon: "_chipIcon_1gu87_6",
|
|
816
864
|
chipText: "_chipText_1gu87_10",
|
|
817
865
|
chipClose: "_chipClose_1gu87_14"
|
|
818
|
-
},
|
|
866
|
+
}, Ye = (e) => `${e} tool${e === 1 ? "" : "s"}`, J = (e) => `Remove ${e}`, Xe = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = Ye, removeLabel: i = J, typography: s, colors: l }) => {
|
|
819
867
|
let u = e.filter((e) => e.isSelected);
|
|
820
868
|
if (u.length === 0) return null;
|
|
821
869
|
let d = a({
|
|
@@ -827,7 +875,7 @@ var We = {
|
|
|
827
875
|
"--ci-chip-close-hover": l?.chipCloseHover
|
|
828
876
|
});
|
|
829
877
|
if (n) {
|
|
830
|
-
let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(
|
|
878
|
+
let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(de, {
|
|
831
879
|
size: c,
|
|
832
880
|
"aria-hidden": !0
|
|
833
881
|
}), n = e ? u[0].label : r(u.length);
|
|
@@ -867,7 +915,7 @@ var We = {
|
|
|
867
915
|
onClick: () => t(e.id),
|
|
868
916
|
className: o(q.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
869
917
|
"aria-label": i(e.label),
|
|
870
|
-
children: /* @__PURE__ */ U(
|
|
918
|
+
children: /* @__PURE__ */ U(P, {
|
|
871
919
|
size: 12,
|
|
872
920
|
"aria-hidden": !0
|
|
873
921
|
})
|
|
@@ -882,23 +930,23 @@ var We = {
|
|
|
882
930
|
modelSelectorButton: "_modelSelectorButton_teqwe_24",
|
|
883
931
|
modelSelectorCaret: "_modelSelectorCaret_teqwe_24",
|
|
884
932
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_teqwe_33"
|
|
885
|
-
},
|
|
933
|
+
}, X = {
|
|
886
934
|
wrapperError: "_wrapperError_129ri_1",
|
|
887
935
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
888
936
|
recordingDot: "_recordingDot_129ri_19",
|
|
889
937
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
890
|
-
},
|
|
891
|
-
let u = B(null), f = B(new Float32Array(Z)), p = B(0), m = B(0), h = e ===
|
|
938
|
+
}, Ze = 3, Qe = 4, Z = 200, $e = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
|
|
939
|
+
let u = B(null), f = B(new Float32Array(Z)), p = B(0), m = B(0), h = e === Ne.Recording, g = e === Ne.Error, _ = L((e) => {
|
|
892
940
|
let t = e.getContext("2d");
|
|
893
941
|
if (!t) return;
|
|
894
942
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
895
943
|
let { width: n, height: r } = e;
|
|
896
944
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
897
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
945
|
+
let i = Math.min(Math.max(1, Math.floor(n / Qe)), Z - 1), a = p.current, o = m.current;
|
|
898
946
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
899
947
|
for (let e = 0; e <= i; e++) {
|
|
900
948
|
let n = ((a - i + e) % Z + Z) % Z, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
901
|
-
t.fillRect(e *
|
|
949
|
+
t.fillRect(e * Qe, (r - c) / 2, Ze, c);
|
|
902
950
|
}
|
|
903
951
|
t.restore();
|
|
904
952
|
}, []);
|
|
@@ -908,8 +956,8 @@ var We = {
|
|
|
908
956
|
if (!e) return;
|
|
909
957
|
f.current.fill(0), p.current = 0, m.current = 0;
|
|
910
958
|
let n, r = () => {
|
|
911
|
-
if (m.current += 1, m.current >=
|
|
912
|
-
m.current -=
|
|
959
|
+
if (m.current += 1, m.current >= Qe) {
|
|
960
|
+
m.current -= Qe;
|
|
913
961
|
let e = t.current;
|
|
914
962
|
if (e) {
|
|
915
963
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -942,14 +990,14 @@ var We = {
|
|
|
942
990
|
let v = /* @__PURE__ */ W("div", {
|
|
943
991
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
944
992
|
children: [/* @__PURE__ */ U(b, {
|
|
945
|
-
icon: /* @__PURE__ */ U(
|
|
993
|
+
icon: /* @__PURE__ */ U(P, {
|
|
946
994
|
size: d.LG,
|
|
947
995
|
"aria-hidden": !0
|
|
948
996
|
}),
|
|
949
997
|
"aria-label": s,
|
|
950
998
|
onClick: i
|
|
951
999
|
}), h && /* @__PURE__ */ U(D, {
|
|
952
|
-
icon: /* @__PURE__ */ U(
|
|
1000
|
+
icon: /* @__PURE__ */ U(oe, {
|
|
953
1001
|
size: d.LG,
|
|
954
1002
|
"aria-hidden": !0
|
|
955
1003
|
}),
|
|
@@ -961,16 +1009,16 @@ var We = {
|
|
|
961
1009
|
className: l,
|
|
962
1010
|
children: [/* @__PURE__ */ W("div", {
|
|
963
1011
|
style: c,
|
|
964
|
-
className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", g &&
|
|
1012
|
+
className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", g && X.wrapperError),
|
|
965
1013
|
children: [/* @__PURE__ */ W("div", {
|
|
966
1014
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
967
1015
|
children: [h && /* @__PURE__ */ U("span", {
|
|
968
|
-
className: o(
|
|
1016
|
+
className: o(X.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
969
1017
|
"aria-hidden": !0
|
|
970
1018
|
}), /* @__PURE__ */ U("canvas", {
|
|
971
1019
|
ref: u,
|
|
972
1020
|
height: 32,
|
|
973
|
-
className: o(
|
|
1021
|
+
className: o(X.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
974
1022
|
})]
|
|
975
1023
|
}), v]
|
|
976
1024
|
}), g && n && /* @__PURE__ */ U(y, {
|
|
@@ -978,25 +1026,25 @@ var We = {
|
|
|
978
1026
|
className: "mt-1 px-1"
|
|
979
1027
|
})]
|
|
980
1028
|
});
|
|
981
|
-
},
|
|
1029
|
+
}, et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(D, {
|
|
982
1030
|
"aria-label": n,
|
|
983
1031
|
onClick: () => e?.(),
|
|
984
1032
|
disabled: t,
|
|
985
1033
|
"aria-hidden": r,
|
|
986
|
-
icon: /* @__PURE__ */ U(
|
|
1034
|
+
icon: /* @__PURE__ */ U(M, {
|
|
987
1035
|
size: d.LG,
|
|
988
1036
|
className: "rtl:scale-x-[-1]"
|
|
989
1037
|
})
|
|
990
|
-
}),
|
|
991
|
-
icon: /* @__PURE__ */ U(
|
|
1038
|
+
}), tt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
|
|
1039
|
+
icon: /* @__PURE__ */ U(se, { size: d.LG }),
|
|
992
1040
|
onClick: () => e?.(),
|
|
993
1041
|
"aria-label": t
|
|
994
|
-
}),
|
|
1042
|
+
}), nt = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
|
|
995
1043
|
variant: A.Circular,
|
|
996
1044
|
width: e,
|
|
997
1045
|
height: e,
|
|
998
1046
|
active: !0
|
|
999
|
-
}),
|
|
1047
|
+
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
|
|
1000
1048
|
className: "flex min-w-0 flex-1 items-center",
|
|
1001
1049
|
children: [/* @__PURE__ */ U(k, {
|
|
1002
1050
|
variant: A.Text,
|
|
@@ -1007,28 +1055,28 @@ var We = {
|
|
|
1007
1055
|
className: "sr-only",
|
|
1008
1056
|
children: e
|
|
1009
1057
|
})]
|
|
1010
|
-
}),
|
|
1058
|
+
}), it = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
|
|
1011
1059
|
role: "status",
|
|
1012
1060
|
"aria-label": e,
|
|
1013
1061
|
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
|
|
1014
1062
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1015
1063
|
"aria-hidden": "true",
|
|
1016
|
-
children: [/* @__PURE__ */ U(
|
|
1064
|
+
children: [/* @__PURE__ */ U(nt, {}), /* @__PURE__ */ U(rt, {})]
|
|
1017
1065
|
}, t))
|
|
1018
|
-
}),
|
|
1066
|
+
}), at = (e) => e.displayName ?? e.id, ot = (e, t) => {
|
|
1019
1067
|
let n = t.trim().toLowerCase();
|
|
1020
|
-
return n ? e.filter((e) =>
|
|
1021
|
-
},
|
|
1068
|
+
return n ? e.filter((e) => at(e).toLowerCase().includes(n)) : e;
|
|
1069
|
+
}, st = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
|
|
1022
1070
|
src: e,
|
|
1023
1071
|
size: i,
|
|
1024
1072
|
labels: { tooltip: a },
|
|
1025
1073
|
initialsName: r
|
|
1026
|
-
}),
|
|
1074
|
+
}), ct = {
|
|
1027
1075
|
searchHeader: "_searchHeader_ibyso_1",
|
|
1028
1076
|
selectedItem: "_selectedItem_ibyso_5",
|
|
1029
1077
|
selectedItemCheck: "_selectedItemCheck_ibyso_9"
|
|
1030
|
-
},
|
|
1031
|
-
let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = z(() => h ? /* @__PURE__ */ U(
|
|
1078
|
+
}, lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ct.searchHeader, selectedItemClassName: s = ct.selectedItem, selectedItemCheckClassName: c = ct.selectedItemCheck, colors: l }) => {
|
|
1079
|
+
let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = z(() => h ? /* @__PURE__ */ U(nt, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
|
|
1032
1080
|
return {
|
|
1033
1081
|
selectorIcon: g,
|
|
1034
1082
|
selectorAriaLabel: _ ? `${r?.ariaLabel ?? "Select model"}: ${_}` : r?.ariaLabel ?? "Select model",
|
|
@@ -1036,8 +1084,8 @@ var We = {
|
|
|
1036
1084
|
menuItems: z(() => {
|
|
1037
1085
|
if (h) return Array.from({ length: 7 }, (e, t) => ({
|
|
1038
1086
|
key: `__loading-${t}`,
|
|
1039
|
-
icon: /* @__PURE__ */ U(
|
|
1040
|
-
label: /* @__PURE__ */ U(
|
|
1087
|
+
icon: /* @__PURE__ */ U(nt, {}),
|
|
1088
|
+
label: /* @__PURE__ */ U(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1041
1089
|
disabled: !0
|
|
1042
1090
|
}));
|
|
1043
1091
|
if (!e || e.length === 0) {
|
|
@@ -1048,7 +1096,7 @@ var We = {
|
|
|
1048
1096
|
disabled: !0
|
|
1049
1097
|
}] : [];
|
|
1050
1098
|
}
|
|
1051
|
-
return
|
|
1099
|
+
return ot(e, u).map((e) => {
|
|
1052
1100
|
let r = e.id === t;
|
|
1053
1101
|
return {
|
|
1054
1102
|
key: e.id,
|
|
@@ -1056,17 +1104,17 @@ var We = {
|
|
|
1056
1104
|
className: "flex w-full items-center justify-between gap-2",
|
|
1057
1105
|
style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
|
|
1058
1106
|
children: [/* @__PURE__ */ U(x, {
|
|
1059
|
-
text:
|
|
1107
|
+
text: at(e),
|
|
1060
1108
|
query: u,
|
|
1061
1109
|
maxLines: 1
|
|
1062
|
-
}), r && /* @__PURE__ */ U(
|
|
1110
|
+
}), r && /* @__PURE__ */ U(te, {
|
|
1063
1111
|
size: d.SM,
|
|
1064
1112
|
stroke: 2,
|
|
1065
1113
|
className: c,
|
|
1066
1114
|
"aria-hidden": !0
|
|
1067
1115
|
})]
|
|
1068
1116
|
}),
|
|
1069
|
-
icon:
|
|
1117
|
+
icon: st(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1070
1118
|
onClick: () => n?.(e.id),
|
|
1071
1119
|
className: r ? s : void 0
|
|
1072
1120
|
};
|
|
@@ -1104,8 +1152,8 @@ var We = {
|
|
|
1104
1152
|
e || f("");
|
|
1105
1153
|
}
|
|
1106
1154
|
};
|
|
1107
|
-
},
|
|
1108
|
-
function
|
|
1155
|
+
}, ut = typeof window < "u" ? me : R;
|
|
1156
|
+
function dt(e) {
|
|
1109
1157
|
if (e !== void 0) switch (typeof e) {
|
|
1110
1158
|
case "number": return e;
|
|
1111
1159
|
case "string":
|
|
@@ -1113,15 +1161,15 @@ function ut(e) {
|
|
|
1113
1161
|
break;
|
|
1114
1162
|
}
|
|
1115
1163
|
}
|
|
1116
|
-
function
|
|
1164
|
+
function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1117
1165
|
let { styleHeight: s, styleWidth: c } = z(() => ({
|
|
1118
|
-
styleHeight:
|
|
1119
|
-
styleWidth:
|
|
1166
|
+
styleHeight: dt(o?.height),
|
|
1167
|
+
styleWidth: dt(o?.width)
|
|
1120
1168
|
}), [o?.height, o?.width]), [l, u] = V({
|
|
1121
1169
|
height: t,
|
|
1122
1170
|
width: n
|
|
1123
1171
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1124
|
-
return
|
|
1172
|
+
return ut(() => {
|
|
1125
1173
|
if (i === null || d) return;
|
|
1126
1174
|
let t = new ResizeObserver((e) => {
|
|
1127
1175
|
for (let t of e) {
|
|
@@ -1150,26 +1198,26 @@ function dt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1150
1198
|
c
|
|
1151
1199
|
]);
|
|
1152
1200
|
}
|
|
1153
|
-
function
|
|
1201
|
+
function pt(e) {
|
|
1154
1202
|
let t = B(() => {
|
|
1155
1203
|
throw Error("Cannot call during render.");
|
|
1156
1204
|
});
|
|
1157
|
-
return
|
|
1205
|
+
return ut(() => {
|
|
1158
1206
|
t.current = e;
|
|
1159
1207
|
}, [e]), L((e) => t.current?.(e), [t]);
|
|
1160
1208
|
}
|
|
1161
|
-
var
|
|
1162
|
-
function
|
|
1163
|
-
if (
|
|
1209
|
+
var mt = null;
|
|
1210
|
+
function ht(e = !1) {
|
|
1211
|
+
if (mt === null || e) {
|
|
1164
1212
|
let e = document.createElement("div"), t = e.style;
|
|
1165
1213
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1166
1214
|
let n = document.createElement("div"), r = n.style;
|
|
1167
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1215
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? mt = "positive-descending" : (e.scrollLeft = 1, mt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), mt;
|
|
1168
1216
|
}
|
|
1169
|
-
return
|
|
1217
|
+
return mt;
|
|
1170
1218
|
}
|
|
1171
|
-
function
|
|
1172
|
-
if (t === "horizontal" && n) switch (
|
|
1219
|
+
function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1220
|
+
if (t === "horizontal" && n) switch (ht()) {
|
|
1173
1221
|
case "negative": return -r;
|
|
1174
1222
|
case "positive-descending":
|
|
1175
1223
|
if (e) {
|
|
@@ -1183,13 +1231,13 @@ function ht({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1183
1231
|
function Q(e, t = "Assertion error") {
|
|
1184
1232
|
if (!e) throw console.error(t), Error(t);
|
|
1185
1233
|
}
|
|
1186
|
-
function
|
|
1234
|
+
function _t(e, t) {
|
|
1187
1235
|
if (e === t) return !0;
|
|
1188
1236
|
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1189
1237
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1190
1238
|
return !0;
|
|
1191
1239
|
}
|
|
1192
|
-
function
|
|
1240
|
+
function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1193
1241
|
if (t === 0) return 0;
|
|
1194
1242
|
if (typeof n == "number") return t * n;
|
|
1195
1243
|
{
|
|
@@ -1197,9 +1245,9 @@ function _t({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
1197
1245
|
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1198
1246
|
}
|
|
1199
1247
|
}
|
|
1200
|
-
function
|
|
1248
|
+
function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1201
1249
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1202
|
-
let s =
|
|
1250
|
+
let s = vt({
|
|
1203
1251
|
cachedBounds: t,
|
|
1204
1252
|
itemCount: r,
|
|
1205
1253
|
itemSize: i
|
|
@@ -1211,7 +1259,7 @@ function vt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1211
1259
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1212
1260
|
}
|
|
1213
1261
|
}
|
|
1214
|
-
function
|
|
1262
|
+
function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1215
1263
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1216
1264
|
for (; u < a;) {
|
|
1217
1265
|
let n = e.get(u);
|
|
@@ -1230,7 +1278,7 @@ function yt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1230
1278
|
stopIndexOverscan: l
|
|
1231
1279
|
};
|
|
1232
1280
|
}
|
|
1233
|
-
function
|
|
1281
|
+
function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1234
1282
|
let r = /* @__PURE__ */ new Map();
|
|
1235
1283
|
return {
|
|
1236
1284
|
get(i) {
|
|
@@ -1267,8 +1315,8 @@ function bt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1267
1315
|
}
|
|
1268
1316
|
};
|
|
1269
1317
|
}
|
|
1270
|
-
function
|
|
1271
|
-
return z(() =>
|
|
1318
|
+
function St({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1319
|
+
return z(() => xt({
|
|
1272
1320
|
itemCount: e,
|
|
1273
1321
|
itemProps: t,
|
|
1274
1322
|
itemSize: n
|
|
@@ -1278,7 +1326,7 @@ function $({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1278
1326
|
n
|
|
1279
1327
|
]);
|
|
1280
1328
|
}
|
|
1281
|
-
function
|
|
1329
|
+
function Ct({ containerSize: e, itemSize: t }) {
|
|
1282
1330
|
let n;
|
|
1283
1331
|
switch (typeof t) {
|
|
1284
1332
|
case "string":
|
|
@@ -1290,8 +1338,8 @@ function xt({ containerSize: e, itemSize: t }) {
|
|
|
1290
1338
|
}
|
|
1291
1339
|
return n;
|
|
1292
1340
|
}
|
|
1293
|
-
function
|
|
1294
|
-
let { height: u = n, width: d = n } =
|
|
1341
|
+
function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1342
|
+
let { height: u = n, width: d = n } = ft({
|
|
1295
1343
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1296
1344
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1297
1345
|
element: e,
|
|
@@ -1300,11 +1348,11 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1300
1348
|
}), f = B({
|
|
1301
1349
|
height: 0,
|
|
1302
1350
|
width: 0
|
|
1303
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1351
|
+
}), p = r === "vertical" ? u : d, m = Ct({
|
|
1304
1352
|
containerSize: p,
|
|
1305
1353
|
itemSize: s
|
|
1306
1354
|
});
|
|
1307
|
-
|
|
1355
|
+
me(() => {
|
|
1308
1356
|
if (typeof c == "function") {
|
|
1309
1357
|
let e = f.current;
|
|
1310
1358
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1317,11 +1365,11 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1317
1365
|
c,
|
|
1318
1366
|
d
|
|
1319
1367
|
]);
|
|
1320
|
-
let h =
|
|
1368
|
+
let h = St({
|
|
1321
1369
|
itemCount: a,
|
|
1322
1370
|
itemProps: o,
|
|
1323
1371
|
itemSize: m
|
|
1324
|
-
}), g = L((e) => h.get(e), [h]), [_, v] = V(() =>
|
|
1372
|
+
}), g = L((e) => h.get(e), [h]), [_, v] = V(() => bt({
|
|
1325
1373
|
cachedBounds: h,
|
|
1326
1374
|
containerScrollOffset: 0,
|
|
1327
1375
|
containerSize: p,
|
|
@@ -1332,7 +1380,7 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1332
1380
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1333
1381
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1334
1382
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1335
|
-
}, C = L(() =>
|
|
1383
|
+
}, C = L(() => vt({
|
|
1336
1384
|
cachedBounds: h,
|
|
1337
1385
|
itemCount: a,
|
|
1338
1386
|
itemSize: m
|
|
@@ -1340,9 +1388,9 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1340
1388
|
h,
|
|
1341
1389
|
a,
|
|
1342
1390
|
m
|
|
1343
|
-
]), w = L((t) =>
|
|
1391
|
+
]), w = L((t) => bt({
|
|
1344
1392
|
cachedBounds: h,
|
|
1345
|
-
containerScrollOffset:
|
|
1393
|
+
containerScrollOffset: gt({
|
|
1346
1394
|
containerElement: e,
|
|
1347
1395
|
direction: r,
|
|
1348
1396
|
isRtl: i,
|
|
@@ -1360,19 +1408,19 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1360
1408
|
a,
|
|
1361
1409
|
l
|
|
1362
1410
|
]);
|
|
1363
|
-
return
|
|
1411
|
+
return ut(() => {
|
|
1364
1412
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1365
1413
|
}, [
|
|
1366
1414
|
e,
|
|
1367
1415
|
r,
|
|
1368
1416
|
w
|
|
1369
|
-
]),
|
|
1417
|
+
]), ut(() => {
|
|
1370
1418
|
if (!e) return;
|
|
1371
1419
|
let t = () => {
|
|
1372
1420
|
v((t) => {
|
|
1373
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1421
|
+
let { scrollLeft: n, scrollTop: o } = e, s = bt({
|
|
1374
1422
|
cachedBounds: h,
|
|
1375
|
-
containerScrollOffset:
|
|
1423
|
+
containerScrollOffset: gt({
|
|
1376
1424
|
containerElement: e,
|
|
1377
1425
|
direction: r,
|
|
1378
1426
|
isRtl: i,
|
|
@@ -1382,7 +1430,7 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1382
1430
|
itemCount: a,
|
|
1383
1431
|
overscanCount: l
|
|
1384
1432
|
});
|
|
1385
|
-
return
|
|
1433
|
+
return _t(s, t) ? t : s;
|
|
1386
1434
|
});
|
|
1387
1435
|
};
|
|
1388
1436
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1398,8 +1446,8 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1398
1446
|
]), {
|
|
1399
1447
|
getCellBounds: g,
|
|
1400
1448
|
getEstimatedSize: C,
|
|
1401
|
-
scrollToIndex:
|
|
1402
|
-
let s =
|
|
1449
|
+
scrollToIndex: pt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1450
|
+
let s = yt({
|
|
1403
1451
|
align: t,
|
|
1404
1452
|
cachedBounds: h,
|
|
1405
1453
|
containerScrollOffset: n,
|
|
@@ -1409,14 +1457,14 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1409
1457
|
itemSize: m
|
|
1410
1458
|
});
|
|
1411
1459
|
if (e) {
|
|
1412
|
-
if (s =
|
|
1460
|
+
if (s = gt({
|
|
1413
1461
|
containerElement: e,
|
|
1414
1462
|
direction: r,
|
|
1415
1463
|
isRtl: i,
|
|
1416
1464
|
scrollOffset: s
|
|
1417
1465
|
}), typeof e.scrollTo != "function") {
|
|
1418
1466
|
let e = w(s);
|
|
1419
|
-
|
|
1467
|
+
_t(_, e) || v(e);
|
|
1420
1468
|
}
|
|
1421
1469
|
return s;
|
|
1422
1470
|
}
|
|
@@ -1427,19 +1475,19 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1427
1475
|
stopIndexVisible: x
|
|
1428
1476
|
};
|
|
1429
1477
|
}
|
|
1430
|
-
function
|
|
1478
|
+
function wt(e) {
|
|
1431
1479
|
return z(() => e, Object.values(e));
|
|
1432
1480
|
}
|
|
1433
|
-
function
|
|
1481
|
+
function Tt(e, t) {
|
|
1434
1482
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1435
|
-
return
|
|
1483
|
+
return _t(n, a) && _t(r, o) && _t(i, s);
|
|
1436
1484
|
}
|
|
1437
|
-
function
|
|
1485
|
+
function Et(e) {
|
|
1438
1486
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1439
1487
|
}
|
|
1440
|
-
var
|
|
1441
|
-
function
|
|
1442
|
-
let m =
|
|
1488
|
+
var Dt = "data-react-window-index";
|
|
1489
|
+
function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
1490
|
+
let m = wt(u), h = z(() => fe(s, Tt), [s]), [g, _] = V(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = $({
|
|
1443
1491
|
containerElement: g,
|
|
1444
1492
|
containerStyle: f,
|
|
1445
1493
|
defaultContainerSize: n,
|
|
@@ -1450,7 +1498,7 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1450
1498
|
onResize: i,
|
|
1451
1499
|
overscanCount: o
|
|
1452
1500
|
});
|
|
1453
|
-
|
|
1501
|
+
pe(r, () => ({
|
|
1454
1502
|
get element() {
|
|
1455
1503
|
return g;
|
|
1456
1504
|
},
|
|
@@ -1465,12 +1513,12 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1465
1513
|
top: r
|
|
1466
1514
|
});
|
|
1467
1515
|
}
|
|
1468
|
-
}), [g, x]),
|
|
1516
|
+
}), [g, x]), ut(() => {
|
|
1469
1517
|
if (!g) return;
|
|
1470
1518
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1471
1519
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1472
1520
|
let n = `${S + t}`;
|
|
1473
|
-
return e.setAttribute(
|
|
1521
|
+
return e.setAttribute(Dt, n), !0;
|
|
1474
1522
|
});
|
|
1475
1523
|
if (v) return l.observeRowElements(e);
|
|
1476
1524
|
}, [
|
|
@@ -1498,7 +1546,7 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1498
1546
|
let e = [];
|
|
1499
1547
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1500
1548
|
let n = y(t);
|
|
1501
|
-
e.push(/* @__PURE__ */
|
|
1549
|
+
e.push(/* @__PURE__ */ I(h, {
|
|
1502
1550
|
...m,
|
|
1503
1551
|
ariaAttributes: {
|
|
1504
1552
|
"aria-posinset": t + 1,
|
|
@@ -1533,7 +1581,7 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1533
1581
|
zIndex: -1
|
|
1534
1582
|
}
|
|
1535
1583
|
});
|
|
1536
|
-
return
|
|
1584
|
+
return I(d, {
|
|
1537
1585
|
role: "list",
|
|
1538
1586
|
...p,
|
|
1539
1587
|
className: t,
|
|
@@ -1547,22 +1595,22 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1547
1595
|
}
|
|
1548
1596
|
}, E, e, D);
|
|
1549
1597
|
}
|
|
1550
|
-
var
|
|
1598
|
+
var kt = {
|
|
1551
1599
|
divider: "_divider_s5khb_1",
|
|
1552
1600
|
item: "_item_s5khb_5",
|
|
1553
1601
|
itemIcon: "_itemIcon_s5khb_15",
|
|
1554
1602
|
checkIcon: "_checkIcon_s5khb_19",
|
|
1555
1603
|
stateLabel: "_stateLabel_s5khb_23"
|
|
1556
|
-
},
|
|
1557
|
-
let u = r[e], f =
|
|
1604
|
+
}, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1605
|
+
let u = r[e], f = st(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
|
|
1558
1606
|
return /* @__PURE__ */ U("div", {
|
|
1559
1607
|
style: t,
|
|
1560
1608
|
...n,
|
|
1561
1609
|
children: /* @__PURE__ */ U(l, {
|
|
1562
1610
|
type: "button",
|
|
1563
|
-
className: o(
|
|
1611
|
+
className: o(kt.item, "h-full w-full gap-3 px-4"),
|
|
1564
1612
|
iconBefore: /* @__PURE__ */ U("span", {
|
|
1565
|
-
className:
|
|
1613
|
+
className: kt.itemIcon,
|
|
1566
1614
|
children: f
|
|
1567
1615
|
}),
|
|
1568
1616
|
label: /* @__PURE__ */ W("span", {
|
|
@@ -1572,21 +1620,21 @@ var Ot = {
|
|
|
1572
1620
|
query: s,
|
|
1573
1621
|
maxLines: 1,
|
|
1574
1622
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1575
|
-
}), p && /* @__PURE__ */ U(
|
|
1623
|
+
}), p && /* @__PURE__ */ U(te, {
|
|
1576
1624
|
size: d.SM,
|
|
1577
|
-
className:
|
|
1625
|
+
className: kt.checkIcon,
|
|
1578
1626
|
"aria-hidden": !0
|
|
1579
1627
|
})]
|
|
1580
1628
|
}),
|
|
1581
1629
|
onClick: () => c(u.id)
|
|
1582
1630
|
})
|
|
1583
1631
|
});
|
|
1584
|
-
},
|
|
1632
|
+
}, Nt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
|
|
1585
1633
|
let [y, b] = V("");
|
|
1586
1634
|
R(() => {
|
|
1587
1635
|
e || b("");
|
|
1588
1636
|
}, [e]);
|
|
1589
|
-
let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ?
|
|
1637
|
+
let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? ot(s, y) : [], T = (e) => {
|
|
1590
1638
|
l(e), i();
|
|
1591
1639
|
}, E = a({
|
|
1592
1640
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1596,7 +1644,7 @@ var Ot = {
|
|
|
1596
1644
|
"--ci-sheet-icon": _?.itemIcon,
|
|
1597
1645
|
"--ci-check-icon": _?.checkIcon
|
|
1598
1646
|
});
|
|
1599
|
-
return /* @__PURE__ */ U(
|
|
1647
|
+
return /* @__PURE__ */ U(G, {
|
|
1600
1648
|
isOpen: e,
|
|
1601
1649
|
title: t,
|
|
1602
1650
|
closeLabel: n,
|
|
@@ -1616,17 +1664,17 @@ var Ot = {
|
|
|
1616
1664
|
size: v.Standard,
|
|
1617
1665
|
onChange: b
|
|
1618
1666
|
})
|
|
1619
|
-
}), /* @__PURE__ */ U("div", { className: o(
|
|
1667
|
+
}), /* @__PURE__ */ U("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ U(it, { loadingLabel: u }) : C ? /* @__PURE__ */ U("div", {
|
|
1620
1668
|
role: "list",
|
|
1621
|
-
className: o(
|
|
1669
|
+
className: o(kt.stateLabel, g, "px-4 py-4"),
|
|
1622
1670
|
children: C
|
|
1623
|
-
}) : /* @__PURE__ */ U(
|
|
1671
|
+
}) : /* @__PURE__ */ U(Ot, {
|
|
1624
1672
|
role: "list",
|
|
1625
1673
|
className: "overflow-y-auto",
|
|
1626
|
-
style: { height: Math.min(w.length,
|
|
1627
|
-
rowComponent:
|
|
1674
|
+
style: { height: Math.min(w.length, jt) * At },
|
|
1675
|
+
rowComponent: Mt,
|
|
1628
1676
|
rowCount: w.length,
|
|
1629
|
-
rowHeight:
|
|
1677
|
+
rowHeight: At,
|
|
1630
1678
|
rowProps: {
|
|
1631
1679
|
items: w,
|
|
1632
1680
|
selectedDeploymentId: c,
|
|
@@ -1637,15 +1685,15 @@ var Ot = {
|
|
|
1637
1685
|
})]
|
|
1638
1686
|
})
|
|
1639
1687
|
});
|
|
1640
|
-
},
|
|
1641
|
-
let [h, y] = V(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } =
|
|
1688
|
+
}, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: p, onPickerOpenChange: m }) => {
|
|
1689
|
+
let [h, y] = V(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } = lt({
|
|
1642
1690
|
deployments: e,
|
|
1643
1691
|
selectedDeploymentId: t,
|
|
1644
1692
|
onDeploymentChange: n,
|
|
1645
1693
|
modelSelectorLabels: r
|
|
1646
1694
|
});
|
|
1647
1695
|
if (!e) return null;
|
|
1648
|
-
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(
|
|
1696
|
+
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(N, {
|
|
1649
1697
|
size: d.SM,
|
|
1650
1698
|
className: Y.modelSelectorCaret,
|
|
1651
1699
|
"aria-hidden": !0
|
|
@@ -1663,14 +1711,14 @@ var Ot = {
|
|
|
1663
1711
|
},
|
|
1664
1712
|
className: o("w-[50px]", Y.modelSelectorButton, D)
|
|
1665
1713
|
})
|
|
1666
|
-
}), l ? /* @__PURE__ */ U(
|
|
1714
|
+
}), l ? /* @__PURE__ */ U(G, {
|
|
1667
1715
|
isOpen: h,
|
|
1668
1716
|
title: r?.ariaLabel ?? "Select model",
|
|
1669
1717
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1670
1718
|
onClose: () => y(!1),
|
|
1671
1719
|
style: c,
|
|
1672
1720
|
children: l(() => y(!1))
|
|
1673
|
-
}) : /* @__PURE__ */ U(
|
|
1721
|
+
}) : /* @__PURE__ */ U(Nt, {
|
|
1674
1722
|
isOpen: h,
|
|
1675
1723
|
title: r?.ariaLabel ?? "Select model",
|
|
1676
1724
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1726,8 +1774,8 @@ var Ot = {
|
|
|
1726
1774
|
})
|
|
1727
1775
|
})
|
|
1728
1776
|
});
|
|
1729
|
-
},
|
|
1730
|
-
let
|
|
1777
|
+
}, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: k, pendingDropFiles: A = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: N = 4e3, deployments: ne, selectedDeploymentId: ae, onDeploymentChange: oe, modelSelectorLabels: se, initialAttachments: ce = [], isStacked: le = !1, hideAddButton: ue = !1, hideAttachFile: de = !1, hideActionBar: P = !1, renderFooterActions: F, isInputDisabled: I = !1, isModelSelectorDisabled: fe = !1, isSendDisabled: R = !1, isAudioMessageSupported: pe = !1, sendOnEnter: me = Le.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: ge, chatSettings: _e, toolsMenuItems: ye, onToolToggle: be, toolsMenuTitle: xe, toolsBackLabel: Se, toolsChipLabels: we, promptsMenuOverlay: Te, promptsMenuTitle: G, promptsBackLabel: Ee, autoFocus: ke = !1, messageHistory: Ae, onDialFileSystemClick: Ne, dialFileSystemLabel: Pe, validateAttachment: Fe, onAttachmentClick: Re, modelPickerOverlay: ze, maximumAttachmentsAmount: Be, onAttachmentsLimitExceeded: Ve, isAttachmentsEnabled: He = !0, usageLimitsSlot: Ue, onMessageTooLong: We }) => {
|
|
1778
|
+
let Ge = s(), [Ke, qe] = V(!1), K = je(Ae), q = z(() => a({
|
|
1731
1779
|
"--ci-bg": D?.background,
|
|
1732
1780
|
"--ci-text": D?.text,
|
|
1733
1781
|
"--ci-border": D?.border,
|
|
@@ -1740,223 +1788,226 @@ var Ot = {
|
|
|
1740
1788
|
"--ci-voice-error": D?.voiceError,
|
|
1741
1789
|
"--ci-voice-waveform": D?.voiceWaveform,
|
|
1742
1790
|
"--ci-voice-accent": D?.voiceAccent
|
|
1743
|
-
}), [D]),
|
|
1791
|
+
}), [D]), Ye = z(() => Ne ? [{
|
|
1744
1792
|
key: "dial-fs",
|
|
1745
|
-
label:
|
|
1746
|
-
icon: /* @__PURE__ */ U(
|
|
1793
|
+
label: Pe ?? "DIAL file system",
|
|
1794
|
+
icon: /* @__PURE__ */ U(re, {
|
|
1747
1795
|
size: c,
|
|
1748
1796
|
"aria-hidden": !0
|
|
1749
1797
|
}),
|
|
1750
|
-
onClick:
|
|
1751
|
-
}] : [], [
|
|
1798
|
+
onClick: Ne
|
|
1799
|
+
}] : [], [Ne, Pe]), { message: J, setMessage: X, textareaRef: Ze, isMultiLine: Qe } = Me({
|
|
1752
1800
|
messageProp: e,
|
|
1753
1801
|
messageRevision: t
|
|
1754
|
-
}), { attachments:
|
|
1755
|
-
initialAttachments:
|
|
1802
|
+
}), { attachments: Z, buildAttachments: nt, addAttachments: rt, resetAttachments: it, handleRemove: at, handleRetry: ot, handleExpand: st, hasBlockedAttachments: ct } = De({
|
|
1803
|
+
initialAttachments: ce,
|
|
1756
1804
|
onUploadAttachment: r,
|
|
1757
1805
|
onAttachmentsChange: f,
|
|
1758
|
-
validateAttachment:
|
|
1806
|
+
validateAttachment: Fe,
|
|
1759
1807
|
pendingDropFiles: A,
|
|
1760
|
-
onDropFilesConsumed:
|
|
1761
|
-
pendingAttachments:
|
|
1762
|
-
onPendingAttachmentsConsumed:
|
|
1808
|
+
onDropFilesConsumed: ee,
|
|
1809
|
+
pendingAttachments: M,
|
|
1810
|
+
onPendingAttachmentsConsumed: te,
|
|
1763
1811
|
onExpandPastedText: L((e) => {
|
|
1764
|
-
|
|
1765
|
-
}, [
|
|
1766
|
-
maximumAttachmentsAmount:
|
|
1767
|
-
baseAttachmentsAmount:
|
|
1768
|
-
onAttachmentsLimitExceeded:
|
|
1769
|
-
}), { state:
|
|
1770
|
-
|
|
1771
|
-
}, [
|
|
1772
|
-
if (!
|
|
1812
|
+
X((t) => t ? `${t}\n${e}` : e);
|
|
1813
|
+
}, [X]),
|
|
1814
|
+
maximumAttachmentsAmount: Be,
|
|
1815
|
+
baseAttachmentsAmount: he.length,
|
|
1816
|
+
onAttachmentsLimitExceeded: Ve
|
|
1817
|
+
}), { state: lt, analyserNodeRef: ut, errorMessage: dt, startRecording: ft, stopRecording: pt, discardRecording: mt } = Ie({ onAttachAudio: L((e) => {
|
|
1818
|
+
rt(nt([e]));
|
|
1819
|
+
}, [rt, nt]) }), ht = B(null), gt = B(null), { handlePaste: Q } = Ce(rt, He ? N : Infinity), _t = L((e) => {
|
|
1820
|
+
if (!He) {
|
|
1773
1821
|
let t = e.clipboardData.getData("text/plain");
|
|
1774
|
-
t.length >=
|
|
1822
|
+
t.length >= N && We?.(t.length, N);
|
|
1775
1823
|
}
|
|
1776
|
-
|
|
1824
|
+
Q(e);
|
|
1777
1825
|
}, [
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
]),
|
|
1826
|
+
He,
|
|
1827
|
+
N,
|
|
1828
|
+
We,
|
|
1829
|
+
Q
|
|
1830
|
+
]), vt = J.trim().length > 0 || Z.length > 0, yt = vt && !ct && !R, { shouldRender: bt, isExiting: xt, instanceKey: St } = Oe(!l && vt, Ft), Ct = (ye?.some((e) => e.isSelected) ?? !1) && be != null, $ = le || J.includes("\n") || Qe || Ct, wt = ne === void 0 || ae != null, Tt = z(() => pe && !xt && !l, [
|
|
1783
1831
|
pe,
|
|
1784
|
-
|
|
1832
|
+
xt,
|
|
1785
1833
|
l
|
|
1786
|
-
]),
|
|
1787
|
-
if (
|
|
1788
|
-
if (!
|
|
1789
|
-
|
|
1834
|
+
]), Et = async () => {
|
|
1835
|
+
if (R) return;
|
|
1836
|
+
if (!He && J.length >= N) {
|
|
1837
|
+
We?.(J.length, N);
|
|
1790
1838
|
return;
|
|
1791
1839
|
}
|
|
1792
|
-
let e =
|
|
1793
|
-
|
|
1840
|
+
let e = J, t = Z;
|
|
1841
|
+
X(""), K.reset();
|
|
1794
1842
|
try {
|
|
1795
1843
|
await n?.(e, t), t.forEach((e) => {
|
|
1796
1844
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1797
|
-
}),
|
|
1845
|
+
}), it([]);
|
|
1798
1846
|
} catch {
|
|
1799
|
-
|
|
1847
|
+
X(e), it(t);
|
|
1800
1848
|
}
|
|
1801
|
-
},
|
|
1849
|
+
}, Dt = (e) => {
|
|
1802
1850
|
if (!e.nativeEvent.isComposing && !I && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1803
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1851
|
+
let t = e.currentTarget.selectionStart ?? 0, n = K.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
|
|
1804
1852
|
if (n !== null) {
|
|
1805
|
-
e.preventDefault(),
|
|
1853
|
+
e.preventDefault(), X(n);
|
|
1806
1854
|
return;
|
|
1807
1855
|
}
|
|
1808
1856
|
}
|
|
1809
|
-
e.key === "Enter" && (me ===
|
|
1810
|
-
},
|
|
1857
|
+
e.key === "Enter" && (me === Le.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && yt && wt && !I && Et());
|
|
1858
|
+
}, Ot = (e) => {
|
|
1811
1859
|
let t = Array.from(e.target.files ?? []);
|
|
1812
1860
|
if (t.length === 0) return;
|
|
1813
|
-
let n =
|
|
1814
|
-
e.target.value = "",
|
|
1861
|
+
let n = nt(t);
|
|
1862
|
+
e.target.value = "", rt(n);
|
|
1815
1863
|
};
|
|
1816
|
-
if (
|
|
1817
|
-
state:
|
|
1818
|
-
analyserNodeRef:
|
|
1819
|
-
errorMessage:
|
|
1820
|
-
onStop:
|
|
1821
|
-
onDiscard:
|
|
1864
|
+
if (lt !== "idle") return /* @__PURE__ */ U($e, {
|
|
1865
|
+
state: lt,
|
|
1866
|
+
analyserNodeRef: ut,
|
|
1867
|
+
errorMessage: dt,
|
|
1868
|
+
onStop: pt,
|
|
1869
|
+
onDiscard: mt,
|
|
1822
1870
|
stopLabel: T,
|
|
1823
1871
|
discardLabel: E,
|
|
1824
|
-
style:
|
|
1872
|
+
style: q,
|
|
1825
1873
|
className: k
|
|
1826
1874
|
});
|
|
1827
|
-
let
|
|
1875
|
+
let kt = /* @__PURE__ */ U("textarea", {
|
|
1828
1876
|
className: o(Y.textarea, O?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1829
|
-
ref:
|
|
1830
|
-
autoFocus:
|
|
1831
|
-
value:
|
|
1877
|
+
ref: Ze,
|
|
1878
|
+
autoFocus: ke,
|
|
1879
|
+
value: J,
|
|
1832
1880
|
onChange: (e) => {
|
|
1833
|
-
|
|
1881
|
+
X(e.target.value), K.notifyChange(), u?.(e.target.value);
|
|
1834
1882
|
},
|
|
1835
|
-
onKeyDown:
|
|
1836
|
-
onPaste:
|
|
1883
|
+
onKeyDown: Dt,
|
|
1884
|
+
onPaste: _t,
|
|
1837
1885
|
placeholder: p,
|
|
1838
1886
|
"aria-label": m,
|
|
1839
1887
|
disabled: I,
|
|
1840
1888
|
rows: 1
|
|
1841
1889
|
});
|
|
1842
1890
|
return /* @__PURE__ */ W("div", {
|
|
1843
|
-
ref:
|
|
1844
|
-
style:
|
|
1845
|
-
className: o(Y.wrapper, I && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1",
|
|
1846
|
-
children: [(
|
|
1847
|
-
attachments: [...
|
|
1891
|
+
ref: gt,
|
|
1892
|
+
style: q,
|
|
1893
|
+
className: o(Y.wrapper, I && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", Z.length > 6 ? "py-3 ps-3" : "p-3", k),
|
|
1894
|
+
children: [(he.length > 0 || Z.length > 0) && /* @__PURE__ */ U(ve, {
|
|
1895
|
+
attachments: [...he, ...Z],
|
|
1848
1896
|
onRemove: (e) => {
|
|
1849
|
-
|
|
1897
|
+
he.some((t) => t.id === e) ? ge?.(e) : at(e);
|
|
1850
1898
|
},
|
|
1851
|
-
onRetry:
|
|
1852
|
-
onExpand:
|
|
1899
|
+
onRetry: ot,
|
|
1900
|
+
onExpand: st,
|
|
1853
1901
|
labels: {
|
|
1854
1902
|
removeLabel: b,
|
|
1855
1903
|
retryLabel: x
|
|
1856
1904
|
},
|
|
1857
|
-
onAttachmentClick:
|
|
1858
|
-
let t = [...
|
|
1859
|
-
t != null &&
|
|
1905
|
+
onAttachmentClick: Re == null ? void 0 : (e) => {
|
|
1906
|
+
let t = [...he, ...Z].find((t) => t.id === e);
|
|
1907
|
+
t != null && Re(t);
|
|
1860
1908
|
}
|
|
1861
|
-
}),
|
|
1909
|
+
}), P ? $ && kt : /* @__PURE__ */ W("div", {
|
|
1862
1910
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1863
1911
|
children: [
|
|
1864
|
-
!
|
|
1912
|
+
!ue && /* @__PURE__ */ W("div", {
|
|
1865
1913
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1866
1914
|
children: [/* @__PURE__ */ U("input", {
|
|
1867
|
-
ref:
|
|
1915
|
+
ref: ht,
|
|
1868
1916
|
type: "file",
|
|
1869
1917
|
multiple: !0,
|
|
1870
1918
|
accept: g,
|
|
1871
1919
|
className: "sr-only",
|
|
1872
1920
|
"aria-hidden": !0,
|
|
1873
1921
|
tabIndex: -1,
|
|
1874
|
-
onChange:
|
|
1875
|
-
}), /* @__PURE__ */ U(
|
|
1876
|
-
onAttachClick:
|
|
1922
|
+
onChange: Ot
|
|
1923
|
+
}), /* @__PURE__ */ U(Je, {
|
|
1924
|
+
onAttachClick: de ? void 0 : () => ht.current?.click(),
|
|
1877
1925
|
attachLabel: h,
|
|
1878
1926
|
addMenuTitle: _,
|
|
1879
1927
|
menuTitle: v,
|
|
1880
1928
|
menuCloseLabel: y,
|
|
1881
|
-
style:
|
|
1929
|
+
style: q,
|
|
1882
1930
|
isDisabled: I,
|
|
1883
1931
|
chatSettings: _e,
|
|
1884
|
-
extraMenuItems:
|
|
1885
|
-
toolsMenuItems:
|
|
1886
|
-
onToolToggle:
|
|
1887
|
-
toolsMenuTitle:
|
|
1888
|
-
toolsBackLabel: Se
|
|
1932
|
+
extraMenuItems: Ye,
|
|
1933
|
+
toolsMenuItems: ye,
|
|
1934
|
+
onToolToggle: be,
|
|
1935
|
+
toolsMenuTitle: xe,
|
|
1936
|
+
toolsBackLabel: Se,
|
|
1937
|
+
promptsMenuOverlay: Te,
|
|
1938
|
+
promptsMenuTitle: G,
|
|
1939
|
+
promptsBackLabel: Ee
|
|
1889
1940
|
})]
|
|
1890
1941
|
}),
|
|
1891
|
-
$ &&
|
|
1942
|
+
$ && Ct && /* @__PURE__ */ U("div", {
|
|
1892
1943
|
className: "order-3 min-w-0 flex-1",
|
|
1893
|
-
children: /* @__PURE__ */ U(
|
|
1894
|
-
items:
|
|
1895
|
-
onToolToggle:
|
|
1896
|
-
isMobile:
|
|
1897
|
-
countLabel:
|
|
1898
|
-
removeLabel:
|
|
1944
|
+
children: /* @__PURE__ */ U(Xe, {
|
|
1945
|
+
items: ye ?? [],
|
|
1946
|
+
onToolToggle: be,
|
|
1947
|
+
isMobile: Ge,
|
|
1948
|
+
countLabel: we?.countLabel,
|
|
1949
|
+
removeLabel: we?.removeLabel
|
|
1899
1950
|
})
|
|
1900
1951
|
}),
|
|
1901
1952
|
/* @__PURE__ */ U("div", {
|
|
1902
1953
|
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1903
|
-
children:
|
|
1954
|
+
children: kt
|
|
1904
1955
|
}),
|
|
1905
1956
|
/* @__PURE__ */ W("div", {
|
|
1906
|
-
className: o("flex flex-shrink-0 items-center gap-2", $ &&
|
|
1907
|
-
children: [
|
|
1908
|
-
canSend:
|
|
1909
|
-
onSend:
|
|
1957
|
+
className: o("flex flex-shrink-0 items-center gap-2", $ && Ct ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1958
|
+
children: [F ? F({
|
|
1959
|
+
canSend: yt,
|
|
1960
|
+
onSend: Et
|
|
1910
1961
|
}) : /* @__PURE__ */ W(H, { children: [
|
|
1911
|
-
|
|
1912
|
-
/* @__PURE__ */ U(
|
|
1913
|
-
deployments:
|
|
1914
|
-
selectedDeploymentId:
|
|
1915
|
-
onDeploymentChange:
|
|
1916
|
-
modelSelectorLabels:
|
|
1962
|
+
Ue,
|
|
1963
|
+
/* @__PURE__ */ U(Pt, {
|
|
1964
|
+
deployments: ne,
|
|
1965
|
+
selectedDeploymentId: ae,
|
|
1966
|
+
onDeploymentChange: oe,
|
|
1967
|
+
modelSelectorLabels: se,
|
|
1917
1968
|
isStreaming: l,
|
|
1918
|
-
isMobile:
|
|
1919
|
-
isDisabled:
|
|
1920
|
-
style:
|
|
1921
|
-
modelPickerOverlay:
|
|
1922
|
-
isPickerOpen:
|
|
1923
|
-
onPickerToggle: () =>
|
|
1924
|
-
onPickerOpenChange:
|
|
1969
|
+
isMobile: Ge,
|
|
1970
|
+
isDisabled: fe,
|
|
1971
|
+
style: q,
|
|
1972
|
+
modelPickerOverlay: ze,
|
|
1973
|
+
isPickerOpen: Ke,
|
|
1974
|
+
onPickerToggle: () => qe((e) => !e),
|
|
1975
|
+
onPickerOpenChange: qe
|
|
1925
1976
|
}),
|
|
1926
|
-
l && i ? /* @__PURE__ */ U(
|
|
1977
|
+
l && i ? /* @__PURE__ */ U(tt, {
|
|
1927
1978
|
onStop: i,
|
|
1928
1979
|
ariaLabel: C
|
|
1929
|
-
}) : !l &&
|
|
1930
|
-
onSend:
|
|
1931
|
-
isDisabled: !
|
|
1980
|
+
}) : !l && bt && /* @__PURE__ */ U(et, {
|
|
1981
|
+
onSend: Et,
|
|
1982
|
+
isDisabled: !wt || ct || R,
|
|
1932
1983
|
ariaLabel: S,
|
|
1933
|
-
isExiting:
|
|
1934
|
-
},
|
|
1935
|
-
] }),
|
|
1936
|
-
icon: /* @__PURE__ */ U(
|
|
1984
|
+
isExiting: xt
|
|
1985
|
+
}, St)
|
|
1986
|
+
] }), Tt && /* @__PURE__ */ U(j, {
|
|
1987
|
+
icon: /* @__PURE__ */ U(ie, {
|
|
1937
1988
|
size: d.LG,
|
|
1938
1989
|
"aria-hidden": !0
|
|
1939
1990
|
}),
|
|
1940
1991
|
"aria-label": w,
|
|
1941
1992
|
className: "size-8 flex-shrink-0",
|
|
1942
|
-
onClick:
|
|
1993
|
+
onClick: ft,
|
|
1943
1994
|
disabled: I || l
|
|
1944
1995
|
})]
|
|
1945
1996
|
})
|
|
1946
1997
|
]
|
|
1947
1998
|
})]
|
|
1948
1999
|
});
|
|
1949
|
-
},
|
|
2000
|
+
}, Lt = { welcome: "_welcome_n2ph8_1" }, Rt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
|
|
1950
2001
|
let { colors: u, typography: d } = r ?? {};
|
|
1951
2002
|
return /* @__PURE__ */ W("div", {
|
|
1952
2003
|
style: a({ "--ci-welcome-color": u?.welcomeText }),
|
|
1953
2004
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1954
2005
|
children: [n && /* @__PURE__ */ U("h1", {
|
|
1955
|
-
className: o(
|
|
2006
|
+
className: o(Lt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
|
|
1956
2007
|
children: n
|
|
1957
2008
|
}), /* @__PURE__ */ U("div", {
|
|
1958
2009
|
className: "relative w-full max-w-[748px]",
|
|
1959
|
-
children: /* @__PURE__ */ U(
|
|
2010
|
+
children: /* @__PURE__ */ U(It, {
|
|
1960
2011
|
placeholder: t,
|
|
1961
2012
|
isStreaming: e,
|
|
1962
2013
|
isInputDisabled: c,
|
|
@@ -1967,30 +2018,30 @@ var Ot = {
|
|
|
1967
2018
|
})
|
|
1968
2019
|
})]
|
|
1969
2020
|
});
|
|
1970
|
-
},
|
|
1971
|
-
let
|
|
2021
|
+
}, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, onMessageTooLong: te }) => {
|
|
2022
|
+
let N = B(null), [ne, ie] = V([]);
|
|
1972
2023
|
R(() => {
|
|
1973
|
-
v?.length && (
|
|
2024
|
+
v?.length && (ie(v), y?.());
|
|
1974
2025
|
}, [v, y]);
|
|
1975
|
-
let [
|
|
1976
|
-
|
|
2026
|
+
let [ae, oe] = V(e ?? ""), [se, ce] = V([]), [le, ue] = V(t), de = se.some((e) => e.status === r.Loading || e.status === r.Error), P = (ae.trim().length > 0 || se.length > 0 || le.length > 0) && !de, F = (e) => {
|
|
2027
|
+
ue((t) => t.filter((t) => t.id !== e));
|
|
1977
2028
|
}, I = L((e, t) => {
|
|
1978
|
-
i(e,
|
|
1979
|
-
}, [
|
|
1980
|
-
if (
|
|
1981
|
-
if (!x &&
|
|
1982
|
-
|
|
2029
|
+
i(e, le, t);
|
|
2030
|
+
}, [le, i]), fe = () => {
|
|
2031
|
+
if (P) {
|
|
2032
|
+
if (!x && ae.length >= (M ?? 4e3)) {
|
|
2033
|
+
te?.(ae.length, M ?? 4e3);
|
|
1983
2034
|
return;
|
|
1984
2035
|
}
|
|
1985
|
-
I(
|
|
2036
|
+
I(ae, se);
|
|
1986
2037
|
}
|
|
1987
|
-
}, pe = L(() =>
|
|
2038
|
+
}, pe = L(() => ie([]), []), me = L((e) => {
|
|
1988
2039
|
let t = Array.from(e.target.files ?? []);
|
|
1989
|
-
t.length !== 0 && (e.target.value = "",
|
|
1990
|
-
}, []),
|
|
2040
|
+
t.length !== 0 && (e.target.value = "", ie(t));
|
|
2041
|
+
}, []), he = z(() => O ? [{
|
|
1991
2042
|
key: "dial-fs",
|
|
1992
2043
|
label: k ?? "DIAL file system",
|
|
1993
|
-
icon: /* @__PURE__ */ U(
|
|
2044
|
+
icon: /* @__PURE__ */ U(re, {
|
|
1994
2045
|
size: c,
|
|
1995
2046
|
"aria-hidden": !0
|
|
1996
2047
|
}),
|
|
@@ -1998,37 +2049,37 @@ var Ot = {
|
|
|
1998
2049
|
}] : [], [O, k]);
|
|
1999
2050
|
return /* @__PURE__ */ W("div", {
|
|
2000
2051
|
className: o("flex w-full flex-col gap-2", _),
|
|
2001
|
-
children: [/* @__PURE__ */ U(
|
|
2052
|
+
children: [/* @__PURE__ */ U(It, {
|
|
2002
2053
|
message: e,
|
|
2003
2054
|
ariaLabel: u,
|
|
2004
2055
|
isStacked: !0,
|
|
2005
2056
|
hideActionBar: !0,
|
|
2006
|
-
pendingDropFiles:
|
|
2057
|
+
pendingDropFiles: ne,
|
|
2007
2058
|
onDropFilesConsumed: pe,
|
|
2008
2059
|
onSend: I,
|
|
2009
2060
|
onUploadAttachment: a,
|
|
2010
|
-
onChange:
|
|
2011
|
-
onAttachmentsChange:
|
|
2061
|
+
onChange: oe,
|
|
2062
|
+
onAttachmentsChange: ce,
|
|
2012
2063
|
removeLabel: d,
|
|
2013
2064
|
retryLabel: f,
|
|
2014
2065
|
className: "max-w-full",
|
|
2015
|
-
prefixAttachments:
|
|
2016
|
-
onRemovePrefixAttachment:
|
|
2066
|
+
prefixAttachments: le,
|
|
2067
|
+
onRemovePrefixAttachment: F,
|
|
2017
2068
|
validateAttachment: b,
|
|
2018
2069
|
isAttachmentsEnabled: x,
|
|
2019
2070
|
maximumAttachmentsAmount: T,
|
|
2020
2071
|
onAttachmentsLimitExceeded: D,
|
|
2021
2072
|
pendingAttachments: A,
|
|
2022
2073
|
onPendingAttachmentsConsumed: j,
|
|
2023
|
-
onAttachmentClick:
|
|
2024
|
-
pasteTextThreshold:
|
|
2025
|
-
onMessageTooLong:
|
|
2074
|
+
onAttachmentClick: ee,
|
|
2075
|
+
pasteTextThreshold: M,
|
|
2076
|
+
onMessageTooLong: te
|
|
2026
2077
|
}), /* @__PURE__ */ W("div", {
|
|
2027
2078
|
className: "flex items-center justify-between",
|
|
2028
2079
|
children: [/* @__PURE__ */ U("div", {
|
|
2029
2080
|
className: "flex",
|
|
2030
2081
|
children: !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
|
|
2031
|
-
ref:
|
|
2082
|
+
ref: N,
|
|
2032
2083
|
type: "file",
|
|
2033
2084
|
multiple: !0,
|
|
2034
2085
|
accept: w,
|
|
@@ -2036,13 +2087,13 @@ var Ot = {
|
|
|
2036
2087
|
"aria-hidden": !0,
|
|
2037
2088
|
tabIndex: -1,
|
|
2038
2089
|
onChange: me
|
|
2039
|
-
}), /* @__PURE__ */ U(
|
|
2040
|
-
onAttachClick: () =>
|
|
2090
|
+
}), /* @__PURE__ */ U(Je, {
|
|
2091
|
+
onAttachClick: () => N.current?.click(),
|
|
2041
2092
|
attachLabel: m,
|
|
2042
2093
|
addMenuTitle: p,
|
|
2043
2094
|
menuTitle: h,
|
|
2044
2095
|
menuCloseLabel: g,
|
|
2045
|
-
extraMenuItems:
|
|
2096
|
+
extraMenuItems: he
|
|
2046
2097
|
})] })
|
|
2047
2098
|
}), /* @__PURE__ */ W("div", {
|
|
2048
2099
|
className: "flex gap-2",
|
|
@@ -2052,11 +2103,11 @@ var Ot = {
|
|
|
2052
2103
|
}), /* @__PURE__ */ U(E, {
|
|
2053
2104
|
label: l,
|
|
2054
2105
|
onClick: fe,
|
|
2055
|
-
disabled: !
|
|
2106
|
+
disabled: !P
|
|
2056
2107
|
})]
|
|
2057
2108
|
})]
|
|
2058
2109
|
})]
|
|
2059
2110
|
});
|
|
2060
2111
|
};
|
|
2061
2112
|
//#endregion
|
|
2062
|
-
export {
|
|
2113
|
+
export { he as AttachmentCard, ge as AttachmentGroup, _e as AttachmentTray, G as BottomSheetShell, Ge as ChatSettingsModal, Rt as ConversationInput, zt as EditMessageInput, ye as FileDndOverlay, It as Input, Le as SendOnEnter, Se as getAttachmentIcon };
|