@epam/ai-dial-conversation-stages 1.3.0-dev.32 → 1.3.0-dev.321

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,24 +1,24 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, MarkdownCodeBlock as r, MarkdownRenderer as i, RequestStatus as a, StageStatus as o, buildCssVars as s, mergeClasses as c, messageAttachmentsToDisplayAttachments as l, normalizeMimeType as u } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, ElementSize as m, EllipsisTooltip as h, Highlight as g, Skeleton as _, SkeletonVariant as v, Spinner as y, StaticIconButton as b } from "@epam/ai-dial-ui-kit";
3
- import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as L, IconFileTypePng as R, IconFileTypePpt as z, IconFileTypeRs as ee, IconFileTypeSql as te, IconFileTypeSvg as ne, IconFileTypeTs as re, IconFileTypeTsx as B, IconFileTypeTxt as ie, IconFileTypeVue as ae, IconFileTypeXls as oe, IconFileTypeXml as se, IconFileTypeZip as ce, IconMusic as le, IconPhoto as V, IconReload as ue, IconTerminal2 as de, IconVideo as fe, IconX as pe } from "@tabler/icons-react";
4
- import { memo as me, useCallback as H, useEffect as U, useId as he, useMemo as W, useRef as ge, useState as G } from "react";
5
- import { Fragment as _e, jsx as K, jsxs as q } from "react/jsx-runtime";
2
+ import { Accordion as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, DialItemType as m, ElementSize as h, EllipsisTooltip as g, FileIcon as _, Highlight as v, LiveRegion as y, LiveRegionElement as b, Skeleton as x, SkeletonVariant as S, Spinner as C, StaticIconButton as w } from "@epam/ai-dial-ui-kit";
3
+ import { IconAlertCircle as T, IconCheck as E, IconClipboard as D, IconDownload as O, IconExternalLink as k, IconFile as A, IconFileTypeBmp as j, IconFileTypeCss as M, IconFileTypeCsv as N, IconFileTypeDoc as P, IconFileTypeDocx as F, IconFileTypeHtml as I, IconFileTypeJpg as L, IconFileTypeJs as R, IconFileTypeJsx as z, IconFileTypePdf as B, IconFileTypePhp as V, IconFileTypePng as H, IconFileTypePpt as U, IconFileTypeRs as ee, IconFileTypeSql as te, IconFileTypeSvg as ne, IconFileTypeTs as re, IconFileTypeTsx as ie, IconFileTypeTxt as W, IconFileTypeVue as G, IconFileTypeXls as ae, IconFileTypeXml as oe, IconFileTypeZip as se, IconMusic as ce, IconPhoto as le, IconReload as ue, IconTerminal2 as de, IconVideo as fe, IconX as pe } from "@tabler/icons-react";
4
+ import { memo as me, useCallback as K, useEffect as he, useId as ge, useMemo as q, useRef as _e, useState as ve } from "react";
5
+ import { Fragment as ye, jsx as J, jsxs as Y } from "react/jsx-runtime";
6
6
  //#region src/constants/public-class-names.ts
7
- var J = {
7
+ var be = {
8
8
  panel: "dial-conversation-stages-panel",
9
9
  group: "dial-conversation-stages-group",
10
10
  groupToggle: "dial-conversation-stages-group-toggle"
11
- }, ve = () => {
12
- let [e, t] = G(() => /* @__PURE__ */ new Set()), n = H((e, n) => {
11
+ }, xe = () => {
12
+ let [e, t] = ve(() => /* @__PURE__ */ new Set()), n = K((e, n) => {
13
13
  t((t) => {
14
14
  if (t.has(e) === n) return t;
15
15
  let r = new Set(t);
16
16
  return n ? r.add(e) : r.delete(e), r;
17
17
  });
18
- }, []), r = H(() => {
18
+ }, []), r = K(() => {
19
19
  t((e) => e.size ? /* @__PURE__ */ new Set() : e);
20
20
  }, []);
21
- return W(() => ({
21
+ return q(() => ({
22
22
  isExpanded: (t) => e.has(t),
23
23
  onToggle: n,
24
24
  reset: r
@@ -27,30 +27,30 @@ var J = {
27
27
  n,
28
28
  r
29
29
  ]);
30
- }, ye = /[([][^()[\]]*[)\]]/g, be = /(\d+(?:\.\d+)?)\s*s\b/, xe = (e) => {
30
+ }, Se = /[([][^()[\]]*[)\]]/g, Ce = /(\d+(?:\.\d+)?)\s*s\b/, we = (e) => {
31
31
  let t = e.trimEnd();
32
32
  return t.endsWith(":") ? t.slice(0, -1) : t;
33
- }, Se = (e) => {
34
- ye.lastIndex = 0;
33
+ }, Te = (e) => {
34
+ Se.lastIndex = 0;
35
35
  let t;
36
- for (; t = ye.exec(e);) {
37
- let e = t[0].slice(1, -1), n = be.exec(e);
36
+ for (; t = Se.exec(e);) {
37
+ let e = t[0].slice(1, -1), n = Ce.exec(e);
38
38
  if (n) return {
39
39
  durationLabel: `${n[1]}s`,
40
40
  groupIndex: t.index,
41
41
  groupLength: t[0].length
42
42
  };
43
43
  }
44
- }, Y = (e) => {
45
- let t = e ?? "", n = Se(t);
44
+ }, Ee = (e) => {
45
+ let t = e ?? "", n = Te(t);
46
46
  return {
47
- name: xe(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
47
+ name: we(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
48
48
  durationLabel: n?.durationLabel
49
49
  };
50
- }, Ce = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), we = (e) => [...e].reverse().find((e) => e.status == null), Te = (e, t) => {
50
+ }, De = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), Oe = (e) => [...e].reverse().find((e) => e.status == null), ke = (e, t) => {
51
51
  let n = e.parent_stage_index;
52
52
  if (!(n == null || !Number.isInteger(n) || n < 0 || n >= e.index)) return t.get(n);
53
- }, Ee = (e) => {
53
+ }, Ae = (e) => {
54
54
  let t = e.map((e) => ({
55
55
  stage: e,
56
56
  children: []
@@ -58,15 +58,15 @@ var J = {
58
58
  for (let e of t) n.has(e.stage.index) || n.set(e.stage.index, e);
59
59
  let r = [];
60
60
  for (let e of t) {
61
- let t = Te(e.stage, n);
61
+ let t = ke(e.stage, n);
62
62
  t ? t.children.push(e) : r.push(e);
63
63
  }
64
64
  return r;
65
- }, De = (e) => `stage:${e}`, Oe = (e) => `group:${e}`, ke = "min-w-0 overflow-visible py-0", Ae = "min-w-0 justify-start gap-2 rounded-lg px-2 py-1.5 text-start mobile:min-h-11", je = (e) => {
65
+ }, je = (e) => `stage:${e}`, Me = (e) => `group:${e}`, Ne = "min-w-0 overflow-visible py-0", Pe = "min-w-0 justify-start gap-2 rounded-lg px-2 py-1.5 text-start mobile:min-h-11", Fe = (e) => {
66
66
  let t = [], n = 0;
67
67
  for (; n < e.length;) {
68
- let r = e[n], i = Y(r.stage.name).name, a = n + 1;
69
- for (; a < e.length && Y(e[a].stage.name).name === i;) a += 1;
68
+ let r = e[n], i = Ee(r.stage.name).name, a = n + 1;
69
+ for (; a < e.length && Ee(e[a].stage.name).name === i;) a += 1;
70
70
  let o = e.slice(n, a);
71
71
  o.length > 1 ? t.push({
72
72
  key: r.stage.index,
@@ -79,117 +79,120 @@ var J = {
79
79
  }
80
80
  return t;
81
81
  }, X = {
82
- panel: "_panel_w65is_2",
83
- row: "_row_w65is_6",
84
- collapseButton: "_collapseButton_w65is_10",
85
- stageHeader: "_stageHeader_w65is_19",
86
- stageRegion: "_stageRegion_w65is_28",
87
- stageName: "_stageName_w65is_32",
88
- stageNameFailed: "_stageNameFailed_w65is_36",
89
- monoName: "_monoName_w65is_40",
90
- tag: "_tag_w65is_44",
91
- count: "_count_w65is_48",
92
- duration: "_duration_w65is_53",
93
- iconSecondary: "_iconSecondary_w65is_58",
94
- iconCompleted: "_iconCompleted_w65is_63",
95
- iconError: "_iconError_w65is_67",
96
- stageContent: "_stageContent_w65is_71",
97
- codeBlock: "_codeBlock_w65is_75",
98
- codeInline: "_codeInline_w65is_84",
99
- blockquote: "_blockquote_w65is_91",
100
- tableCell: "_tableCell_w65is_96"
101
- }, Me = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ q(_e, { children: [/* @__PURE__ */ K(x, {
82
+ panel: "_panel_msss2_1",
83
+ row: "_row_msss2_5",
84
+ collapseButton: "_collapseButton_msss2_9",
85
+ stageHeader: "_stageHeader_msss2_18",
86
+ stageRegion: "_stageRegion_msss2_27",
87
+ stageName: "_stageName_msss2_31",
88
+ stageNameFailed: "_stageNameFailed_msss2_35",
89
+ tag: "_tag_msss2_39",
90
+ count: "_count_msss2_43",
91
+ duration: "_duration_msss2_48",
92
+ iconSecondary: "_iconSecondary_msss2_53",
93
+ iconCompleted: "_iconCompleted_msss2_58",
94
+ iconError: "_iconError_msss2_62",
95
+ stageContent: "_stageContent_msss2_66",
96
+ codeBlock: "_codeBlock_msss2_70",
97
+ codeInline: "_codeInline_msss2_76",
98
+ blockquote: "_blockquote_msss2_82",
99
+ tableCell: "_tableCell_msss2_87"
100
+ }, Ie = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ Y(ye, { children: [/* @__PURE__ */ J(T, {
102
101
  size: f.MD,
103
102
  className: X.iconError,
104
103
  "aria-hidden": !0,
105
104
  stroke: p
106
- }), /* @__PURE__ */ K("span", {
105
+ }), /* @__PURE__ */ J("span", {
107
106
  className: "sr-only",
108
107
  children: r
109
- })] }) : e === o.Completed ? /* @__PURE__ */ K(S, {
108
+ })] }) : e === o.Completed ? /* @__PURE__ */ J(E, {
110
109
  size: f.SM,
111
110
  className: X.iconCompleted,
112
111
  "aria-hidden": !0,
113
112
  stroke: p
114
- }) : t ? /* @__PURE__ */ K(y, {
113
+ }) : t ? /* @__PURE__ */ J(C, {
115
114
  size: 16,
116
115
  ariaLabel: n
117
- }) : null, Ne = (e) => {
116
+ }) : null, Le = (e) => {
118
117
  if (e == null) return "";
119
118
  let t = e.lastIndexOf(".");
120
119
  return t > 0 ? e.slice(0, t) : e;
121
- }, Pe = (e) => {
122
- if (!e) return E;
120
+ }, Re = (e) => {
121
+ if (!e) return A;
123
122
  let t = u(e);
124
123
  if (t.startsWith("image/")) switch (t) {
125
- case "image/jpeg": return N;
126
- case "image/png": return R;
124
+ case "image/jpeg": return L;
125
+ case "image/png": return H;
127
126
  case "image/svg+xml": return ne;
128
- case "image/bmp": return D;
129
- default: return V;
127
+ case "image/bmp": return j;
128
+ default: return le;
130
129
  }
131
130
  if (t.startsWith("video/")) return fe;
132
- if (t.startsWith("audio/")) return le;
131
+ if (t.startsWith("audio/")) return ce;
133
132
  switch (t) {
134
- case "application/pdf": return I;
135
- case "application/msword": return A;
136
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return j;
137
- case "application/vnd.ms-powerpoint": return z;
138
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return z;
139
- case "application/vnd.ms-excel": return oe;
140
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return oe;
133
+ case "application/pdf": return B;
134
+ case "application/msword": return P;
135
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return F;
136
+ case "application/vnd.ms-powerpoint": return U;
137
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return U;
138
+ case "application/vnd.ms-excel": return ae;
139
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return ae;
141
140
  case "application/zip":
142
141
  case "application/vnd.rar":
143
142
  case "application/x-7z-compressed":
144
143
  case "application/gzip":
145
- case "application/x-tar": return ce;
146
- case "text/csv": return k;
147
- case "text/plain": return ie;
144
+ case "application/x-tar": return se;
145
+ case "text/csv": return N;
146
+ case "text/plain": return W;
148
147
  case "text/html":
149
- case "application/xhtml+xml": return M;
150
- case "application/xml": return se;
148
+ case "application/xhtml+xml": return I;
149
+ case "application/xml": return oe;
151
150
  case "application/sql": return te;
152
- case "text/javascript": return P;
153
- case "text/jsx": return F;
151
+ case "text/javascript": return R;
152
+ case "text/jsx": return z;
154
153
  case "text/typescript": return re;
155
- case "text/tsx": return B;
156
- case "text/css": return O;
157
- case "text/x-php": return L;
154
+ case "text/tsx": return ie;
155
+ case "text/css": return M;
156
+ case "text/x-php": return V;
158
157
  case "text/x-rustsrc": return ee;
159
- case "text/x-vue": return ae;
160
- default: return E;
158
+ case "text/x-vue": return G;
159
+ default: return A;
161
160
  }
162
- }, Fe = (e) => {
161
+ }, ze = (e) => {
163
162
  let { type: n, contentType: r } = e;
164
- return n === t.Prompt ? de : n === t.Pasted ? C : n === t.Image ? V : Pe(r ?? "");
165
- }, Ie = (e) => {
163
+ return n === t.Prompt ? de : n === t.Pasted ? D : n === t.Image ? le : Re(r ?? "");
164
+ }, Be = (e) => {
166
165
  let t = u(e), r = n[t];
167
166
  if (r) return r;
168
167
  let i = t.split("/")[1];
169
168
  if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
170
- }, Le = (e, n) => {
171
- let { type: r, name: i, contentType: a } = e;
169
+ }, Ve = (e) => {
170
+ let { name: t, contentType: n } = e;
171
+ if (n) {
172
+ let e = Be(n);
173
+ if (e) return e;
174
+ }
175
+ if (t == null) return;
176
+ let r = t.lastIndexOf(".");
177
+ if (r > 0 && r < t.length - 1) return t.slice(r + 1).toLowerCase();
178
+ }, He = (e) => e.type !== t.Prompt && e.type !== t.Pasted, Ue = (e, n) => {
179
+ let { type: r, name: i } = e;
172
180
  if (r === t.Prompt) return n.promptLabel ?? "Prompt";
173
181
  if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
174
182
  if (r === t.Image) return n.imageLabel ?? "Image";
175
- if (a) {
176
- let e = Ie(a);
177
- if (e) return `.${e}`;
178
- }
179
- if (i == null) return "";
180
- let o = i.lastIndexOf(".");
181
- return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
182
- }, Re = (e, n = {}) => {
183
+ let a = Ve(e);
184
+ return a ? `.${a}` : i ?? "";
185
+ }, We = (e, n = {}) => {
183
186
  let { type: r, status: i, previewUrl: o, url: s } = e, c = i === a.Loading, l = i === a.Error, u = r === t.Image && !!(o ?? s) && !l, d = r === t.Link && !l;
184
187
  return {
185
188
  isLoading: c,
186
189
  isError: l,
187
190
  isImage: u,
188
191
  isLink: d,
189
- BottomIcon: d ? null : Fe(e),
190
- typeLabel: d ? null : Le(e, n)
192
+ BottomIcon: d ? null : ze(e),
193
+ typeLabel: d ? null : Ue(e, n)
191
194
  };
192
- }, ze = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
195
+ }, Ge = "flex size-[100px] items-center justify-center rounded-xl border", Ke = "outline-offset-1 focus-visible:outline-1", Z = {
193
196
  tray: "dial-ai-attachment-tray",
194
197
  trayItem: "dial-ai-attachment-tray-item",
195
198
  tile: "dial-ai-attachment-tile",
@@ -198,156 +201,170 @@ var J = {
198
201
  tileType: "dial-ai-attachment-tile-type",
199
202
  tileAction: "dial-ai-attachment-tile-action"
200
203
  }, Q = {
201
- tile: "_tile_1tdbq_12",
202
- hovered: "_hovered_1tdbq_18",
203
- selected: "_selected_1tdbq_28",
204
- tileError: "_tileError_1tdbq_33",
205
- nameText: "_nameText_1tdbq_38",
206
- typeText: "_typeText_1tdbq_42",
207
- retryIcon: "_retryIcon_1tdbq_46",
208
- track: "_track_1tdbq_50",
209
- actionButton: "_actionButton_1tdbq_56",
210
- imageActionButton: "_imageActionButton_1tdbq_60"
211
- }, Be = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ K(b, {
204
+ tile: "_tile_hb2mo_12",
205
+ hovered: "_hovered_hb2mo_18",
206
+ selected: "_selected_hb2mo_28",
207
+ tileError: "_tileError_hb2mo_33",
208
+ nameText: "_nameText_hb2mo_38",
209
+ typeText: "_typeText_hb2mo_42",
210
+ placeholderIcon: "_placeholderIcon_hb2mo_46",
211
+ retryIcon: "_retryIcon_hb2mo_50",
212
+ track: "_track_hb2mo_54",
213
+ actionButton: "_actionButton_hb2mo_65",
214
+ loading: "_loading_hb2mo_86",
215
+ imageActionButton: "_imageActionButton_hb2mo_87",
216
+ tileAction: "_tileAction_hb2mo_99",
217
+ proxyFocus: "_proxyFocus_hb2mo_108"
218
+ }, qe = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o, isAlwaysVisible: s }) => /* @__PURE__ */ J(w, {
212
219
  icon: a,
213
- size: m.Small,
214
- className: c("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Q.actionButton, o, Z.tileAction),
220
+ size: h.Small,
221
+ className: c(s ? "opacity-100" : "opacity-0 group-hover/attachment-tile:opacity-100 group-focus-visible/attachment-tile:opacity-100 group-has-focus-visible/attachment-tile:opacity-100", Q.actionButton, o, Z.tileAction),
215
222
  "aria-label": e,
216
223
  "aria-describedby": t ? n : void 0,
217
224
  onClick: (e) => {
218
225
  e.stopPropagation(), r(i);
219
226
  }
220
- }), Ve = ({ ...e }) => /* @__PURE__ */ K(Be, {
221
- icon: /* @__PURE__ */ K(ue, {
227
+ }), Je = ({ ...e }) => /* @__PURE__ */ J(qe, {
228
+ icon: /* @__PURE__ */ J(ue, {
222
229
  size: f.SM,
223
230
  "aria-hidden": !0,
224
231
  stroke: p
225
232
  }),
226
233
  className: Q.retryIcon,
227
234
  ...e
228
- }), He = ({ ...e }) => /* @__PURE__ */ K(Be, {
229
- icon: /* @__PURE__ */ K(w, {
235
+ }), Ye = ({ ...e }) => /* @__PURE__ */ J(qe, {
236
+ icon: /* @__PURE__ */ J(O, {
230
237
  size: f.SM,
231
238
  "aria-hidden": !0,
232
239
  stroke: p
233
240
  }),
234
241
  ...e
235
- }), Ue = ({ ...e }) => /* @__PURE__ */ K(Be, {
236
- icon: /* @__PURE__ */ K(T, {
242
+ }), Xe = ({ ...e }) => /* @__PURE__ */ J(qe, {
243
+ icon: /* @__PURE__ */ J(k, {
237
244
  size: f.SM,
238
245
  "aria-hidden": !0,
239
246
  stroke: p
240
247
  }),
241
248
  ...e
242
- }), We = ({ ...e }) => /* @__PURE__ */ K(Be, {
243
- icon: /* @__PURE__ */ K(pe, {
249
+ }), Ze = ({ className: e, ...t }) => /* @__PURE__ */ J(qe, {
250
+ icon: /* @__PURE__ */ J(pe, {
244
251
  size: f.SM,
245
252
  "aria-hidden": !0,
246
253
  stroke: p
247
254
  }),
248
- ...e
249
- }), Ge = {
255
+ className: c("mobile:opacity-100", e),
256
+ ...t
257
+ }), Qe = {
250
258
  [e.Network]: "Upload failed · network error",
251
259
  [e.UnsupportedType]: "Upload failed · unsupported file type",
252
260
  [e.FileTooLarge]: "Upload failed · file too large"
253
- }, Ke = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isLink: u, cssVars: d, onExpand: f, isExpandable: p, onRemove: m, isSelected: h }) => {
254
- let { clickLabel: _ = "Download attachment", expandLabel: v = "Expand pasted text", downloadLabel: b = "Download attachment", retryLabel: x = "Retry upload", removeLabel: S = "Remove attachment", openInNewTabLabel: C = "Open in new tab", sizeLabel: w, uploadingLabel: T = "Uploading", errorReasonLabels: E, genericErrorLabel: D = "Upload failed" } = o ?? {}, { typography: O, className: k } = s ?? {}, { id: A, name: j, status: M, errorReason: N } = t, P = M === a.Loading, F = M === a.Error, I = he(), L = F ? N && (E?.[N] ?? Ge[N]) || D : "", { BottomIcon: R, typeLabel: z } = Re(t), ee = !F && !P && l && !u, te = F && !!i && N !== e.UnsupportedType && N !== e.FileTooLarge, ne = Number(!!ee) + Number(!!te) + Number(!!u) + Number(!!m), re = ne > 1 ? "pe-11" : ne === 1 ? "pe-5" : void 0, B = !!p && f !== void 0, ie = B || r !== void 0, ae = () => {
255
- B ? f(A) : r?.(A);
256
- }, oe = (e) => {
257
- e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ae());
258
- }, se = W(() => Ne(j), [j]), ce = H(() => {
261
+ }, $e = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isLink: u, cssVars: d, onExpand: h, isExpandable: g, onRemove: x, isSelected: S }) => {
262
+ let { clickLabel: w = "Download attachment", expandLabel: T = "Expand pasted text", downloadLabel: E = "Download attachment", retryLabel: D = "Retry upload", removeLabel: O = "Remove attachment", openInNewTabLabel: k = "Open in new tab", sizeLabel: A, uploadingLabel: j = "Uploading", errorReasonLabels: M, genericErrorLabel: N = "Upload failed" } = o ?? {}, { typography: P, className: F } = s ?? {}, { id: I, name: L, status: R, errorReason: z } = t, B = R === a.Loading, V = R === a.Error, H = ge(), U = V ? z && (M?.[z] ?? Qe[z]) || N : "", { BottomIcon: ee, typeLabel: te } = We(t), ne = He(t), re = !V && !B && l && !u, ie = V && !!i && z !== e.UnsupportedType && z !== e.FileTooLarge, W = !!g && h !== void 0, G = W || r !== void 0, ae = Number(!!re) + Number(!!ie) + Number(!!u) + Number(!!x), oe = !G && ae === 1, se = () => {
263
+ W ? h(I) : r?.(I);
264
+ }, ce = q(() => Le(L), [L]), le = K(() => {
259
265
  window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
260
- }, [t]), le = c(ze, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Q.tile, !F && Q.hovered, h && Q.selected, F && Q.tileError, Z.tile, h && Z.tileSelected), V = /* @__PURE__ */ K("div", {
261
- title: se,
262
- className: c(O?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", Q.nameText, !F && re, Z.tileName),
263
- children: n ? /* @__PURE__ */ K(g, {
264
- text: se,
266
+ }, [t]), ue = c(Ge, "group/attachment-tile relative flex-col justify-between items-start gap-2 overflow-hidden p-3", Q.tile, G && !V && !B && Q.hovered, B && Q.loading, S && Q.selected, V && Q.tileError, oe && Q.proxyFocus, Z.tile, S && Z.tileSelected), de = /* @__PURE__ */ J("div", {
267
+ title: ce,
268
+ className: c(P?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 wrap-break-word", Q.nameText, Z.tileName),
269
+ children: n ? /* @__PURE__ */ J(v, {
270
+ text: ce,
265
271
  query: n,
266
272
  maxLines: 2
267
- }) : se
268
- }), ue = R && /* @__PURE__ */ q("div", {
269
- className: c("flex w-full items-center gap-1", F && re, Z.tileType),
270
- children: [/* @__PURE__ */ K(R, {
271
- size: 16,
273
+ }) : ce
274
+ }), fe = ee && /* @__PURE__ */ Y("div", {
275
+ className: c("flex w-full items-end gap-1", Z.tileType),
276
+ children: [ne ? /* @__PURE__ */ J(_, {
277
+ type: m.File,
278
+ name: L ?? "",
279
+ fileExtension: Ve(t),
280
+ size: f.MD,
281
+ decorative: !0
282
+ }) : /* @__PURE__ */ J(ee, {
283
+ size: f.MD,
272
284
  className: Q.typeText,
285
+ stroke: p,
273
286
  "aria-hidden": !0
274
- }), /* @__PURE__ */ K("span", {
275
- className: c(O?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Q.typeText),
276
- children: w ? `${z} · ${w}` : z
287
+ }), /* @__PURE__ */ J("span", {
288
+ className: c(P?.metaClassName ?? "dial-tiny-text", "min-w-0 flex-1 truncate", Q.typeText),
289
+ children: A ? `${te} · ${A}` : te
277
290
  })]
278
- }), de = ie ? {
279
- role: "button",
280
- tabIndex: 0,
281
- "aria-label": B ? v : _,
282
- onClick: ae,
283
- onKeyDown: oe
284
- } : {}, fe = /* @__PURE__ */ q(_e, { children: [
285
- V,
286
- ue,
287
- P && /* @__PURE__ */ K("div", {
291
+ }), pe = /* @__PURE__ */ Y(ye, { children: [
292
+ de,
293
+ fe,
294
+ G && /* @__PURE__ */ J("button", {
295
+ type: "button",
296
+ "aria-label": W ? T : w,
297
+ "aria-pressed": !W && r !== void 0 ? S : void 0,
298
+ onClick: se,
299
+ className: c("absolute inset-0 cursor-pointer rounded-[11px]", Q.tileAction)
300
+ }),
301
+ B && /* @__PURE__ */ J("div", {
288
302
  role: "progressbar",
289
- "aria-label": T,
290
- className: c("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Q.track),
291
- children: /* @__PURE__ */ K(y, { size: 32 })
303
+ "aria-label": j,
304
+ className: c("absolute inset-0 flex items-center justify-center rounded-[11px]", Q.track),
305
+ children: /* @__PURE__ */ J("span", {
306
+ "aria-hidden": !0,
307
+ className: "flex",
308
+ children: /* @__PURE__ */ J(C, { size: 32 })
309
+ })
292
310
  }),
293
- /* @__PURE__ */ q("div", {
294
- className: "absolute end-1 top-1 flex gap-1",
311
+ /* @__PURE__ */ Y("div", {
312
+ className: "absolute inset-e-1 top-1 flex",
295
313
  children: [
296
- ee && /* @__PURE__ */ K(He, {
297
- ariaLabel: b,
298
- errorTitle: L,
299
- errorDescId: I,
314
+ re && /* @__PURE__ */ J(Ye, {
315
+ ariaLabel: E,
316
+ errorTitle: U,
317
+ errorDescId: H,
300
318
  onClick: l,
301
- id: A
319
+ id: I
302
320
  }),
303
- te && /* @__PURE__ */ K(Ve, {
304
- ariaLabel: x,
305
- errorTitle: L,
306
- errorDescId: I,
321
+ ie && /* @__PURE__ */ J(Je, {
322
+ ariaLabel: D,
323
+ errorTitle: U,
324
+ errorDescId: H,
307
325
  onClick: i,
308
- id: A
326
+ id: I
309
327
  }),
310
- u && /* @__PURE__ */ K(Ue, {
311
- ariaLabel: C,
312
- errorTitle: L,
313
- errorDescId: I,
314
- onClick: ce
328
+ u && /* @__PURE__ */ J(Xe, {
329
+ ariaLabel: k,
330
+ errorTitle: U,
331
+ errorDescId: H,
332
+ onClick: le
315
333
  }),
316
- m && /* @__PURE__ */ K(We, {
317
- ariaLabel: S,
318
- errorTitle: L,
319
- errorDescId: I,
320
- onClick: m,
321
- id: A
334
+ x && /* @__PURE__ */ J(Ze, {
335
+ ariaLabel: O,
336
+ errorTitle: U,
337
+ errorDescId: H,
338
+ onClick: x,
339
+ id: I,
340
+ isAlwaysVisible: B
322
341
  })
323
342
  ]
324
343
  }),
325
- F && /* @__PURE__ */ K("span", {
326
- id: I,
327
- role: "status",
328
- "aria-live": "polite",
329
- className: "sr-only",
330
- children: L
344
+ /* @__PURE__ */ J(y, {
345
+ id: H,
346
+ visuallyHidden: !0,
347
+ as: b.Span,
348
+ children: V ? U : ""
331
349
  })
332
350
  ] });
333
- return /* @__PURE__ */ K("div", {
351
+ return /* @__PURE__ */ J("div", {
334
352
  style: d,
335
- className: c("inline-flex", k),
336
- children: /* @__PURE__ */ K("div", {
337
- ...de,
338
- "aria-busy": P,
353
+ className: c("inline-flex", F),
354
+ children: /* @__PURE__ */ J("div", {
355
+ "aria-busy": B,
339
356
  style: d,
340
- className: c(le, ie && "cursor-pointer", "focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
341
- children: fe
357
+ className: c(ue, G && "cursor-pointer", Ke),
358
+ children: pe
342
359
  })
343
360
  });
344
- }, qe = /* @__PURE__ */ function(e) {
361
+ }, et = /* @__PURE__ */ function(e) {
345
362
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
346
- }({}), Je = ({ enabled: e, src: t }) => {
347
- let n = ge(null), [r, i] = G("idle");
348
- return U(() => {
363
+ }({}), tt = ({ enabled: e, src: t }) => {
364
+ let n = _e(null), [r, i] = ve("idle");
365
+ return he(() => {
349
366
  i(e && t ? "loading" : "idle");
350
- }, [e, t]), U(() => {
367
+ }, [e, t]), he(() => {
351
368
  let r = n.current;
352
369
  if (!r || !e || !t) return;
353
370
  let a = () => i("loaded"), o = () => i("error");
@@ -358,67 +375,77 @@ var J = {
358
375
  imageRef: n,
359
376
  imageLoadStatus: r
360
377
  };
361
- }, Ye = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
362
- let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } = W(() => Re(e), [e]), D = r !== void 0 && !C && !w && !T, O = C || D, { imageRef: k, imageLoadStatus: A } = Je({
363
- enabled: E,
364
- src: S
365
- }), j = () => {
366
- C && n ? n(b) : D && r && r(b);
367
- }, M = O ? {
368
- role: "button",
369
- tabIndex: 0,
370
- "aria-label": C ? m : d,
371
- onClick: j,
372
- onKeyDown: (e) => {
373
- e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), j());
374
- }
375
- } : {};
376
- return /* @__PURE__ */ K("div", {
377
- className: c(ze, "group/attachment-tile", O && "cursor-pointer", Q.tile, u && Q.selected, y, Z.tile, u && Z.tileSelected),
378
- ...M,
378
+ }, nt = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
379
+ let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment", uploadingLabel: _ = "Uploading" } = i ?? {}, { className: v } = l ?? {}, { id: y, name: b } = e, w = e.previewUrl ?? e.url, T = e.type === t.Pasted && n !== void 0, { isLoading: E, isError: D, isImage: O } = q(() => We(e), [e]), k = r !== void 0 && !T && !E && !D, A = T || k, j = !!s && !E, M = !A && Number(!!a) + Number(j) === 1, { imageRef: N, imageLoadStatus: P } = tt({
380
+ enabled: O,
381
+ src: w
382
+ }), F = () => {
383
+ T && n ? n(y) : k && r && r(y);
384
+ }, I = c(Ge, "group/attachment-tile", A && "cursor-pointer", Q.tile, u && Q.selected, E && Q.loading, M && Q.proxyFocus, Ke, v, Z.tile, u && Z.tileSelected);
385
+ return /* @__PURE__ */ J("div", {
386
+ className: I,
387
+ "aria-busy": E,
379
388
  style: o,
380
- children: /* @__PURE__ */ q("div", {
389
+ children: /* @__PURE__ */ Y("div", {
381
390
  className: "relative h-full w-full overflow-hidden",
382
391
  children: [
383
- /* @__PURE__ */ q("div", {
384
- className: "absolute end-1 top-1 z-10 flex gap-1",
385
- children: [a && /* @__PURE__ */ K(We, {
392
+ /* @__PURE__ */ Y("div", {
393
+ className: "absolute inset-e-1 top-1 z-10 flex",
394
+ children: [a && /* @__PURE__ */ J(Ze, {
386
395
  ariaLabel: h,
387
396
  onClick: a,
388
- id: b,
389
- className: Q.imageActionButton
390
- }), s && /* @__PURE__ */ K(He, {
397
+ id: y,
398
+ className: Q.imageActionButton,
399
+ isAlwaysVisible: E
400
+ }), j && /* @__PURE__ */ J(Ye, {
391
401
  ariaLabel: g,
392
402
  onClick: s,
393
- id: b,
403
+ id: y,
394
404
  className: Q.imageActionButton
395
405
  })]
396
406
  }),
397
- A !== qe.Loaded && /* @__PURE__ */ K(_, {
398
- variant: v.Rectangular,
407
+ P !== et.Loaded && /* @__PURE__ */ J(x, {
408
+ variant: S.Rectangular,
399
409
  width: "100%",
400
410
  height: "100%",
401
- active: A === qe.Loading,
402
- overlay: /* @__PURE__ */ K(V, {
411
+ active: P === et.Loading,
412
+ overlay: /* @__PURE__ */ J(le, {
403
413
  size: f.LG,
404
- className: Q.typeText,
414
+ className: Q.placeholderIcon,
405
415
  "aria-hidden": !0,
406
416
  stroke: p
407
417
  }),
408
418
  className: "absolute inset-0 rounded-xl"
409
419
  }),
410
- /* @__PURE__ */ K("img", {
411
- ref: k,
412
- src: S,
413
- alt: x,
420
+ /* @__PURE__ */ J("img", {
421
+ ref: N,
422
+ src: w,
423
+ alt: b,
414
424
  loading: "lazy",
415
425
  decoding: "async",
416
- className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", A === qe.Loaded ? "opacity-100" : "opacity-0")
426
+ className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", P === et.Loaded ? "opacity-100" : "opacity-0")
427
+ }),
428
+ A && /* @__PURE__ */ J("button", {
429
+ type: "button",
430
+ "aria-label": T ? m : d,
431
+ "aria-pressed": k ? u : void 0,
432
+ onClick: F,
433
+ className: c("absolute inset-0 cursor-pointer rounded-xl", Q.tileAction)
434
+ }),
435
+ E && /* @__PURE__ */ J("div", {
436
+ role: "progressbar",
437
+ "aria-label": _,
438
+ className: c("absolute inset-0 flex items-center justify-center rounded-xl", Q.track),
439
+ children: /* @__PURE__ */ J("span", {
440
+ "aria-hidden": !0,
441
+ className: "flex",
442
+ children: /* @__PURE__ */ J(C, { size: 32 })
443
+ })
417
444
  })
418
445
  ]
419
446
  })
420
447
  });
421
- }, Xe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
448
+ }, rt = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
422
449
  let { colors: f } = u ?? {}, p = e.type === t.Pasted && a !== void 0, m = s({
423
450
  "--ai-tile-bg": f?.background,
424
451
  "--ai-tile-border": f?.border,
@@ -432,11 +459,12 @@ var J = {
432
459
  "--ai-tile-error-text": f?.errorText,
433
460
  "--ai-tile-name-text": f?.nameText,
434
461
  "--ai-tile-type-text": f?.typeText,
462
+ "--ai-tile-placeholder-icon": f?.placeholderIcon,
435
463
  "--ai-tile-hover-icon-bg": f?.hoverIconBackground,
436
464
  "--ai-tile-hover-icon-color": f?.hoverIconColor,
437
465
  "--ai-tile-progress-track": f?.trackBackground
438
- }), { isImage: h, isLink: g } = W(() => Re(e), [e]);
439
- return h ? /* @__PURE__ */ K(Ye, {
466
+ }), { isImage: h, isLink: g } = q(() => We(e), [e]);
467
+ return h ? /* @__PURE__ */ J(nt, {
440
468
  attachment: e,
441
469
  labels: l,
442
470
  onClick: o,
@@ -446,7 +474,7 @@ var J = {
446
474
  cssVars: m,
447
475
  onDownload: c,
448
476
  isSelected: d
449
- }) : /* @__PURE__ */ K(Ke, {
477
+ }) : /* @__PURE__ */ J($e, {
450
478
  attachment: e,
451
479
  searchQuery: n,
452
480
  onClick: o,
@@ -461,261 +489,282 @@ var J = {
461
489
  isExpandable: p,
462
490
  isSelected: d
463
491
  });
464
- }, Ze = (e) => {
465
- let t = l(e);
466
- if (!e?.length) return t;
467
- let n = /* @__PURE__ */ new Map();
492
+ }, it = (e, t) => {
493
+ let n = l(e, t);
494
+ if (!e?.length) return n;
495
+ let r = /* @__PURE__ */ new Map();
468
496
  for (let t of e) {
469
497
  let e = t.url ?? t.data ?? t.title;
470
- n.has(e) || n.set(e, t.type);
498
+ r.has(e) || r.set(e, t.type);
471
499
  }
472
- return t.map((e) => {
473
- let t = n.get(e.id);
500
+ return n.map((e) => {
501
+ let t = r.get(e.id);
474
502
  return t ? {
475
503
  ...e,
476
504
  contentType: t
477
505
  } : e;
478
506
  });
479
- }, Qe = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i, copiedLabel: a }) => /* @__PURE__ */ K(r, {
480
- language: t?.replace(/^language-/, "") ?? "",
481
- value: typeof e == "string" ? e : String(e ?? ""),
482
- codeClassName: n,
483
- containerClassName: c(X.codeBlock, n),
484
- copyLabel: i,
485
- copiedLabel: a,
486
- hideDownload: !0
487
- }), $e = me(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: a, mathScrollRegionAriaLabel: o }) => {
488
- let s = "mb-1.5 last:mb-0", l = c(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, s);
489
- return /* @__PURE__ */ K(i, {
507
+ }, at = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i, copiedLabel: a }) => {
508
+ let o = t?.replace(/^language-/, "") ?? "";
509
+ return /* @__PURE__ */ J(r, {
510
+ language: o,
511
+ value: typeof e == "string" ? e : String(e ?? ""),
512
+ codeClassName: n,
513
+ containerClassName: c(X.codeBlock, n),
514
+ copyLabel: i,
515
+ copiedLabel: a,
516
+ hideDownload: !0
517
+ });
518
+ }, ot = me(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: a, mathScrollRegionAriaLabel: o, renderCitation: s }) => {
519
+ let l = "mb-1.5 last:mb-0", u = c(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, l), d = q(() => ({
520
+ code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ J(at, {
521
+ codeClassName: i,
522
+ blockClassName: t?.codeBlockClassName,
523
+ copyAriaLabel: n,
524
+ copiedLabel: r,
525
+ children: e
526
+ }) : /* @__PURE__ */ J("code", {
527
+ className: c("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-code-text rounded-md", X.codeInline),
528
+ children: e
529
+ }),
530
+ ...s != null && { cit: (e) => s(e["data-id"], e.children) }
531
+ }), [
532
+ t?.codeClassName,
533
+ t?.codeBlockClassName,
534
+ n,
535
+ r,
536
+ s
537
+ ]);
538
+ return /* @__PURE__ */ J(i, {
490
539
  content: e,
491
540
  tableScrollRegionAriaLabel: a,
492
541
  mathScrollRegionAriaLabel: o,
493
542
  classNames: {
494
- h1: l,
495
- h2: l,
496
- h3: l,
497
- h4: l,
498
- h5: l,
499
- h6: l,
543
+ h1: u,
544
+ h2: u,
545
+ h3: u,
546
+ h4: u,
547
+ h5: u,
548
+ h6: u,
500
549
  p: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, "mb-1.5"),
501
- ul: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, s),
502
- ol: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, s),
550
+ ul: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, l),
551
+ ol: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, l),
503
552
  strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", X.stageContent),
504
553
  codeInline: X.codeInline,
505
- blockquote: c(t?.contentClassName ?? "dial-tiny-text", X.blockquote, s),
554
+ blockquote: c(t?.contentClassName ?? "dial-tiny-text", X.blockquote, l),
506
555
  link: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent),
507
556
  tableCell: c(t?.contentClassName ?? "dial-tiny-text", X.tableCell)
508
557
  },
509
- components: { code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ K(Qe, {
510
- codeClassName: i,
511
- blockClassName: t?.codeBlockClassName,
512
- copyAriaLabel: n,
513
- copiedLabel: r,
514
- children: e
515
- }) : /* @__PURE__ */ K("code", {
516
- className: c("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-text rounded-md", X.codeInline),
517
- children: e
518
- }) }
558
+ components: d
519
559
  });
520
- }), et = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
521
- let r = H((t) => {
560
+ }), st = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
561
+ let r = K((t) => {
522
562
  let r = e.find((e) => e.id === t);
523
563
  r && n?.(r);
524
564
  }, [e, n]);
525
- return /* @__PURE__ */ K("div", {
565
+ return /* @__PURE__ */ J("div", {
526
566
  role: "list",
527
- className: "flex flex-wrap gap-3",
528
- children: e.map((e) => /* @__PURE__ */ K("div", {
567
+ className: "flex flex-wrap gap-2",
568
+ children: e.map((e) => /* @__PURE__ */ J("div", {
529
569
  role: "listitem",
530
- children: /* @__PURE__ */ K(Xe, {
570
+ children: /* @__PURE__ */ J(rt, {
531
571
  attachment: e,
532
572
  onClick: n && r,
533
573
  labels: { clickLabel: t }
534
574
  })
535
575
  }, e.id))
536
576
  });
537
- }, tt = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, childList: s, isExpanded: l, onToggle: u }) => {
538
- let [f, p] = G(!1), m = l ?? f, g = H((e) => {
539
- l === void 0 && p(e), u?.(e);
540
- }, [l, u]), { copyAriaLabel: _ = "Copy stage content", codeBlockCopiedLabel: v, tableScrollRegionAriaLabel: y, mathScrollRegionAriaLabel: b, runningAriaLabel: x, failedAriaLabel: S, attachmentClickLabel: C = "Preview search result" } = r ?? {}, w = W(() => Ze(e.attachments), [e.attachments]), { name: T, durationLabel: E } = Y(e.name), D = i ?? T, O = !i && Ce(T), k = e.status === o.Failed, A = !!e.content || !!e.attachments?.length, j = A || s != null, M = /* @__PURE__ */ q(_e, { children: [
541
- /* @__PURE__ */ K("span", {
577
+ }, ct = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, attachmentDisplayResolvers: s, renderCitation: l, childList: u, isExpanded: f, onToggle: p }) => {
578
+ let [m, h] = ve(!1), _ = f ?? m, v = K((e) => {
579
+ f === void 0 && h(e), p?.(e);
580
+ }, [f, p]), { copyAriaLabel: y = "Copy stage content", codeBlockCopiedLabel: b, tableScrollRegionAriaLabel: x, mathScrollRegionAriaLabel: S, runningAriaLabel: C, failedAriaLabel: w, attachmentClickLabel: T = "Preview search result" } = r ?? {}, E = q(() => it(e.attachments, s), [e.attachments, s]), { name: D, durationLabel: O } = Ee(e.name), k = i ?? D, A = !i && De(D), j = e.status === o.Failed, M = !!e.content || !!e.attachments?.length, N = M || u != null, P = /* @__PURE__ */ Y(ye, { children: [
581
+ /* @__PURE__ */ J("span", {
542
582
  className: "flex flex-none items-center",
543
- children: /* @__PURE__ */ K(Me, {
583
+ children: /* @__PURE__ */ J(Ie, {
544
584
  status: e.status,
545
585
  isLive: t,
546
- runningLabel: x,
547
- failedLabel: S
586
+ runningLabel: C,
587
+ failedLabel: w
548
588
  })
549
589
  }),
550
- /* @__PURE__ */ K("span", {
551
- className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", X.stageName, k && X.stageNameFailed, O && X.monoName),
552
- children: /* @__PURE__ */ K(h, { text: D || e.status || "" })
590
+ /* @__PURE__ */ J("span", {
591
+ className: c("max-w-88 min-w-0 truncate", A ? n?.monoFontClassName ?? "dial-code-text" : n?.fontClassName ?? "dial-small-text", X.stageName, j && X.stageNameFailed),
592
+ children: /* @__PURE__ */ J(g, { text: k || e.status || "" })
553
593
  }),
554
- e.tag && /* @__PURE__ */ K("span", {
594
+ e.tag && /* @__PURE__ */ J("span", {
555
595
  className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", X.tag),
556
596
  children: e.tag
557
597
  }),
558
- E && /* @__PURE__ */ K("span", {
598
+ O && /* @__PURE__ */ J("span", {
559
599
  className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
560
- children: E
600
+ children: O
561
601
  })
562
602
  ] });
563
- return j ? /* @__PURE__ */ q(d, {
564
- expanded: m,
565
- onToggle: g,
566
- title: /* @__PURE__ */ K("span", {
603
+ return N ? /* @__PURE__ */ Y(d, {
604
+ expanded: _,
605
+ onToggle: v,
606
+ title: /* @__PURE__ */ J("span", {
567
607
  className: "flex min-w-0 items-center gap-2",
568
- children: M
608
+ children: P
569
609
  }),
570
- className: ke,
571
- headerClassName: c(Ae, X.row, X.stageHeader),
610
+ className: Ne,
611
+ headerClassName: c(Pe, X.row, X.stageHeader),
572
612
  contentClassName: c("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1", X.stageRegion),
573
- children: [m && A && /* @__PURE__ */ q("div", {
613
+ children: [_ && M && /* @__PURE__ */ Y("div", {
574
614
  className: "flex min-w-0 flex-col gap-3 ps-8",
575
- children: [e.content && /* @__PURE__ */ K("div", {
615
+ children: [e.content && /* @__PURE__ */ J("div", {
576
616
  className: "max-h-[300px] min-w-0 overflow-y-auto",
577
- children: /* @__PURE__ */ K($e, {
617
+ children: /* @__PURE__ */ J(ot, {
578
618
  content: e.content,
579
619
  typography: n,
580
- copyAriaLabel: _,
581
- copiedLabel: v,
582
- tableScrollRegionAriaLabel: y,
583
- mathScrollRegionAriaLabel: b
620
+ copyAriaLabel: y,
621
+ copiedLabel: b,
622
+ tableScrollRegionAriaLabel: x,
623
+ mathScrollRegionAriaLabel: S,
624
+ renderCitation: l
584
625
  })
585
- }), w.length > 0 && /* @__PURE__ */ K(et, {
586
- attachments: w,
587
- clickLabel: C,
626
+ }), E.length > 0 && /* @__PURE__ */ J(st, {
627
+ attachments: E,
628
+ clickLabel: T,
588
629
  onAttachmentClick: a
589
630
  })]
590
- }), m && s]
591
- }) : /* @__PURE__ */ K("div", {
631
+ }), _ && u]
632
+ }) : /* @__PURE__ */ J("div", {
592
633
  className: c("flex w-full items-center gap-2 px-2 py-1.5", X.row),
593
- children: M
634
+ children: P
594
635
  });
595
- }, nt = (e) => e <= 3 ? "ps-4" : "ps-0", rt = (e) => e <= 3 ? "ps-6" : "ps-0", it = ({ node: e, depth: t, nameOverride: n, isStreaming: r, expansion: i, typography: a, labels: o, onAttachmentClick: s }) => {
596
- let c = De(e.stage.index), l = t + 1;
597
- return /* @__PURE__ */ K(tt, {
636
+ }, lt = (e) => e <= 3 ? "ps-4" : "ps-0", ut = (e) => e <= 3 ? "ps-6" : "ps-0", dt = ({ node: e, depth: t, nameOverride: n, isStreaming: r, expansion: i, typography: a, labels: o, onAttachmentClick: s, attachmentDisplayResolvers: c, renderCitation: l }) => {
637
+ let u = je(e.stage.index), d = t + 1;
638
+ return /* @__PURE__ */ J(ct, {
598
639
  stage: e.stage,
599
640
  nameOverride: n,
600
641
  isLive: r && e.stage.status == null,
601
642
  typography: a,
602
643
  labels: o,
603
644
  onAttachmentClick: s,
604
- isExpanded: i.isExpanded(c),
605
- onToggle: (e) => i.onToggle(c, e),
606
- childList: e.children.length > 0 ? /* @__PURE__ */ K(ot, {
645
+ attachmentDisplayResolvers: c,
646
+ renderCitation: l,
647
+ isExpanded: i.isExpanded(u),
648
+ onToggle: (e) => i.onToggle(u, e),
649
+ childList: e.children.length > 0 ? /* @__PURE__ */ J(pt, {
607
650
  nodes: e.children,
608
- depth: l,
609
- className: nt(l),
651
+ depth: d,
652
+ className: lt(d),
610
653
  isStreaming: r,
611
654
  expansion: i,
612
655
  typography: a,
613
656
  labels: o,
614
- onAttachmentClick: s
657
+ onAttachmentClick: s,
658
+ attachmentDisplayResolvers: c,
659
+ renderCitation: l
615
660
  }) : void 0
616
661
  });
617
- }, at = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: s }) => {
618
- let { runningAriaLabel: l, failedAriaLabel: u, attemptLabel: f = (e) => `Attempt ${e}` } = a ?? {}, p = e.attempts ?? [], m = p.some((e) => e.stage.status == null), g = p.some((e) => e.stage.status === o.Failed), _ = o.Completed;
619
- m ? _ = null : g && (_ = o.Failed);
620
- let v = Oe(e.key), y = r.isExpanded(v), b = t + 1;
621
- return /* @__PURE__ */ K(d, {
622
- title: /* @__PURE__ */ q("span", {
623
- className: "flex min-w-0 items-center gap-2",
624
- children: [
625
- /* @__PURE__ */ K("span", {
626
- className: "flex flex-none items-center",
627
- children: /* @__PURE__ */ K(Me, {
628
- status: _,
629
- isLive: n && m,
630
- runningLabel: l,
631
- failedLabel: u
632
- })
633
- }),
634
- /* @__PURE__ */ K("span", {
635
- className: c("min-w-0 max-w-[22rem] truncate", i?.fontClassName ?? "dial-small-text", X.stageName, g && X.stageNameFailed),
636
- children: /* @__PURE__ */ K(h, { text: e.name })
637
- }),
638
- /* @__PURE__ */ q("span", {
639
- className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
640
- children: ["×", p.length]
662
+ }, ft = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: s, attachmentDisplayResolvers: l, renderCitation: u }) => {
663
+ let { runningAriaLabel: f, failedAriaLabel: p, attemptLabel: m = (e) => `Attempt ${e}` } = a ?? {}, h = e.attempts ?? [], _ = h.some((e) => e.stage.status == null), v = h.some((e) => e.stage.status === o.Failed), y = o.Completed;
664
+ _ ? y = null : v && (y = o.Failed);
665
+ let b = Me(e.key), x = r.isExpanded(b), S = t + 1, C = /* @__PURE__ */ Y("span", {
666
+ className: "flex min-w-0 items-center gap-2",
667
+ children: [
668
+ /* @__PURE__ */ J("span", {
669
+ className: "flex flex-none items-center",
670
+ children: /* @__PURE__ */ J(Ie, {
671
+ status: y,
672
+ isLive: n && _,
673
+ runningLabel: f,
674
+ failedLabel: p
641
675
  })
642
- ]
643
- }),
644
- expanded: y,
645
- onToggle: (e) => r.onToggle(v, e),
646
- className: ke,
647
- headerClassName: c(Ae, X.collapseButton, X.row, X.stageHeader),
648
- contentClassName: c("-mt-2 min-w-0 px-0", rt(b), X.stageRegion),
649
- children: /* @__PURE__ */ K("ul", {
676
+ }),
677
+ /* @__PURE__ */ J("span", {
678
+ className: c("max-w-88 min-w-0 truncate", i?.fontClassName ?? "dial-small-text", X.stageName, v && X.stageNameFailed),
679
+ children: /* @__PURE__ */ J(g, { text: e.name })
680
+ }),
681
+ /* @__PURE__ */ Y("span", {
682
+ className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
683
+ children: ["×", h.length]
684
+ })
685
+ ]
686
+ });
687
+ return /* @__PURE__ */ J(d, {
688
+ title: C,
689
+ expanded: x,
690
+ onToggle: (e) => r.onToggle(b, e),
691
+ className: Ne,
692
+ headerClassName: c(Pe, X.collapseButton, X.row, X.stageHeader),
693
+ contentClassName: c("-mt-2 min-w-0 px-0", ut(S), X.stageRegion),
694
+ children: /* @__PURE__ */ J("ul", {
650
695
  role: "list",
651
696
  className: "flex min-w-0 flex-col gap-0.5",
652
- children: y && p.map((e, t) => /* @__PURE__ */ K("li", {
697
+ children: x && h.map((e, t) => /* @__PURE__ */ J("li", {
653
698
  role: "listitem",
654
699
  className: "min-w-0",
655
- children: /* @__PURE__ */ K(it, {
700
+ children: /* @__PURE__ */ J(dt, {
656
701
  node: e,
657
- depth: b,
658
- nameOverride: f(t + 1),
702
+ depth: S,
703
+ nameOverride: m(t + 1),
659
704
  isStreaming: n,
660
705
  expansion: r,
661
706
  typography: i,
662
707
  labels: a,
663
- onAttachmentClick: s
708
+ onAttachmentClick: s,
709
+ attachmentDisplayResolvers: l,
710
+ renderCitation: u
664
711
  })
665
712
  }, e.stage.index))
666
713
  })
667
714
  });
668
- }, ot = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ K("ul", {
715
+ }, pt = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ J("ul", {
669
716
  role: "list",
670
717
  className: c("flex min-w-0 flex-col gap-0.5", n),
671
- children: je(e).map((e) => /* @__PURE__ */ K("li", {
718
+ children: Fe(e).map((e) => /* @__PURE__ */ J("li", {
672
719
  role: "listitem",
673
720
  className: "min-w-0",
674
- children: e.node ? /* @__PURE__ */ K(it, {
721
+ children: e.node ? /* @__PURE__ */ J(dt, {
675
722
  node: e.node,
676
723
  depth: t,
677
724
  ...r
678
- }) : /* @__PURE__ */ K(at, {
725
+ }) : /* @__PURE__ */ J(ft, {
679
726
  row: e,
680
727
  depth: t,
681
728
  ...r
682
729
  })
683
730
  }, e.key))
684
- }), st = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, expansion: o }) => {
685
- let { colors: l, typography: u } = r ?? {}, d = s({
686
- "--cs-text": l?.text,
687
- "--cs-row-hover": l?.rowHoverColor,
688
- "--cs-button-bg": l?.collapsedButtonBg,
689
- "--cs-stage-text": l?.stageTextColor,
690
- "--cs-failed-text": l?.failedColor,
691
- "--cs-tag-text": l?.tagTextColor,
692
- "--cs-count-text": l?.countTextColor,
693
- "--cs-duration-text": l?.durationTextColor,
694
- "--cs-icon-secondary": l?.iconSecondaryColor,
695
- "--cs-icon-completed": l?.iconCompletedColor,
696
- "--cs-icon-error": l?.iconErrorColor,
697
- "--cs-code-bg": l?.codeBg,
698
- "--cs-code-border": l?.codeBorderColor,
699
- "--cs-code-text": l?.codeTextColor,
700
- "--cs-border": l?.borderColor
701
- }), f = W(() => Ee(e), [e]);
702
- return /* @__PURE__ */ K("div", {
703
- style: d,
704
- className: c("w-full min-w-0", X.panel, n, J.panel),
705
- children: /* @__PURE__ */ K(ot, {
706
- nodes: f,
731
+ }), mt = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: l, expansion: u }) => {
732
+ let { colors: d, typography: f } = r ?? {}, p = s({
733
+ "--cs-text": d?.text,
734
+ "--cs-row-hover": d?.rowHoverColor,
735
+ "--cs-button-bg": d?.collapsedButtonBg,
736
+ "--cs-stage-text": d?.stageTextColor,
737
+ "--cs-failed-text": d?.failedColor,
738
+ "--cs-tag-text": d?.tagTextColor,
739
+ "--cs-count-text": d?.countTextColor,
740
+ "--cs-duration-text": d?.durationTextColor,
741
+ "--cs-icon-secondary": d?.iconSecondaryColor,
742
+ "--cs-icon-completed": d?.iconCompletedColor,
743
+ "--cs-icon-error": d?.iconErrorColor,
744
+ "--cs-code-bg": d?.codeBg,
745
+ "--cs-code-border": d?.codeBorderColor,
746
+ "--cs-code-text": d?.codeTextColor,
747
+ "--cs-border": d?.borderColor
748
+ }), m = q(() => Ae(e), [e]);
749
+ return /* @__PURE__ */ J("div", {
750
+ style: p,
751
+ className: c("w-full min-w-0", X.panel, n, be.panel),
752
+ children: /* @__PURE__ */ J(pt, {
753
+ nodes: m,
707
754
  depth: 0,
708
755
  className: "w-full ps-5",
709
756
  isStreaming: t,
710
- expansion: o,
711
- typography: u,
757
+ expansion: u,
758
+ typography: f,
712
759
  labels: i,
713
- onAttachmentClick: a
760
+ onAttachmentClick: a,
761
+ attachmentDisplayResolvers: o,
762
+ renderCitation: l
714
763
  })
715
764
  });
716
- }, ct = (e) => {
717
- let t = ve();
718
- return /* @__PURE__ */ K(st, {
765
+ }, ht = (e) => {
766
+ let t = xe();
767
+ return /* @__PURE__ */ J(mt, {
719
768
  ...e,
720
769
  expansion: t
721
770
  });
@@ -726,141 +775,145 @@ var J = {
726
775
  doneIcon: "_doneIcon_16fae_36",
727
776
  failedText: "_failedText_16fae_40",
728
777
  liveName: "_liveName_16fae_44"
729
- }, lt = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a }) => {
730
- let { executedLabel: l = "Executed", stepsLabel: u = () => "steps", failedCountLabel: m = (e) => `${e} failed`, runningAriaLabel: g = "Running", copyAriaLabel: _, codeBlockCopiedLabel: v, tableScrollRegionAriaLabel: b, mathScrollRegionAriaLabel: x, failedAriaLabel: C, attemptLabel: w, attachmentClickLabel: T } = n ?? {}, [E, D] = G(t), O = ve(), { reset: k } = O, A = e.length > 1;
731
- U(() => {
732
- A && !E && k();
778
+ }, gt = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a, attachmentDisplayResolvers: l, renderCitation: u }) => {
779
+ let { executedLabel: m = "Executed", stepsLabel: h = () => "steps", failedCountLabel: _ = (e) => `${e} failed`, runningAriaLabel: v = "Running", copyAriaLabel: y, codeBlockCopiedLabel: b, tableScrollRegionAriaLabel: x, mathScrollRegionAriaLabel: S, failedAriaLabel: w, attemptLabel: T, attachmentClickLabel: D } = n ?? {}, [O, k] = ve(t), A = xe(), { reset: j } = A, M = e.length > 1;
780
+ he(() => {
781
+ M && !O && j();
733
782
  }, [
734
- A,
735
- E,
736
- k
783
+ M,
784
+ O,
785
+ j
737
786
  ]);
738
- let j = ge(t);
739
- U(() => {
740
- j.current && !t && D(!1), j.current = t;
787
+ let N = _e(t);
788
+ he(() => {
789
+ N.current && !t && k(!1), N.current = t;
741
790
  }, [t]);
742
- let { colors: M, panel: N } = i ?? {}, P = i?.typography ?? { fontClassName: "dial-small-text" }, F = s({
743
- "--cs-cg-label": M?.labelColor,
744
- "--cs-cg-label-hover": M?.labelHoverColor,
745
- "--cs-cg-done": M?.doneColor,
746
- "--cs-cg-failed": M?.failedColor,
747
- "--cs-text": N?.text,
748
- "--cs-row-hover": N?.rowHoverColor,
749
- "--cs-button-bg": N?.collapsedButtonBg,
750
- "--cs-stage-text": N?.stageTextColor,
751
- "--cs-failed-text": N?.failedColor,
752
- "--cs-tag-text": N?.tagTextColor,
753
- "--cs-count-text": N?.countTextColor,
754
- "--cs-duration-text": N?.durationTextColor,
755
- "--cs-icon-secondary": N?.iconSecondaryColor,
756
- "--cs-icon-completed": N?.iconCompletedColor,
757
- "--cs-icon-error": N?.iconErrorColor,
758
- "--cs-code-bg": N?.codeBg,
759
- "--cs-code-border": N?.codeBorderColor,
760
- "--cs-code-text": N?.codeTextColor,
761
- "--cs-border": N?.borderColor
791
+ let { colors: P, panel: F } = i ?? {}, I = i?.typography ?? { fontClassName: "dial-small-text" }, L = s({
792
+ "--cs-cg-label": P?.labelColor,
793
+ "--cs-cg-label-hover": P?.labelHoverColor,
794
+ "--cs-cg-done": P?.doneColor,
795
+ "--cs-cg-failed": P?.failedColor,
796
+ "--cs-text": F?.text,
797
+ "--cs-row-hover": F?.rowHoverColor,
798
+ "--cs-button-bg": F?.collapsedButtonBg,
799
+ "--cs-stage-text": F?.stageTextColor,
800
+ "--cs-failed-text": F?.failedColor,
801
+ "--cs-tag-text": F?.tagTextColor,
802
+ "--cs-count-text": F?.countTextColor,
803
+ "--cs-duration-text": F?.durationTextColor,
804
+ "--cs-icon-secondary": F?.iconSecondaryColor,
805
+ "--cs-icon-completed": F?.iconCompletedColor,
806
+ "--cs-icon-error": F?.iconErrorColor,
807
+ "--cs-code-bg": F?.codeBg,
808
+ "--cs-code-border": F?.codeBorderColor,
809
+ "--cs-code-text": F?.codeTextColor,
810
+ "--cs-border": F?.borderColor
762
811
  });
763
812
  if (e.length === 0) return null;
764
- let I = {
765
- copyAriaLabel: _,
766
- codeBlockCopiedLabel: v,
767
- tableScrollRegionAriaLabel: b,
768
- mathScrollRegionAriaLabel: x,
769
- runningAriaLabel: g,
770
- failedAriaLabel: C,
771
- attemptLabel: w,
772
- attachmentClickLabel: T
813
+ let R = {
814
+ copyAriaLabel: y,
815
+ codeBlockCopiedLabel: b,
816
+ tableScrollRegionAriaLabel: x,
817
+ mathScrollRegionAriaLabel: S,
818
+ runningAriaLabel: v,
819
+ failedAriaLabel: w,
820
+ attemptLabel: T,
821
+ attachmentClickLabel: D
773
822
  };
774
- if (e.length === 1) return /* @__PURE__ */ K(st, {
823
+ if (e.length === 1) return /* @__PURE__ */ J(mt, {
775
824
  stages: e,
776
825
  isStreaming: t,
777
- expansion: O,
826
+ expansion: A,
778
827
  className: r,
779
828
  styles: {
780
- colors: N,
829
+ colors: F,
781
830
  typography: i?.typography
782
831
  },
783
- labels: I,
784
- onAttachmentClick: a
832
+ labels: R,
833
+ onAttachmentClick: a,
834
+ attachmentDisplayResolvers: l,
835
+ renderCitation: u
785
836
  });
786
- let L = e.some((e) => e.status === o.Failed), R;
837
+ let z = e.some((e) => e.status === o.Failed), B;
787
838
  if (t) {
788
- let t = Y((we(e) ?? e[e.length - 1]).name).name;
789
- R = /* @__PURE__ */ q("span", {
839
+ let t = Ee((Oe(e) ?? e[e.length - 1]).name).name;
840
+ B = /* @__PURE__ */ Y("span", {
790
841
  role: "status",
791
842
  "aria-live": "polite",
792
843
  className: "flex min-w-0 items-center gap-2",
793
- children: [/* @__PURE__ */ K("span", {
844
+ children: [/* @__PURE__ */ J("span", {
794
845
  className: "flex flex-none items-center",
795
- children: /* @__PURE__ */ K(y, {
846
+ children: /* @__PURE__ */ J(C, {
796
847
  size: 14,
797
- ariaLabel: g
848
+ ariaLabel: v
798
849
  })
799
- }), t && /* @__PURE__ */ K("span", {
800
- className: c("min-w-0 max-w-[22rem] truncate", P.fontClassName, $.liveName),
801
- children: /* @__PURE__ */ K(h, { text: t })
850
+ }), t && /* @__PURE__ */ J("span", {
851
+ className: c("max-w-88 min-w-0 truncate", I.fontClassName, $.liveName),
852
+ children: /* @__PURE__ */ J(g, { text: t })
802
853
  })]
803
854
  });
804
- } else if (L) {
855
+ } else if (z) {
805
856
  let t = e.filter((e) => e.status === o.Failed).length;
806
- R = /* @__PURE__ */ q("span", {
857
+ B = /* @__PURE__ */ Y("span", {
807
858
  className: "inline-flex items-center gap-1",
808
- children: [/* @__PURE__ */ q("span", {
809
- className: c(P.fontClassName, $.executedLabel),
859
+ children: [/* @__PURE__ */ Y("span", {
860
+ className: c(I.fontClassName, $.executedLabel),
810
861
  children: [
811
- l,
862
+ m,
812
863
  " ",
813
864
  e.length,
814
865
  " ",
815
- u(e.length)
866
+ h(e.length)
816
867
  ]
817
- }), /* @__PURE__ */ K("span", {
818
- className: c(P.fontClassName, $.failedText),
819
- children: m(t)
868
+ }), /* @__PURE__ */ J("span", {
869
+ className: c(I.fontClassName, $.failedText),
870
+ children: _(t)
820
871
  })]
821
872
  });
822
- } else R = /* @__PURE__ */ q("span", {
873
+ } else B = /* @__PURE__ */ Y("span", {
823
874
  className: "inline-flex items-center gap-1",
824
- children: [/* @__PURE__ */ K(S, {
875
+ children: [/* @__PURE__ */ J(E, {
825
876
  size: f.SM,
826
877
  className: $.doneIcon,
827
878
  "aria-hidden": !0,
828
879
  stroke: p
829
- }), /* @__PURE__ */ q("span", {
830
- className: c(P.fontClassName, $.executedLabel),
880
+ }), /* @__PURE__ */ Y("span", {
881
+ className: c(I.fontClassName, $.executedLabel),
831
882
  children: [
832
- l,
883
+ m,
833
884
  " ",
834
885
  e.length,
835
886
  " ",
836
- u(e.length)
887
+ h(e.length)
837
888
  ]
838
889
  })]
839
890
  });
840
- return /* @__PURE__ */ K("div", {
841
- style: F,
842
- className: c("flex w-full flex-col gap-1", r, J.group),
843
- children: /* @__PURE__ */ K(d, {
844
- title: R,
845
- expanded: E,
846
- onToggle: D,
891
+ return /* @__PURE__ */ J("div", {
892
+ style: L,
893
+ className: c("flex w-full flex-col gap-1", r, be.group),
894
+ children: /* @__PURE__ */ J(d, {
895
+ title: B,
896
+ expanded: O,
897
+ onToggle: k,
847
898
  className: "overflow-visible py-0",
848
- headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, J.groupToggle),
899
+ headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, be.groupToggle),
849
900
  contentClassName: c("-mt-2 px-0", $.groupRegion),
850
- children: E && /* @__PURE__ */ K(st, {
901
+ children: O && /* @__PURE__ */ J(mt, {
851
902
  stages: e,
852
903
  isStreaming: t,
853
- expansion: O,
904
+ expansion: A,
854
905
  styles: {
855
- colors: N,
906
+ colors: F,
856
907
  typography: i?.typography
857
908
  },
858
- labels: I,
909
+ labels: R,
859
910
  className: "pt-1",
860
- onAttachmentClick: a
911
+ onAttachmentClick: a,
912
+ attachmentDisplayResolvers: l,
913
+ renderCitation: u
861
914
  })
862
915
  })
863
916
  });
864
917
  };
865
918
  //#endregion
866
- export { J as CONVERSATION_STAGES_CLASS, lt as CollapsedGroup, ct as StagesPanel };
919
+ export { be as CONVERSATION_STAGES_CLASS, gt as CollapsedGroup, ht as StagesPanel };