@epam/ai-dial-conversation-messages 1.1.0-dev.29 → 1.1.0-dev.293
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/MessageActions/MessageActions.d.ts.map +1 -1
- package/components/MessageBubble/AssistantMessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/StatusMessageBubble.d.ts +1 -5
- package/components/MessageBubble/StatusMessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/UserMessageBubble.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js +499 -609
- package/models/message-actions.d.ts +29 -22
- package/models/message-actions.d.ts.map +1 -1
- package/models/message-bubble.d.ts +44 -70
- package/models/message-bubble.d.ts.map +1 -1
- package/models/message-source.d.ts +8 -8
- package/models/message-source.d.ts.map +1 -1
- package/package.json +5 -5
- package/types/bubble-position.d.ts +3 -3
- package/types/bubble-position.d.ts.map +1 -1
- package/components/MessageSource/MessageSource.d.ts +0 -5
- package/components/MessageSource/MessageSource.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,67 +1,66 @@
|
|
|
1
|
-
import { AttachmentErrorReason as e, AttachmentType as t,
|
|
2
|
-
import { DIAL_ICON_SIZE as p,
|
|
3
|
-
import {
|
|
1
|
+
import { AttachmentErrorReason as e, AttachmentType as t, CopyIconButton as n, DeploymentIcon as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { DIAL_ICON_SIZE as p, ElementSize as m, GhostIconButton as h, Highlight as g, InfoMessageNotification as _, LinkButton as v, NeutralButton as y, Popup as b, PopupSize as x, PrimaryButton as S, RadioGroup as C, RadioGroupOrientation as w, Skeleton as T, SkeletonVariant as E, Slider as D, Spinner as O, StaticIconButton as k, Textarea as A, ToggleIconButton as j, Tooltip as M } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconChevronDown as N, IconChevronUp as P, IconClipboard as F, IconDownload as I, IconExternalLink as L, IconFile as R, IconFileTypeBmp as z, IconFileTypeCss as B, IconFileTypeCsv as V, IconFileTypeDoc as H, IconFileTypeDocx as ee, IconFileTypeHtml as te, IconFileTypeJpg as ne, IconFileTypeJs as U, IconFileTypeJsx as W, IconFileTypePdf as re, IconFileTypePhp as ie, IconFileTypePng as ae, IconFileTypePpt as oe, IconFileTypeRs as se, IconFileTypeSql as ce, IconFileTypeSvg as le, IconFileTypeTs as ue, IconFileTypeTsx as de, IconFileTypeTxt as fe, IconFileTypeVue as pe, IconFileTypeXls as me, IconFileTypeXml as he, IconFileTypeZip as ge, IconMarkdown as _e, IconMusic as ve, IconPaperclip as ye, IconPencilMinus as be, IconPhoto as G, IconRefresh as xe, IconReload as Se, IconTerminal2 as Ce, IconThumbDown as we, IconThumbDownFilled as Te, IconThumbUp as Ee, IconThumbUpFilled as De, IconTrashX as Oe, IconVideo as ke, IconX as Ae } from "@tabler/icons-react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
import { memo as je, useCallback as
|
|
6
|
-
import { Fragment as
|
|
5
|
+
import { memo as je, useCallback as K, useEffect as Me, useId as Ne, useMemo as Pe, useRef as Fe, useState as q } from "react";
|
|
6
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
7
7
|
//#region ../attachment-input/dist/index.js
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
}({}), Ie = (e) => {
|
|
8
|
+
var Ie = (e) => {
|
|
9
|
+
if (e == null) return "";
|
|
11
10
|
let t = e.lastIndexOf(".");
|
|
12
11
|
return t > 0 ? e.slice(0, t) : e;
|
|
13
12
|
}, Le = (e) => {
|
|
14
|
-
if (!e) return
|
|
13
|
+
if (!e) return R;
|
|
15
14
|
if (e.startsWith("image/")) switch (e) {
|
|
16
15
|
case "image/jpeg":
|
|
17
16
|
case "image/jpg": return ne;
|
|
18
|
-
case "image/png": return
|
|
19
|
-
case "image/svg+xml": return
|
|
20
|
-
case "image/bmp": return
|
|
21
|
-
default: return
|
|
17
|
+
case "image/png": return ae;
|
|
18
|
+
case "image/svg+xml": return le;
|
|
19
|
+
case "image/bmp": return z;
|
|
20
|
+
default: return G;
|
|
22
21
|
}
|
|
23
22
|
if (e.startsWith("video/")) return ke;
|
|
24
|
-
if (e.startsWith("audio/")) return
|
|
23
|
+
if (e.startsWith("audio/")) return ve;
|
|
25
24
|
switch (e) {
|
|
26
|
-
case "application/pdf": return
|
|
25
|
+
case "application/pdf": return re;
|
|
27
26
|
case "application/msword":
|
|
28
|
-
case "application/vnd.ms-word": return
|
|
27
|
+
case "application/vnd.ms-word": return H;
|
|
29
28
|
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return ee;
|
|
30
|
-
case "application/vnd.ms-powerpoint": return
|
|
31
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return
|
|
32
|
-
case "application/vnd.ms-excel": return
|
|
33
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
29
|
+
case "application/vnd.ms-powerpoint": return oe;
|
|
30
|
+
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return oe;
|
|
31
|
+
case "application/vnd.ms-excel": return me;
|
|
32
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return me;
|
|
34
33
|
case "application/zip":
|
|
35
34
|
case "application/x-zip-compressed":
|
|
36
35
|
case "application/x-rar-compressed":
|
|
37
36
|
case "application/x-7z-compressed":
|
|
38
37
|
case "application/gzip":
|
|
39
|
-
case "application/x-tar": return
|
|
40
|
-
case "text/csv": return
|
|
41
|
-
case "text/plain": return
|
|
38
|
+
case "application/x-tar": return ge;
|
|
39
|
+
case "text/csv": return V;
|
|
40
|
+
case "text/plain": return fe;
|
|
42
41
|
case "text/html":
|
|
43
42
|
case "application/xhtml+xml": return te;
|
|
44
43
|
case "text/xml":
|
|
45
|
-
case "application/xml": return
|
|
44
|
+
case "application/xml": return he;
|
|
46
45
|
case "application/sql":
|
|
47
|
-
case "text/x-sql": return
|
|
46
|
+
case "text/x-sql": return ce;
|
|
48
47
|
case "text/javascript":
|
|
49
|
-
case "application/javascript": return
|
|
50
|
-
case "text/jsx": return
|
|
48
|
+
case "application/javascript": return U;
|
|
49
|
+
case "text/jsx": return W;
|
|
51
50
|
case "application/typescript":
|
|
52
|
-
case "text/typescript": return
|
|
53
|
-
case "text/tsx": return
|
|
54
|
-
case "text/css": return
|
|
51
|
+
case "text/typescript": return ue;
|
|
52
|
+
case "text/tsx": return de;
|
|
53
|
+
case "text/css": return B;
|
|
55
54
|
case "text/x-php":
|
|
56
|
-
case "application/x-php": return
|
|
55
|
+
case "application/x-php": return ie;
|
|
57
56
|
case "text/x-rustsrc":
|
|
58
|
-
case "application/x-rust": return
|
|
59
|
-
case "text/x-vue": return
|
|
60
|
-
default: return
|
|
57
|
+
case "application/x-rust": return se;
|
|
58
|
+
case "text/x-vue": return pe;
|
|
59
|
+
default: return R;
|
|
61
60
|
}
|
|
62
61
|
}, Re = (e) => {
|
|
63
62
|
let { type: n, contentType: r } = e;
|
|
64
|
-
return n === t.Prompt ?
|
|
63
|
+
return n === t.Prompt ? Ce : n === t.Pasted ? F : n === t.Image ? G : Le(r ?? "");
|
|
65
64
|
}, ze = (e) => {
|
|
66
65
|
let t = e.toLowerCase().split(";")[0].trim(), n = a[t];
|
|
67
66
|
if (n) return n;
|
|
@@ -76,208 +75,158 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
76
75
|
let e = ze(a);
|
|
77
76
|
if (e) return `.${e}`;
|
|
78
77
|
}
|
|
78
|
+
if (i == null) return "";
|
|
79
79
|
let o = i.lastIndexOf(".");
|
|
80
80
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
81
81
|
}, Ve = (e, n = {}) => {
|
|
82
|
-
let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.
|
|
82
|
+
let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Link && !l;
|
|
83
83
|
return {
|
|
84
84
|
isLoading: s,
|
|
85
85
|
isError: l,
|
|
86
86
|
isImage: u,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
typeLabel: f ? null : Be(e, n)
|
|
87
|
+
isLink: d,
|
|
88
|
+
BottomIcon: d ? null : Re(e),
|
|
89
|
+
typeLabel: d ? null : Be(e, n)
|
|
91
90
|
};
|
|
92
|
-
}, He =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, X = {
|
|
105
|
-
tile: "_tile_3x6ks_1",
|
|
106
|
-
tileLight: "_tileLight_3x6ks_12",
|
|
107
|
-
tileError: "_tileError_3x6ks_16",
|
|
108
|
-
nameText: "_nameText_3x6ks_23",
|
|
109
|
-
typeText: "_typeText_3x6ks_24",
|
|
110
|
-
retryIcon: "_retryIcon_3x6ks_36",
|
|
111
|
-
hoverIcon: "_hoverIcon_3x6ks_40",
|
|
112
|
-
track: "_track_3x6ks_48",
|
|
113
|
-
indeterminateFill: "_indeterminateFill_3x6ks_52",
|
|
114
|
-
"attachment-tile-indeterminate": "_attachment-tile-indeterminate_3x6ks_1"
|
|
115
|
-
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(m, {
|
|
91
|
+
}, He = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
|
|
92
|
+
tile: "_tile_1whwz_1",
|
|
93
|
+
hovered: "_hovered_1whwz_5",
|
|
94
|
+
selected: "_selected_1whwz_15",
|
|
95
|
+
tileError: "_tileError_1whwz_20",
|
|
96
|
+
nameText: "_nameText_1whwz_25",
|
|
97
|
+
typeText: "_typeText_1whwz_29",
|
|
98
|
+
retryIcon: "_retryIcon_1whwz_33",
|
|
99
|
+
track: "_track_1whwz_37",
|
|
100
|
+
actionButton: "_actionButton_1whwz_43",
|
|
101
|
+
imageActionButton: "_imageActionButton_1whwz_47"
|
|
102
|
+
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(k, {
|
|
116
103
|
icon: a,
|
|
117
|
-
size:
|
|
118
|
-
className: d("absolute end-1 top-1
|
|
104
|
+
size: m.Small,
|
|
105
|
+
className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o),
|
|
119
106
|
"aria-label": e,
|
|
120
107
|
"aria-describedby": t ? n : void 0,
|
|
121
108
|
onClick: (e) => {
|
|
122
109
|
e.stopPropagation(), r(i);
|
|
123
110
|
}
|
|
124
|
-
}), Ue = ({ ...e }) => /* @__PURE__ */
|
|
125
|
-
icon: /* @__PURE__ */
|
|
111
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
112
|
+
icon: /* @__PURE__ */ Y(Se, {
|
|
126
113
|
size: p.SM,
|
|
127
114
|
"aria-hidden": !0
|
|
128
115
|
}),
|
|
129
|
-
className:
|
|
116
|
+
className: Z.retryIcon,
|
|
130
117
|
...e
|
|
131
|
-
}), We = ({ ...e }) => /* @__PURE__ */
|
|
132
|
-
icon: /* @__PURE__ */
|
|
118
|
+
}), We = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
119
|
+
icon: /* @__PURE__ */ Y(I, {
|
|
133
120
|
size: p.SM,
|
|
134
121
|
"aria-hidden": !0
|
|
135
122
|
}),
|
|
136
123
|
...e
|
|
137
|
-
}), Ge = ({ ...e }) => /* @__PURE__ */
|
|
138
|
-
icon: /* @__PURE__ */
|
|
124
|
+
}), Ge = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
125
|
+
icon: /* @__PURE__ */ Y(L, {
|
|
139
126
|
size: p.SM,
|
|
140
127
|
"aria-hidden": !0
|
|
141
128
|
}),
|
|
142
129
|
...e
|
|
143
|
-
}), Ke = ({ ...e }) => /* @__PURE__ */
|
|
144
|
-
icon: /* @__PURE__ */
|
|
130
|
+
}), Ke = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
131
|
+
icon: /* @__PURE__ */ Y(Ae, {
|
|
145
132
|
size: p.SM,
|
|
146
133
|
"aria-hidden": !0
|
|
147
134
|
}),
|
|
148
|
-
className: X.hoverIcon,
|
|
149
135
|
...e
|
|
150
|
-
}), qe =
|
|
151
|
-
let { clickLabel: l = "Open attachment", downloadLabel: u = "Download attachment", removeLabel: f = "Remove attachment" } = o ?? {}, { typography: p, className: m } = s ?? {}, h = () => {
|
|
152
|
-
n?.(e.id);
|
|
153
|
-
};
|
|
154
|
-
return /* @__PURE__ */ J("div", {
|
|
155
|
-
style: c,
|
|
156
|
-
...n == null ? {} : {
|
|
157
|
-
role: "button",
|
|
158
|
-
tabIndex: 0,
|
|
159
|
-
"aria-label": l,
|
|
160
|
-
onClick: h,
|
|
161
|
-
onKeyDown: (e) => {
|
|
162
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
className: d("group relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (i || a) && "pe-8", m),
|
|
166
|
-
children: [
|
|
167
|
-
/* @__PURE__ */ q("span", {
|
|
168
|
-
title: e.name,
|
|
169
|
-
className: d(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
|
|
170
|
-
children: t ? /* @__PURE__ */ q(r, {
|
|
171
|
-
text: e.name,
|
|
172
|
-
query: t,
|
|
173
|
-
maxLines: 1
|
|
174
|
-
}) : e.name
|
|
175
|
-
}),
|
|
176
|
-
e.playUrl && /* @__PURE__ */ q("audio", {
|
|
177
|
-
controls: !0,
|
|
178
|
-
src: e.playUrl,
|
|
179
|
-
"aria-label": e.name,
|
|
180
|
-
className: "w-full",
|
|
181
|
-
preload: "metadata",
|
|
182
|
-
onClick: (e) => e.stopPropagation()
|
|
183
|
-
}),
|
|
184
|
-
i && /* @__PURE__ */ q(We, {
|
|
185
|
-
ariaLabel: u,
|
|
186
|
-
onClick: i,
|
|
187
|
-
id: e.id
|
|
188
|
-
}),
|
|
189
|
-
a && /* @__PURE__ */ q(Ke, {
|
|
190
|
-
ariaLabel: f,
|
|
191
|
-
onClick: a,
|
|
192
|
-
id: e.id
|
|
193
|
-
})
|
|
194
|
-
]
|
|
195
|
-
});
|
|
196
|
-
}, Je = {
|
|
136
|
+
}), qe = {
|
|
197
137
|
[e.Network]: "Upload failed · network error",
|
|
198
138
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
199
|
-
},
|
|
200
|
-
let { clickLabel:
|
|
201
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
202
|
-
},
|
|
139
|
+
}, Je = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: _ }) => {
|
|
140
|
+
let { clickLabel: v = "Download attachment", retryLabel: y = "Retry upload", sizeLabel: b, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: k, errorReason: A } = t, j = k === c.Loading, M = k === c.Error, N = Ne(), P = M ? A && (S?.[A] ?? qe[A]) || C : "", { BottomIcon: F, typeLabel: I } = Ve(t), L = !M && !j && s && !u, R = M && !!i && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
|
|
141
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
142
|
+
}, V = Pe(() => l ? D : Ie(D), [l, D]), H = K(() => {
|
|
203
143
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
204
|
-
}, [t]),
|
|
205
|
-
title:
|
|
206
|
-
className: d(
|
|
207
|
-
children:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
144
|
+
}, [t]), ee = d(He, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !M && Z.hovered, _ && Z.selected, M && Z.tileError), te = /* @__PURE__ */ Y("div", {
|
|
145
|
+
title: V,
|
|
146
|
+
className: d(w?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
|
|
147
|
+
children: n ? /* @__PURE__ */ Y(g, {
|
|
148
|
+
text: V,
|
|
149
|
+
query: n,
|
|
150
|
+
maxLines: 2
|
|
151
|
+
}) : V
|
|
152
|
+
}), ne = F && /* @__PURE__ */ X("div", {
|
|
153
|
+
className: d("flex w-full items-center gap-1", M && z),
|
|
154
|
+
children: [/* @__PURE__ */ Y(F, {
|
|
211
155
|
size: 16,
|
|
212
|
-
className:
|
|
156
|
+
className: Z.typeText,
|
|
213
157
|
"aria-hidden": !0
|
|
214
|
-
}), /* @__PURE__ */
|
|
215
|
-
className: d(
|
|
216
|
-
children:
|
|
158
|
+
}), /* @__PURE__ */ Y("span", {
|
|
159
|
+
className: d(w?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
|
|
160
|
+
children: b ? `${I} · ${b}` : I
|
|
217
161
|
})]
|
|
218
|
-
}),
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
"aria-label":
|
|
225
|
-
className: d("absolute
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
-
}),
|
|
228
|
-
P && /* @__PURE__ */ q(We, {
|
|
229
|
-
ariaLabel: h,
|
|
230
|
-
errorTitle: j,
|
|
231
|
-
errorDescId: A,
|
|
232
|
-
onClick: o,
|
|
233
|
-
id: w
|
|
234
|
-
}),
|
|
235
|
-
F && /* @__PURE__ */ q(Ue, {
|
|
236
|
-
ariaLabel: g,
|
|
237
|
-
errorTitle: j,
|
|
238
|
-
errorDescId: A,
|
|
239
|
-
onClick: r,
|
|
240
|
-
id: w
|
|
162
|
+
}), U = () => {
|
|
163
|
+
m && p ? p(E) : r && r(E);
|
|
164
|
+
}, W = /* @__PURE__ */ X(J, { children: [
|
|
165
|
+
te,
|
|
166
|
+
ne,
|
|
167
|
+
j && /* @__PURE__ */ Y("div", {
|
|
168
|
+
"aria-label": x,
|
|
169
|
+
className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
170
|
+
children: /* @__PURE__ */ Y(O, { size: 32 })
|
|
241
171
|
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
172
|
+
/* @__PURE__ */ X("div", {
|
|
173
|
+
className: d("absolute right-0 top-0 flex gap-1"),
|
|
174
|
+
children: [
|
|
175
|
+
L && /* @__PURE__ */ Y(We, {
|
|
176
|
+
ariaLabel: v,
|
|
177
|
+
errorTitle: P,
|
|
178
|
+
errorDescId: N,
|
|
179
|
+
onClick: s,
|
|
180
|
+
id: E
|
|
181
|
+
}),
|
|
182
|
+
R && /* @__PURE__ */ Y(Ue, {
|
|
183
|
+
ariaLabel: y,
|
|
184
|
+
errorTitle: P,
|
|
185
|
+
errorDescId: N,
|
|
186
|
+
onClick: i,
|
|
187
|
+
id: E
|
|
188
|
+
}),
|
|
189
|
+
u && /* @__PURE__ */ Y(Ge, {
|
|
190
|
+
ariaLabel: y,
|
|
191
|
+
errorTitle: P,
|
|
192
|
+
errorDescId: N,
|
|
193
|
+
onClick: H
|
|
194
|
+
}),
|
|
195
|
+
h && /* @__PURE__ */ Y(Ke, {
|
|
196
|
+
ariaLabel: y,
|
|
197
|
+
errorTitle: P,
|
|
198
|
+
errorDescId: N,
|
|
199
|
+
onClick: h,
|
|
200
|
+
id: E
|
|
201
|
+
})
|
|
202
|
+
]
|
|
254
203
|
}),
|
|
255
|
-
|
|
256
|
-
id:
|
|
204
|
+
M && /* @__PURE__ */ Y("span", {
|
|
205
|
+
id: N,
|
|
257
206
|
role: "status",
|
|
258
207
|
"aria-live": "polite",
|
|
259
208
|
className: "sr-only",
|
|
260
|
-
children:
|
|
209
|
+
children: P
|
|
261
210
|
})
|
|
262
211
|
] });
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
style:
|
|
265
|
-
className: d("inline-flex",
|
|
266
|
-
children: /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ Y("div", {
|
|
213
|
+
style: f,
|
|
214
|
+
className: d("inline-flex", T),
|
|
215
|
+
children: /* @__PURE__ */ Y("div", {
|
|
267
216
|
role: "button",
|
|
268
217
|
tabIndex: 0,
|
|
269
|
-
"aria-label":
|
|
270
|
-
onClick:
|
|
271
|
-
onKeyDown:
|
|
272
|
-
style:
|
|
273
|
-
className: d(
|
|
274
|
-
children:
|
|
218
|
+
"aria-label": v,
|
|
219
|
+
onClick: U,
|
|
220
|
+
onKeyDown: B,
|
|
221
|
+
style: f,
|
|
222
|
+
className: d(ee, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
223
|
+
children: W
|
|
275
224
|
})
|
|
276
225
|
});
|
|
277
|
-
},
|
|
226
|
+
}, Ye = /* @__PURE__ */ function(e) {
|
|
278
227
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
279
|
-
}({}),
|
|
280
|
-
let n =
|
|
228
|
+
}({}), Xe = ({ enabled: e, src: t }) => {
|
|
229
|
+
let n = Fe(null), [r, i] = q("idle");
|
|
281
230
|
return Me(() => {
|
|
282
231
|
i(e && t ? "loading" : "idle");
|
|
283
232
|
}, [e, t]), Me(() => {
|
|
@@ -291,15 +240,15 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
291
240
|
imageRef: n,
|
|
292
241
|
imageLoadStatus: r
|
|
293
242
|
};
|
|
294
|
-
},
|
|
295
|
-
let { clickLabel:
|
|
243
|
+
}, Ze = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
|
|
244
|
+
let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = Pe(() => Ve(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = Xe({
|
|
296
245
|
enabled: x,
|
|
297
246
|
src: _
|
|
298
247
|
}), D = () => {
|
|
299
|
-
v && n ? n(h) :
|
|
248
|
+
v && n ? n(h) : S && r && r(h);
|
|
300
249
|
};
|
|
301
|
-
return /* @__PURE__ */
|
|
302
|
-
className: d(
|
|
250
|
+
return /* @__PURE__ */ Y("div", {
|
|
251
|
+
className: d(He, "group/attachment-tile", S && "cursor-pointer", Z.tile, l && Z.selected, m),
|
|
303
252
|
onClick: D,
|
|
304
253
|
onKeyDown: (e) => {
|
|
305
254
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
@@ -307,223 +256,152 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
307
256
|
tabIndex: 0,
|
|
308
257
|
role: "button",
|
|
309
258
|
style: o,
|
|
310
|
-
"aria-label":
|
|
311
|
-
children: /* @__PURE__ */
|
|
259
|
+
"aria-label": S ? u : v ? f : void 0,
|
|
260
|
+
children: /* @__PURE__ */ X("div", {
|
|
312
261
|
className: "relative h-full w-full overflow-hidden",
|
|
313
262
|
children: [
|
|
314
|
-
a && /* @__PURE__ */
|
|
263
|
+
a && /* @__PURE__ */ Y(Ke, {
|
|
315
264
|
onClick: a,
|
|
316
|
-
id: h
|
|
265
|
+
id: h,
|
|
266
|
+
className: Z.imageActionButton
|
|
317
267
|
}),
|
|
318
|
-
s && /* @__PURE__ */
|
|
268
|
+
s && /* @__PURE__ */ Y(We, {
|
|
319
269
|
onClick: s,
|
|
320
|
-
id: h
|
|
270
|
+
id: h,
|
|
271
|
+
className: Z.imageActionButton
|
|
321
272
|
}),
|
|
322
|
-
|
|
323
|
-
variant:
|
|
273
|
+
w !== Ye.Loaded && /* @__PURE__ */ Y(T, {
|
|
274
|
+
variant: E.Rectangular,
|
|
324
275
|
width: "100%",
|
|
325
276
|
height: "100%",
|
|
326
|
-
active:
|
|
327
|
-
overlay: /* @__PURE__ */
|
|
277
|
+
active: w === Ye.Loading,
|
|
278
|
+
overlay: /* @__PURE__ */ Y(G, {
|
|
328
279
|
size: p.LG,
|
|
329
|
-
className:
|
|
280
|
+
className: Z.typeText,
|
|
330
281
|
"aria-hidden": !0
|
|
331
282
|
}),
|
|
332
283
|
className: "absolute inset-0 rounded-xl"
|
|
333
284
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
ref:
|
|
285
|
+
/* @__PURE__ */ Y("img", {
|
|
286
|
+
ref: C,
|
|
336
287
|
src: _,
|
|
337
288
|
alt: g,
|
|
338
289
|
loading: "lazy",
|
|
339
290
|
decoding: "async",
|
|
340
|
-
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
291
|
+
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === Ye.Loaded ? "opacity-100" : "opacity-0")
|
|
341
292
|
})
|
|
342
293
|
]
|
|
343
294
|
})
|
|
344
295
|
});
|
|
345
|
-
},
|
|
346
|
-
let { colors:
|
|
347
|
-
"--
|
|
348
|
-
"--
|
|
349
|
-
"--
|
|
350
|
-
"--
|
|
351
|
-
"--
|
|
352
|
-
"--
|
|
353
|
-
"--
|
|
354
|
-
"--
|
|
355
|
-
"--
|
|
356
|
-
"--
|
|
357
|
-
"--
|
|
358
|
-
"--
|
|
359
|
-
"--
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
onClick: o,
|
|
365
|
-
onDownload: s,
|
|
366
|
-
onRemove: r,
|
|
367
|
-
searchQuery: n,
|
|
368
|
-
styles: l,
|
|
369
|
-
cssVars: m
|
|
370
|
-
}) : h ? /* @__PURE__ */ q(Qe, {
|
|
296
|
+
}, Qe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l, isSelected: d }) => {
|
|
297
|
+
let { colors: f } = l ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = u({
|
|
298
|
+
"--ai-tile-bg": f?.background,
|
|
299
|
+
"--ai-tile-border": f?.border,
|
|
300
|
+
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
301
|
+
"--ai-tile-border-hover": f?.borderHover,
|
|
302
|
+
"--ai-tile-bg-selected": f?.backgroundSelected,
|
|
303
|
+
"--ai-tile-border-selected": f?.borderSelected,
|
|
304
|
+
"--ai-tile-focus-outline": f?.focusOutline,
|
|
305
|
+
"--ai-tile-bg-error": f?.backgroundError,
|
|
306
|
+
"--ai-tile-border-error": f?.borderError,
|
|
307
|
+
"--ai-tile-error-text": f?.errorText,
|
|
308
|
+
"--ai-tile-name-text": f?.nameText,
|
|
309
|
+
"--ai-tile-type-text": f?.typeText,
|
|
310
|
+
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
311
|
+
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
312
|
+
"--ai-tile-progress-track": f?.trackBackground
|
|
313
|
+
}), { isImage: g, isLink: _ } = Pe(() => Ve(e), [e]);
|
|
314
|
+
return g ? /* @__PURE__ */ Y(Ze, {
|
|
371
315
|
attachment: e,
|
|
372
316
|
labels: c,
|
|
373
317
|
onClick: o,
|
|
374
318
|
onExpand: a,
|
|
375
319
|
styles: l,
|
|
376
320
|
onRemove: r,
|
|
377
|
-
cssVars:
|
|
378
|
-
onDownload: s
|
|
379
|
-
|
|
321
|
+
cssVars: h,
|
|
322
|
+
onDownload: s,
|
|
323
|
+
isSelected: d
|
|
324
|
+
}) : /* @__PURE__ */ Y(Je, {
|
|
380
325
|
attachment: e,
|
|
326
|
+
searchQuery: n,
|
|
381
327
|
onClick: o,
|
|
382
328
|
onRetry: i,
|
|
383
329
|
onRemove: r,
|
|
384
330
|
onDownload: s,
|
|
385
331
|
isLink: _,
|
|
386
|
-
isPasted:
|
|
332
|
+
isPasted: p,
|
|
387
333
|
styles: l,
|
|
388
334
|
labels: c,
|
|
389
335
|
onExpand: a,
|
|
390
|
-
cssVars:
|
|
391
|
-
isExpandable:
|
|
336
|
+
cssVars: h,
|
|
337
|
+
isExpandable: m,
|
|
338
|
+
isSelected: d
|
|
392
339
|
});
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
"--ci-more-tile-bg-hover": c?.backgroundHover,
|
|
399
|
-
"--ci-more-tile-color-hover": c?.colorHover,
|
|
400
|
-
"--ci-more-tile-border-hover": c?.borderHover,
|
|
401
|
-
"--ci-more-tile-focus-outline": c?.focusOutline
|
|
402
|
-
});
|
|
403
|
-
return /* @__PURE__ */ q("button", {
|
|
404
|
-
type: "button",
|
|
405
|
-
onClick: t,
|
|
406
|
-
"aria-label": a ?? `Show ${e} more attachments`,
|
|
407
|
-
style: l,
|
|
408
|
-
className: d(Fe, o, et.tile, s),
|
|
409
|
-
children: r ?? /* @__PURE__ */ q("bdi", {
|
|
410
|
-
dir: "ltr",
|
|
411
|
-
children: `+${e}`
|
|
412
|
-
})
|
|
413
|
-
});
|
|
414
|
-
}, Q = {
|
|
415
|
-
container: "_container_7fktb_1",
|
|
416
|
-
headerIcon: "_headerIcon_7fktb_6",
|
|
417
|
-
headerLabel: "_headerLabel_7fktb_7",
|
|
418
|
-
downloadAllButton: "_downloadAllButton_7fktb_8",
|
|
419
|
-
imageTile: "_imageTile_7fktb_12"
|
|
420
|
-
}, nt = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, rt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o }) => {
|
|
421
|
-
let { ariaLabel: s = "Attachments", clickLabel: l = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: h = "Show less", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => nt(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = a ?? {}, { typography: { headerLabelClassName: S = "dial-tiny-semi-text" } = {}, colors: C, className: w } = o ?? {}, T = u({
|
|
422
|
-
"--ci-group-bg": C?.background,
|
|
423
|
-
"--ci-group-border": C?.border,
|
|
424
|
-
"--ci-group-text": C?.text
|
|
425
|
-
}), [E, D] = G(!1), O = W(() => He(e.length, E), [e.length, E]);
|
|
340
|
+
}, $e = {
|
|
341
|
+
headerIcon: "_headerIcon_1dmgi_1",
|
|
342
|
+
headerLabel: "_headerLabel_1dmgi_2"
|
|
343
|
+
}, et = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, tt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
|
|
344
|
+
let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: g = "Retry upload", downloadAllLabel: _ = "Download all", openInNewTabLabel: v, getHeaderLabel: y = (e) => et(e, "attachment"), promptLabel: b, pastedLabel: x, imageLabel: S } = a ?? {}, { typography: C, colors: w, className: T } = o ?? {}, E = u({ "--ai-group-text": w?.text });
|
|
426
345
|
if (e.length === 0) return null;
|
|
427
|
-
let
|
|
346
|
+
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ye : D ? G : R, M = y(e.length), N = () => {
|
|
428
347
|
let t = e.filter((e) => e.status === c.Idle);
|
|
429
348
|
r ? r(t) : t.forEach((e) => n?.(e.id));
|
|
430
|
-
},
|
|
349
|
+
}, P = (t) => {
|
|
431
350
|
let n = e.find((e) => e.id === t);
|
|
432
351
|
n && r?.([n]);
|
|
433
352
|
};
|
|
434
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ X("div", {
|
|
435
354
|
role: "group",
|
|
436
|
-
"aria-label":
|
|
437
|
-
style:
|
|
438
|
-
className: d("
|
|
439
|
-
children: [/* @__PURE__ */
|
|
440
|
-
className: "
|
|
441
|
-
children: [
|
|
442
|
-
|
|
355
|
+
"aria-label": l,
|
|
356
|
+
style: E,
|
|
357
|
+
className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $e.container, T),
|
|
358
|
+
children: [/* @__PURE__ */ X("div", {
|
|
359
|
+
className: "flex items-center justify-between",
|
|
360
|
+
children: [/* @__PURE__ */ X("div", {
|
|
361
|
+
className: "flex items-center gap-1",
|
|
362
|
+
children: [/* @__PURE__ */ Y(j, {
|
|
363
|
+
size: p.SM,
|
|
364
|
+
className: d("shrink-0", $e.headerIcon),
|
|
365
|
+
"aria-hidden": !0
|
|
366
|
+
}), /* @__PURE__ */ Y("span", {
|
|
367
|
+
className: d(C?.headerLabelClassName ?? "dial-tiny-semi-text", $e.headerLabel),
|
|
368
|
+
children: M
|
|
369
|
+
})]
|
|
370
|
+
}), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(h, {
|
|
371
|
+
icon: /* @__PURE__ */ Y(I, {
|
|
443
372
|
size: p.SM,
|
|
444
|
-
className: d("shrink-0", Q.headerIcon),
|
|
445
373
|
"aria-hidden": !0
|
|
446
374
|
}),
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
icon: /* @__PURE__ */ q(F, {
|
|
453
|
-
size: p.SM,
|
|
454
|
-
"aria-hidden": !0
|
|
455
|
-
}),
|
|
456
|
-
className: d("ms-auto h-6 w-6 rounded-lg", Q.downloadAllButton),
|
|
457
|
-
"aria-label": g,
|
|
458
|
-
onClick: z
|
|
459
|
-
})
|
|
460
|
-
]
|
|
461
|
-
}), /* @__PURE__ */ J("div", {
|
|
375
|
+
size: m.Small,
|
|
376
|
+
"aria-label": _,
|
|
377
|
+
onClick: N
|
|
378
|
+
})]
|
|
379
|
+
}), /* @__PURE__ */ Y("div", {
|
|
462
380
|
role: "list",
|
|
463
|
-
"aria-label":
|
|
464
|
-
className: d("gap-3",
|
|
465
|
-
children:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
})
|
|
482
|
-
}, e.id)),
|
|
483
|
-
O.layout === Y.Collapsed && /* @__PURE__ */ q("div", {
|
|
484
|
-
role: "listitem",
|
|
485
|
-
children: /* @__PURE__ */ q(tt, {
|
|
486
|
-
count: O.hiddenCount,
|
|
487
|
-
onClick: () => D(!0)
|
|
488
|
-
})
|
|
489
|
-
}),
|
|
490
|
-
N && E && /* @__PURE__ */ q("div", {
|
|
491
|
-
role: "listitem",
|
|
492
|
-
children: /* @__PURE__ */ q(tt, {
|
|
493
|
-
count: 0,
|
|
494
|
-
onClick: () => D(!1),
|
|
495
|
-
labels: { ariaLabel: h },
|
|
496
|
-
children: /* @__PURE__ */ q(M, {
|
|
497
|
-
size: p.MD,
|
|
498
|
-
"aria-hidden": !0
|
|
499
|
-
})
|
|
500
|
-
})
|
|
381
|
+
"aria-label": M,
|
|
382
|
+
className: d("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
383
|
+
children: e.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
384
|
+
role: "listitem",
|
|
385
|
+
children: /* @__PURE__ */ Y(Qe, {
|
|
386
|
+
attachment: e,
|
|
387
|
+
onClick: n,
|
|
388
|
+
onDownload: P,
|
|
389
|
+
onRetry: i,
|
|
390
|
+
labels: {
|
|
391
|
+
clickLabel: f,
|
|
392
|
+
retryLabel: g,
|
|
393
|
+
promptLabel: b,
|
|
394
|
+
pastedLabel: x,
|
|
395
|
+
imageLabel: S,
|
|
396
|
+
openInNewTabLabel: v
|
|
397
|
+
},
|
|
398
|
+
isSelected: e.id === s
|
|
501
399
|
})
|
|
502
|
-
|
|
400
|
+
}, `${e.id}-${t}`))
|
|
503
401
|
})]
|
|
504
402
|
});
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
tabActive: "_tabActive_rzv03_13"
|
|
508
|
-
};
|
|
509
|
-
je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
510
|
-
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
511
|
-
return /* @__PURE__ */ q("div", {
|
|
512
|
-
className: "flex flex-nowrap gap-1",
|
|
513
|
-
children: e.map((e) => {
|
|
514
|
-
let r = t === e.id;
|
|
515
|
-
return /* @__PURE__ */ q(T, {
|
|
516
|
-
label: e.label,
|
|
517
|
-
selected: r,
|
|
518
|
-
onClick: () => n(e.id),
|
|
519
|
-
"aria-selected": r,
|
|
520
|
-
className: d("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, it.tabContainer, r && it.tabActive)
|
|
521
|
-
}, e.id);
|
|
522
|
-
})
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
526
|
-
let [s, c] = G(t), [l, u] = G(n), [d, f] = G(r), p = Pe(o);
|
|
403
|
+
}, nt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
404
|
+
let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Fe(o);
|
|
527
405
|
Me(() => {
|
|
528
406
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
529
407
|
}, [
|
|
@@ -541,7 +419,7 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
|
|
|
541
419
|
setResponseFormat: c,
|
|
542
420
|
setSystemPrompt: u,
|
|
543
421
|
setTemperature: f,
|
|
544
|
-
handleSubmit:
|
|
422
|
+
handleSubmit: K(() => {
|
|
545
423
|
if (!m) return;
|
|
546
424
|
let t = {};
|
|
547
425
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -555,55 +433,64 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
|
|
|
555
433
|
a
|
|
556
434
|
])
|
|
557
435
|
};
|
|
558
|
-
},
|
|
436
|
+
}, rt = { label: "_label_14i7c_1" }, it = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: h = "Enter a prompt", temperatureLabel: g = "Temperature", temperatureLabels: _ = [
|
|
559
437
|
"Precise",
|
|
560
438
|
"Neutral",
|
|
561
439
|
"Creative"
|
|
562
|
-
], temperatureHint:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
440
|
+
], temperatureHint: v, labelClassName: y = "!dial-small-semi-text", colors: b }) => {
|
|
441
|
+
let x = u({ "--csf-label-text": b?.labelText }), S = d(y, rt.label, "gap-1");
|
|
442
|
+
return /* @__PURE__ */ X("div", {
|
|
443
|
+
className: "flex flex-col gap-4 px-6 pb-3",
|
|
444
|
+
style: x,
|
|
445
|
+
children: [
|
|
446
|
+
e.responseFormat && /* @__PURE__ */ Y(C, {
|
|
447
|
+
id: "response-format",
|
|
448
|
+
labelProps: {
|
|
449
|
+
label: s,
|
|
450
|
+
className: S,
|
|
451
|
+
caption: c
|
|
452
|
+
},
|
|
453
|
+
optionsClassName: "mb-2",
|
|
454
|
+
orientation: w.Column,
|
|
455
|
+
value: t ?? l.Markdown,
|
|
456
|
+
items: [{
|
|
457
|
+
value: l.Markdown,
|
|
458
|
+
label: f
|
|
459
|
+
}, {
|
|
460
|
+
value: l.PlainText,
|
|
461
|
+
label: p
|
|
462
|
+
}],
|
|
463
|
+
onChange: (e) => i(e)
|
|
464
|
+
}),
|
|
465
|
+
e.systemPrompt && /* @__PURE__ */ Y(A, {
|
|
466
|
+
value: n,
|
|
467
|
+
placeholder: h,
|
|
468
|
+
resize: !0,
|
|
469
|
+
labelProps: {
|
|
470
|
+
className: S,
|
|
471
|
+
label: m
|
|
472
|
+
},
|
|
473
|
+
onChange: (e) => a(e ?? "")
|
|
474
|
+
}),
|
|
475
|
+
e.temperature && /* @__PURE__ */ Y(D, {
|
|
476
|
+
labelProps: {
|
|
477
|
+
label: g,
|
|
478
|
+
className: S,
|
|
479
|
+
caption: v
|
|
480
|
+
},
|
|
481
|
+
value: r,
|
|
482
|
+
min: 0,
|
|
483
|
+
max: 1,
|
|
484
|
+
step: .1,
|
|
485
|
+
labels: _,
|
|
486
|
+
showValue: !0,
|
|
487
|
+
onChange: o
|
|
488
|
+
})
|
|
489
|
+
]
|
|
490
|
+
});
|
|
491
|
+
}, at = { modal: "_modal_kl0h0_1" };
|
|
492
|
+
je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = at.modal }) => {
|
|
493
|
+
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = nt({
|
|
607
494
|
features: e,
|
|
608
495
|
initialResponseFormat: t,
|
|
609
496
|
initialSystemPrompt: n,
|
|
@@ -611,205 +498,223 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
611
498
|
onSave: i,
|
|
612
499
|
onClose: a
|
|
613
500
|
});
|
|
614
|
-
return /* @__PURE__ */
|
|
501
|
+
return /* @__PURE__ */ Y(b, {
|
|
615
502
|
open: !0,
|
|
616
503
|
header: o,
|
|
617
|
-
|
|
504
|
+
titleClassName: s,
|
|
505
|
+
size: x.Sm,
|
|
618
506
|
onClose: a,
|
|
619
|
-
className:
|
|
620
|
-
footer: /* @__PURE__ */
|
|
507
|
+
className: y,
|
|
508
|
+
footer: /* @__PURE__ */ Y("div", {
|
|
621
509
|
className: "flex justify-end px-6 py-4",
|
|
622
|
-
children: /* @__PURE__ */
|
|
623
|
-
tooltip:
|
|
624
|
-
hideTooltip:
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
label:
|
|
627
|
-
onClick:
|
|
628
|
-
disabled: !
|
|
510
|
+
children: /* @__PURE__ */ Y(M, {
|
|
511
|
+
tooltip: v,
|
|
512
|
+
hideTooltip: E || !v,
|
|
513
|
+
children: /* @__PURE__ */ Y(S, {
|
|
514
|
+
label: _,
|
|
515
|
+
onClick: A,
|
|
516
|
+
disabled: !E
|
|
629
517
|
})
|
|
630
518
|
})
|
|
631
519
|
}),
|
|
632
|
-
children: /* @__PURE__ */
|
|
520
|
+
children: /* @__PURE__ */ Y(it, {
|
|
633
521
|
features: e,
|
|
634
|
-
responseFormat:
|
|
635
|
-
systemPrompt:
|
|
636
|
-
temperature:
|
|
637
|
-
onResponseFormatChange:
|
|
638
|
-
onSystemPromptChange:
|
|
639
|
-
onTemperatureChange:
|
|
640
|
-
responseFormatLabel:
|
|
641
|
-
responseFormatHint:
|
|
642
|
-
responseFormatMarkdownLabel:
|
|
643
|
-
responseFormatPlainTextLabel:
|
|
644
|
-
systemPromptLabel:
|
|
645
|
-
systemPromptTooltip:
|
|
646
|
-
temperatureLabel:
|
|
647
|
-
temperatureLabels:
|
|
648
|
-
temperatureHint:
|
|
522
|
+
responseFormat: C,
|
|
523
|
+
systemPrompt: w,
|
|
524
|
+
temperature: T,
|
|
525
|
+
onResponseFormatChange: D,
|
|
526
|
+
onSystemPromptChange: O,
|
|
527
|
+
onTemperatureChange: k,
|
|
528
|
+
responseFormatLabel: c,
|
|
529
|
+
responseFormatHint: l,
|
|
530
|
+
responseFormatMarkdownLabel: u,
|
|
531
|
+
responseFormatPlainTextLabel: d,
|
|
532
|
+
systemPromptLabel: f,
|
|
533
|
+
systemPromptTooltip: p,
|
|
534
|
+
temperatureLabel: m,
|
|
535
|
+
temperatureLabels: h,
|
|
536
|
+
temperatureHint: g
|
|
649
537
|
})
|
|
650
538
|
});
|
|
651
539
|
});
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
|
|
659
|
-
}, [c, y?.copiedMarkdownStatus]);
|
|
660
|
-
return /* @__PURE__ */ J("div", {
|
|
540
|
+
var ot = { activeRating: "_activeRating_ygoee_1" }, st = 2e3, ct = ({ role: e = s.User, onEdit: t, onEditHover: r, onDelete: i, onRegenerate: a, onCopy: c, onCopyMarkdown: l, onLike: f, onDislike: h, activeRating: g, isAlwaysVisible: _, className: v, labels: y, colors: b }) => {
|
|
541
|
+
let { tooltips: x, ariaLabels: S } = y ?? {}, [C, w] = q(null), [T, E] = q(""), D = u({ "--ma-active-rating-text": b?.activeRatingText }), O = K(() => {
|
|
542
|
+
c?.(), w("copy"), E(S?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => w(null), st);
|
|
543
|
+
}, [c, S?.copiedStatus]), k = K(() => {
|
|
544
|
+
l?.(), w("markdown"), E(S?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => w(null), st);
|
|
545
|
+
}, [l, S?.copiedMarkdownStatus]);
|
|
546
|
+
return /* @__PURE__ */ X("div", {
|
|
661
547
|
role: "toolbar",
|
|
662
|
-
"aria-label":
|
|
663
|
-
|
|
664
|
-
|
|
548
|
+
"aria-label": S?.actionsGroup ?? "Message actions",
|
|
549
|
+
style: D,
|
|
550
|
+
className: d("flex gap-1", !_ && "opacity-0 group-hover:opacity-100", v),
|
|
551
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
665
552
|
role: "status",
|
|
666
553
|
"aria-live": "polite",
|
|
667
554
|
className: "sr-only",
|
|
668
|
-
children:
|
|
669
|
-
}), e === s.User ? /* @__PURE__ */ J
|
|
670
|
-
icon: /* @__PURE__ */
|
|
555
|
+
children: T
|
|
556
|
+
}), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(j, {
|
|
557
|
+
icon: /* @__PURE__ */ Y(be, {
|
|
671
558
|
size: p.SM,
|
|
672
|
-
"aria-hidden": !0
|
|
559
|
+
"aria-hidden": !0,
|
|
560
|
+
stroke: 1.5
|
|
673
561
|
}),
|
|
674
|
-
size:
|
|
675
|
-
"aria-label":
|
|
676
|
-
tooltipProps: { tooltip:
|
|
562
|
+
size: m.Small,
|
|
563
|
+
"aria-label": S?.editMessage ?? "Edit message",
|
|
564
|
+
tooltipProps: { tooltip: x?.edit ?? "Edit" },
|
|
677
565
|
onClick: t,
|
|
678
|
-
onMouseEnter:
|
|
679
|
-
onFocus:
|
|
680
|
-
}),
|
|
681
|
-
icon: /* @__PURE__ */
|
|
566
|
+
onMouseEnter: r,
|
|
567
|
+
onFocus: r
|
|
568
|
+
}), i && /* @__PURE__ */ Y(j, {
|
|
569
|
+
icon: /* @__PURE__ */ Y(Oe, {
|
|
682
570
|
size: p.SM,
|
|
683
|
-
"aria-hidden": !0
|
|
571
|
+
"aria-hidden": !0,
|
|
572
|
+
stroke: 1.5
|
|
684
573
|
}),
|
|
685
|
-
size:
|
|
686
|
-
"aria-label":
|
|
687
|
-
tooltipProps: { tooltip:
|
|
688
|
-
onClick:
|
|
689
|
-
})] }) : /* @__PURE__ */ J
|
|
690
|
-
|
|
691
|
-
icon: /* @__PURE__ */
|
|
574
|
+
size: m.Small,
|
|
575
|
+
"aria-label": S?.deleteMessage ?? "Delete message",
|
|
576
|
+
tooltipProps: { tooltip: x?.delete ?? "Delete" },
|
|
577
|
+
onClick: i
|
|
578
|
+
})] }) : /* @__PURE__ */ X(J, { children: [
|
|
579
|
+
a && /* @__PURE__ */ Y(j, {
|
|
580
|
+
icon: /* @__PURE__ */ Y(xe, {
|
|
692
581
|
size: p.SM,
|
|
693
|
-
"aria-hidden": !0
|
|
582
|
+
"aria-hidden": !0,
|
|
583
|
+
stroke: 1.5
|
|
694
584
|
}),
|
|
695
|
-
size:
|
|
696
|
-
"aria-label":
|
|
697
|
-
tooltipProps: { tooltip:
|
|
698
|
-
onClick:
|
|
585
|
+
size: m.Small,
|
|
586
|
+
"aria-label": S?.regenerateResponse ?? "Regenerate response",
|
|
587
|
+
tooltipProps: { tooltip: x?.regenerate ?? "Regenerate" },
|
|
588
|
+
onClick: a
|
|
699
589
|
}),
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
onClick: w
|
|
590
|
+
c && /* @__PURE__ */ Y(n, {
|
|
591
|
+
iconSize: p.SM,
|
|
592
|
+
onClick: O,
|
|
593
|
+
size: m.Small,
|
|
594
|
+
isCopied: C === "copy",
|
|
595
|
+
copyLabel: x?.copy ?? "Copy",
|
|
596
|
+
copiedLabel: x?.copied ?? "Copied!",
|
|
597
|
+
ariaLabel: S?.copyResponse ?? "Copy response"
|
|
709
598
|
}),
|
|
710
|
-
|
|
711
|
-
|
|
599
|
+
l && /* @__PURE__ */ Y(n, {
|
|
600
|
+
iconSize: p.SM,
|
|
601
|
+
onClick: k,
|
|
602
|
+
size: m.Small,
|
|
603
|
+
isCopied: C === "markdown",
|
|
604
|
+
iconCopy: /* @__PURE__ */ Y(_e, {
|
|
712
605
|
size: p.SM,
|
|
713
|
-
"aria-hidden": !0
|
|
606
|
+
"aria-hidden": !0,
|
|
607
|
+
stroke: 1.5
|
|
714
608
|
}),
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
onClick: T
|
|
609
|
+
copyLabel: x?.copyMarkdown ?? "Copy as Markdown",
|
|
610
|
+
copiedLabel: x?.copiedMarkdown ?? "Copied!",
|
|
611
|
+
ariaLabel: S?.copyAsMarkdown ?? "Copy as markdown"
|
|
719
612
|
}),
|
|
720
|
-
|
|
721
|
-
icon: /* @__PURE__ */
|
|
613
|
+
f && /* @__PURE__ */ Y(j, {
|
|
614
|
+
icon: g === o.Like ? /* @__PURE__ */ Y(De, {
|
|
615
|
+
className: ot.activeRating,
|
|
722
616
|
size: p.SM,
|
|
617
|
+
stroke: 1.5,
|
|
723
618
|
"aria-hidden": !0
|
|
619
|
+
}) : /* @__PURE__ */ Y(Ee, {
|
|
620
|
+
size: p.SM,
|
|
621
|
+
"aria-hidden": !0,
|
|
622
|
+
stroke: 1.5
|
|
724
623
|
}),
|
|
725
|
-
size:
|
|
726
|
-
"aria-label":
|
|
727
|
-
"aria-pressed":
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
onClick: l
|
|
624
|
+
size: m.Small,
|
|
625
|
+
"aria-label": S?.likeResponse ?? "Like response",
|
|
626
|
+
"aria-pressed": g === o.Like,
|
|
627
|
+
tooltipProps: { tooltip: x?.like ?? "Like" },
|
|
628
|
+
onClick: f
|
|
731
629
|
}),
|
|
732
|
-
|
|
733
|
-
icon: /* @__PURE__ */
|
|
630
|
+
h && /* @__PURE__ */ Y(j, {
|
|
631
|
+
icon: g === o.Dislike ? /* @__PURE__ */ Y(Te, {
|
|
632
|
+
className: ot.activeRating,
|
|
734
633
|
size: p.SM,
|
|
735
|
-
"aria-hidden": !0
|
|
634
|
+
"aria-hidden": !0,
|
|
635
|
+
stroke: 1.5
|
|
636
|
+
}) : /* @__PURE__ */ Y(we, {
|
|
637
|
+
size: p.SM,
|
|
638
|
+
"aria-hidden": !0,
|
|
639
|
+
stroke: 1.5
|
|
736
640
|
}),
|
|
737
|
-
size:
|
|
738
|
-
"aria-label":
|
|
739
|
-
"aria-pressed":
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
onClick: u
|
|
641
|
+
size: m.Small,
|
|
642
|
+
"aria-label": S?.dislikeResponse ?? "Dislike response",
|
|
643
|
+
"aria-pressed": g === o.Dislike,
|
|
644
|
+
tooltipProps: { tooltip: x?.dislike ?? "Dislike" },
|
|
645
|
+
onClick: h
|
|
743
646
|
})
|
|
744
647
|
] })]
|
|
745
648
|
});
|
|
746
649
|
}, $ = {
|
|
747
|
-
userBubble: "
|
|
748
|
-
collapsibleText: "
|
|
749
|
-
expandedText: "
|
|
750
|
-
collapsedText: "
|
|
751
|
-
startersDivider: "
|
|
752
|
-
text: "
|
|
753
|
-
},
|
|
754
|
-
let { colors:
|
|
755
|
-
"--cm-bubble-text":
|
|
756
|
-
"--cm-starters-divider":
|
|
757
|
-
}),
|
|
758
|
-
return /* @__PURE__ */
|
|
650
|
+
userBubble: "_userBubble_qoxdz_1",
|
|
651
|
+
collapsibleText: "_collapsibleText_qoxdz_6",
|
|
652
|
+
expandedText: "_expandedText_qoxdz_11",
|
|
653
|
+
collapsedText: "_collapsedText_qoxdz_15",
|
|
654
|
+
startersDivider: "_startersDivider_qoxdz_26",
|
|
655
|
+
text: "_text_qoxdz_30"
|
|
656
|
+
}, lt = ({ text: e, styles: n, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, markdownClassNames: v, onAttachmentClick: b, onDownloadAll: x, onAttachmentRetry: S, codeBlockTheme: C, labels: w, selectedAttachmentId: T }) => {
|
|
657
|
+
let { colors: E, typography: D, className: O, bubbleClassName: k } = n ?? {}, { attachmentClickLabel: A, attachmentRetryLabel: j, attachmentOpenInNewTabLabel: M, startersAriaLabel: N = "Quick reply buttons", thinkingLabel: P, codeBlockCopyLabel: F, codeBlockCopiedLabel: I, assistantMessageAriaLabel: L = "Assistant message", deploymentIconFallbackLabel: R = "AI" } = w ?? {}, z = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], B = u({
|
|
658
|
+
"--cm-bubble-text": E?.text,
|
|
659
|
+
"--cm-starters-divider": E?.startersDivider
|
|
660
|
+
}), V = d($.text, D?.fontClassName), H = !!(h || g);
|
|
661
|
+
return /* @__PURE__ */ X("div", {
|
|
759
662
|
role: "group",
|
|
760
|
-
"aria-label":
|
|
761
|
-
style:
|
|
762
|
-
className: d("flex w-full items-start gap-3",
|
|
763
|
-
children: [
|
|
663
|
+
"aria-label": L,
|
|
664
|
+
style: B,
|
|
665
|
+
className: d("flex w-full items-start gap-3", O),
|
|
666
|
+
children: [H && /* @__PURE__ */ Y(r, {
|
|
764
667
|
src: h,
|
|
765
668
|
size: 28,
|
|
766
|
-
initialsName: g ||
|
|
767
|
-
labels: { tooltip: g ??
|
|
768
|
-
}), /* @__PURE__ */
|
|
669
|
+
initialsName: g || R,
|
|
670
|
+
labels: { tooltip: g ?? R }
|
|
671
|
+
}), /* @__PURE__ */ X("div", {
|
|
769
672
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
770
|
-
children: [/* @__PURE__ */
|
|
771
|
-
className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4",
|
|
673
|
+
children: [/* @__PURE__ */ X("div", {
|
|
674
|
+
className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", k),
|
|
772
675
|
children: [
|
|
773
|
-
(e || c) && /* @__PURE__ */
|
|
676
|
+
(e || c) && /* @__PURE__ */ Y("div", {
|
|
774
677
|
"aria-live": "polite",
|
|
775
678
|
"aria-atomic": "false",
|
|
776
|
-
className: d(
|
|
777
|
-
children: /* @__PURE__ */
|
|
679
|
+
className: d(V, "min-w-0 max-w-full text-start"),
|
|
680
|
+
children: /* @__PURE__ */ Y(i, {
|
|
778
681
|
content: e,
|
|
779
682
|
isStreaming: c,
|
|
780
|
-
thinkingLabel:
|
|
683
|
+
thinkingLabel: P,
|
|
781
684
|
components: _,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
685
|
+
classNames: v,
|
|
686
|
+
codeBlockCopyLabel: F,
|
|
687
|
+
codeBlockCopiedLabel: I,
|
|
688
|
+
codeBlockTheme: C
|
|
785
689
|
})
|
|
786
690
|
}),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
attachments:
|
|
789
|
-
onAttachmentClick: (e) =>
|
|
790
|
-
onDownloadAll:
|
|
791
|
-
onRetry:
|
|
691
|
+
/* @__PURE__ */ Y(tt, {
|
|
692
|
+
attachments: z,
|
|
693
|
+
onAttachmentClick: (e) => b?.(l?.find((t) => t.id === e)),
|
|
694
|
+
onDownloadAll: x,
|
|
695
|
+
onRetry: S,
|
|
792
696
|
labels: {
|
|
793
|
-
clickLabel:
|
|
794
|
-
retryLabel:
|
|
795
|
-
openInNewTabLabel:
|
|
796
|
-
}
|
|
697
|
+
clickLabel: A,
|
|
698
|
+
retryLabel: j,
|
|
699
|
+
openInNewTabLabel: M
|
|
700
|
+
},
|
|
701
|
+
selectedAttachmentId: T
|
|
797
702
|
}),
|
|
798
703
|
f,
|
|
799
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ Y(ct, {
|
|
800
705
|
...a,
|
|
801
706
|
isAlwaysVisible: o,
|
|
802
707
|
role: s.Assistant
|
|
803
708
|
})
|
|
804
709
|
]
|
|
805
|
-
}), p && p.length > 0 && m && /* @__PURE__ */
|
|
710
|
+
}), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
|
|
806
711
|
role: "list",
|
|
807
|
-
"aria-label":
|
|
712
|
+
"aria-label": N,
|
|
808
713
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
809
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
714
|
+
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
810
715
|
role: "listitem",
|
|
811
716
|
className: "min-w-[40px]",
|
|
812
|
-
children: /* @__PURE__ */
|
|
717
|
+
children: /* @__PURE__ */ Y(y, {
|
|
813
718
|
label: e.title,
|
|
814
719
|
className: "min-w-[40px]",
|
|
815
720
|
onClick: () => m(e)
|
|
@@ -818,77 +723,77 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
818
723
|
})]
|
|
819
724
|
})]
|
|
820
725
|
});
|
|
821
|
-
},
|
|
726
|
+
}, ut = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
|
|
822
727
|
role: "status",
|
|
823
728
|
"aria-live": "polite",
|
|
824
|
-
|
|
825
|
-
children: /* @__PURE__ */ q(_, {
|
|
729
|
+
children: /* @__PURE__ */ Y(_, {
|
|
826
730
|
title: e,
|
|
827
731
|
message: t,
|
|
828
732
|
textClassName: "flex-row flex-wrap gap-1"
|
|
829
733
|
})
|
|
830
|
-
}),
|
|
734
|
+
}), dt = /* @__PURE__ */ function(e) {
|
|
831
735
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
832
|
-
}({}),
|
|
833
|
-
let { colors:
|
|
736
|
+
}({}), ft = 10, pt = ({ text: e, position: t = dt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = ft, labels: c, onAttachmentClick: l, onDownloadAll: h, onAttachmentRetry: g, selectedAttachmentId: _ }) => {
|
|
737
|
+
let { colors: y, typography: b, className: x, bubbleClassName: S } = n ?? {}, { showMoreLabel: C = "Show more", showLessLabel: w = "Show less", showMoreAriaLabel: T, showLessAriaLabel: E, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: M, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = f({
|
|
834
738
|
text: e,
|
|
835
739
|
collapsedLineCount: o
|
|
836
|
-
}),
|
|
837
|
-
"--cm-bubble-user-bg":
|
|
838
|
-
"--cm-bubble-user-border":
|
|
839
|
-
"--cm-bubble-fade-start":
|
|
840
|
-
"--cm-bubble-text":
|
|
841
|
-
"--cm-bubble-collapsed-height":
|
|
842
|
-
"--cm-bubble-expanded-height":
|
|
843
|
-
}),
|
|
844
|
-
return /* @__PURE__ */
|
|
740
|
+
}), B = u({
|
|
741
|
+
"--cm-bubble-user-bg": y?.userBackground,
|
|
742
|
+
"--cm-bubble-user-border": y?.userBorder,
|
|
743
|
+
"--cm-bubble-fade-start": y?.fadeStart,
|
|
744
|
+
"--cm-bubble-text": y?.text,
|
|
745
|
+
"--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
|
|
746
|
+
"--cm-bubble-expanded-height": F ? `${L}px` : void 0
|
|
747
|
+
}), V = t === dt.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, b?.fontClassName), ee = T ?? C, te = E ?? w, ne = R ? C : w, U = R ? ee : te, W = R ? N : P, re = Ne();
|
|
748
|
+
return /* @__PURE__ */ Y("div", {
|
|
845
749
|
role: "group",
|
|
846
|
-
"aria-label":
|
|
847
|
-
style:
|
|
848
|
-
className: d("flex w-full",
|
|
849
|
-
children: /* @__PURE__ */
|
|
750
|
+
"aria-label": A,
|
|
751
|
+
style: B,
|
|
752
|
+
className: d("flex w-full", x),
|
|
753
|
+
children: /* @__PURE__ */ X("div", {
|
|
850
754
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
851
755
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ Y(tt, {
|
|
853
757
|
attachments: a ?? [],
|
|
854
758
|
onAttachmentClick: (e) => l?.(a?.find((t) => t.id === e)),
|
|
855
|
-
onDownloadAll:
|
|
856
|
-
onRetry:
|
|
759
|
+
onDownloadAll: h,
|
|
760
|
+
onRetry: g,
|
|
857
761
|
labels: {
|
|
858
|
-
clickLabel:
|
|
859
|
-
retryLabel:
|
|
860
|
-
openInNewTabLabel:
|
|
762
|
+
clickLabel: D,
|
|
763
|
+
retryLabel: O,
|
|
764
|
+
openInNewTabLabel: k
|
|
861
765
|
},
|
|
862
|
-
styles: { className: "max-w-[640px]" }
|
|
766
|
+
styles: { className: "max-w-[640px]" },
|
|
767
|
+
selectedAttachmentId: _
|
|
863
768
|
}),
|
|
864
|
-
e && /* @__PURE__ */
|
|
865
|
-
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4",
|
|
866
|
-
children: /* @__PURE__ */
|
|
769
|
+
e && /* @__PURE__ */ Y("div", {
|
|
770
|
+
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, S),
|
|
771
|
+
children: /* @__PURE__ */ X("div", {
|
|
867
772
|
className: "flex min-w-0 flex-col items-start",
|
|
868
|
-
children: [/* @__PURE__ */
|
|
869
|
-
id:
|
|
870
|
-
className: d("relative overflow-hidden",
|
|
871
|
-
children: /* @__PURE__ */
|
|
872
|
-
ref:
|
|
873
|
-
className: d(
|
|
773
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
774
|
+
id: re,
|
|
775
|
+
className: d("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, M && $.collapsedText),
|
|
776
|
+
children: /* @__PURE__ */ Y("p", {
|
|
777
|
+
ref: j,
|
|
778
|
+
className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
874
779
|
children: e
|
|
875
780
|
})
|
|
876
|
-
}),
|
|
877
|
-
label: /* @__PURE__ */
|
|
878
|
-
iconBefore: /* @__PURE__ */
|
|
781
|
+
}), F && /* @__PURE__ */ Y(v, {
|
|
782
|
+
label: /* @__PURE__ */ Y(J, { children: ne }),
|
|
783
|
+
iconBefore: /* @__PURE__ */ Y(W, {
|
|
879
784
|
size: p.SM,
|
|
880
785
|
"aria-hidden": "true"
|
|
881
786
|
}),
|
|
882
|
-
"aria-label":
|
|
883
|
-
"aria-expanded": !
|
|
884
|
-
"aria-controls":
|
|
787
|
+
"aria-label": U,
|
|
788
|
+
"aria-expanded": !R,
|
|
789
|
+
"aria-controls": re,
|
|
885
790
|
className: "mt-3",
|
|
886
|
-
onClick:
|
|
887
|
-
size:
|
|
791
|
+
onClick: z,
|
|
792
|
+
size: m.Small
|
|
888
793
|
})]
|
|
889
794
|
})
|
|
890
795
|
}),
|
|
891
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ Y(ct, {
|
|
892
797
|
...r,
|
|
893
798
|
isAlwaysVisible: i,
|
|
894
799
|
role: s.User
|
|
@@ -896,31 +801,16 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
896
801
|
]
|
|
897
802
|
})
|
|
898
803
|
});
|
|
899
|
-
},
|
|
804
|
+
}, mt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ Y(ut, { labels: {
|
|
900
805
|
titleText: r.labels?.statusTitleText,
|
|
901
806
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
902
|
-
} }) : e === s.User ? /* @__PURE__ */
|
|
807
|
+
} }) : e === s.User ? /* @__PURE__ */ Y(pt, {
|
|
903
808
|
...r,
|
|
904
809
|
onAttachmentClick: t
|
|
905
|
-
}) : /* @__PURE__ */
|
|
810
|
+
}) : /* @__PURE__ */ Y(lt, {
|
|
906
811
|
...r,
|
|
907
812
|
markdownComponents: n,
|
|
908
813
|
onAttachmentClick: t
|
|
909
|
-
})
|
|
910
|
-
let { colors: r, typography: i, className: a } = n ?? {};
|
|
911
|
-
return /* @__PURE__ */ q("button", {
|
|
912
|
-
type: "button",
|
|
913
|
-
onClick: t,
|
|
914
|
-
style: u({
|
|
915
|
-
"--cm-source-bg": r?.background,
|
|
916
|
-
"--cm-source-border": r?.border,
|
|
917
|
-
"--cm-source-text": r?.text,
|
|
918
|
-
"--cm-source-bg-hover": r?.backgroundHover,
|
|
919
|
-
"--cm-source-border-hover": r?.borderHover
|
|
920
|
-
}),
|
|
921
|
-
className: d(_t.button, "relative flex h-6 items-center justify-center px-2", "border border-solid", "outline-none focus-visible:outline focus-visible:outline-1", "focus-visible:outline-offset-[3px]", "cursor-pointer whitespace-nowrap", i?.fontClassName, a),
|
|
922
|
-
children: e
|
|
923
|
-
});
|
|
924
|
-
};
|
|
814
|
+
});
|
|
925
815
|
//#endregion
|
|
926
|
-
export {
|
|
816
|
+
export { lt as AssistantMessageBubble, dt as BubblePosition, ct as MessageActions, mt as MessageBubble, ut as StatusMessageBubble, pt as UserMessageBubble };
|