@epam/ai-dial-conversation-input 1.1.0-dev.290 → 1.1.0-dev.294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Input/Input.d.ts.map +1 -1
- package/components/ToolsChips/ToolsChips.d.ts +54 -0
- package/components/ToolsChips/ToolsChips.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.js +323 -336
- package/models/ConversationInput.d.ts +1 -1
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +3 -5
- package/models/Input.d.ts.map +1 -1
- package/package.json +3 -3
- package/components/SelectedToolsChips/SelectedToolsChips.d.ts +0 -42
- package/components/SelectedToolsChips/SelectedToolsChips.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, Dropdown as p, ElementSize as m, ErrorText as h, GhostIconButton as g, Highlight as _, NeutralButton as v, Popup as y, PopupSize as b, PrimaryButton as x, PrimaryIconButton as S, RadioGroup as C, RadioGroupOrientation as w, Search as T, Skeleton as E, SkeletonVariant as D, Slider as O, StaticIconButton as k, Textarea as A, Tooltip as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconArrowLeft as ee, IconArrowNarrowRight as
|
|
3
|
+
import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as N, IconChevronDown as te, IconChevronRight as P, IconFile as ne, IconMicrophone as re, IconPaperclip as ie, IconPlayerStopFilled as F, IconPlaystationSquare as I, IconPlus as ae, IconPrompt as oe, IconSettings as se, IconTool as ce, IconX as le } from "@tabler/icons-react";
|
|
4
4
|
import { createPortal as ue } from "react-dom";
|
|
5
5
|
import { createElement as L, memo as R, useCallback as z, useEffect as B, useImperativeHandle as de, useLayoutEffect as fe, useMemo as V, useRef as H, useState as U } from "react";
|
|
6
6
|
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
@@ -485,7 +485,7 @@ var Se = (e, t) => {
|
|
|
485
485
|
]
|
|
486
486
|
});
|
|
487
487
|
}, Ve = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
|
|
488
|
-
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: ee, handleSubmit:
|
|
488
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: ee, handleSubmit: M } = Re({
|
|
489
489
|
isOpen: e,
|
|
490
490
|
features: s,
|
|
491
491
|
initialResponseFormat: c,
|
|
@@ -527,7 +527,7 @@ var Se = (e, t) => {
|
|
|
527
527
|
triggerClassName: "w-full",
|
|
528
528
|
children: /* @__PURE__ */ G(x, {
|
|
529
529
|
label: C,
|
|
530
|
-
onClick:
|
|
530
|
+
onClick: M,
|
|
531
531
|
disabled: !O,
|
|
532
532
|
className: "w-full"
|
|
533
533
|
})
|
|
@@ -614,7 +614,7 @@ var We = {
|
|
|
614
614
|
}),
|
|
615
615
|
iconAfter: e.isSelected ? /* @__PURE__ */ G("span", {
|
|
616
616
|
className: o("ms-auto", We.selectedIcon),
|
|
617
|
-
children: /* @__PURE__ */ G(
|
|
617
|
+
children: /* @__PURE__ */ G(N, {
|
|
618
618
|
size: c,
|
|
619
619
|
"aria-hidden": !0
|
|
620
620
|
})
|
|
@@ -632,7 +632,7 @@ var We = {
|
|
|
632
632
|
toolIcon: "_toolIcon_r268y_5",
|
|
633
633
|
chevronIcon: "_chevronIcon_r268y_9"
|
|
634
634
|
}, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: h = !1, chatSettings: _, extraMenuItems: v, toolsMenuItems: y = [], onToolToggle: b, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
|
|
635
|
-
let D = s(), [O, k] = U(!1), [A, j] = U(!1), [ee,
|
|
635
|
+
let D = s(), [O, k] = U(!1), [A, j] = U(!1), [ee, M] = U(!1), [te, ne] = U(!1), [re, F] = U(!1), I = V(() => a({
|
|
636
636
|
"--aab-selected-tool-icon": E?.selectedToolIcon,
|
|
637
637
|
"--aab-tool-icon": E?.toolIcon,
|
|
638
638
|
"--aab-chevron-icon": E?.chevronIcon
|
|
@@ -640,22 +640,22 @@ var We = {
|
|
|
640
640
|
E?.selectedToolIcon,
|
|
641
641
|
E?.toolIcon,
|
|
642
642
|
E?.chevronIcon
|
|
643
|
-
]),
|
|
643
|
+
]), le = y.length > 0 && b != null, ue = V(() => y.map((e) => ({
|
|
644
644
|
key: e.id,
|
|
645
645
|
label: /* @__PURE__ */ K("span", {
|
|
646
646
|
className: "flex flex-1 items-center gap-2",
|
|
647
647
|
children: [/* @__PURE__ */ G("span", {
|
|
648
648
|
className: "flex-1",
|
|
649
649
|
children: e.label
|
|
650
|
-
}), e.isSelected && /* @__PURE__ */ G(
|
|
650
|
+
}), e.isSelected && /* @__PURE__ */ G(N, {
|
|
651
651
|
size: c,
|
|
652
|
-
style:
|
|
652
|
+
style: I,
|
|
653
653
|
className: Ke.selectedToolIcon,
|
|
654
654
|
"aria-hidden": !0
|
|
655
655
|
})]
|
|
656
656
|
}),
|
|
657
657
|
icon: /* @__PURE__ */ G("span", {
|
|
658
|
-
style:
|
|
658
|
+
style: I,
|
|
659
659
|
className: o("flex items-center", Ke.toolIcon),
|
|
660
660
|
children: e.icon
|
|
661
661
|
}),
|
|
@@ -663,32 +663,32 @@ var We = {
|
|
|
663
663
|
})), [
|
|
664
664
|
y,
|
|
665
665
|
b,
|
|
666
|
-
|
|
666
|
+
I
|
|
667
667
|
]), L = V(() => [
|
|
668
668
|
...e == null ? [] : [{
|
|
669
669
|
key: "attach",
|
|
670
670
|
label: t,
|
|
671
|
-
icon: /* @__PURE__ */ G(
|
|
671
|
+
icon: /* @__PURE__ */ G(ie, {
|
|
672
672
|
size: c,
|
|
673
673
|
"aria-hidden": !0
|
|
674
674
|
}),
|
|
675
675
|
onClick: e
|
|
676
676
|
}],
|
|
677
677
|
...v ?? [],
|
|
678
|
-
...
|
|
678
|
+
...le ? [{
|
|
679
679
|
key: "tools",
|
|
680
680
|
label: x,
|
|
681
|
-
icon: /* @__PURE__ */ G(
|
|
681
|
+
icon: /* @__PURE__ */ G(ce, {
|
|
682
682
|
size: c,
|
|
683
683
|
"aria-hidden": !0
|
|
684
684
|
}),
|
|
685
685
|
onClick: D ? () => {
|
|
686
|
-
|
|
686
|
+
M(!0), k(!1);
|
|
687
687
|
} : () => void 0,
|
|
688
|
-
...D ? { iconAfter: /* @__PURE__ */ G(
|
|
688
|
+
...D ? { iconAfter: /* @__PURE__ */ G(P, {
|
|
689
689
|
size: c,
|
|
690
690
|
stroke: 1.5,
|
|
691
|
-
style:
|
|
691
|
+
style: I,
|
|
692
692
|
className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
|
|
693
693
|
"aria-hidden": !0
|
|
694
694
|
}) } : { children: ue }
|
|
@@ -696,17 +696,17 @@ var We = {
|
|
|
696
696
|
...C == null ? [] : [{
|
|
697
697
|
key: "prompts",
|
|
698
698
|
label: w,
|
|
699
|
-
icon: /* @__PURE__ */ G(
|
|
699
|
+
icon: /* @__PURE__ */ G(oe, {
|
|
700
700
|
size: c,
|
|
701
701
|
"aria-hidden": !0
|
|
702
702
|
}),
|
|
703
703
|
onClick: D ? () => {
|
|
704
|
-
|
|
704
|
+
ne(!0), k(!1);
|
|
705
705
|
} : () => void 0,
|
|
706
|
-
...D ? { iconAfter: /* @__PURE__ */ G(
|
|
706
|
+
...D ? { iconAfter: /* @__PURE__ */ G(P, {
|
|
707
707
|
size: c,
|
|
708
708
|
stroke: 1.5,
|
|
709
|
-
style:
|
|
709
|
+
style: I,
|
|
710
710
|
className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
|
|
711
711
|
"aria-hidden": !0
|
|
712
712
|
}) } : {
|
|
@@ -714,20 +714,20 @@ var We = {
|
|
|
714
714
|
key: "prompts-panel",
|
|
715
715
|
label: ""
|
|
716
716
|
}],
|
|
717
|
-
renderSubMenu: () => C(() =>
|
|
717
|
+
renderSubMenu: () => C(() => F(!1))
|
|
718
718
|
}
|
|
719
719
|
}],
|
|
720
720
|
..._ == null ? [] : [{
|
|
721
721
|
key: "chat-settings",
|
|
722
722
|
label: _.menuItemLabel ?? "Chat settings",
|
|
723
|
-
icon: /* @__PURE__ */ G(
|
|
723
|
+
icon: /* @__PURE__ */ G(se, {
|
|
724
724
|
size: c,
|
|
725
725
|
"aria-hidden": !0
|
|
726
726
|
}),
|
|
727
|
-
iconAfter: D ? /* @__PURE__ */ G(
|
|
727
|
+
iconAfter: D ? /* @__PURE__ */ G(P, {
|
|
728
728
|
size: c,
|
|
729
729
|
stroke: 1.5,
|
|
730
|
-
style:
|
|
730
|
+
style: I,
|
|
731
731
|
className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
|
|
732
732
|
"aria-hidden": !0
|
|
733
733
|
}) : null,
|
|
@@ -739,12 +739,12 @@ var We = {
|
|
|
739
739
|
_,
|
|
740
740
|
v,
|
|
741
741
|
D,
|
|
742
|
-
|
|
742
|
+
le,
|
|
743
743
|
x,
|
|
744
744
|
ue,
|
|
745
745
|
C,
|
|
746
746
|
w,
|
|
747
|
-
|
|
747
|
+
I
|
|
748
748
|
]);
|
|
749
749
|
if (L.length === 0) return null;
|
|
750
750
|
let R = /* @__PURE__ */ G(p, {
|
|
@@ -752,10 +752,10 @@ var We = {
|
|
|
752
752
|
placement: "bottom-start",
|
|
753
753
|
listClassName: f,
|
|
754
754
|
items: L,
|
|
755
|
-
open: C == null ? void 0 :
|
|
756
|
-
onOpenChange: C == null ? void 0 :
|
|
755
|
+
open: C == null ? void 0 : re,
|
|
756
|
+
onOpenChange: C == null ? void 0 : F,
|
|
757
757
|
children: /* @__PURE__ */ G(g, {
|
|
758
|
-
icon: /* @__PURE__ */ G(
|
|
758
|
+
icon: /* @__PURE__ */ G(ae, {
|
|
759
759
|
size: d.LG,
|
|
760
760
|
"aria-hidden": !0
|
|
761
761
|
}),
|
|
@@ -766,7 +766,7 @@ var We = {
|
|
|
766
766
|
});
|
|
767
767
|
return /* @__PURE__ */ G(W, { children: D ? /* @__PURE__ */ K(W, { children: [
|
|
768
768
|
/* @__PURE__ */ G(g, {
|
|
769
|
-
icon: /* @__PURE__ */ G(
|
|
769
|
+
icon: /* @__PURE__ */ G(ae, {
|
|
770
770
|
size: d.LG,
|
|
771
771
|
"aria-hidden": !0
|
|
772
772
|
}),
|
|
@@ -786,13 +786,13 @@ var We = {
|
|
|
786
786
|
className: "pb-4",
|
|
787
787
|
btnTextClassName: "flex-1"
|
|
788
788
|
}),
|
|
789
|
-
|
|
789
|
+
le && /* @__PURE__ */ G(Ge, {
|
|
790
790
|
isOpen: ee,
|
|
791
791
|
onBack: () => {
|
|
792
|
-
|
|
792
|
+
M(!1), k(!0);
|
|
793
793
|
},
|
|
794
794
|
backLabel: S,
|
|
795
|
-
onClose: () =>
|
|
795
|
+
onClose: () => M(!1),
|
|
796
796
|
closeLabel: l,
|
|
797
797
|
style: u,
|
|
798
798
|
title: x,
|
|
@@ -800,16 +800,16 @@ var We = {
|
|
|
800
800
|
onToolToggle: b
|
|
801
801
|
}),
|
|
802
802
|
C != null && /* @__PURE__ */ G(q, {
|
|
803
|
-
isOpen:
|
|
803
|
+
isOpen: te,
|
|
804
804
|
title: w,
|
|
805
805
|
closeLabel: l,
|
|
806
806
|
onBack: () => {
|
|
807
|
-
|
|
807
|
+
ne(!1), k(!0);
|
|
808
808
|
},
|
|
809
809
|
backLabel: T,
|
|
810
|
-
onClose: () =>
|
|
810
|
+
onClose: () => ne(!1),
|
|
811
811
|
style: u,
|
|
812
|
-
children: C(() =>
|
|
812
|
+
children: C(() => ne(!1))
|
|
813
813
|
}),
|
|
814
814
|
_ != null && /* @__PURE__ */ G(Ve, {
|
|
815
815
|
isOpen: A,
|
|
@@ -859,94 +859,76 @@ var We = {
|
|
|
859
859
|
saveDisabledTooltip: _.saveDisabledTooltip
|
|
860
860
|
})] }) });
|
|
861
861
|
}, J = {
|
|
862
|
-
chip: "
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
"--ci-chip-bg":
|
|
871
|
-
"--ci-chip-border":
|
|
872
|
-
"--ci-chip-icon":
|
|
873
|
-
"--ci-chip-text":
|
|
874
|
-
"--ci-chip-
|
|
875
|
-
"--ci-chip-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
862
|
+
chip: "_chip_ydmd8_1",
|
|
863
|
+
chipSelected: "_chipSelected_ydmd8_9",
|
|
864
|
+
chipIcon: "_chipIcon_ydmd8_16",
|
|
865
|
+
chipText: "_chipText_ydmd8_19",
|
|
866
|
+
chipClose: "_chipClose_ydmd8_22"
|
|
867
|
+
}, Je = (e) => `Remove ${e}`, Ye = ({ items: e, onToolToggle: t, onToolDismiss: n, removeLabel: r = Je, typography: i, colors: s }) => e.length === 0 ? null : /* @__PURE__ */ G("div", {
|
|
868
|
+
className: "flex flex-wrap items-center gap-2",
|
|
869
|
+
style: a({
|
|
870
|
+
"--ci-chip-bg": s?.chipBg,
|
|
871
|
+
"--ci-chip-border": s?.chipBorder,
|
|
872
|
+
"--ci-chip-icon": s?.chipIcon,
|
|
873
|
+
"--ci-chip-text": s?.chipText,
|
|
874
|
+
"--ci-chip-hover-bg": s?.chipHoverBg,
|
|
875
|
+
"--ci-chip-selected-bg": s?.chipSelectedBg,
|
|
876
|
+
"--ci-chip-selected-border": s?.chipSelectedBorder,
|
|
877
|
+
"--ci-chip-selected-icon": s?.chipSelectedIcon,
|
|
878
|
+
"--ci-chip-selected-text": s?.chipSelectedText,
|
|
879
|
+
"--ci-chip-close": s?.chipClose,
|
|
880
|
+
"--ci-chip-close-hover": s?.chipCloseHover
|
|
881
|
+
}),
|
|
882
|
+
children: e.map((e) => /* @__PURE__ */ K("div", {
|
|
883
|
+
className: o(J.chip, e.isSelected && J.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 pe-1 ps-2 transition-colors"),
|
|
884
|
+
children: [/* @__PURE__ */ K("button", {
|
|
885
|
+
type: "button",
|
|
886
|
+
onClick: () => t(e.id),
|
|
887
|
+
"aria-pressed": e.isSelected,
|
|
888
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
889
|
+
children: [/* @__PURE__ */ G("span", {
|
|
890
|
+
className: o(J.chipIcon, "shrink-0"),
|
|
891
|
+
"aria-hidden": !0,
|
|
892
|
+
children: e.icon
|
|
893
|
+
}), /* @__PURE__ */ G("span", {
|
|
894
|
+
className: o(J.chipText, i?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
895
|
+
children: e.label
|
|
896
|
+
})]
|
|
897
|
+
}), /* @__PURE__ */ G("button", {
|
|
898
|
+
type: "button",
|
|
899
|
+
onClick: () => n(e.id),
|
|
900
|
+
"aria-label": r(e.label),
|
|
901
|
+
className: o(J.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
902
|
+
children: /* @__PURE__ */ G(le, {
|
|
903
|
+
size: 12,
|
|
904
|
+
"aria-hidden": !0
|
|
895
905
|
})
|
|
896
|
-
})
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
className: "flex flex-wrap items-center gap-2",
|
|
900
|
-
style: d,
|
|
901
|
-
children: u.map((e) => /* @__PURE__ */ K("div", {
|
|
902
|
-
className: o(J.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
|
|
903
|
-
children: [
|
|
904
|
-
/* @__PURE__ */ G("span", {
|
|
905
|
-
className: J.chipIcon,
|
|
906
|
-
"aria-hidden": !0,
|
|
907
|
-
children: e.icon
|
|
908
|
-
}),
|
|
909
|
-
/* @__PURE__ */ G("span", {
|
|
910
|
-
className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text"),
|
|
911
|
-
children: e.label
|
|
912
|
-
}),
|
|
913
|
-
/* @__PURE__ */ G("button", {
|
|
914
|
-
type: "button",
|
|
915
|
-
onClick: () => t(e.id),
|
|
916
|
-
className: o(J.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
917
|
-
"aria-label": i(e.label),
|
|
918
|
-
children: /* @__PURE__ */ G(I, {
|
|
919
|
-
size: 12,
|
|
920
|
-
"aria-hidden": !0
|
|
921
|
-
})
|
|
922
|
-
})
|
|
923
|
-
]
|
|
924
|
-
}, e.id))
|
|
925
|
-
});
|
|
926
|
-
}, Y = {
|
|
906
|
+
})]
|
|
907
|
+
}, e.id))
|
|
908
|
+
}), Y = {
|
|
927
909
|
wrapper: "_wrapper_10e5r_1",
|
|
928
910
|
wrapperDisabled: "_wrapperDisabled_10e5r_8",
|
|
929
911
|
textarea: "_textarea_10e5r_13",
|
|
930
912
|
modelSelectorButton: "_modelSelectorButton_10e5r_24",
|
|
931
913
|
modelSelectorCaret: "_modelSelectorCaret_10e5r_24",
|
|
932
914
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_10e5r_33"
|
|
933
|
-
},
|
|
915
|
+
}, Xe = {
|
|
934
916
|
wrapperError: "_wrapperError_129ri_1",
|
|
935
917
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
936
918
|
recordingDot: "_recordingDot_129ri_19",
|
|
937
919
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
938
|
-
}, Ze = 3,
|
|
939
|
-
let u = H(null), f = H(new Float32Array(
|
|
920
|
+
}, Ze = 3, X = 4, Z = 200, Qe = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
|
|
921
|
+
let u = H(null), f = H(new Float32Array(Z)), p = H(0), m = H(0), _ = e === je.Recording, v = e === je.Error, y = z((e) => {
|
|
940
922
|
let t = e.getContext("2d");
|
|
941
923
|
if (!t) return;
|
|
942
924
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
943
925
|
let { width: n, height: r } = e;
|
|
944
926
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
945
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
927
|
+
let i = Math.min(Math.max(1, Math.floor(n / X)), Z - 1), a = p.current, o = m.current;
|
|
946
928
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
947
929
|
for (let e = 0; e <= i; e++) {
|
|
948
|
-
let n = ((a - i + e) %
|
|
949
|
-
t.fillRect(e *
|
|
930
|
+
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);
|
|
931
|
+
t.fillRect(e * X, (r - c) / 2, Ze, c);
|
|
950
932
|
}
|
|
951
933
|
t.restore();
|
|
952
934
|
}, []);
|
|
@@ -956,8 +938,8 @@ var We = {
|
|
|
956
938
|
if (!e) return;
|
|
957
939
|
f.current.fill(0), p.current = 0, m.current = 0;
|
|
958
940
|
let n, r = () => {
|
|
959
|
-
if (m.current += 1, m.current >=
|
|
960
|
-
m.current -=
|
|
941
|
+
if (m.current += 1, m.current >= X) {
|
|
942
|
+
m.current -= X;
|
|
961
943
|
let e = t.current;
|
|
962
944
|
if (e) {
|
|
963
945
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -967,7 +949,7 @@ var We = {
|
|
|
967
949
|
let r = (t[e] - 128) / 128;
|
|
968
950
|
n += r * r;
|
|
969
951
|
}
|
|
970
|
-
f.current[p.current %
|
|
952
|
+
f.current[p.current % Z] = Math.sqrt(n / t.length), p.current++;
|
|
971
953
|
}
|
|
972
954
|
}
|
|
973
955
|
y(e), n = requestAnimationFrame(r);
|
|
@@ -990,14 +972,14 @@ var We = {
|
|
|
990
972
|
let b = /* @__PURE__ */ K("div", {
|
|
991
973
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
992
974
|
children: [/* @__PURE__ */ G(g, {
|
|
993
|
-
icon: /* @__PURE__ */ G(
|
|
975
|
+
icon: /* @__PURE__ */ G(le, {
|
|
994
976
|
size: d.LG,
|
|
995
977
|
"aria-hidden": !0
|
|
996
978
|
}),
|
|
997
979
|
"aria-label": s,
|
|
998
980
|
onClick: i
|
|
999
981
|
}), _ && /* @__PURE__ */ G(S, {
|
|
1000
|
-
icon: /* @__PURE__ */ G(
|
|
982
|
+
icon: /* @__PURE__ */ G(F, {
|
|
1001
983
|
size: d.LG,
|
|
1002
984
|
"aria-hidden": !0
|
|
1003
985
|
}),
|
|
@@ -1009,16 +991,16 @@ var We = {
|
|
|
1009
991
|
className: l,
|
|
1010
992
|
children: [/* @__PURE__ */ K("div", {
|
|
1011
993
|
style: c,
|
|
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", v &&
|
|
994
|
+
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", v && Xe.wrapperError),
|
|
1013
995
|
children: [/* @__PURE__ */ K("div", {
|
|
1014
996
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1015
997
|
children: [_ && /* @__PURE__ */ G("span", {
|
|
1016
|
-
className: o(
|
|
998
|
+
className: o(Xe.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1017
999
|
"aria-hidden": !0
|
|
1018
1000
|
}), /* @__PURE__ */ G("canvas", {
|
|
1019
1001
|
ref: u,
|
|
1020
1002
|
height: 32,
|
|
1021
|
-
className: o(
|
|
1003
|
+
className: o(Xe.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
1022
1004
|
})]
|
|
1023
1005
|
}), b]
|
|
1024
1006
|
}), v && n && /* @__PURE__ */ G(h, {
|
|
@@ -1026,25 +1008,25 @@ var We = {
|
|
|
1026
1008
|
className: "mt-1 px-1"
|
|
1027
1009
|
})]
|
|
1028
1010
|
});
|
|
1029
|
-
},
|
|
1011
|
+
}, $e = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ G(S, {
|
|
1030
1012
|
"aria-label": n,
|
|
1031
1013
|
onClick: () => e?.(),
|
|
1032
1014
|
disabled: t,
|
|
1033
1015
|
"aria-hidden": r,
|
|
1034
|
-
icon: /* @__PURE__ */ G(
|
|
1016
|
+
icon: /* @__PURE__ */ G(M, {
|
|
1035
1017
|
size: d.LG,
|
|
1036
1018
|
className: "rtl:scale-x-[-1]"
|
|
1037
1019
|
})
|
|
1038
|
-
}),
|
|
1039
|
-
icon: /* @__PURE__ */ G(
|
|
1020
|
+
}), et = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ G(k, {
|
|
1021
|
+
icon: /* @__PURE__ */ G(I, { size: d.LG }),
|
|
1040
1022
|
onClick: () => e?.(),
|
|
1041
1023
|
"aria-label": t
|
|
1042
|
-
}),
|
|
1024
|
+
}), tt = ({ size: e = 20 }) => /* @__PURE__ */ G(E, {
|
|
1043
1025
|
variant: D.Circular,
|
|
1044
1026
|
width: e,
|
|
1045
1027
|
height: e,
|
|
1046
1028
|
active: !0
|
|
1047
|
-
}),
|
|
1029
|
+
}), nt = ({ loadingLabel: e }) => /* @__PURE__ */ K("span", {
|
|
1048
1030
|
className: "flex min-w-0 flex-1 items-center",
|
|
1049
1031
|
children: [/* @__PURE__ */ G(E, {
|
|
1050
1032
|
variant: D.Text,
|
|
@@ -1055,28 +1037,28 @@ var We = {
|
|
|
1055
1037
|
className: "sr-only",
|
|
1056
1038
|
children: e
|
|
1057
1039
|
})]
|
|
1058
|
-
}),
|
|
1040
|
+
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */ G("div", {
|
|
1059
1041
|
role: "status",
|
|
1060
1042
|
"aria-label": e,
|
|
1061
1043
|
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ K("div", {
|
|
1062
1044
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1063
1045
|
"aria-hidden": "true",
|
|
1064
|
-
children: [/* @__PURE__ */ G(
|
|
1046
|
+
children: [/* @__PURE__ */ G(tt, {}), /* @__PURE__ */ G(nt, {})]
|
|
1065
1047
|
}, t))
|
|
1066
|
-
}),
|
|
1048
|
+
}), it = (e) => e.displayName ?? e.id, at = (e, t) => {
|
|
1067
1049
|
let n = t.trim().toLowerCase();
|
|
1068
|
-
return n ? e.filter((e) =>
|
|
1069
|
-
},
|
|
1050
|
+
return n ? e.filter((e) => it(e).toLowerCase().includes(n)) : e;
|
|
1051
|
+
}, ot = (e, t, r, i = 18, a) => /* @__PURE__ */ G(n, {
|
|
1070
1052
|
src: e,
|
|
1071
1053
|
size: i,
|
|
1072
1054
|
labels: { tooltip: a },
|
|
1073
1055
|
initialsName: r
|
|
1074
|
-
}),
|
|
1056
|
+
}), st = {
|
|
1075
1057
|
searchHeader: "_searchHeader_1tt5t_1",
|
|
1076
1058
|
selectedItem: "_selectedItem_1tt5t_5",
|
|
1077
1059
|
selectedItemCheck: "_selectedItemCheck_1tt5t_9"
|
|
1078
|
-
},
|
|
1079
|
-
let [u, f] = U(""), p = V(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = !h && !p && !!t, v = V(() => h ? /* @__PURE__ */ G(
|
|
1060
|
+
}, ct = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = st.searchHeader, selectedItemClassName: s = st.selectedItem, selectedItemCheckClassName: c = st.selectedItemCheck, colors: l }) => {
|
|
1061
|
+
let [u, f] = U(""), p = V(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = !h && !p && !!t, v = V(() => h ? /* @__PURE__ */ G(tt, { size: d.LG }) : ot(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG, g ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1080
1062
|
h,
|
|
1081
1063
|
p,
|
|
1082
1064
|
g,
|
|
@@ -1089,8 +1071,8 @@ var We = {
|
|
|
1089
1071
|
menuItems: V(() => {
|
|
1090
1072
|
if (h) return Array.from({ length: 7 }, (e, t) => ({
|
|
1091
1073
|
key: `__loading-${t}`,
|
|
1092
|
-
icon: /* @__PURE__ */ G(
|
|
1093
|
-
label: /* @__PURE__ */ G(
|
|
1074
|
+
icon: /* @__PURE__ */ G(tt, {}),
|
|
1075
|
+
label: /* @__PURE__ */ G(nt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1094
1076
|
disabled: !0
|
|
1095
1077
|
}));
|
|
1096
1078
|
if (!e || e.length === 0) {
|
|
@@ -1101,7 +1083,7 @@ var We = {
|
|
|
1101
1083
|
disabled: !0
|
|
1102
1084
|
}] : [];
|
|
1103
1085
|
}
|
|
1104
|
-
return
|
|
1086
|
+
return at(e, u).map((e) => {
|
|
1105
1087
|
let r = e.id === t;
|
|
1106
1088
|
return {
|
|
1107
1089
|
key: e.id,
|
|
@@ -1109,17 +1091,17 @@ var We = {
|
|
|
1109
1091
|
className: "flex w-full items-center justify-between gap-2",
|
|
1110
1092
|
style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
|
|
1111
1093
|
children: [/* @__PURE__ */ G(_, {
|
|
1112
|
-
text:
|
|
1094
|
+
text: it(e),
|
|
1113
1095
|
query: u,
|
|
1114
1096
|
maxLines: 1
|
|
1115
|
-
}), r && /* @__PURE__ */ G(
|
|
1097
|
+
}), r && /* @__PURE__ */ G(N, {
|
|
1116
1098
|
size: d.SM,
|
|
1117
1099
|
stroke: 2,
|
|
1118
1100
|
className: c,
|
|
1119
1101
|
"aria-hidden": !0
|
|
1120
1102
|
})]
|
|
1121
1103
|
}),
|
|
1122
|
-
icon:
|
|
1104
|
+
icon: ot(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1123
1105
|
onClick: () => n?.(e.id),
|
|
1124
1106
|
className: r ? s : void 0
|
|
1125
1107
|
};
|
|
@@ -1157,8 +1139,8 @@ var We = {
|
|
|
1157
1139
|
e || f("");
|
|
1158
1140
|
}
|
|
1159
1141
|
};
|
|
1160
|
-
},
|
|
1161
|
-
function
|
|
1142
|
+
}, lt = typeof window < "u" ? fe : B;
|
|
1143
|
+
function ut(e) {
|
|
1162
1144
|
if (e !== void 0) switch (typeof e) {
|
|
1163
1145
|
case "number": return e;
|
|
1164
1146
|
case "string":
|
|
@@ -1166,15 +1148,15 @@ function dt(e) {
|
|
|
1166
1148
|
break;
|
|
1167
1149
|
}
|
|
1168
1150
|
}
|
|
1169
|
-
function
|
|
1151
|
+
function dt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1170
1152
|
let { styleHeight: s, styleWidth: c } = V(() => ({
|
|
1171
|
-
styleHeight:
|
|
1172
|
-
styleWidth:
|
|
1153
|
+
styleHeight: ut(o?.height),
|
|
1154
|
+
styleWidth: ut(o?.width)
|
|
1173
1155
|
}), [o?.height, o?.width]), [l, u] = U({
|
|
1174
1156
|
height: t,
|
|
1175
1157
|
width: n
|
|
1176
1158
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1177
|
-
return
|
|
1159
|
+
return lt(() => {
|
|
1178
1160
|
if (i === null || d) return;
|
|
1179
1161
|
let t = new ResizeObserver((e) => {
|
|
1180
1162
|
for (let t of e) {
|
|
@@ -1203,26 +1185,26 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1203
1185
|
c
|
|
1204
1186
|
]);
|
|
1205
1187
|
}
|
|
1206
|
-
function
|
|
1188
|
+
function ft(e) {
|
|
1207
1189
|
let t = H(() => {
|
|
1208
1190
|
throw Error("Cannot call during render.");
|
|
1209
1191
|
});
|
|
1210
|
-
return
|
|
1192
|
+
return lt(() => {
|
|
1211
1193
|
t.current = e;
|
|
1212
1194
|
}, [e]), z((e) => t.current?.(e), [t]);
|
|
1213
1195
|
}
|
|
1214
|
-
var
|
|
1215
|
-
function
|
|
1216
|
-
if (
|
|
1196
|
+
var pt = null;
|
|
1197
|
+
function mt(e = !1) {
|
|
1198
|
+
if (pt === null || e) {
|
|
1217
1199
|
let e = document.createElement("div"), t = e.style;
|
|
1218
1200
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1219
1201
|
let n = document.createElement("div"), r = n.style;
|
|
1220
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1202
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? pt = "positive-descending" : (e.scrollLeft = 1, pt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), pt;
|
|
1221
1203
|
}
|
|
1222
|
-
return
|
|
1204
|
+
return pt;
|
|
1223
1205
|
}
|
|
1224
|
-
function
|
|
1225
|
-
if (t === "horizontal" && n) switch (
|
|
1206
|
+
function ht({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1207
|
+
if (t === "horizontal" && n) switch (mt()) {
|
|
1226
1208
|
case "negative": return -r;
|
|
1227
1209
|
case "positive-descending":
|
|
1228
1210
|
if (e) {
|
|
@@ -1236,13 +1218,13 @@ function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1236
1218
|
function Q(e, t = "Assertion error") {
|
|
1237
1219
|
if (!e) throw console.error(t), Error(t);
|
|
1238
1220
|
}
|
|
1239
|
-
function
|
|
1221
|
+
function gt(e, t) {
|
|
1240
1222
|
if (e === t) return !0;
|
|
1241
1223
|
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1242
1224
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1243
1225
|
return !0;
|
|
1244
1226
|
}
|
|
1245
|
-
function
|
|
1227
|
+
function _t({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1246
1228
|
if (t === 0) return 0;
|
|
1247
1229
|
if (typeof n == "number") return t * n;
|
|
1248
1230
|
{
|
|
@@ -1250,9 +1232,9 @@ function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
|
1250
1232
|
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1251
1233
|
}
|
|
1252
1234
|
}
|
|
1253
|
-
function
|
|
1235
|
+
function vt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1254
1236
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1255
|
-
let s =
|
|
1237
|
+
let s = _t({
|
|
1256
1238
|
cachedBounds: t,
|
|
1257
1239
|
itemCount: r,
|
|
1258
1240
|
itemSize: i
|
|
@@ -1264,7 +1246,7 @@ function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1264
1246
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1265
1247
|
}
|
|
1266
1248
|
}
|
|
1267
|
-
function
|
|
1249
|
+
function yt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1268
1250
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1269
1251
|
for (; u < a;) {
|
|
1270
1252
|
let n = e.get(u);
|
|
@@ -1283,7 +1265,7 @@ function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1283
1265
|
stopIndexOverscan: l
|
|
1284
1266
|
};
|
|
1285
1267
|
}
|
|
1286
|
-
function
|
|
1268
|
+
function bt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1287
1269
|
let r = /* @__PURE__ */ new Map();
|
|
1288
1270
|
return {
|
|
1289
1271
|
get(i) {
|
|
@@ -1320,8 +1302,8 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1320
1302
|
}
|
|
1321
1303
|
};
|
|
1322
1304
|
}
|
|
1323
|
-
function
|
|
1324
|
-
return V(() =>
|
|
1305
|
+
function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1306
|
+
return V(() => bt({
|
|
1325
1307
|
itemCount: e,
|
|
1326
1308
|
itemProps: t,
|
|
1327
1309
|
itemSize: n
|
|
@@ -1331,7 +1313,7 @@ function St({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1331
1313
|
n
|
|
1332
1314
|
]);
|
|
1333
1315
|
}
|
|
1334
|
-
function
|
|
1316
|
+
function St({ containerSize: e, itemSize: t }) {
|
|
1335
1317
|
let n;
|
|
1336
1318
|
switch (typeof t) {
|
|
1337
1319
|
case "string":
|
|
@@ -1343,8 +1325,8 @@ function Ct({ containerSize: e, itemSize: t }) {
|
|
|
1343
1325
|
}
|
|
1344
1326
|
return n;
|
|
1345
1327
|
}
|
|
1346
|
-
function
|
|
1347
|
-
let { height: u = n, width: d = n } =
|
|
1328
|
+
function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1329
|
+
let { height: u = n, width: d = n } = dt({
|
|
1348
1330
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1349
1331
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1350
1332
|
element: e,
|
|
@@ -1353,7 +1335,7 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1353
1335
|
}), f = H({
|
|
1354
1336
|
height: 0,
|
|
1355
1337
|
width: 0
|
|
1356
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1338
|
+
}), p = r === "vertical" ? u : d, m = St({
|
|
1357
1339
|
containerSize: p,
|
|
1358
1340
|
itemSize: s
|
|
1359
1341
|
});
|
|
@@ -1370,11 +1352,11 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1370
1352
|
c,
|
|
1371
1353
|
d
|
|
1372
1354
|
]);
|
|
1373
|
-
let h =
|
|
1355
|
+
let h = xt({
|
|
1374
1356
|
itemCount: a,
|
|
1375
1357
|
itemProps: o,
|
|
1376
1358
|
itemSize: m
|
|
1377
|
-
}), g = z((e) => h.get(e), [h]), [_, v] = U(() =>
|
|
1359
|
+
}), g = z((e) => h.get(e), [h]), [_, v] = U(() => yt({
|
|
1378
1360
|
cachedBounds: h,
|
|
1379
1361
|
containerScrollOffset: 0,
|
|
1380
1362
|
containerSize: p,
|
|
@@ -1385,7 +1367,7 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1385
1367
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1386
1368
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1387
1369
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1388
|
-
}, C = z(() =>
|
|
1370
|
+
}, C = z(() => _t({
|
|
1389
1371
|
cachedBounds: h,
|
|
1390
1372
|
itemCount: a,
|
|
1391
1373
|
itemSize: m
|
|
@@ -1393,9 +1375,9 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1393
1375
|
h,
|
|
1394
1376
|
a,
|
|
1395
1377
|
m
|
|
1396
|
-
]), w = z((t) =>
|
|
1378
|
+
]), w = z((t) => yt({
|
|
1397
1379
|
cachedBounds: h,
|
|
1398
|
-
containerScrollOffset:
|
|
1380
|
+
containerScrollOffset: ht({
|
|
1399
1381
|
containerElement: e,
|
|
1400
1382
|
direction: r,
|
|
1401
1383
|
isRtl: i,
|
|
@@ -1413,19 +1395,19 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1413
1395
|
a,
|
|
1414
1396
|
l
|
|
1415
1397
|
]);
|
|
1416
|
-
return
|
|
1398
|
+
return lt(() => {
|
|
1417
1399
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1418
1400
|
}, [
|
|
1419
1401
|
e,
|
|
1420
1402
|
r,
|
|
1421
1403
|
w
|
|
1422
|
-
]),
|
|
1404
|
+
]), lt(() => {
|
|
1423
1405
|
if (!e) return;
|
|
1424
1406
|
let t = () => {
|
|
1425
1407
|
v((t) => {
|
|
1426
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1408
|
+
let { scrollLeft: n, scrollTop: o } = e, s = yt({
|
|
1427
1409
|
cachedBounds: h,
|
|
1428
|
-
containerScrollOffset:
|
|
1410
|
+
containerScrollOffset: ht({
|
|
1429
1411
|
containerElement: e,
|
|
1430
1412
|
direction: r,
|
|
1431
1413
|
isRtl: i,
|
|
@@ -1435,7 +1417,7 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1435
1417
|
itemCount: a,
|
|
1436
1418
|
overscanCount: l
|
|
1437
1419
|
});
|
|
1438
|
-
return
|
|
1420
|
+
return gt(s, t) ? t : s;
|
|
1439
1421
|
});
|
|
1440
1422
|
};
|
|
1441
1423
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1451,8 +1433,8 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1451
1433
|
]), {
|
|
1452
1434
|
getCellBounds: g,
|
|
1453
1435
|
getEstimatedSize: C,
|
|
1454
|
-
scrollToIndex:
|
|
1455
|
-
let s =
|
|
1436
|
+
scrollToIndex: ft(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1437
|
+
let s = vt({
|
|
1456
1438
|
align: t,
|
|
1457
1439
|
cachedBounds: h,
|
|
1458
1440
|
containerScrollOffset: n,
|
|
@@ -1462,14 +1444,14 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1462
1444
|
itemSize: m
|
|
1463
1445
|
});
|
|
1464
1446
|
if (e) {
|
|
1465
|
-
if (s =
|
|
1447
|
+
if (s = ht({
|
|
1466
1448
|
containerElement: e,
|
|
1467
1449
|
direction: r,
|
|
1468
1450
|
isRtl: i,
|
|
1469
1451
|
scrollOffset: s
|
|
1470
1452
|
}), typeof e.scrollTo != "function") {
|
|
1471
1453
|
let e = w(s);
|
|
1472
|
-
|
|
1454
|
+
gt(_, e) || v(e);
|
|
1473
1455
|
}
|
|
1474
1456
|
return s;
|
|
1475
1457
|
}
|
|
@@ -1480,19 +1462,19 @@ function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1480
1462
|
stopIndexVisible: x
|
|
1481
1463
|
};
|
|
1482
1464
|
}
|
|
1483
|
-
function
|
|
1465
|
+
function wt(e) {
|
|
1484
1466
|
return V(() => e, Object.values(e));
|
|
1485
1467
|
}
|
|
1486
1468
|
function Tt(e, t) {
|
|
1487
1469
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1488
|
-
return
|
|
1470
|
+
return gt(n, a) && gt(r, o) && gt(i, s);
|
|
1489
1471
|
}
|
|
1490
1472
|
function Et(e) {
|
|
1491
1473
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1492
1474
|
}
|
|
1493
1475
|
var Dt = "data-react-window-index";
|
|
1494
1476
|
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 }) {
|
|
1495
|
-
let m =
|
|
1477
|
+
let m = wt(u), h = V(() => R(s, Tt), [s]), [g, _] = U(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Ct({
|
|
1496
1478
|
containerElement: g,
|
|
1497
1479
|
containerStyle: f,
|
|
1498
1480
|
defaultContainerSize: n,
|
|
@@ -1518,7 +1500,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1518
1500
|
top: r
|
|
1519
1501
|
});
|
|
1520
1502
|
}
|
|
1521
|
-
}), [g, x]),
|
|
1503
|
+
}), [g, x]), lt(() => {
|
|
1522
1504
|
if (!g) return;
|
|
1523
1505
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1524
1506
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
@@ -1606,8 +1588,8 @@ var kt = {
|
|
|
1606
1588
|
itemIcon: "_itemIcon_1tiyp_15",
|
|
1607
1589
|
checkIcon: "_checkIcon_1tiyp_19",
|
|
1608
1590
|
stateLabel: "_stateLabel_1tiyp_23"
|
|
1609
|
-
},
|
|
1610
|
-
let u = r[e], f =
|
|
1591
|
+
}, $ = 44, At = 8, jt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1592
|
+
let u = r[e], f = ot(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
|
|
1611
1593
|
return /* @__PURE__ */ G("div", {
|
|
1612
1594
|
style: t,
|
|
1613
1595
|
...n,
|
|
@@ -1625,7 +1607,7 @@ var kt = {
|
|
|
1625
1607
|
query: s,
|
|
1626
1608
|
maxLines: 1,
|
|
1627
1609
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1628
|
-
}), p && /* @__PURE__ */ G(
|
|
1610
|
+
}), p && /* @__PURE__ */ G(N, {
|
|
1629
1611
|
size: d.SM,
|
|
1630
1612
|
className: kt.checkIcon,
|
|
1631
1613
|
"aria-hidden": !0
|
|
@@ -1634,12 +1616,12 @@ var kt = {
|
|
|
1634
1616
|
onClick: () => c(u.id)
|
|
1635
1617
|
})
|
|
1636
1618
|
});
|
|
1637
|
-
},
|
|
1619
|
+
}, Mt = ({ 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: _ }) => {
|
|
1638
1620
|
let [v, y] = U("");
|
|
1639
1621
|
B(() => {
|
|
1640
1622
|
e || y("");
|
|
1641
1623
|
}, [e]);
|
|
1642
|
-
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1624
|
+
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? at(s, v) : [], w = (e) => {
|
|
1643
1625
|
l(e), i();
|
|
1644
1626
|
}, E = a({
|
|
1645
1627
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1669,17 +1651,17 @@ var kt = {
|
|
|
1669
1651
|
size: m.Standard,
|
|
1670
1652
|
onChange: (e) => y(e ?? "")
|
|
1671
1653
|
})
|
|
1672
|
-
}), /* @__PURE__ */ G("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ G(
|
|
1654
|
+
}), /* @__PURE__ */ G("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ G(rt, { loadingLabel: u }) : S ? /* @__PURE__ */ G("div", {
|
|
1673
1655
|
role: "list",
|
|
1674
1656
|
className: o(kt.stateLabel, g, "px-4 py-4"),
|
|
1675
1657
|
children: S
|
|
1676
1658
|
}) : /* @__PURE__ */ G(Ot, {
|
|
1677
1659
|
role: "list",
|
|
1678
1660
|
className: "overflow-y-auto",
|
|
1679
|
-
style: { height: Math.min(C.length,
|
|
1680
|
-
rowComponent:
|
|
1661
|
+
style: { height: Math.min(C.length, At) * $ },
|
|
1662
|
+
rowComponent: jt,
|
|
1681
1663
|
rowCount: C.length,
|
|
1682
|
-
rowHeight:
|
|
1664
|
+
rowHeight: $,
|
|
1683
1665
|
rowProps: {
|
|
1684
1666
|
items: C,
|
|
1685
1667
|
selectedDeploymentId: c,
|
|
@@ -1690,15 +1672,15 @@ var kt = {
|
|
|
1690
1672
|
})]
|
|
1691
1673
|
})
|
|
1692
1674
|
});
|
|
1693
|
-
},
|
|
1694
|
-
let [v, y] = U(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } =
|
|
1675
|
+
}, Nt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: h, onPickerOpenChange: _ }) => {
|
|
1676
|
+
let [v, y] = U(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = ct({
|
|
1695
1677
|
deployments: e,
|
|
1696
1678
|
selectedDeploymentId: t,
|
|
1697
1679
|
onDeploymentChange: n,
|
|
1698
1680
|
modelSelectorLabels: r
|
|
1699
1681
|
});
|
|
1700
1682
|
if (!e) return null;
|
|
1701
|
-
let E = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ G(
|
|
1683
|
+
let E = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ G(te, {
|
|
1702
1684
|
size: d.SM,
|
|
1703
1685
|
className: Y.modelSelectorCaret,
|
|
1704
1686
|
"aria-hidden": !0
|
|
@@ -1723,7 +1705,7 @@ var kt = {
|
|
|
1723
1705
|
onClose: () => y(!1),
|
|
1724
1706
|
style: c,
|
|
1725
1707
|
children: l(() => y(!1))
|
|
1726
|
-
}) : /* @__PURE__ */ G(
|
|
1708
|
+
}) : /* @__PURE__ */ G(Mt, {
|
|
1727
1709
|
isOpen: v,
|
|
1728
1710
|
title: r?.ariaLabel ?? "Select model",
|
|
1729
1711
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1779,8 +1761,8 @@ var kt = {
|
|
|
1779
1761
|
})
|
|
1780
1762
|
})
|
|
1781
1763
|
});
|
|
1782
|
-
},
|
|
1783
|
-
let
|
|
1764
|
+
}, Pt = 160, Ft = ({ 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: A, pendingDropFiles: j = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed: N, pasteTextThreshold: te = 4e3, maxMessageLength: P = 5e4, deployments: ie, selectedDeploymentId: F, onDeploymentChange: I, modelSelectorLabels: ae, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: L, isInputDisabled: R = !1, isModelSelectorDisabled: de = !1, isSendDisabled: fe = !1, isAudioMessageSupported: pe = !1, sendOnEnter: me = Fe.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: _e, chatSettings: ve, toolsMenuItems: ye, onToolToggle: be, toolsMenuTitle: Se, toolsBackLabel: Ce, toolsChipLabels: q, promptsMenuOverlay: we, promptsMenuTitle: De, promptsBackLabel: Oe, autoFocus: je = !1, messageHistory: Me, onDialFileSystemClick: Ne, dialFileSystemLabel: Ie, validateAttachment: Le, onAttachmentClick: Re, modelPickerOverlay: ze, maximumAttachmentsAmount: Be, onAttachmentsLimitExceeded: Ve, isAttachmentsEnabled: He = !0, usageLimitsSlot: Ue, onMessageTooLong: We }) => {
|
|
1765
|
+
let Ge = s(), [Ke, J] = U(!1), Je = ke(Me), Xe = V(() => a({
|
|
1784
1766
|
"--ci-bg": D?.background,
|
|
1785
1767
|
"--ci-text": D?.text,
|
|
1786
1768
|
"--ci-border": D?.border,
|
|
@@ -1793,128 +1775,134 @@ var kt = {
|
|
|
1793
1775
|
"--ci-voice-error": D?.voiceError,
|
|
1794
1776
|
"--ci-voice-waveform": D?.voiceWaveform,
|
|
1795
1777
|
"--ci-voice-accent": D?.voiceAccent
|
|
1796
|
-
}), [D]),
|
|
1778
|
+
}), [D]), Ze = V(() => Ne ? [{
|
|
1797
1779
|
key: "dial-fs",
|
|
1798
|
-
label:
|
|
1799
|
-
icon: /* @__PURE__ */ G(
|
|
1780
|
+
label: Ie ?? "DIAL file system",
|
|
1781
|
+
icon: /* @__PURE__ */ G(ne, {
|
|
1800
1782
|
size: c,
|
|
1801
1783
|
"aria-hidden": !0
|
|
1802
1784
|
}),
|
|
1803
|
-
onClick:
|
|
1804
|
-
}] : [], [
|
|
1785
|
+
onClick: Ne
|
|
1786
|
+
}] : [], [Ne, Ie]), { message: X, setMessage: Z, textareaRef: tt, isMultiLine: nt } = Ae({
|
|
1805
1787
|
messageProp: e,
|
|
1806
1788
|
messageRevision: t
|
|
1807
|
-
}), { attachments:
|
|
1808
|
-
initialAttachments:
|
|
1789
|
+
}), { attachments: rt, buildAttachments: it, addAttachments: at, resetAttachments: ot, handleRemove: st, handleRetry: ct, handleExpand: lt, hasBlockedAttachments: ut } = Te({
|
|
1790
|
+
initialAttachments: oe,
|
|
1809
1791
|
onUploadAttachment: r,
|
|
1810
1792
|
onAttachmentsChange: f,
|
|
1811
|
-
validateAttachment:
|
|
1793
|
+
validateAttachment: Le,
|
|
1812
1794
|
pendingDropFiles: j,
|
|
1813
1795
|
onDropFilesConsumed: ee,
|
|
1814
|
-
pendingAttachments:
|
|
1815
|
-
onPendingAttachmentsConsumed:
|
|
1796
|
+
pendingAttachments: M,
|
|
1797
|
+
onPendingAttachmentsConsumed: N,
|
|
1816
1798
|
onExpandPastedText: z((e) => {
|
|
1817
|
-
|
|
1818
|
-
}, [
|
|
1819
|
-
maximumAttachmentsAmount:
|
|
1820
|
-
baseAttachmentsAmount:
|
|
1821
|
-
onAttachmentsLimitExceeded:
|
|
1822
|
-
}), { state:
|
|
1823
|
-
it(
|
|
1824
|
-
}, [
|
|
1825
|
-
if (!
|
|
1799
|
+
Z((t) => t ? `${t}\n${e}` : e);
|
|
1800
|
+
}, [Z]),
|
|
1801
|
+
maximumAttachmentsAmount: Be,
|
|
1802
|
+
baseAttachmentsAmount: he.length,
|
|
1803
|
+
onAttachmentsLimitExceeded: Ve
|
|
1804
|
+
}), { state: dt, analyserNodeRef: ft, errorMessage: pt, startRecording: mt, stopRecording: ht, discardRecording: Q } = Pe({ onAttachAudio: z((e) => {
|
|
1805
|
+
at(it([e]));
|
|
1806
|
+
}, [at, it]) }), gt = H(null), _t = H(null), { handlePaste: vt } = xe(at, He ? te : Infinity), yt = z((e) => {
|
|
1807
|
+
if (!He) {
|
|
1826
1808
|
let t = e.clipboardData.getData("text/plain");
|
|
1827
|
-
t.length >=
|
|
1809
|
+
t.length >= P && We?.(t.length, P);
|
|
1828
1810
|
}
|
|
1829
|
-
|
|
1811
|
+
vt(e);
|
|
1830
1812
|
}, [
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
]),
|
|
1836
|
-
|
|
1837
|
-
|
|
1813
|
+
He,
|
|
1814
|
+
P,
|
|
1815
|
+
We,
|
|
1816
|
+
vt
|
|
1817
|
+
]), bt = X.trim().length > 0 || rt.length > 0, xt = bt && !ut && !fe, { shouldRender: St, isExiting: Ct, instanceKey: wt } = Ee(!l && bt, Pt), [Tt, Et] = U([]);
|
|
1818
|
+
B(() => {
|
|
1819
|
+
Et([]);
|
|
1820
|
+
}, [(ye ?? []).map((e) => e.id).join("|")]);
|
|
1821
|
+
let Dt = V(() => (ye ?? []).filter((e) => e.isSelected || !Tt.includes(e.id)), [ye, Tt]), Ot = z((e) => {
|
|
1822
|
+
Et((t) => t.includes(e) ? t : [...t, e]), ye?.find((t) => t.id === e)?.isSelected && be?.(e);
|
|
1823
|
+
}, [ye, be]), kt = Dt.length > 0 && be != null, $ = se || X.includes("\n") || nt || kt, At = ie === void 0 || F != null, jt = V(() => pe && !Ct && !l, [
|
|
1824
|
+
pe,
|
|
1825
|
+
Ct,
|
|
1838
1826
|
l
|
|
1839
|
-
]),
|
|
1840
|
-
if (
|
|
1841
|
-
if (!
|
|
1842
|
-
|
|
1827
|
+
]), Mt = async () => {
|
|
1828
|
+
if (fe) return;
|
|
1829
|
+
if (!He && X.length >= P) {
|
|
1830
|
+
We?.(X.length, P);
|
|
1843
1831
|
return;
|
|
1844
1832
|
}
|
|
1845
|
-
let e = X, t =
|
|
1846
|
-
|
|
1833
|
+
let e = X, t = rt;
|
|
1834
|
+
Z(""), Je.reset();
|
|
1847
1835
|
try {
|
|
1848
1836
|
await n?.(e, t), t.forEach((e) => {
|
|
1849
1837
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1850
|
-
}),
|
|
1838
|
+
}), ot([]);
|
|
1851
1839
|
} catch {
|
|
1852
|
-
|
|
1840
|
+
Z(e), ot(t);
|
|
1853
1841
|
}
|
|
1854
|
-
},
|
|
1842
|
+
}, Ft = (e) => {
|
|
1855
1843
|
if (!e.nativeEvent.isComposing && !R && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1856
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1844
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Je.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
|
|
1857
1845
|
if (n !== null) {
|
|
1858
|
-
e.preventDefault(),
|
|
1846
|
+
e.preventDefault(), Z(n);
|
|
1859
1847
|
return;
|
|
1860
1848
|
}
|
|
1861
1849
|
}
|
|
1862
|
-
e.key === "Enter" && (
|
|
1863
|
-
},
|
|
1850
|
+
e.key === "Enter" && (me === Fe.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && xt && At && !R && Mt());
|
|
1851
|
+
}, It = (e) => {
|
|
1864
1852
|
let t = Array.from(e.target.files ?? []);
|
|
1865
1853
|
if (t.length === 0) return;
|
|
1866
|
-
let n =
|
|
1867
|
-
e.target.value = "",
|
|
1854
|
+
let n = it(t);
|
|
1855
|
+
e.target.value = "", at(n);
|
|
1868
1856
|
};
|
|
1869
|
-
if (
|
|
1870
|
-
state:
|
|
1871
|
-
analyserNodeRef:
|
|
1872
|
-
errorMessage:
|
|
1873
|
-
onStop:
|
|
1874
|
-
onDiscard:
|
|
1857
|
+
if (dt !== "idle") return /* @__PURE__ */ G(Qe, {
|
|
1858
|
+
state: dt,
|
|
1859
|
+
analyserNodeRef: ft,
|
|
1860
|
+
errorMessage: pt,
|
|
1861
|
+
onStop: ht,
|
|
1862
|
+
onDiscard: Q,
|
|
1875
1863
|
stopLabel: T,
|
|
1876
1864
|
discardLabel: E,
|
|
1877
|
-
style:
|
|
1865
|
+
style: Xe,
|
|
1878
1866
|
className: A
|
|
1879
1867
|
});
|
|
1880
|
-
let
|
|
1868
|
+
let Lt = /* @__PURE__ */ G("textarea", {
|
|
1881
1869
|
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]"),
|
|
1882
|
-
ref:
|
|
1883
|
-
autoFocus:
|
|
1870
|
+
ref: tt,
|
|
1871
|
+
autoFocus: je,
|
|
1884
1872
|
value: X,
|
|
1885
1873
|
onChange: (e) => {
|
|
1886
|
-
|
|
1874
|
+
Z(e.target.value), Je.notifyChange(), u?.(e.target.value);
|
|
1887
1875
|
},
|
|
1888
|
-
onKeyDown:
|
|
1889
|
-
onPaste:
|
|
1876
|
+
onKeyDown: Ft,
|
|
1877
|
+
onPaste: yt,
|
|
1890
1878
|
placeholder: p,
|
|
1891
1879
|
"aria-label": m,
|
|
1892
1880
|
disabled: R,
|
|
1893
1881
|
rows: 1
|
|
1894
1882
|
});
|
|
1895
1883
|
return /* @__PURE__ */ K("div", {
|
|
1896
|
-
ref:
|
|
1897
|
-
style:
|
|
1898
|
-
className: o(Y.wrapper, R && 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",
|
|
1899
|
-
children: [(
|
|
1900
|
-
attachments: [...
|
|
1884
|
+
ref: _t,
|
|
1885
|
+
style: Xe,
|
|
1886
|
+
className: o(Y.wrapper, R && 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", rt.length > 6 ? "py-3 ps-3" : "p-3", A),
|
|
1887
|
+
children: [(he.length > 0 || rt.length > 0) && /* @__PURE__ */ G(ge, {
|
|
1888
|
+
attachments: [...he, ...rt],
|
|
1901
1889
|
onRemove: (e) => {
|
|
1902
|
-
|
|
1890
|
+
he.some((t) => t.id === e) ? _e?.(e) : st(e);
|
|
1903
1891
|
},
|
|
1904
|
-
onRetry:
|
|
1905
|
-
onExpand:
|
|
1892
|
+
onRetry: ct,
|
|
1893
|
+
onExpand: lt,
|
|
1906
1894
|
labels: {
|
|
1907
1895
|
removeLabel: b,
|
|
1908
1896
|
retryLabel: x
|
|
1909
1897
|
},
|
|
1910
|
-
onAttachmentClick:
|
|
1911
|
-
let t = [...
|
|
1912
|
-
t != null &&
|
|
1898
|
+
onAttachmentClick: Re == null ? void 0 : (e) => {
|
|
1899
|
+
let t = [...he, ...rt].find((t) => t.id === e);
|
|
1900
|
+
t != null && Re(t);
|
|
1913
1901
|
}
|
|
1914
|
-
}), ue ? $ &&
|
|
1902
|
+
}), ue ? $ && Lt : /* @__PURE__ */ K("div", {
|
|
1915
1903
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1916
1904
|
children: [
|
|
1917
|
-
!
|
|
1905
|
+
!ce && /* @__PURE__ */ K("div", {
|
|
1918
1906
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1919
1907
|
children: [/* @__PURE__ */ G("input", {
|
|
1920
1908
|
ref: gt,
|
|
@@ -1924,95 +1912,94 @@ var kt = {
|
|
|
1924
1912
|
className: "sr-only",
|
|
1925
1913
|
"aria-hidden": !0,
|
|
1926
1914
|
tabIndex: -1,
|
|
1927
|
-
onChange:
|
|
1915
|
+
onChange: It
|
|
1928
1916
|
}), /* @__PURE__ */ G(qe, {
|
|
1929
|
-
onAttachClick:
|
|
1917
|
+
onAttachClick: le ? void 0 : () => gt.current?.click(),
|
|
1930
1918
|
attachLabel: h,
|
|
1931
1919
|
addMenuTitle: _,
|
|
1932
1920
|
menuTitle: v,
|
|
1933
1921
|
menuCloseLabel: y,
|
|
1934
|
-
style:
|
|
1922
|
+
style: Xe,
|
|
1935
1923
|
isDisabled: R,
|
|
1936
|
-
chatSettings:
|
|
1937
|
-
extraMenuItems:
|
|
1938
|
-
toolsMenuItems:
|
|
1939
|
-
onToolToggle:
|
|
1940
|
-
toolsMenuTitle:
|
|
1941
|
-
toolsBackLabel:
|
|
1942
|
-
promptsMenuOverlay:
|
|
1943
|
-
promptsMenuTitle:
|
|
1944
|
-
promptsBackLabel:
|
|
1924
|
+
chatSettings: ve,
|
|
1925
|
+
extraMenuItems: Ze,
|
|
1926
|
+
toolsMenuItems: ye,
|
|
1927
|
+
onToolToggle: be,
|
|
1928
|
+
toolsMenuTitle: Se,
|
|
1929
|
+
toolsBackLabel: Ce,
|
|
1930
|
+
promptsMenuOverlay: we,
|
|
1931
|
+
promptsMenuTitle: De,
|
|
1932
|
+
promptsBackLabel: Oe
|
|
1945
1933
|
})]
|
|
1946
1934
|
}),
|
|
1947
|
-
$ &&
|
|
1935
|
+
$ && Dt.length > 0 && be != null && /* @__PURE__ */ G("div", {
|
|
1948
1936
|
className: "order-3 min-w-0 flex-1",
|
|
1949
|
-
children: /* @__PURE__ */ G(
|
|
1950
|
-
items:
|
|
1951
|
-
onToolToggle:
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
removeLabel: Ce?.removeLabel
|
|
1937
|
+
children: /* @__PURE__ */ G(Ye, {
|
|
1938
|
+
items: Dt,
|
|
1939
|
+
onToolToggle: be,
|
|
1940
|
+
onToolDismiss: Ot,
|
|
1941
|
+
removeLabel: q?.removeLabel
|
|
1955
1942
|
})
|
|
1956
1943
|
}),
|
|
1957
1944
|
/* @__PURE__ */ G("div", {
|
|
1958
1945
|
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1959
|
-
children:
|
|
1946
|
+
children: Lt
|
|
1960
1947
|
}),
|
|
1961
1948
|
/* @__PURE__ */ K("div", {
|
|
1962
|
-
className: o("flex flex-shrink-0 items-center gap-2", $ &&
|
|
1949
|
+
className: o("flex flex-shrink-0 items-center gap-2", $ && kt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1963
1950
|
children: [L ? L({
|
|
1964
|
-
canSend:
|
|
1965
|
-
onSend:
|
|
1951
|
+
canSend: xt,
|
|
1952
|
+
onSend: Mt
|
|
1966
1953
|
}) : /* @__PURE__ */ K(W, { children: [
|
|
1967
|
-
|
|
1968
|
-
/* @__PURE__ */ G(
|
|
1969
|
-
deployments:
|
|
1970
|
-
selectedDeploymentId:
|
|
1971
|
-
onDeploymentChange:
|
|
1972
|
-
modelSelectorLabels:
|
|
1954
|
+
Ue,
|
|
1955
|
+
/* @__PURE__ */ G(Nt, {
|
|
1956
|
+
deployments: ie,
|
|
1957
|
+
selectedDeploymentId: F,
|
|
1958
|
+
onDeploymentChange: I,
|
|
1959
|
+
modelSelectorLabels: ae,
|
|
1973
1960
|
isStreaming: l,
|
|
1974
|
-
isMobile:
|
|
1975
|
-
isDisabled:
|
|
1976
|
-
style:
|
|
1977
|
-
modelPickerOverlay:
|
|
1978
|
-
isPickerOpen:
|
|
1979
|
-
onPickerToggle: () =>
|
|
1980
|
-
onPickerOpenChange:
|
|
1961
|
+
isMobile: Ge,
|
|
1962
|
+
isDisabled: de,
|
|
1963
|
+
style: Xe,
|
|
1964
|
+
modelPickerOverlay: ze,
|
|
1965
|
+
isPickerOpen: Ke,
|
|
1966
|
+
onPickerToggle: () => J((e) => !e),
|
|
1967
|
+
onPickerOpenChange: J
|
|
1981
1968
|
}),
|
|
1982
|
-
l && i ? /* @__PURE__ */ G(
|
|
1969
|
+
l && i ? /* @__PURE__ */ G(et, {
|
|
1983
1970
|
onStop: i,
|
|
1984
1971
|
ariaLabel: C
|
|
1985
|
-
}) : !l &&
|
|
1986
|
-
onSend:
|
|
1987
|
-
isDisabled: !
|
|
1972
|
+
}) : !l && St && /* @__PURE__ */ G($e, {
|
|
1973
|
+
onSend: Mt,
|
|
1974
|
+
isDisabled: !At || ut || fe,
|
|
1988
1975
|
ariaLabel: S,
|
|
1989
|
-
isExiting:
|
|
1990
|
-
},
|
|
1991
|
-
] }),
|
|
1992
|
-
icon: /* @__PURE__ */ G(
|
|
1976
|
+
isExiting: Ct
|
|
1977
|
+
}, wt)
|
|
1978
|
+
] }), jt && /* @__PURE__ */ G(k, {
|
|
1979
|
+
icon: /* @__PURE__ */ G(re, {
|
|
1993
1980
|
size: d.LG,
|
|
1994
1981
|
"aria-hidden": !0
|
|
1995
1982
|
}),
|
|
1996
1983
|
"aria-label": w,
|
|
1997
1984
|
className: "size-8 flex-shrink-0",
|
|
1998
|
-
onClick:
|
|
1985
|
+
onClick: mt,
|
|
1999
1986
|
disabled: R || l
|
|
2000
1987
|
})]
|
|
2001
1988
|
})
|
|
2002
1989
|
]
|
|
2003
1990
|
})]
|
|
2004
1991
|
});
|
|
2005
|
-
},
|
|
1992
|
+
}, It = { welcome: "_welcome_n2ph8_1" }, Lt = ({ 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 }) => {
|
|
2006
1993
|
let { colors: u, typography: d } = r ?? {};
|
|
2007
1994
|
return /* @__PURE__ */ K("div", {
|
|
2008
1995
|
style: a({ "--ci-welcome-color": u?.welcomeText }),
|
|
2009
1996
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
2010
1997
|
children: [n && /* @__PURE__ */ G("h1", {
|
|
2011
|
-
className: o(
|
|
1998
|
+
className: o(It.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
|
|
2012
1999
|
children: n
|
|
2013
2000
|
}), /* @__PURE__ */ G("div", {
|
|
2014
2001
|
className: "relative w-full max-w-[748px]",
|
|
2015
|
-
children: /* @__PURE__ */ G(
|
|
2002
|
+
children: /* @__PURE__ */ G(Ft, {
|
|
2016
2003
|
placeholder: t,
|
|
2017
2004
|
isStreaming: e,
|
|
2018
2005
|
isInputDisabled: c,
|
|
@@ -2023,30 +2010,30 @@ var kt = {
|
|
|
2023
2010
|
})
|
|
2024
2011
|
})]
|
|
2025
2012
|
});
|
|
2026
|
-
},
|
|
2027
|
-
let
|
|
2013
|
+
}, Rt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: y, onDropFilesConsumed: b, validateAttachment: S, isAttachmentsEnabled: C, hideAttachFile: w = !1, fileAccept: T, maximumAttachmentsAmount: E, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, maxMessageLength: N = 5e4, onMessageTooLong: te }) => {
|
|
2014
|
+
let P = H(null), [re, ie] = U([]);
|
|
2028
2015
|
B(() => {
|
|
2029
|
-
y?.length && (
|
|
2016
|
+
y?.length && (ie(y), b?.());
|
|
2030
2017
|
}, [y, b]);
|
|
2031
|
-
let [
|
|
2032
|
-
|
|
2018
|
+
let [F, I] = U(e ?? ""), [ae, oe] = U([]), [se, ce] = U(t), le = ae.some((e) => e.status === r.Loading || e.status === r.Error), ue = (F.trim().length > 0 || ae.length > 0 || se.length > 0) && !le, L = (e) => {
|
|
2019
|
+
ce((t) => t.filter((t) => t.id !== e));
|
|
2033
2020
|
}, R = z((e, t) => {
|
|
2034
|
-
i(e,
|
|
2035
|
-
}, [
|
|
2021
|
+
i(e, se, t);
|
|
2022
|
+
}, [se, i]), de = () => {
|
|
2036
2023
|
if (ue) {
|
|
2037
|
-
if (!C &&
|
|
2038
|
-
|
|
2024
|
+
if (!C && F.length >= N) {
|
|
2025
|
+
te?.(F.length, N);
|
|
2039
2026
|
return;
|
|
2040
2027
|
}
|
|
2041
|
-
R(
|
|
2028
|
+
R(F, ae);
|
|
2042
2029
|
}
|
|
2043
|
-
}, fe = z(() =>
|
|
2030
|
+
}, fe = z(() => ie([]), []), pe = z((e) => {
|
|
2044
2031
|
let t = Array.from(e.target.files ?? []);
|
|
2045
|
-
t.length !== 0 && (e.target.value = "",
|
|
2032
|
+
t.length !== 0 && (e.target.value = "", ie(t));
|
|
2046
2033
|
}, []), me = V(() => O ? [{
|
|
2047
2034
|
key: "dial-fs",
|
|
2048
2035
|
label: k ?? "DIAL file system",
|
|
2049
|
-
icon: /* @__PURE__ */ G(
|
|
2036
|
+
icon: /* @__PURE__ */ G(ne, {
|
|
2050
2037
|
size: c,
|
|
2051
2038
|
"aria-hidden": !0
|
|
2052
2039
|
}),
|
|
@@ -2054,21 +2041,21 @@ var kt = {
|
|
|
2054
2041
|
}] : [], [O, k]);
|
|
2055
2042
|
return /* @__PURE__ */ K("div", {
|
|
2056
2043
|
className: o("flex w-full flex-col gap-2", _),
|
|
2057
|
-
children: [/* @__PURE__ */ G(
|
|
2044
|
+
children: [/* @__PURE__ */ G(Ft, {
|
|
2058
2045
|
message: e,
|
|
2059
2046
|
ariaLabel: u,
|
|
2060
2047
|
isStacked: !0,
|
|
2061
2048
|
hideActionBar: !0,
|
|
2062
|
-
pendingDropFiles:
|
|
2049
|
+
pendingDropFiles: re,
|
|
2063
2050
|
onDropFilesConsumed: fe,
|
|
2064
2051
|
onSend: R,
|
|
2065
2052
|
onUploadAttachment: a,
|
|
2066
|
-
onChange:
|
|
2067
|
-
onAttachmentsChange:
|
|
2053
|
+
onChange: I,
|
|
2054
|
+
onAttachmentsChange: oe,
|
|
2068
2055
|
removeLabel: d,
|
|
2069
2056
|
retryLabel: f,
|
|
2070
2057
|
className: "max-w-full",
|
|
2071
|
-
prefixAttachments:
|
|
2058
|
+
prefixAttachments: se,
|
|
2072
2059
|
onRemovePrefixAttachment: L,
|
|
2073
2060
|
validateAttachment: S,
|
|
2074
2061
|
isAttachmentsEnabled: C,
|
|
@@ -2077,15 +2064,15 @@ var kt = {
|
|
|
2077
2064
|
pendingAttachments: A,
|
|
2078
2065
|
onPendingAttachmentsConsumed: j,
|
|
2079
2066
|
onAttachmentClick: ee,
|
|
2080
|
-
pasteTextThreshold:
|
|
2081
|
-
maxMessageLength:
|
|
2082
|
-
onMessageTooLong:
|
|
2067
|
+
pasteTextThreshold: M,
|
|
2068
|
+
maxMessageLength: N,
|
|
2069
|
+
onMessageTooLong: te
|
|
2083
2070
|
}), /* @__PURE__ */ K("div", {
|
|
2084
2071
|
className: "flex items-center justify-between",
|
|
2085
2072
|
children: [/* @__PURE__ */ G("div", {
|
|
2086
2073
|
className: "flex",
|
|
2087
2074
|
children: !w && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("input", {
|
|
2088
|
-
ref:
|
|
2075
|
+
ref: P,
|
|
2089
2076
|
type: "file",
|
|
2090
2077
|
multiple: !0,
|
|
2091
2078
|
accept: T,
|
|
@@ -2094,7 +2081,7 @@ var kt = {
|
|
|
2094
2081
|
tabIndex: -1,
|
|
2095
2082
|
onChange: pe
|
|
2096
2083
|
}), /* @__PURE__ */ G(qe, {
|
|
2097
|
-
onAttachClick: () =>
|
|
2084
|
+
onAttachClick: () => P.current?.click(),
|
|
2098
2085
|
attachLabel: m,
|
|
2099
2086
|
addMenuTitle: p,
|
|
2100
2087
|
menuTitle: h,
|
|
@@ -2116,4 +2103,4 @@ var kt = {
|
|
|
2116
2103
|
});
|
|
2117
2104
|
};
|
|
2118
2105
|
//#endregion
|
|
2119
|
-
export { pe as AttachmentCard, me as AttachmentGroup, he as AttachmentTray, q as BottomSheetShell, Ue as ChatSettingsModal,
|
|
2106
|
+
export { pe as AttachmentCard, me as AttachmentGroup, he as AttachmentTray, q as BottomSheetShell, Ue as ChatSettingsModal, Lt as ConversationInput, Rt as EditMessageInput, _e as FileDndOverlay, Ft as Input, Fe as SendOnEnter, be as getAttachmentIcon };
|