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