@epam/ai-dial-conversation-stages 1.3.0-dev.29 → 1.3.0-dev.294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CollapsedGroup/CollapsedGroup.d.ts.map +1 -1
- package/components/StageItem/StageItem.d.ts +5 -1
- package/components/StageItem/StageItem.d.ts.map +1 -1
- package/components/StageList/StageList.d.ts +4 -0
- package/components/StageList/StageList.d.ts.map +1 -1
- package/components/StageMarkdownContent/StageMarkdownContent.d.ts +3 -1
- package/components/StageMarkdownContent/StageMarkdownContent.d.ts.map +1 -1
- package/components/StagesPanel/StagesPanel.d.ts.map +1 -1
- package/index.css +3 -2
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +508 -463
- package/models/collapsed-group.d.ts +6 -2
- package/models/collapsed-group.d.ts.map +1 -1
- package/models/stages-props.d.ts +11 -2
- package/models/stages-props.d.ts.map +1 -1
- package/package.json +5 -5
- package/utils/stage-attachments.d.ts +4 -2
- package/utils/stage-attachments.d.ts.map +1 -1
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,
|
|
3
|
-
import { IconAlertCircle as
|
|
4
|
-
import { memo as me, useCallback as
|
|
5
|
-
import { Fragment as
|
|
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
|
|
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
|
-
},
|
|
12
|
-
let [e, t] =
|
|
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 =
|
|
18
|
+
}, []), r = K(() => {
|
|
19
19
|
t((e) => e.size ? /* @__PURE__ */ new Set() : e);
|
|
20
20
|
}, []);
|
|
21
|
-
return
|
|
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
|
-
},
|
|
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
|
-
},
|
|
34
|
-
|
|
33
|
+
}, Te = (e) => {
|
|
34
|
+
Se.lastIndex = 0;
|
|
35
35
|
let t;
|
|
36
|
-
for (; t =
|
|
37
|
-
let e = t[0].slice(1, -1), n =
|
|
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
|
-
},
|
|
45
|
-
let t = e ?? "", n =
|
|
44
|
+
}, Ee = (e) => {
|
|
45
|
+
let t = e ?? "", n = Te(t);
|
|
46
46
|
return {
|
|
47
|
-
name:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
61
|
+
let t = ke(e.stage, n);
|
|
62
62
|
t ? t.children.push(e) : r.push(e);
|
|
63
63
|
}
|
|
64
64
|
return r;
|
|
65
|
-
},
|
|
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 =
|
|
69
|
-
for (; a < e.length &&
|
|
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: "
|
|
83
|
-
row: "
|
|
84
|
-
collapseButton: "
|
|
85
|
-
stageHeader: "
|
|
86
|
-
stageRegion: "
|
|
87
|
-
stageName: "
|
|
88
|
-
stageNameFailed: "
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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__ */
|
|
105
|
+
}), /* @__PURE__ */ J("span", {
|
|
107
106
|
className: "sr-only",
|
|
108
107
|
children: r
|
|
109
|
-
})] }) : e === o.Completed ? /* @__PURE__ */
|
|
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__ */
|
|
113
|
+
}) : t ? /* @__PURE__ */ J(C, {
|
|
115
114
|
size: 16,
|
|
116
115
|
ariaLabel: n
|
|
117
|
-
}) : null,
|
|
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
|
-
},
|
|
122
|
-
if (!e) return
|
|
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
|
|
126
|
-
case "image/png": return
|
|
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
|
|
129
|
-
default: return
|
|
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
|
|
131
|
+
if (t.startsWith("audio/")) return ce;
|
|
133
132
|
switch (t) {
|
|
134
|
-
case "application/pdf": return
|
|
135
|
-
case "application/msword": return
|
|
136
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return
|
|
137
|
-
case "application/vnd.ms-powerpoint": return
|
|
138
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return
|
|
139
|
-
case "application/vnd.ms-excel": return
|
|
140
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
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
|
|
146
|
-
case "text/csv": return
|
|
147
|
-
case "text/plain": return
|
|
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
|
|
150
|
-
case "application/xml": return
|
|
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
|
|
153
|
-
case "text/jsx": return
|
|
151
|
+
case "text/javascript": return R;
|
|
152
|
+
case "text/jsx": return z;
|
|
154
153
|
case "text/typescript": return re;
|
|
155
|
-
case "text/tsx": return
|
|
156
|
-
case "text/css": return
|
|
157
|
-
case "text/x-php": return
|
|
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
|
|
160
|
-
default: return
|
|
158
|
+
case "text/x-vue": return G;
|
|
159
|
+
default: return A;
|
|
161
160
|
}
|
|
162
|
-
},
|
|
161
|
+
}, ze = (e) => {
|
|
163
162
|
let { type: n, contentType: r } = e;
|
|
164
|
-
return n === t.Prompt ? de : n === t.Pasted ?
|
|
165
|
-
},
|
|
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
|
-
},
|
|
171
|
-
let {
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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 :
|
|
190
|
-
typeLabel: d ? null :
|
|
192
|
+
BottomIcon: d ? null : ze(e),
|
|
193
|
+
typeLabel: d ? null : Ue(e, n)
|
|
191
194
|
};
|
|
192
|
-
},
|
|
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,166 @@ var J = {
|
|
|
198
201
|
tileType: "dial-ai-attachment-tile-type",
|
|
199
202
|
tileAction: "dial-ai-attachment-tile-action"
|
|
200
203
|
}, Q = {
|
|
201
|
-
tile: "
|
|
202
|
-
hovered: "
|
|
203
|
-
selected: "
|
|
204
|
-
tileError: "
|
|
205
|
-
nameText: "
|
|
206
|
-
typeText: "
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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:
|
|
214
|
-
className: c("opacity-0
|
|
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
|
-
}),
|
|
221
|
-
icon: /* @__PURE__ */
|
|
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
|
-
}),
|
|
229
|
-
icon: /* @__PURE__ */
|
|
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
|
-
}),
|
|
236
|
-
icon: /* @__PURE__ */
|
|
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
|
-
}),
|
|
243
|
-
icon: /* @__PURE__ */
|
|
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
|
-
|
|
249
|
-
|
|
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
|
-
},
|
|
254
|
-
let { clickLabel:
|
|
255
|
-
|
|
256
|
-
},
|
|
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]),
|
|
261
|
-
title:
|
|
262
|
-
className: c(
|
|
263
|
-
children: n ? /* @__PURE__ */
|
|
264
|
-
text:
|
|
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
|
-
}) :
|
|
268
|
-
}),
|
|
269
|
-
className: c("flex w-full items-
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
-
|
|
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__ */
|
|
275
|
-
className: c(
|
|
276
|
-
children:
|
|
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
|
-
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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":
|
|
290
|
-
className: c("absolute
|
|
291
|
-
children: /* @__PURE__ */
|
|
303
|
+
"aria-label": j,
|
|
304
|
+
className: c("absolute inset-0 flex items-center justify-center rounded-[11px]", Q.track),
|
|
305
|
+
children: /* @__PURE__ */ J(C, { size: 32 })
|
|
292
306
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
className: "absolute
|
|
307
|
+
/* @__PURE__ */ Y("div", {
|
|
308
|
+
className: "absolute inset-e-1 top-1 flex",
|
|
295
309
|
children: [
|
|
296
|
-
|
|
297
|
-
ariaLabel:
|
|
298
|
-
errorTitle:
|
|
299
|
-
errorDescId:
|
|
310
|
+
re && /* @__PURE__ */ J(Ye, {
|
|
311
|
+
ariaLabel: E,
|
|
312
|
+
errorTitle: U,
|
|
313
|
+
errorDescId: H,
|
|
300
314
|
onClick: l,
|
|
301
|
-
id:
|
|
315
|
+
id: I
|
|
302
316
|
}),
|
|
303
|
-
|
|
304
|
-
ariaLabel:
|
|
305
|
-
errorTitle:
|
|
306
|
-
errorDescId:
|
|
317
|
+
ie && /* @__PURE__ */ J(Je, {
|
|
318
|
+
ariaLabel: D,
|
|
319
|
+
errorTitle: U,
|
|
320
|
+
errorDescId: H,
|
|
307
321
|
onClick: i,
|
|
308
|
-
id:
|
|
322
|
+
id: I
|
|
309
323
|
}),
|
|
310
|
-
u && /* @__PURE__ */
|
|
311
|
-
ariaLabel:
|
|
312
|
-
errorTitle:
|
|
313
|
-
errorDescId:
|
|
314
|
-
onClick:
|
|
324
|
+
u && /* @__PURE__ */ J(Xe, {
|
|
325
|
+
ariaLabel: k,
|
|
326
|
+
errorTitle: U,
|
|
327
|
+
errorDescId: H,
|
|
328
|
+
onClick: le
|
|
315
329
|
}),
|
|
316
|
-
|
|
317
|
-
ariaLabel:
|
|
318
|
-
errorTitle:
|
|
319
|
-
errorDescId:
|
|
320
|
-
onClick:
|
|
321
|
-
id:
|
|
330
|
+
x && /* @__PURE__ */ J(Ze, {
|
|
331
|
+
ariaLabel: O,
|
|
332
|
+
errorTitle: U,
|
|
333
|
+
errorDescId: H,
|
|
334
|
+
onClick: x,
|
|
335
|
+
id: I,
|
|
336
|
+
isAlwaysVisible: B
|
|
322
337
|
})
|
|
323
338
|
]
|
|
324
339
|
}),
|
|
325
|
-
|
|
326
|
-
id:
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
children: L
|
|
340
|
+
/* @__PURE__ */ J(y, {
|
|
341
|
+
id: H,
|
|
342
|
+
visuallyHidden: !0,
|
|
343
|
+
as: b.Span,
|
|
344
|
+
children: V ? U : ""
|
|
331
345
|
})
|
|
332
346
|
] });
|
|
333
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ J("div", {
|
|
334
348
|
style: d,
|
|
335
|
-
className: c("inline-flex",
|
|
336
|
-
children: /* @__PURE__ */
|
|
337
|
-
|
|
338
|
-
"aria-busy": P,
|
|
349
|
+
className: c("inline-flex", F),
|
|
350
|
+
children: /* @__PURE__ */ J("div", {
|
|
351
|
+
"aria-busy": B,
|
|
339
352
|
style: d,
|
|
340
|
-
className: c(
|
|
341
|
-
children:
|
|
353
|
+
className: c(ue, G && "cursor-pointer", Ke),
|
|
354
|
+
children: pe
|
|
342
355
|
})
|
|
343
356
|
});
|
|
344
|
-
},
|
|
357
|
+
}, et = /* @__PURE__ */ function(e) {
|
|
345
358
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
346
|
-
}({}),
|
|
347
|
-
let n =
|
|
348
|
-
return
|
|
359
|
+
}({}), tt = ({ enabled: e, src: t }) => {
|
|
360
|
+
let n = _e(null), [r, i] = ve("idle");
|
|
361
|
+
return he(() => {
|
|
349
362
|
i(e && t ? "loading" : "idle");
|
|
350
|
-
}, [e, t]),
|
|
363
|
+
}, [e, t]), he(() => {
|
|
351
364
|
let r = n.current;
|
|
352
365
|
if (!r || !e || !t) return;
|
|
353
366
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -358,67 +371,73 @@ var J = {
|
|
|
358
371
|
imageRef: n,
|
|
359
372
|
imageLoadStatus: r
|
|
360
373
|
};
|
|
361
|
-
},
|
|
362
|
-
let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className:
|
|
363
|
-
enabled:
|
|
364
|
-
src:
|
|
365
|
-
}),
|
|
366
|
-
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"aria-
|
|
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,
|
|
374
|
+
}, nt = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
|
|
375
|
+
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({
|
|
376
|
+
enabled: O,
|
|
377
|
+
src: w
|
|
378
|
+
}), F = () => {
|
|
379
|
+
T && n ? n(y) : k && r && r(y);
|
|
380
|
+
}, 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);
|
|
381
|
+
return /* @__PURE__ */ J("div", {
|
|
382
|
+
className: I,
|
|
383
|
+
"aria-busy": E,
|
|
379
384
|
style: o,
|
|
380
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ Y("div", {
|
|
381
386
|
className: "relative h-full w-full overflow-hidden",
|
|
382
387
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
className: "absolute
|
|
385
|
-
children: [a && /* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ Y("div", {
|
|
389
|
+
className: "absolute inset-e-1 top-1 z-10 flex",
|
|
390
|
+
children: [a && /* @__PURE__ */ J(Ze, {
|
|
386
391
|
ariaLabel: h,
|
|
387
392
|
onClick: a,
|
|
388
|
-
id:
|
|
389
|
-
className: Q.imageActionButton
|
|
390
|
-
|
|
393
|
+
id: y,
|
|
394
|
+
className: Q.imageActionButton,
|
|
395
|
+
isAlwaysVisible: E
|
|
396
|
+
}), j && /* @__PURE__ */ J(Ye, {
|
|
391
397
|
ariaLabel: g,
|
|
392
398
|
onClick: s,
|
|
393
|
-
id:
|
|
399
|
+
id: y,
|
|
394
400
|
className: Q.imageActionButton
|
|
395
401
|
})]
|
|
396
402
|
}),
|
|
397
|
-
|
|
398
|
-
variant:
|
|
403
|
+
P !== et.Loaded && /* @__PURE__ */ J(x, {
|
|
404
|
+
variant: S.Rectangular,
|
|
399
405
|
width: "100%",
|
|
400
406
|
height: "100%",
|
|
401
|
-
active:
|
|
402
|
-
overlay: /* @__PURE__ */
|
|
407
|
+
active: P === et.Loading,
|
|
408
|
+
overlay: /* @__PURE__ */ J(le, {
|
|
403
409
|
size: f.LG,
|
|
404
|
-
className: Q.
|
|
410
|
+
className: Q.placeholderIcon,
|
|
405
411
|
"aria-hidden": !0,
|
|
406
412
|
stroke: p
|
|
407
413
|
}),
|
|
408
414
|
className: "absolute inset-0 rounded-xl"
|
|
409
415
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
ref:
|
|
412
|
-
src:
|
|
413
|
-
alt:
|
|
416
|
+
/* @__PURE__ */ J("img", {
|
|
417
|
+
ref: N,
|
|
418
|
+
src: w,
|
|
419
|
+
alt: b,
|
|
414
420
|
loading: "lazy",
|
|
415
421
|
decoding: "async",
|
|
416
|
-
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
422
|
+
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", P === et.Loaded ? "opacity-100" : "opacity-0")
|
|
423
|
+
}),
|
|
424
|
+
A && /* @__PURE__ */ J("button", {
|
|
425
|
+
type: "button",
|
|
426
|
+
"aria-label": T ? m : d,
|
|
427
|
+
"aria-pressed": k ? u : void 0,
|
|
428
|
+
onClick: F,
|
|
429
|
+
className: c("absolute inset-0 cursor-pointer rounded-xl", Q.tileAction)
|
|
430
|
+
}),
|
|
431
|
+
E && /* @__PURE__ */ J("div", {
|
|
432
|
+
role: "progressbar",
|
|
433
|
+
"aria-label": _,
|
|
434
|
+
className: c("absolute inset-0 flex items-center justify-center rounded-xl", Q.track),
|
|
435
|
+
children: /* @__PURE__ */ J(C, { size: 32 })
|
|
417
436
|
})
|
|
418
437
|
]
|
|
419
438
|
})
|
|
420
439
|
});
|
|
421
|
-
},
|
|
440
|
+
}, rt = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
|
|
422
441
|
let { colors: f } = u ?? {}, p = e.type === t.Pasted && a !== void 0, m = s({
|
|
423
442
|
"--ai-tile-bg": f?.background,
|
|
424
443
|
"--ai-tile-border": f?.border,
|
|
@@ -432,11 +451,12 @@ var J = {
|
|
|
432
451
|
"--ai-tile-error-text": f?.errorText,
|
|
433
452
|
"--ai-tile-name-text": f?.nameText,
|
|
434
453
|
"--ai-tile-type-text": f?.typeText,
|
|
454
|
+
"--ai-tile-placeholder-icon": f?.placeholderIcon,
|
|
435
455
|
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
436
456
|
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
437
457
|
"--ai-tile-progress-track": f?.trackBackground
|
|
438
|
-
}), { isImage: h, isLink: g } =
|
|
439
|
-
return h ? /* @__PURE__ */
|
|
458
|
+
}), { isImage: h, isLink: g } = q(() => We(e), [e]);
|
|
459
|
+
return h ? /* @__PURE__ */ J(nt, {
|
|
440
460
|
attachment: e,
|
|
441
461
|
labels: l,
|
|
442
462
|
onClick: o,
|
|
@@ -446,7 +466,7 @@ var J = {
|
|
|
446
466
|
cssVars: m,
|
|
447
467
|
onDownload: c,
|
|
448
468
|
isSelected: d
|
|
449
|
-
}) : /* @__PURE__ */
|
|
469
|
+
}) : /* @__PURE__ */ J($e, {
|
|
450
470
|
attachment: e,
|
|
451
471
|
searchQuery: n,
|
|
452
472
|
onClick: o,
|
|
@@ -461,261 +481,282 @@ var J = {
|
|
|
461
481
|
isExpandable: p,
|
|
462
482
|
isSelected: d
|
|
463
483
|
});
|
|
464
|
-
},
|
|
465
|
-
let
|
|
466
|
-
if (!e?.length) return
|
|
467
|
-
let
|
|
484
|
+
}, it = (e, t) => {
|
|
485
|
+
let n = l(e, t);
|
|
486
|
+
if (!e?.length) return n;
|
|
487
|
+
let r = /* @__PURE__ */ new Map();
|
|
468
488
|
for (let t of e) {
|
|
469
489
|
let e = t.url ?? t.data ?? t.title;
|
|
470
|
-
|
|
490
|
+
r.has(e) || r.set(e, t.type);
|
|
471
491
|
}
|
|
472
|
-
return
|
|
473
|
-
let t =
|
|
492
|
+
return n.map((e) => {
|
|
493
|
+
let t = r.get(e.id);
|
|
474
494
|
return t ? {
|
|
475
495
|
...e,
|
|
476
496
|
contentType: t
|
|
477
497
|
} : e;
|
|
478
498
|
});
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
499
|
+
}, at = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i, copiedLabel: a }) => {
|
|
500
|
+
let o = t?.replace(/^language-/, "") ?? "";
|
|
501
|
+
return /* @__PURE__ */ J(r, {
|
|
502
|
+
language: o,
|
|
503
|
+
value: typeof e == "string" ? e : String(e ?? ""),
|
|
504
|
+
codeClassName: n,
|
|
505
|
+
containerClassName: c(X.codeBlock, n),
|
|
506
|
+
copyLabel: i,
|
|
507
|
+
copiedLabel: a,
|
|
508
|
+
hideDownload: !0
|
|
509
|
+
});
|
|
510
|
+
}, ot = me(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: a, mathScrollRegionAriaLabel: o, renderCitation: s }) => {
|
|
511
|
+
let l = "mb-1.5 last:mb-0", u = c(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, l), d = q(() => ({
|
|
512
|
+
code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ J(at, {
|
|
513
|
+
codeClassName: i,
|
|
514
|
+
blockClassName: t?.codeBlockClassName,
|
|
515
|
+
copyAriaLabel: n,
|
|
516
|
+
copiedLabel: r,
|
|
517
|
+
children: e
|
|
518
|
+
}) : /* @__PURE__ */ J("code", {
|
|
519
|
+
className: c("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-code-text rounded-md", X.codeInline),
|
|
520
|
+
children: e
|
|
521
|
+
}),
|
|
522
|
+
...s != null && { cit: (e) => s(e["data-id"], e.children) }
|
|
523
|
+
}), [
|
|
524
|
+
t?.codeClassName,
|
|
525
|
+
t?.codeBlockClassName,
|
|
526
|
+
n,
|
|
527
|
+
r,
|
|
528
|
+
s
|
|
529
|
+
]);
|
|
530
|
+
return /* @__PURE__ */ J(i, {
|
|
490
531
|
content: e,
|
|
491
532
|
tableScrollRegionAriaLabel: a,
|
|
492
533
|
mathScrollRegionAriaLabel: o,
|
|
493
534
|
classNames: {
|
|
494
|
-
h1:
|
|
495
|
-
h2:
|
|
496
|
-
h3:
|
|
497
|
-
h4:
|
|
498
|
-
h5:
|
|
499
|
-
h6:
|
|
535
|
+
h1: u,
|
|
536
|
+
h2: u,
|
|
537
|
+
h3: u,
|
|
538
|
+
h4: u,
|
|
539
|
+
h5: u,
|
|
540
|
+
h6: u,
|
|
500
541
|
p: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, "mb-1.5"),
|
|
501
|
-
ul: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent,
|
|
502
|
-
ol: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent,
|
|
542
|
+
ul: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, l),
|
|
543
|
+
ol: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, l),
|
|
503
544
|
strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
504
545
|
codeInline: X.codeInline,
|
|
505
|
-
blockquote: c(t?.contentClassName ?? "dial-tiny-text", X.blockquote,
|
|
546
|
+
blockquote: c(t?.contentClassName ?? "dial-tiny-text", X.blockquote, l),
|
|
506
547
|
link: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
507
548
|
tableCell: c(t?.contentClassName ?? "dial-tiny-text", X.tableCell)
|
|
508
549
|
},
|
|
509
|
-
components:
|
|
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
|
-
}) }
|
|
550
|
+
components: d
|
|
519
551
|
});
|
|
520
|
-
}),
|
|
521
|
-
let r =
|
|
552
|
+
}), st = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
|
|
553
|
+
let r = K((t) => {
|
|
522
554
|
let r = e.find((e) => e.id === t);
|
|
523
555
|
r && n?.(r);
|
|
524
556
|
}, [e, n]);
|
|
525
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ J("div", {
|
|
526
558
|
role: "list",
|
|
527
|
-
className: "flex flex-wrap gap-
|
|
528
|
-
children: e.map((e) => /* @__PURE__ */
|
|
559
|
+
className: "flex flex-wrap gap-2",
|
|
560
|
+
children: e.map((e) => /* @__PURE__ */ J("div", {
|
|
529
561
|
role: "listitem",
|
|
530
|
-
children: /* @__PURE__ */
|
|
562
|
+
children: /* @__PURE__ */ J(rt, {
|
|
531
563
|
attachment: e,
|
|
532
564
|
onClick: n && r,
|
|
533
565
|
labels: { clickLabel: t }
|
|
534
566
|
})
|
|
535
567
|
}, e.id))
|
|
536
568
|
});
|
|
537
|
-
},
|
|
538
|
-
let [
|
|
539
|
-
|
|
540
|
-
}, [
|
|
541
|
-
/* @__PURE__ */
|
|
569
|
+
}, ct = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, attachmentDisplayResolvers: s, renderCitation: l, childList: u, isExpanded: f, onToggle: p }) => {
|
|
570
|
+
let [m, h] = ve(!1), _ = f ?? m, v = K((e) => {
|
|
571
|
+
f === void 0 && h(e), p?.(e);
|
|
572
|
+
}, [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: [
|
|
573
|
+
/* @__PURE__ */ J("span", {
|
|
542
574
|
className: "flex flex-none items-center",
|
|
543
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */ J(Ie, {
|
|
544
576
|
status: e.status,
|
|
545
577
|
isLive: t,
|
|
546
|
-
runningLabel:
|
|
547
|
-
failedLabel:
|
|
578
|
+
runningLabel: C,
|
|
579
|
+
failedLabel: w
|
|
548
580
|
})
|
|
549
581
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
className: c("
|
|
552
|
-
children: /* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ J("span", {
|
|
583
|
+
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),
|
|
584
|
+
children: /* @__PURE__ */ J(g, { text: k || e.status || "" })
|
|
553
585
|
}),
|
|
554
|
-
e.tag && /* @__PURE__ */
|
|
586
|
+
e.tag && /* @__PURE__ */ J("span", {
|
|
555
587
|
className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", X.tag),
|
|
556
588
|
children: e.tag
|
|
557
589
|
}),
|
|
558
|
-
|
|
590
|
+
O && /* @__PURE__ */ J("span", {
|
|
559
591
|
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
|
|
560
|
-
children:
|
|
592
|
+
children: O
|
|
561
593
|
})
|
|
562
594
|
] });
|
|
563
|
-
return
|
|
564
|
-
expanded:
|
|
565
|
-
onToggle:
|
|
566
|
-
title: /* @__PURE__ */
|
|
595
|
+
return N ? /* @__PURE__ */ Y(d, {
|
|
596
|
+
expanded: _,
|
|
597
|
+
onToggle: v,
|
|
598
|
+
title: /* @__PURE__ */ J("span", {
|
|
567
599
|
className: "flex min-w-0 items-center gap-2",
|
|
568
|
-
children:
|
|
600
|
+
children: P
|
|
569
601
|
}),
|
|
570
|
-
className:
|
|
571
|
-
headerClassName: c(
|
|
602
|
+
className: Ne,
|
|
603
|
+
headerClassName: c(Pe, X.row, X.stageHeader),
|
|
572
604
|
contentClassName: c("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1", X.stageRegion),
|
|
573
|
-
children: [
|
|
605
|
+
children: [_ && M && /* @__PURE__ */ Y("div", {
|
|
574
606
|
className: "flex min-w-0 flex-col gap-3 ps-8",
|
|
575
|
-
children: [e.content && /* @__PURE__ */
|
|
607
|
+
children: [e.content && /* @__PURE__ */ J("div", {
|
|
576
608
|
className: "max-h-[300px] min-w-0 overflow-y-auto",
|
|
577
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ J(ot, {
|
|
578
610
|
content: e.content,
|
|
579
611
|
typography: n,
|
|
580
|
-
copyAriaLabel:
|
|
581
|
-
copiedLabel:
|
|
582
|
-
tableScrollRegionAriaLabel:
|
|
583
|
-
mathScrollRegionAriaLabel:
|
|
612
|
+
copyAriaLabel: y,
|
|
613
|
+
copiedLabel: b,
|
|
614
|
+
tableScrollRegionAriaLabel: x,
|
|
615
|
+
mathScrollRegionAriaLabel: S,
|
|
616
|
+
renderCitation: l
|
|
584
617
|
})
|
|
585
|
-
}),
|
|
586
|
-
attachments:
|
|
587
|
-
clickLabel:
|
|
618
|
+
}), E.length > 0 && /* @__PURE__ */ J(st, {
|
|
619
|
+
attachments: E,
|
|
620
|
+
clickLabel: T,
|
|
588
621
|
onAttachmentClick: a
|
|
589
622
|
})]
|
|
590
|
-
}),
|
|
591
|
-
}) : /* @__PURE__ */
|
|
623
|
+
}), _ && u]
|
|
624
|
+
}) : /* @__PURE__ */ J("div", {
|
|
592
625
|
className: c("flex w-full items-center gap-2 px-2 py-1.5", X.row),
|
|
593
|
-
children:
|
|
626
|
+
children: P
|
|
594
627
|
});
|
|
595
|
-
},
|
|
596
|
-
let
|
|
597
|
-
return /* @__PURE__ */
|
|
628
|
+
}, 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 }) => {
|
|
629
|
+
let u = je(e.stage.index), d = t + 1;
|
|
630
|
+
return /* @__PURE__ */ J(ct, {
|
|
598
631
|
stage: e.stage,
|
|
599
632
|
nameOverride: n,
|
|
600
633
|
isLive: r && e.stage.status == null,
|
|
601
634
|
typography: a,
|
|
602
635
|
labels: o,
|
|
603
636
|
onAttachmentClick: s,
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
637
|
+
attachmentDisplayResolvers: c,
|
|
638
|
+
renderCitation: l,
|
|
639
|
+
isExpanded: i.isExpanded(u),
|
|
640
|
+
onToggle: (e) => i.onToggle(u, e),
|
|
641
|
+
childList: e.children.length > 0 ? /* @__PURE__ */ J(pt, {
|
|
607
642
|
nodes: e.children,
|
|
608
|
-
depth:
|
|
609
|
-
className:
|
|
643
|
+
depth: d,
|
|
644
|
+
className: lt(d),
|
|
610
645
|
isStreaming: r,
|
|
611
646
|
expansion: i,
|
|
612
647
|
typography: a,
|
|
613
648
|
labels: o,
|
|
614
|
-
onAttachmentClick: s
|
|
649
|
+
onAttachmentClick: s,
|
|
650
|
+
attachmentDisplayResolvers: c,
|
|
651
|
+
renderCitation: l
|
|
615
652
|
}) : void 0
|
|
616
653
|
});
|
|
617
|
-
},
|
|
618
|
-
let { runningAriaLabel:
|
|
619
|
-
|
|
620
|
-
let
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
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]
|
|
654
|
+
}, ft = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: s, attachmentDisplayResolvers: l, renderCitation: u }) => {
|
|
655
|
+
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;
|
|
656
|
+
_ ? y = null : v && (y = o.Failed);
|
|
657
|
+
let b = Me(e.key), x = r.isExpanded(b), S = t + 1, C = /* @__PURE__ */ Y("span", {
|
|
658
|
+
className: "flex min-w-0 items-center gap-2",
|
|
659
|
+
children: [
|
|
660
|
+
/* @__PURE__ */ J("span", {
|
|
661
|
+
className: "flex flex-none items-center",
|
|
662
|
+
children: /* @__PURE__ */ J(Ie, {
|
|
663
|
+
status: y,
|
|
664
|
+
isLive: n && _,
|
|
665
|
+
runningLabel: f,
|
|
666
|
+
failedLabel: p
|
|
641
667
|
})
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ J("span", {
|
|
670
|
+
className: c("max-w-88 min-w-0 truncate", i?.fontClassName ?? "dial-small-text", X.stageName, v && X.stageNameFailed),
|
|
671
|
+
children: /* @__PURE__ */ J(g, { text: e.name })
|
|
672
|
+
}),
|
|
673
|
+
/* @__PURE__ */ Y("span", {
|
|
674
|
+
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
|
|
675
|
+
children: ["×", h.length]
|
|
676
|
+
})
|
|
677
|
+
]
|
|
678
|
+
});
|
|
679
|
+
return /* @__PURE__ */ J(d, {
|
|
680
|
+
title: C,
|
|
681
|
+
expanded: x,
|
|
682
|
+
onToggle: (e) => r.onToggle(b, e),
|
|
683
|
+
className: Ne,
|
|
684
|
+
headerClassName: c(Pe, X.collapseButton, X.row, X.stageHeader),
|
|
685
|
+
contentClassName: c("-mt-2 min-w-0 px-0", ut(S), X.stageRegion),
|
|
686
|
+
children: /* @__PURE__ */ J("ul", {
|
|
650
687
|
role: "list",
|
|
651
688
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
652
|
-
children:
|
|
689
|
+
children: x && h.map((e, t) => /* @__PURE__ */ J("li", {
|
|
653
690
|
role: "listitem",
|
|
654
691
|
className: "min-w-0",
|
|
655
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ J(dt, {
|
|
656
693
|
node: e,
|
|
657
|
-
depth:
|
|
658
|
-
nameOverride:
|
|
694
|
+
depth: S,
|
|
695
|
+
nameOverride: m(t + 1),
|
|
659
696
|
isStreaming: n,
|
|
660
697
|
expansion: r,
|
|
661
698
|
typography: i,
|
|
662
699
|
labels: a,
|
|
663
|
-
onAttachmentClick: s
|
|
700
|
+
onAttachmentClick: s,
|
|
701
|
+
attachmentDisplayResolvers: l,
|
|
702
|
+
renderCitation: u
|
|
664
703
|
})
|
|
665
704
|
}, e.stage.index))
|
|
666
705
|
})
|
|
667
706
|
});
|
|
668
|
-
},
|
|
707
|
+
}, pt = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ J("ul", {
|
|
669
708
|
role: "list",
|
|
670
709
|
className: c("flex min-w-0 flex-col gap-0.5", n),
|
|
671
|
-
children:
|
|
710
|
+
children: Fe(e).map((e) => /* @__PURE__ */ J("li", {
|
|
672
711
|
role: "listitem",
|
|
673
712
|
className: "min-w-0",
|
|
674
|
-
children: e.node ? /* @__PURE__ */
|
|
713
|
+
children: e.node ? /* @__PURE__ */ J(dt, {
|
|
675
714
|
node: e.node,
|
|
676
715
|
depth: t,
|
|
677
716
|
...r
|
|
678
|
-
}) : /* @__PURE__ */
|
|
717
|
+
}) : /* @__PURE__ */ J(ft, {
|
|
679
718
|
row: e,
|
|
680
719
|
depth: t,
|
|
681
720
|
...r
|
|
682
721
|
})
|
|
683
722
|
}, e.key))
|
|
684
|
-
}),
|
|
685
|
-
let { colors:
|
|
686
|
-
"--cs-text":
|
|
687
|
-
"--cs-row-hover":
|
|
688
|
-
"--cs-button-bg":
|
|
689
|
-
"--cs-stage-text":
|
|
690
|
-
"--cs-failed-text":
|
|
691
|
-
"--cs-tag-text":
|
|
692
|
-
"--cs-count-text":
|
|
693
|
-
"--cs-duration-text":
|
|
694
|
-
"--cs-icon-secondary":
|
|
695
|
-
"--cs-icon-completed":
|
|
696
|
-
"--cs-icon-error":
|
|
697
|
-
"--cs-code-bg":
|
|
698
|
-
"--cs-code-border":
|
|
699
|
-
"--cs-code-text":
|
|
700
|
-
"--cs-border":
|
|
701
|
-
}),
|
|
702
|
-
return /* @__PURE__ */
|
|
703
|
-
style:
|
|
704
|
-
className: c("w-full min-w-0", X.panel, n,
|
|
705
|
-
children: /* @__PURE__ */
|
|
706
|
-
nodes:
|
|
723
|
+
}), mt = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: l, expansion: u }) => {
|
|
724
|
+
let { colors: d, typography: f } = r ?? {}, p = s({
|
|
725
|
+
"--cs-text": d?.text,
|
|
726
|
+
"--cs-row-hover": d?.rowHoverColor,
|
|
727
|
+
"--cs-button-bg": d?.collapsedButtonBg,
|
|
728
|
+
"--cs-stage-text": d?.stageTextColor,
|
|
729
|
+
"--cs-failed-text": d?.failedColor,
|
|
730
|
+
"--cs-tag-text": d?.tagTextColor,
|
|
731
|
+
"--cs-count-text": d?.countTextColor,
|
|
732
|
+
"--cs-duration-text": d?.durationTextColor,
|
|
733
|
+
"--cs-icon-secondary": d?.iconSecondaryColor,
|
|
734
|
+
"--cs-icon-completed": d?.iconCompletedColor,
|
|
735
|
+
"--cs-icon-error": d?.iconErrorColor,
|
|
736
|
+
"--cs-code-bg": d?.codeBg,
|
|
737
|
+
"--cs-code-border": d?.codeBorderColor,
|
|
738
|
+
"--cs-code-text": d?.codeTextColor,
|
|
739
|
+
"--cs-border": d?.borderColor
|
|
740
|
+
}), m = q(() => Ae(e), [e]);
|
|
741
|
+
return /* @__PURE__ */ J("div", {
|
|
742
|
+
style: p,
|
|
743
|
+
className: c("w-full min-w-0", X.panel, n, be.panel),
|
|
744
|
+
children: /* @__PURE__ */ J(pt, {
|
|
745
|
+
nodes: m,
|
|
707
746
|
depth: 0,
|
|
708
747
|
className: "w-full ps-5",
|
|
709
748
|
isStreaming: t,
|
|
710
|
-
expansion:
|
|
711
|
-
typography:
|
|
749
|
+
expansion: u,
|
|
750
|
+
typography: f,
|
|
712
751
|
labels: i,
|
|
713
|
-
onAttachmentClick: a
|
|
752
|
+
onAttachmentClick: a,
|
|
753
|
+
attachmentDisplayResolvers: o,
|
|
754
|
+
renderCitation: l
|
|
714
755
|
})
|
|
715
756
|
});
|
|
716
|
-
},
|
|
717
|
-
let t =
|
|
718
|
-
return /* @__PURE__ */
|
|
757
|
+
}, ht = (e) => {
|
|
758
|
+
let t = xe();
|
|
759
|
+
return /* @__PURE__ */ J(mt, {
|
|
719
760
|
...e,
|
|
720
761
|
expansion: t
|
|
721
762
|
});
|
|
@@ -726,141 +767,145 @@ var J = {
|
|
|
726
767
|
doneIcon: "_doneIcon_16fae_36",
|
|
727
768
|
failedText: "_failedText_16fae_40",
|
|
728
769
|
liveName: "_liveName_16fae_44"
|
|
729
|
-
},
|
|
730
|
-
let { executedLabel:
|
|
731
|
-
|
|
732
|
-
|
|
770
|
+
}, gt = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a, attachmentDisplayResolvers: l, renderCitation: u }) => {
|
|
771
|
+
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;
|
|
772
|
+
he(() => {
|
|
773
|
+
M && !O && j();
|
|
733
774
|
}, [
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
775
|
+
M,
|
|
776
|
+
O,
|
|
777
|
+
j
|
|
737
778
|
]);
|
|
738
|
-
let
|
|
739
|
-
|
|
740
|
-
|
|
779
|
+
let N = _e(t);
|
|
780
|
+
he(() => {
|
|
781
|
+
N.current && !t && k(!1), N.current = t;
|
|
741
782
|
}, [t]);
|
|
742
|
-
let { colors:
|
|
743
|
-
"--cs-cg-label":
|
|
744
|
-
"--cs-cg-label-hover":
|
|
745
|
-
"--cs-cg-done":
|
|
746
|
-
"--cs-cg-failed":
|
|
747
|
-
"--cs-text":
|
|
748
|
-
"--cs-row-hover":
|
|
749
|
-
"--cs-button-bg":
|
|
750
|
-
"--cs-stage-text":
|
|
751
|
-
"--cs-failed-text":
|
|
752
|
-
"--cs-tag-text":
|
|
753
|
-
"--cs-count-text":
|
|
754
|
-
"--cs-duration-text":
|
|
755
|
-
"--cs-icon-secondary":
|
|
756
|
-
"--cs-icon-completed":
|
|
757
|
-
"--cs-icon-error":
|
|
758
|
-
"--cs-code-bg":
|
|
759
|
-
"--cs-code-border":
|
|
760
|
-
"--cs-code-text":
|
|
761
|
-
"--cs-border":
|
|
783
|
+
let { colors: P, panel: F } = i ?? {}, I = i?.typography ?? { fontClassName: "dial-small-text" }, L = s({
|
|
784
|
+
"--cs-cg-label": P?.labelColor,
|
|
785
|
+
"--cs-cg-label-hover": P?.labelHoverColor,
|
|
786
|
+
"--cs-cg-done": P?.doneColor,
|
|
787
|
+
"--cs-cg-failed": P?.failedColor,
|
|
788
|
+
"--cs-text": F?.text,
|
|
789
|
+
"--cs-row-hover": F?.rowHoverColor,
|
|
790
|
+
"--cs-button-bg": F?.collapsedButtonBg,
|
|
791
|
+
"--cs-stage-text": F?.stageTextColor,
|
|
792
|
+
"--cs-failed-text": F?.failedColor,
|
|
793
|
+
"--cs-tag-text": F?.tagTextColor,
|
|
794
|
+
"--cs-count-text": F?.countTextColor,
|
|
795
|
+
"--cs-duration-text": F?.durationTextColor,
|
|
796
|
+
"--cs-icon-secondary": F?.iconSecondaryColor,
|
|
797
|
+
"--cs-icon-completed": F?.iconCompletedColor,
|
|
798
|
+
"--cs-icon-error": F?.iconErrorColor,
|
|
799
|
+
"--cs-code-bg": F?.codeBg,
|
|
800
|
+
"--cs-code-border": F?.codeBorderColor,
|
|
801
|
+
"--cs-code-text": F?.codeTextColor,
|
|
802
|
+
"--cs-border": F?.borderColor
|
|
762
803
|
});
|
|
763
804
|
if (e.length === 0) return null;
|
|
764
|
-
let
|
|
765
|
-
copyAriaLabel:
|
|
766
|
-
codeBlockCopiedLabel:
|
|
767
|
-
tableScrollRegionAriaLabel:
|
|
768
|
-
mathScrollRegionAriaLabel:
|
|
769
|
-
runningAriaLabel:
|
|
770
|
-
failedAriaLabel:
|
|
771
|
-
attemptLabel:
|
|
772
|
-
attachmentClickLabel:
|
|
805
|
+
let R = {
|
|
806
|
+
copyAriaLabel: y,
|
|
807
|
+
codeBlockCopiedLabel: b,
|
|
808
|
+
tableScrollRegionAriaLabel: x,
|
|
809
|
+
mathScrollRegionAriaLabel: S,
|
|
810
|
+
runningAriaLabel: v,
|
|
811
|
+
failedAriaLabel: w,
|
|
812
|
+
attemptLabel: T,
|
|
813
|
+
attachmentClickLabel: D
|
|
773
814
|
};
|
|
774
|
-
if (e.length === 1) return /* @__PURE__ */
|
|
815
|
+
if (e.length === 1) return /* @__PURE__ */ J(mt, {
|
|
775
816
|
stages: e,
|
|
776
817
|
isStreaming: t,
|
|
777
|
-
expansion:
|
|
818
|
+
expansion: A,
|
|
778
819
|
className: r,
|
|
779
820
|
styles: {
|
|
780
|
-
colors:
|
|
821
|
+
colors: F,
|
|
781
822
|
typography: i?.typography
|
|
782
823
|
},
|
|
783
|
-
labels:
|
|
784
|
-
onAttachmentClick: a
|
|
824
|
+
labels: R,
|
|
825
|
+
onAttachmentClick: a,
|
|
826
|
+
attachmentDisplayResolvers: l,
|
|
827
|
+
renderCitation: u
|
|
785
828
|
});
|
|
786
|
-
let
|
|
829
|
+
let z = e.some((e) => e.status === o.Failed), B;
|
|
787
830
|
if (t) {
|
|
788
|
-
let t =
|
|
789
|
-
|
|
831
|
+
let t = Ee((Oe(e) ?? e[e.length - 1]).name).name;
|
|
832
|
+
B = /* @__PURE__ */ Y("span", {
|
|
790
833
|
role: "status",
|
|
791
834
|
"aria-live": "polite",
|
|
792
835
|
className: "flex min-w-0 items-center gap-2",
|
|
793
|
-
children: [/* @__PURE__ */
|
|
836
|
+
children: [/* @__PURE__ */ J("span", {
|
|
794
837
|
className: "flex flex-none items-center",
|
|
795
|
-
children: /* @__PURE__ */
|
|
838
|
+
children: /* @__PURE__ */ J(C, {
|
|
796
839
|
size: 14,
|
|
797
|
-
ariaLabel:
|
|
840
|
+
ariaLabel: v
|
|
798
841
|
})
|
|
799
|
-
}), t && /* @__PURE__ */
|
|
800
|
-
className: c("
|
|
801
|
-
children: /* @__PURE__ */
|
|
842
|
+
}), t && /* @__PURE__ */ J("span", {
|
|
843
|
+
className: c("max-w-88 min-w-0 truncate", I.fontClassName, $.liveName),
|
|
844
|
+
children: /* @__PURE__ */ J(g, { text: t })
|
|
802
845
|
})]
|
|
803
846
|
});
|
|
804
|
-
} else if (
|
|
847
|
+
} else if (z) {
|
|
805
848
|
let t = e.filter((e) => e.status === o.Failed).length;
|
|
806
|
-
|
|
849
|
+
B = /* @__PURE__ */ Y("span", {
|
|
807
850
|
className: "inline-flex items-center gap-1",
|
|
808
|
-
children: [/* @__PURE__ */
|
|
809
|
-
className: c(
|
|
851
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
852
|
+
className: c(I.fontClassName, $.executedLabel),
|
|
810
853
|
children: [
|
|
811
|
-
|
|
854
|
+
m,
|
|
812
855
|
" ",
|
|
813
856
|
e.length,
|
|
814
857
|
" ",
|
|
815
|
-
|
|
858
|
+
h(e.length)
|
|
816
859
|
]
|
|
817
|
-
}), /* @__PURE__ */
|
|
818
|
-
className: c(
|
|
819
|
-
children:
|
|
860
|
+
}), /* @__PURE__ */ J("span", {
|
|
861
|
+
className: c(I.fontClassName, $.failedText),
|
|
862
|
+
children: _(t)
|
|
820
863
|
})]
|
|
821
864
|
});
|
|
822
|
-
} else
|
|
865
|
+
} else B = /* @__PURE__ */ Y("span", {
|
|
823
866
|
className: "inline-flex items-center gap-1",
|
|
824
|
-
children: [/* @__PURE__ */
|
|
867
|
+
children: [/* @__PURE__ */ J(E, {
|
|
825
868
|
size: f.SM,
|
|
826
869
|
className: $.doneIcon,
|
|
827
870
|
"aria-hidden": !0,
|
|
828
871
|
stroke: p
|
|
829
|
-
}), /* @__PURE__ */
|
|
830
|
-
className: c(
|
|
872
|
+
}), /* @__PURE__ */ Y("span", {
|
|
873
|
+
className: c(I.fontClassName, $.executedLabel),
|
|
831
874
|
children: [
|
|
832
|
-
|
|
875
|
+
m,
|
|
833
876
|
" ",
|
|
834
877
|
e.length,
|
|
835
878
|
" ",
|
|
836
|
-
|
|
879
|
+
h(e.length)
|
|
837
880
|
]
|
|
838
881
|
})]
|
|
839
882
|
});
|
|
840
|
-
return /* @__PURE__ */
|
|
841
|
-
style:
|
|
842
|
-
className: c("flex w-full flex-col gap-1", r,
|
|
843
|
-
children: /* @__PURE__ */
|
|
844
|
-
title:
|
|
845
|
-
expanded:
|
|
846
|
-
onToggle:
|
|
883
|
+
return /* @__PURE__ */ J("div", {
|
|
884
|
+
style: L,
|
|
885
|
+
className: c("flex w-full flex-col gap-1", r, be.group),
|
|
886
|
+
children: /* @__PURE__ */ J(d, {
|
|
887
|
+
title: B,
|
|
888
|
+
expanded: O,
|
|
889
|
+
onToggle: k,
|
|
847
890
|
className: "overflow-visible py-0",
|
|
848
|
-
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton,
|
|
891
|
+
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, be.groupToggle),
|
|
849
892
|
contentClassName: c("-mt-2 px-0", $.groupRegion),
|
|
850
|
-
children:
|
|
893
|
+
children: O && /* @__PURE__ */ J(mt, {
|
|
851
894
|
stages: e,
|
|
852
895
|
isStreaming: t,
|
|
853
|
-
expansion:
|
|
896
|
+
expansion: A,
|
|
854
897
|
styles: {
|
|
855
|
-
colors:
|
|
898
|
+
colors: F,
|
|
856
899
|
typography: i?.typography
|
|
857
900
|
},
|
|
858
|
-
labels:
|
|
901
|
+
labels: R,
|
|
859
902
|
className: "pt-1",
|
|
860
|
-
onAttachmentClick: a
|
|
903
|
+
onAttachmentClick: a,
|
|
904
|
+
attachmentDisplayResolvers: l,
|
|
905
|
+
renderCitation: u
|
|
861
906
|
})
|
|
862
907
|
})
|
|
863
908
|
});
|
|
864
909
|
};
|
|
865
910
|
//#endregion
|
|
866
|
-
export {
|
|
911
|
+
export { be as CONVERSATION_STAGES_CLASS, gt as CollapsedGroup, ht as StagesPanel };
|