@epam/ai-dial-conversation-messages 1.1.0-dev.21 → 1.1.0-dev.211

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