@epam/ai-dial-conversation-messages 1.1.0-dev.9 → 1.1.0-dev.91

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