@epam/ai-dial-conversation-stages 1.3.0-dev.35 → 1.3.0-dev.354
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 +516 -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,170 @@ 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("span", {
|
|
306
|
+
"aria-hidden": !0,
|
|
307
|
+
className: "flex",
|
|
308
|
+
children: /* @__PURE__ */ J(C, { size: 32 })
|
|
309
|
+
})
|
|
292
310
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
className: "absolute
|
|
311
|
+
/* @__PURE__ */ Y("div", {
|
|
312
|
+
className: "absolute inset-e-1 top-1 flex",
|
|
295
313
|
children: [
|
|
296
|
-
|
|
297
|
-
ariaLabel:
|
|
298
|
-
errorTitle:
|
|
299
|
-
errorDescId:
|
|
314
|
+
re && /* @__PURE__ */ J(Ye, {
|
|
315
|
+
ariaLabel: E,
|
|
316
|
+
errorTitle: U,
|
|
317
|
+
errorDescId: H,
|
|
300
318
|
onClick: l,
|
|
301
|
-
id:
|
|
319
|
+
id: I
|
|
302
320
|
}),
|
|
303
|
-
|
|
304
|
-
ariaLabel:
|
|
305
|
-
errorTitle:
|
|
306
|
-
errorDescId:
|
|
321
|
+
ie && /* @__PURE__ */ J(Je, {
|
|
322
|
+
ariaLabel: D,
|
|
323
|
+
errorTitle: U,
|
|
324
|
+
errorDescId: H,
|
|
307
325
|
onClick: i,
|
|
308
|
-
id:
|
|
326
|
+
id: I
|
|
309
327
|
}),
|
|
310
|
-
u && /* @__PURE__ */
|
|
311
|
-
ariaLabel:
|
|
312
|
-
errorTitle:
|
|
313
|
-
errorDescId:
|
|
314
|
-
onClick:
|
|
328
|
+
u && /* @__PURE__ */ J(Xe, {
|
|
329
|
+
ariaLabel: k,
|
|
330
|
+
errorTitle: U,
|
|
331
|
+
errorDescId: H,
|
|
332
|
+
onClick: le
|
|
315
333
|
}),
|
|
316
|
-
|
|
317
|
-
ariaLabel:
|
|
318
|
-
errorTitle:
|
|
319
|
-
errorDescId:
|
|
320
|
-
onClick:
|
|
321
|
-
id:
|
|
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
|
-
|
|
326
|
-
id:
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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__ */
|
|
351
|
+
return /* @__PURE__ */ J("div", {
|
|
334
352
|
style: d,
|
|
335
|
-
className: c("inline-flex",
|
|
336
|
-
children: /* @__PURE__ */
|
|
337
|
-
|
|
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(
|
|
341
|
-
children:
|
|
357
|
+
className: c(ue, G && "cursor-pointer", Ke),
|
|
358
|
+
children: pe
|
|
342
359
|
})
|
|
343
360
|
});
|
|
344
|
-
},
|
|
361
|
+
}, et = /* @__PURE__ */ function(e) {
|
|
345
362
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
346
|
-
}({}),
|
|
347
|
-
let n =
|
|
348
|
-
return
|
|
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]),
|
|
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
|
-
},
|
|
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,
|
|
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__ */
|
|
389
|
+
children: /* @__PURE__ */ Y("div", {
|
|
381
390
|
className: "relative h-full w-full overflow-hidden",
|
|
382
391
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
className: "absolute
|
|
385
|
-
children: [a && /* @__PURE__ */
|
|
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:
|
|
389
|
-
className: Q.imageActionButton
|
|
390
|
-
|
|
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:
|
|
403
|
+
id: y,
|
|
394
404
|
className: Q.imageActionButton
|
|
395
405
|
})]
|
|
396
406
|
}),
|
|
397
|
-
|
|
398
|
-
variant:
|
|
407
|
+
P !== et.Loaded && /* @__PURE__ */ J(x, {
|
|
408
|
+
variant: S.Rectangular,
|
|
399
409
|
width: "100%",
|
|
400
410
|
height: "100%",
|
|
401
|
-
active:
|
|
402
|
-
overlay: /* @__PURE__ */
|
|
411
|
+
active: P === et.Loading,
|
|
412
|
+
overlay: /* @__PURE__ */ J(le, {
|
|
403
413
|
size: f.LG,
|
|
404
|
-
className: Q.
|
|
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__ */
|
|
411
|
-
ref:
|
|
412
|
-
src:
|
|
413
|
-
alt:
|
|
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",
|
|
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
|
-
},
|
|
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 } =
|
|
439
|
-
return h ? /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
},
|
|
465
|
-
let
|
|
466
|
-
if (!e?.length) return
|
|
467
|
-
let
|
|
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
|
-
|
|
498
|
+
r.has(e) || r.set(e, t.type);
|
|
471
499
|
}
|
|
472
|
-
return
|
|
473
|
-
let t =
|
|
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
|
-
},
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
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:
|
|
495
|
-
h2:
|
|
496
|
-
h3:
|
|
497
|
-
h4:
|
|
498
|
-
h5:
|
|
499
|
-
h6:
|
|
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,
|
|
502
|
-
ol: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent,
|
|
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,
|
|
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:
|
|
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
|
-
}),
|
|
521
|
-
let r =
|
|
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__ */
|
|
565
|
+
return /* @__PURE__ */ J("div", {
|
|
526
566
|
role: "list",
|
|
527
|
-
className: "flex flex-wrap gap-
|
|
528
|
-
children: e.map((e) => /* @__PURE__ */
|
|
567
|
+
className: "flex flex-wrap gap-2",
|
|
568
|
+
children: e.map((e) => /* @__PURE__ */ J("div", {
|
|
529
569
|
role: "listitem",
|
|
530
|
-
children: /* @__PURE__ */
|
|
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
|
-
},
|
|
538
|
-
let [
|
|
539
|
-
|
|
540
|
-
}, [
|
|
541
|
-
/* @__PURE__ */
|
|
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__ */
|
|
583
|
+
children: /* @__PURE__ */ J(Ie, {
|
|
544
584
|
status: e.status,
|
|
545
585
|
isLive: t,
|
|
546
|
-
runningLabel:
|
|
547
|
-
failedLabel:
|
|
586
|
+
runningLabel: C,
|
|
587
|
+
failedLabel: w
|
|
548
588
|
})
|
|
549
589
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
className: c("
|
|
552
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
598
|
+
O && /* @__PURE__ */ J("span", {
|
|
559
599
|
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
|
|
560
|
-
children:
|
|
600
|
+
children: O
|
|
561
601
|
})
|
|
562
602
|
] });
|
|
563
|
-
return
|
|
564
|
-
expanded:
|
|
565
|
-
onToggle:
|
|
566
|
-
title: /* @__PURE__ */
|
|
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:
|
|
608
|
+
children: P
|
|
569
609
|
}),
|
|
570
|
-
className:
|
|
571
|
-
headerClassName: c(
|
|
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: [
|
|
613
|
+
children: [_ && M && /* @__PURE__ */ Y("div", {
|
|
574
614
|
className: "flex min-w-0 flex-col gap-3 ps-8",
|
|
575
|
-
children: [e.content && /* @__PURE__ */
|
|
615
|
+
children: [e.content && /* @__PURE__ */ J("div", {
|
|
576
616
|
className: "max-h-[300px] min-w-0 overflow-y-auto",
|
|
577
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ J(ot, {
|
|
578
618
|
content: e.content,
|
|
579
619
|
typography: n,
|
|
580
|
-
copyAriaLabel:
|
|
581
|
-
copiedLabel:
|
|
582
|
-
tableScrollRegionAriaLabel:
|
|
583
|
-
mathScrollRegionAriaLabel:
|
|
620
|
+
copyAriaLabel: y,
|
|
621
|
+
copiedLabel: b,
|
|
622
|
+
tableScrollRegionAriaLabel: x,
|
|
623
|
+
mathScrollRegionAriaLabel: S,
|
|
624
|
+
renderCitation: l
|
|
584
625
|
})
|
|
585
|
-
}),
|
|
586
|
-
attachments:
|
|
587
|
-
clickLabel:
|
|
626
|
+
}), E.length > 0 && /* @__PURE__ */ J(st, {
|
|
627
|
+
attachments: E,
|
|
628
|
+
clickLabel: T,
|
|
588
629
|
onAttachmentClick: a
|
|
589
630
|
})]
|
|
590
|
-
}),
|
|
591
|
-
}) : /* @__PURE__ */
|
|
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:
|
|
634
|
+
children: P
|
|
594
635
|
});
|
|
595
|
-
},
|
|
596
|
-
let
|
|
597
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
605
|
-
|
|
606
|
-
|
|
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:
|
|
609
|
-
className:
|
|
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
|
-
},
|
|
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]
|
|
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
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
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:
|
|
697
|
+
children: x && h.map((e, t) => /* @__PURE__ */ J("li", {
|
|
653
698
|
role: "listitem",
|
|
654
699
|
className: "min-w-0",
|
|
655
|
-
children: /* @__PURE__ */
|
|
700
|
+
children: /* @__PURE__ */ J(dt, {
|
|
656
701
|
node: e,
|
|
657
|
-
depth:
|
|
658
|
-
nameOverride:
|
|
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
|
-
},
|
|
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:
|
|
718
|
+
children: Fe(e).map((e) => /* @__PURE__ */ J("li", {
|
|
672
719
|
role: "listitem",
|
|
673
720
|
className: "min-w-0",
|
|
674
|
-
children: e.node ? /* @__PURE__ */
|
|
721
|
+
children: e.node ? /* @__PURE__ */ J(dt, {
|
|
675
722
|
node: e.node,
|
|
676
723
|
depth: t,
|
|
677
724
|
...r
|
|
678
|
-
}) : /* @__PURE__ */
|
|
725
|
+
}) : /* @__PURE__ */ J(ft, {
|
|
679
726
|
row: e,
|
|
680
727
|
depth: t,
|
|
681
728
|
...r
|
|
682
729
|
})
|
|
683
730
|
}, 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:
|
|
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:
|
|
711
|
-
typography:
|
|
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
|
-
},
|
|
717
|
-
let t =
|
|
718
|
-
return /* @__PURE__ */
|
|
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
|
-
},
|
|
730
|
-
let { executedLabel:
|
|
731
|
-
|
|
732
|
-
|
|
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
|
-
|
|
735
|
-
|
|
736
|
-
|
|
783
|
+
M,
|
|
784
|
+
O,
|
|
785
|
+
j
|
|
737
786
|
]);
|
|
738
|
-
let
|
|
739
|
-
|
|
740
|
-
|
|
787
|
+
let N = _e(t);
|
|
788
|
+
he(() => {
|
|
789
|
+
N.current && !t && k(!1), N.current = t;
|
|
741
790
|
}, [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":
|
|
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
|
|
765
|
-
copyAriaLabel:
|
|
766
|
-
codeBlockCopiedLabel:
|
|
767
|
-
tableScrollRegionAriaLabel:
|
|
768
|
-
mathScrollRegionAriaLabel:
|
|
769
|
-
runningAriaLabel:
|
|
770
|
-
failedAriaLabel:
|
|
771
|
-
attemptLabel:
|
|
772
|
-
attachmentClickLabel:
|
|
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__ */
|
|
823
|
+
if (e.length === 1) return /* @__PURE__ */ J(mt, {
|
|
775
824
|
stages: e,
|
|
776
825
|
isStreaming: t,
|
|
777
|
-
expansion:
|
|
826
|
+
expansion: A,
|
|
778
827
|
className: r,
|
|
779
828
|
styles: {
|
|
780
|
-
colors:
|
|
829
|
+
colors: F,
|
|
781
830
|
typography: i?.typography
|
|
782
831
|
},
|
|
783
|
-
labels:
|
|
784
|
-
onAttachmentClick: a
|
|
832
|
+
labels: R,
|
|
833
|
+
onAttachmentClick: a,
|
|
834
|
+
attachmentDisplayResolvers: l,
|
|
835
|
+
renderCitation: u
|
|
785
836
|
});
|
|
786
|
-
let
|
|
837
|
+
let z = e.some((e) => e.status === o.Failed), B;
|
|
787
838
|
if (t) {
|
|
788
|
-
let t =
|
|
789
|
-
|
|
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__ */
|
|
844
|
+
children: [/* @__PURE__ */ J("span", {
|
|
794
845
|
className: "flex flex-none items-center",
|
|
795
|
-
children: /* @__PURE__ */
|
|
846
|
+
children: /* @__PURE__ */ J(C, {
|
|
796
847
|
size: 14,
|
|
797
|
-
ariaLabel:
|
|
848
|
+
ariaLabel: v
|
|
798
849
|
})
|
|
799
|
-
}), t && /* @__PURE__ */
|
|
800
|
-
className: c("
|
|
801
|
-
children: /* @__PURE__ */
|
|
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 (
|
|
855
|
+
} else if (z) {
|
|
805
856
|
let t = e.filter((e) => e.status === o.Failed).length;
|
|
806
|
-
|
|
857
|
+
B = /* @__PURE__ */ Y("span", {
|
|
807
858
|
className: "inline-flex items-center gap-1",
|
|
808
|
-
children: [/* @__PURE__ */
|
|
809
|
-
className: c(
|
|
859
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
860
|
+
className: c(I.fontClassName, $.executedLabel),
|
|
810
861
|
children: [
|
|
811
|
-
|
|
862
|
+
m,
|
|
812
863
|
" ",
|
|
813
864
|
e.length,
|
|
814
865
|
" ",
|
|
815
|
-
|
|
866
|
+
h(e.length)
|
|
816
867
|
]
|
|
817
|
-
}), /* @__PURE__ */
|
|
818
|
-
className: c(
|
|
819
|
-
children:
|
|
868
|
+
}), /* @__PURE__ */ J("span", {
|
|
869
|
+
className: c(I.fontClassName, $.failedText),
|
|
870
|
+
children: _(t)
|
|
820
871
|
})]
|
|
821
872
|
});
|
|
822
|
-
} else
|
|
873
|
+
} else B = /* @__PURE__ */ Y("span", {
|
|
823
874
|
className: "inline-flex items-center gap-1",
|
|
824
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
830
|
-
className: c(
|
|
880
|
+
}), /* @__PURE__ */ Y("span", {
|
|
881
|
+
className: c(I.fontClassName, $.executedLabel),
|
|
831
882
|
children: [
|
|
832
|
-
|
|
883
|
+
m,
|
|
833
884
|
" ",
|
|
834
885
|
e.length,
|
|
835
886
|
" ",
|
|
836
|
-
|
|
887
|
+
h(e.length)
|
|
837
888
|
]
|
|
838
889
|
})]
|
|
839
890
|
});
|
|
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:
|
|
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,
|
|
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:
|
|
901
|
+
children: O && /* @__PURE__ */ J(mt, {
|
|
851
902
|
stages: e,
|
|
852
903
|
isStreaming: t,
|
|
853
|
-
expansion:
|
|
904
|
+
expansion: A,
|
|
854
905
|
styles: {
|
|
855
|
-
colors:
|
|
906
|
+
colors: F,
|
|
856
907
|
typography: i?.typography
|
|
857
908
|
},
|
|
858
|
-
labels:
|
|
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 {
|
|
919
|
+
export { be as CONVERSATION_STAGES_CLASS, gt as CollapsedGroup, ht as StagesPanel };
|