@pstdio/ui 0.13.0 → 0.15.0
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/dist/MermaidComponent-DBJsTOmj.js +60 -0
- package/dist/MermaidComponent-DBJsTOmj.js.map +1 -0
- package/dist/chat-ui.js +1222 -1147
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/bubble-button.d.ts +1 -1
- package/dist/components/chat-ui/components/chat-input-attachments.d.ts +12 -0
- package/dist/components/chat-ui/components/chat-input.d.ts +3 -0
- package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
- package/dist/components/chat-ui/components/message-parts-renderer.d.ts +1 -1
- package/dist/components/chat-ui/components/message-types.d.ts +90 -3
- package/dist/components/chat-ui/index.d.ts +2 -2
- package/dist/components/chat-ui/mocks/library/index.d.ts +2 -2
- package/dist/components/chat-ui/performance/chat-performance-fixtures.d.ts +1 -1
- package/dist/components/chat-ui/performance/chat-performance-story-utils.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +3 -3
- package/dist/components/chat-ui/tool-rendering/question-renderer.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +2 -2
- package/dist/components/chat-ui/tool-rendering/todowrite-renderer.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/types.d.ts +1 -1
- package/dist/components/data-renderer/data-renderer-board-column-header.d.ts +8 -0
- package/dist/components/data-renderer/data-renderer-board-group-section.d.ts +17 -0
- package/dist/components/data-renderer/data-renderer-board-move.d.ts +21 -0
- package/dist/components/data-renderer/data-renderer-board.d.ts +3 -2
- package/dist/components/data-renderer/data-renderer-content.d.ts +7 -2
- package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
- package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
- package/dist/components/data-renderer/data-renderer.d.ts +2 -2
- package/dist/components/diff-viewer/diff-card-body.d.ts +16 -0
- package/dist/components/diff-viewer/diff-card.d.ts +1 -0
- package/dist/components/diff-viewer/diff-size.d.ts +1 -1
- package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
- package/dist/components/icon-color-picker.d.ts +2 -6
- package/dist/components/list-row/list-row.types.d.ts +1 -1
- package/dist/components/mermaid-renderer/download-png.d.ts +7 -0
- package/dist/components/mermaid-renderer/index.d.ts +2 -0
- package/dist/components/mermaid-renderer/mermaid-error-state.d.ts +6 -0
- package/dist/components/mermaid-renderer/mermaid-fixtures.d.ts +9 -0
- package/dist/components/mermaid-renderer/mermaid-fullscreen.d.ts +10 -0
- package/dist/components/mermaid-renderer/mermaid-renderer.d.ts +8 -0
- package/dist/components/mermaid-renderer/mermaid-svg-view.d.ts +12 -0
- package/dist/components/mermaid-renderer/mermaid-toolbar.d.ts +12 -0
- package/dist/components/mermaid-renderer/mermaid-zoom.d.ts +6 -0
- package/dist/components/mermaid-renderer/svg-data-url.d.ts +6 -0
- package/dist/components/mermaid-renderer/use-mermaid-render.d.ts +5 -0
- package/dist/components/notification-center/index.d.ts +2 -0
- package/dist/components/notification-center/notification-center.d.ts +2 -0
- package/dist/components/notification-center/notification-center.types.d.ts +37 -0
- package/dist/components/palette-shortcut.d.ts +8 -0
- package/dist/components/search-modal-content.d.ts +20 -0
- package/dist/components/style-guide-data.d.ts +0 -6
- package/dist/components/tab-strip/tab-visibility-filter.d.ts +4 -2
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +11 -3
- package/dist/components/tree-list/tree-list.types.d.ts +7 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +4641 -4326
- package/dist/index.js.map +1 -1
- package/dist/mermaid-renderer-CPGj6vsb.js +570 -0
- package/dist/mermaid-renderer-CPGj6vsb.js.map +1 -0
- package/dist/resource-badge-CeJTOn8F.js +188 -0
- package/dist/resource-badge-CeJTOn8F.js.map +1 -0
- package/dist/{rich-message-CEOSsdR2.js → rich-message-DNSEhxXh.js} +431 -519
- package/dist/rich-message-DNSEhxXh.js.map +1 -0
- package/dist/rich-text.js +405 -399
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/shadowless-default-config.d.ts +2 -0
- package/dist/{theme-D2LYEa0j.js → theme-25P7ij4C.js} +211 -241
- package/dist/theme-25P7ij4C.js.map +1 -0
- package/dist/theme.js +1 -1
- package/package.json +3 -2
- package/dist/MermaidComponent-Cz_Iob5U.js +0 -127
- package/dist/MermaidComponent-Cz_Iob5U.js.map +0 -1
- package/dist/components/chat-ui/agent-types.d.ts +0 -220
- package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
- package/dist/get-file-type-icon-ufFb0IkR.js +0 -102
- package/dist/get-file-type-icon-ufFb0IkR.js.map +0 -1
- package/dist/rich-message-CEOSsdR2.js.map +0 -1
- package/dist/theme/tokens/shadows.d.ts +0 -64
- package/dist/theme-D2LYEa0j.js.map +0 -1
package/dist/chat-ui.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { chakra as
|
|
4
|
-
import { ArrowDownIcon as
|
|
5
|
-
import { StickToBottom as
|
|
6
|
-
import { S as
|
|
7
|
-
import { useRef as
|
|
8
|
-
import { i as
|
|
1
|
+
import { jsx as a, jsxs as k, Fragment as Ot } from "react/jsx-runtime";
|
|
2
|
+
import { c as T } from "react/compiler-runtime";
|
|
3
|
+
import { chakra as Fn, AbsoluteCenter as zn, IconButton as $t, defineSlotRecipe as qn, createSlotRecipeContext as Hn, Text as X, Code as jt, Button as Ze, HStack as Me, Box as I, Flex as Re, Stack as Y, Textarea as Qn, Tooltip as dt, Portal as Wn, Kbd as Nn, Spacer as Vn, Timeline as jn, Span as Je, Avatar as We, Card as ue, Link as sn, Spinner as Ft, Image as Un, Skeleton as Kn } from "@chakra-ui/react";
|
|
4
|
+
import { ArrowDownIcon as Gn, ShieldX as Xn, ShieldCheck as Yn, Check as rn, Square as Jn, ArrowUp as Zn, Copy as eo, Move as to, FileDown as no, FileUp as oo, FileDiff as so, Trash2 as ro, FilePen as io, FileText as lo, ListTree as ao, Terminal as ln, ListTodo as co, CircleQuestionMark as uo, File as fo, Globe as po, Search as mo, AlertTriangle as an, DotIcon as ho, ChevronUpIcon as go, MessageCircleIcon as bo } from "lucide-react";
|
|
5
|
+
import { StickToBottom as yo, useStickToBottomContext as mt } from "use-stick-to-bottom";
|
|
6
|
+
import { S as ht, R as zt, T as cn } from "./resource-badge-CeJTOn8F.js";
|
|
7
|
+
import { Fragment as xo, useRef as Ne, useEffect as Ae, useState as G } from "react";
|
|
8
|
+
import { i as Mt, P as So, h as To, R as un } from "./rich-message-DNSEhxXh.js";
|
|
9
9
|
import "@lexical/react/LexicalCollaborationContext";
|
|
10
10
|
import "@lexical/react/LexicalCollaborationPlugin";
|
|
11
11
|
import "@lexical/react/LexicalComposer";
|
|
@@ -30,17 +30,18 @@ import "@lexical/markdown";
|
|
|
30
30
|
import "@lexical/react/LexicalAutoFocusPlugin";
|
|
31
31
|
import "@lexical/react/LexicalCheckListPlugin";
|
|
32
32
|
import "@lexical/react/LexicalHistoryPlugin";
|
|
33
|
+
import "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
33
34
|
import "@lexical/react/LexicalOnChangePlugin";
|
|
34
35
|
import "@lexical/react/LexicalTreeView";
|
|
35
36
|
import "@lexical/react/LexicalClickableLinkPlugin";
|
|
36
|
-
import { C as
|
|
37
|
-
import { useVirtualizer as
|
|
38
|
-
const
|
|
37
|
+
import { C as dn, R as wo, a as ko, D as Co, b as fn, A as Ut, E as Ao } from "./radio-DJtQY9po.js";
|
|
38
|
+
import { useVirtualizer as _o } from "@tanstack/react-virtual";
|
|
39
|
+
const Ro = {
|
|
39
40
|
"aria-roledescription": "conversation",
|
|
40
41
|
initial: "instant",
|
|
41
42
|
resize: "instant",
|
|
42
43
|
role: "log"
|
|
43
|
-
},
|
|
44
|
+
}, Io = Fn(yo, {
|
|
44
45
|
base: {
|
|
45
46
|
position: "relative",
|
|
46
47
|
flex: 1,
|
|
@@ -49,18 +50,18 @@ const xs = {
|
|
|
49
50
|
}
|
|
50
51
|
}, {
|
|
51
52
|
forwardProps: ["initial", "resize"],
|
|
52
|
-
defaultProps:
|
|
53
|
-
}),
|
|
54
|
-
const e =
|
|
55
|
-
let n,
|
|
53
|
+
defaultProps: Ro
|
|
54
|
+
}), Po = (t) => {
|
|
55
|
+
const e = T(10);
|
|
56
|
+
let n, s;
|
|
56
57
|
e[0] !== t ? ({
|
|
57
58
|
children: n,
|
|
58
|
-
...
|
|
59
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
59
|
+
...s
|
|
60
|
+
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
60
61
|
const {
|
|
61
|
-
contentRef:
|
|
62
|
+
contentRef: o,
|
|
62
63
|
scrollRef: r
|
|
63
|
-
} =
|
|
64
|
+
} = mt(), i = r, l = o;
|
|
64
65
|
let c, u;
|
|
65
66
|
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
|
|
66
67
|
zIndex: 2
|
|
@@ -70,23 +71,23 @@ const xs = {
|
|
|
70
71
|
role: "list"
|
|
71
72
|
}, e[3] = c, e[4] = u) : (c = e[3], u = e[4]);
|
|
72
73
|
let d;
|
|
73
|
-
return e[5] !== n || e[6] !==
|
|
74
|
-
},
|
|
74
|
+
return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ a(ht, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: c, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
|
|
75
|
+
}, Mo = {
|
|
75
76
|
axis: "horizontal",
|
|
76
77
|
bottom: "md",
|
|
77
78
|
zIndex: 2
|
|
78
|
-
},
|
|
79
|
-
const e =
|
|
79
|
+
}, Eo = (t) => {
|
|
80
|
+
const e = T(4), {
|
|
80
81
|
isAtBottom: n,
|
|
81
|
-
scrollToBottom:
|
|
82
|
-
} =
|
|
83
|
-
let
|
|
84
|
-
return e[0] !== n || e[1] !== t || e[2] !==
|
|
85
|
-
},
|
|
86
|
-
Root:
|
|
87
|
-
Viewport:
|
|
88
|
-
ScrollToBottom:
|
|
89
|
-
},
|
|
82
|
+
scrollToBottom: s
|
|
83
|
+
} = mt();
|
|
84
|
+
let o;
|
|
85
|
+
return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ a(zn, { ...Mo, children: /* @__PURE__ */ a($t, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ a(Gn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
|
|
86
|
+
}, Et = {
|
|
87
|
+
Root: Io,
|
|
88
|
+
Viewport: Po,
|
|
89
|
+
ScrollToBottom: Eo
|
|
90
|
+
}, vo = qn({
|
|
90
91
|
className: "ai-message",
|
|
91
92
|
slots: ["root", "content"],
|
|
92
93
|
base: {
|
|
@@ -196,611 +197,681 @@ const xs = {
|
|
|
196
197
|
shape: "rounded"
|
|
197
198
|
}
|
|
198
199
|
}), {
|
|
199
|
-
withProvider:
|
|
200
|
-
withContext:
|
|
201
|
-
} =
|
|
202
|
-
recipe:
|
|
203
|
-
}),
|
|
204
|
-
Root:
|
|
205
|
-
Content:
|
|
206
|
-
},
|
|
200
|
+
withProvider: Lo,
|
|
201
|
+
withContext: Do
|
|
202
|
+
} = Hn({
|
|
203
|
+
recipe: vo
|
|
204
|
+
}), Bo = Lo("div", "root"), Oo = Do("div", "content"), _e = {
|
|
205
|
+
Root: Bo,
|
|
206
|
+
Content: Oo
|
|
207
|
+
}, $o = (t) => {
|
|
207
208
|
if (t == null) return null;
|
|
208
209
|
const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
|
|
209
210
|
return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
|
|
210
|
-
},
|
|
211
|
-
const e =
|
|
211
|
+
}, cl = (t) => {
|
|
212
|
+
const e = T(19), {
|
|
212
213
|
toolName: n,
|
|
213
|
-
toolInput:
|
|
214
|
-
onApprove:
|
|
214
|
+
toolInput: s,
|
|
215
|
+
onApprove: o,
|
|
215
216
|
onDeny: r
|
|
216
217
|
} = t;
|
|
217
218
|
let i;
|
|
218
|
-
e[0] !==
|
|
219
|
-
const
|
|
219
|
+
e[0] !== s ? (i = $o(s), e[0] = s, e[1] = i) : i = e[1];
|
|
220
|
+
const l = i;
|
|
220
221
|
let c;
|
|
221
|
-
e[2] !== n ? (c = /* @__PURE__ */
|
|
222
|
+
e[2] !== n ? (c = /* @__PURE__ */ k(X, { textStyle: "label/S/medium", color: "fg", children: [
|
|
222
223
|
"Allow ",
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ a(jt, { size: "sm", children: n }),
|
|
224
225
|
"?"
|
|
225
226
|
] }), e[2] = n, e[3] = c) : c = e[3];
|
|
226
227
|
let u;
|
|
227
|
-
e[4] !==
|
|
228
|
+
e[4] !== l ? (u = l ? /* @__PURE__ */ a(ht, { maxH: "6rem", children: /* @__PURE__ */ a(jt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
|
|
228
229
|
let d;
|
|
229
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */
|
|
230
|
-
let
|
|
231
|
-
e[7] !== r ? (
|
|
230
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ a(Xn, { size: 14 }), e[6] = d) : d = e[6];
|
|
231
|
+
let f;
|
|
232
|
+
e[7] !== r ? (f = /* @__PURE__ */ k(Ze, { size: "xs", variant: "outline", onClick: r, children: [
|
|
232
233
|
d,
|
|
233
234
|
"Deny"
|
|
234
|
-
] }), e[7] = r, e[8] =
|
|
235
|
+
] }), e[7] = r, e[8] = f) : f = e[8];
|
|
235
236
|
let m;
|
|
236
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */
|
|
237
|
-
let
|
|
238
|
-
e[10] !==
|
|
237
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ a(Yn, { size: 14 }), e[9] = m) : m = e[9];
|
|
238
|
+
let p;
|
|
239
|
+
e[10] !== o ? (p = /* @__PURE__ */ k(Ze, { size: "xs", colorPalette: "green", onClick: o, children: [
|
|
239
240
|
m,
|
|
240
241
|
"Allow"
|
|
241
|
-
] }), e[10] =
|
|
242
|
+
] }), e[10] = o, e[11] = p) : p = e[11];
|
|
242
243
|
let h;
|
|
243
|
-
e[12] !==
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
] }), e[12] =
|
|
244
|
+
e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ k(Me, { gap: "xs", justifyContent: "flex-end", children: [
|
|
245
|
+
f,
|
|
246
|
+
p
|
|
247
|
+
] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
|
|
247
248
|
let g;
|
|
248
|
-
return e[15] !== c || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */
|
|
249
|
+
return e[15] !== c || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ a(I, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(Re, { direction: "column", gap: "xs", children: [
|
|
249
250
|
c,
|
|
250
251
|
u,
|
|
251
252
|
h
|
|
252
253
|
] }) }), e[15] = c, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
|
|
253
|
-
},
|
|
254
|
+
}, Fo = "md", zo = "neutral", ul = (t) => {
|
|
255
|
+
const e = T(17), {
|
|
256
|
+
attachments: n,
|
|
257
|
+
onSelect: s,
|
|
258
|
+
onRemove: o,
|
|
259
|
+
renderBadge: r,
|
|
260
|
+
size: i,
|
|
261
|
+
tone: l
|
|
262
|
+
} = t;
|
|
263
|
+
let c;
|
|
264
|
+
e[0] !== n ? (c = n === void 0 ? [] : n, e[0] = n, e[1] = c) : c = e[1];
|
|
265
|
+
const u = c, d = i === void 0 ? Fo : i, f = l === void 0 ? zo : l;
|
|
266
|
+
if (u.length === 0)
|
|
267
|
+
return null;
|
|
268
|
+
let m;
|
|
269
|
+
if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
|
|
270
|
+
let h;
|
|
271
|
+
e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
|
|
272
|
+
const y = s ? () => s(g) : void 0, b = o ? () => o(g) : void 0;
|
|
273
|
+
if (r) {
|
|
274
|
+
const x = r({
|
|
275
|
+
attachmentId: g,
|
|
276
|
+
onSelect: y,
|
|
277
|
+
onRemove: b,
|
|
278
|
+
size: d,
|
|
279
|
+
tone: f
|
|
280
|
+
});
|
|
281
|
+
return /* @__PURE__ */ a(xo, { children: x }, g);
|
|
282
|
+
}
|
|
283
|
+
return /* @__PURE__ */ a(zt, { fileName: g, onSelect: y, onRemove: b, size: d, tone: f }, g);
|
|
284
|
+
}, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
|
|
285
|
+
} else
|
|
286
|
+
m = e[8];
|
|
287
|
+
let p;
|
|
288
|
+
return e[15] !== m ? (p = /* @__PURE__ */ a(Y, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
|
|
289
|
+
}, qo = (t) => {
|
|
254
290
|
const {
|
|
255
291
|
previousUserMessageCount: e,
|
|
256
292
|
userMessageCount: n
|
|
257
293
|
} = t;
|
|
258
294
|
return e === 0 ? !1 : n > e;
|
|
259
295
|
};
|
|
260
|
-
function
|
|
261
|
-
const e =
|
|
296
|
+
function Ho(t) {
|
|
297
|
+
const e = T(4), {
|
|
262
298
|
userMessageCount: n
|
|
263
299
|
} = t, {
|
|
264
|
-
scrollToBottom:
|
|
265
|
-
} =
|
|
300
|
+
scrollToBottom: s
|
|
301
|
+
} = mt(), o = Ne(n);
|
|
266
302
|
let r, i;
|
|
267
|
-
return e[0] !==
|
|
268
|
-
|
|
269
|
-
previousUserMessageCount:
|
|
303
|
+
return e[0] !== s || e[1] !== n ? (r = () => {
|
|
304
|
+
qo({
|
|
305
|
+
previousUserMessageCount: o.current,
|
|
270
306
|
userMessageCount: n
|
|
271
|
-
}) &&
|
|
272
|
-
}, i = [n,
|
|
307
|
+
}) && s(), o.current = n;
|
|
308
|
+
}, i = [n, s], e[0] = s, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), Ae(r, i), null;
|
|
273
309
|
}
|
|
274
|
-
const
|
|
310
|
+
const pn = (t) => t.trim().length > 0, Qo = (t) => {
|
|
275
311
|
const {
|
|
276
312
|
isDisabled: e,
|
|
277
313
|
streaming: n,
|
|
278
|
-
text:
|
|
314
|
+
text: s
|
|
279
315
|
} = t;
|
|
280
|
-
return e || n || !
|
|
281
|
-
},
|
|
316
|
+
return e || n || !pn(s) ? "none" : "submit";
|
|
317
|
+
}, Wo = (t) => {
|
|
282
318
|
const {
|
|
283
319
|
canInterrupt: e,
|
|
284
320
|
isDisabled: n,
|
|
285
|
-
streaming:
|
|
286
|
-
text:
|
|
321
|
+
streaming: s,
|
|
322
|
+
text: o
|
|
323
|
+
} = t;
|
|
324
|
+
return n ? "none" : s ? e ? "interrupt" : "none" : pn(o) ? "submit" : "none";
|
|
325
|
+
}, mn = 200, No = (t, e = mn) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Vo = (t) => {
|
|
326
|
+
const {
|
|
327
|
+
onAttachFiles: e,
|
|
328
|
+
onAttachText: n,
|
|
329
|
+
textAttachmentPasteLineThreshold: s
|
|
287
330
|
} = t;
|
|
288
|
-
return
|
|
289
|
-
|
|
331
|
+
return {
|
|
332
|
+
onDragOver: (l) => {
|
|
333
|
+
!e || !Array.from(l.dataTransfer.types).includes("Files") || l.preventDefault();
|
|
334
|
+
},
|
|
335
|
+
onDropCapture: (l) => {
|
|
336
|
+
const c = Array.from(l.dataTransfer.files ?? []);
|
|
337
|
+
c.length === 0 || !e || (l.preventDefault(), e(c));
|
|
338
|
+
},
|
|
339
|
+
onPasteCapture: (l) => {
|
|
340
|
+
const c = Array.from(l.clipboardData.files ?? []);
|
|
341
|
+
if (c.length > 0 && e) {
|
|
342
|
+
l.preventDefault(), e(c);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const u = l.clipboardData.getData("text/plain");
|
|
346
|
+
n && No(u, s) && (l.preventDefault(), n(u));
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}, jo = (t) => {
|
|
290
350
|
t.preventDefault();
|
|
291
|
-
},
|
|
292
|
-
const e =
|
|
351
|
+
}, hn = (t) => {
|
|
352
|
+
const e = T(7), {
|
|
293
353
|
option: n
|
|
294
354
|
} = t;
|
|
295
|
-
let o;
|
|
296
|
-
e[0] !== n.label ? (o = /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
|
|
297
355
|
let s;
|
|
298
|
-
e[
|
|
356
|
+
e[0] !== n.label ? (s = /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
|
|
357
|
+
let o;
|
|
358
|
+
e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
|
|
299
359
|
let r;
|
|
300
|
-
return e[4] !==
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
] }), e[4] =
|
|
304
|
-
},
|
|
305
|
-
const e =
|
|
360
|
+
return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(Y, { gap: "0", minWidth: "0", children: [
|
|
361
|
+
s,
|
|
362
|
+
o
|
|
363
|
+
] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
|
|
364
|
+
}, Uo = (t) => {
|
|
365
|
+
const e = T(12), {
|
|
306
366
|
option: n,
|
|
307
|
-
name:
|
|
308
|
-
checked:
|
|
367
|
+
name: s,
|
|
368
|
+
checked: o,
|
|
309
369
|
editable: r,
|
|
310
370
|
onToggle: i
|
|
311
|
-
} = t,
|
|
371
|
+
} = t, l = !r, c = r ? void 0 : "true";
|
|
312
372
|
let u;
|
|
313
373
|
e[0] !== r ? (u = r ? void 0 : {
|
|
314
374
|
tabIndex: -1
|
|
315
375
|
}, e[0] = r, e[1] = u) : u = e[1];
|
|
316
376
|
const d = r ? i : void 0;
|
|
317
|
-
let
|
|
318
|
-
e[2] !== n ? (
|
|
377
|
+
let f;
|
|
378
|
+
e[2] !== n ? (f = /* @__PURE__ */ a(hn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
|
|
319
379
|
let m;
|
|
320
|
-
return e[4] !==
|
|
321
|
-
},
|
|
322
|
-
const e =
|
|
380
|
+
return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ a(dn, { name: s, checked: o, readOnly: l, "aria-readonly": c, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = c, e[8] = u, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
|
|
381
|
+
}, Ko = (t) => {
|
|
382
|
+
const e = T(17), {
|
|
323
383
|
question: n,
|
|
324
|
-
questionIndex:
|
|
325
|
-
name:
|
|
384
|
+
questionIndex: s,
|
|
385
|
+
name: o,
|
|
326
386
|
selectedOption: r,
|
|
327
387
|
editable: i,
|
|
328
|
-
onToggleOption:
|
|
388
|
+
onToggleOption: l
|
|
329
389
|
} = t, c = r ?? null, u = !i, d = i ? void 0 : "true";
|
|
330
|
-
let
|
|
331
|
-
e[0] !== i || e[1] !==
|
|
332
|
-
h.value &&
|
|
333
|
-
} : void 0, e[0] = i, e[1] =
|
|
390
|
+
let f;
|
|
391
|
+
e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
|
|
392
|
+
h.value && l?.(n, s, h.value);
|
|
393
|
+
} : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
|
|
334
394
|
let m;
|
|
335
395
|
if (e[5] !== i || e[6] !== n.options) {
|
|
336
396
|
let h;
|
|
337
|
-
e[8] !== i ? (h = (g) => /* @__PURE__ */
|
|
397
|
+
e[8] !== i ? (h = (g) => /* @__PURE__ */ a(wo, { value: g.label, inputProps: i ? void 0 : {
|
|
338
398
|
tabIndex: -1
|
|
339
|
-
}, alignItems: "flex-start", children: /* @__PURE__ */
|
|
399
|
+
}, alignItems: "flex-start", children: /* @__PURE__ */ a(hn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
|
|
340
400
|
} else
|
|
341
401
|
m = e[7];
|
|
342
|
-
let
|
|
343
|
-
return e[10] !==
|
|
344
|
-
},
|
|
345
|
-
const e =
|
|
402
|
+
let p;
|
|
403
|
+
return e[10] !== o || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ a(ko, { name: o, value: c, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = o, e[11] = c, e[12] = u, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
|
|
404
|
+
}, Go = (t) => {
|
|
405
|
+
const e = T(4), {
|
|
346
406
|
items: n
|
|
347
407
|
} = t;
|
|
348
|
-
let o;
|
|
349
|
-
e[0] !== n ? (o = n.map(Fs), e[0] = n, e[1] = o) : o = e[1];
|
|
350
408
|
let s;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
409
|
+
e[0] !== n ? (s = n.map(Xo), e[0] = n, e[1] = s) : s = e[1];
|
|
410
|
+
let o;
|
|
411
|
+
return e[2] !== s ? (o = /* @__PURE__ */ a(Y, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
|
|
412
|
+
}, gn = (t) => {
|
|
413
|
+
const e = T(19), {
|
|
354
414
|
questions: n,
|
|
355
|
-
editable:
|
|
356
|
-
selectedOptionsByQuestion:
|
|
415
|
+
editable: s,
|
|
416
|
+
selectedOptionsByQuestion: o,
|
|
357
417
|
customAnswersByQuestion: r,
|
|
358
418
|
onToggleOption: i,
|
|
359
|
-
onCustomAnswerChange:
|
|
360
|
-
} = t, c =
|
|
419
|
+
onCustomAnswerChange: l
|
|
420
|
+
} = t, c = s === void 0 ? !1 : s;
|
|
361
421
|
let u;
|
|
362
|
-
e[0] !==
|
|
422
|
+
e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
|
|
363
423
|
const d = u;
|
|
364
|
-
let p;
|
|
365
|
-
e[2] !== r ? (p = r === void 0 ? {} : r, e[2] = r, e[3] = p) : p = e[3];
|
|
366
|
-
const m = p;
|
|
367
424
|
let f;
|
|
368
|
-
|
|
425
|
+
e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
|
|
426
|
+
const m = f;
|
|
427
|
+
let p;
|
|
428
|
+
if (e[4] !== m || e[5] !== c || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
|
|
369
429
|
let g;
|
|
370
|
-
e[11] !== m || e[12] !== c || e[13] !==
|
|
371
|
-
const x =
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
|
|
375
|
-
|
|
430
|
+
e[11] !== m || e[12] !== c || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (y, b) => {
|
|
431
|
+
const x = y.id ?? `question-${b}`, C = y.multiple ? "checkbox" : "radio", A = d[x] ?? [];
|
|
432
|
+
return /* @__PURE__ */ k(Y, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
|
|
433
|
+
/* @__PURE__ */ a(X, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: y.question }),
|
|
434
|
+
C === "radio" ? /* @__PURE__ */ a(Ko, { question: y, questionIndex: b, name: x, selectedOption: A[0], editable: c, onToggleOption: i }) : y.options.map((w) => /* @__PURE__ */ a(Uo, { option: w, name: x, checked: A.includes(w.label), editable: c, onToggle: () => i?.(y, b, w.label) }, w.label)),
|
|
435
|
+
y.allowCustomAnswer ? /* @__PURE__ */ a(Qn, { readOnly: !c, "aria-readonly": c ? void 0 : "true", value: m[x] ?? "", placeholder: c ? "Answer..." : "Custom answer", "aria-label": y.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: c ? "vertical" : "none", color: "fg", onChange: (w) => l?.(y, b, w.currentTarget.value) }) : null
|
|
376
436
|
] }, x);
|
|
377
|
-
}, e[11] = m, e[12] = c, e[13] =
|
|
437
|
+
}, e[11] = m, e[12] = c, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = c, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
|
|
378
438
|
} else
|
|
379
|
-
|
|
439
|
+
p = e[10];
|
|
380
440
|
let h;
|
|
381
|
-
return e[17] !==
|
|
441
|
+
return e[17] !== p ? (h = /* @__PURE__ */ a(Y, { as: "form", gap: "sm", onSubmit: jo, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
|
|
382
442
|
};
|
|
383
|
-
function
|
|
384
|
-
return /* @__PURE__ */
|
|
443
|
+
function Xo(t, e) {
|
|
444
|
+
return /* @__PURE__ */ a(I, { as: "li", children: /* @__PURE__ */ a(dn, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
|
|
385
445
|
tabIndex: -1
|
|
386
|
-
}, size: "xs", children: /* @__PURE__ */
|
|
446
|
+
}, size: "xs", children: /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
|
|
387
447
|
}
|
|
388
|
-
const
|
|
389
|
-
id:
|
|
448
|
+
const de = (t, e) => t.id ?? `question-${e}`, Dt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
|
|
449
|
+
id: de(e, n),
|
|
390
450
|
question: e.question,
|
|
391
451
|
multiple: !!e.multiple,
|
|
392
452
|
required: !!e.required,
|
|
393
453
|
allowCustomAnswer: !!e.allowCustomAnswer,
|
|
394
|
-
options: e.options.map((
|
|
395
|
-
label:
|
|
396
|
-
description:
|
|
454
|
+
options: e.options.map((s) => ({
|
|
455
|
+
label: s.label,
|
|
456
|
+
description: s.description ?? ""
|
|
397
457
|
}))
|
|
398
|
-
}))) : "",
|
|
399
|
-
const
|
|
400
|
-
for (let
|
|
401
|
-
const r = t.questions[
|
|
402
|
-
u.length !== 0 &&
|
|
458
|
+
}))) : "", Yo = (t, e, n) => {
|
|
459
|
+
const s = [];
|
|
460
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
461
|
+
const r = t.questions[o], i = de(r, o), l = e[i] ?? [], c = n[i]?.trim(), u = c ? [...l, c] : l;
|
|
462
|
+
u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
|
|
403
463
|
}
|
|
404
|
-
return
|
|
405
|
-
},
|
|
406
|
-
if (
|
|
464
|
+
return s;
|
|
465
|
+
}, Jo = (t) => typeof t != "string", qt = (t, e) => {
|
|
466
|
+
if (Jo(e)) return e;
|
|
407
467
|
const n = e.trim();
|
|
408
468
|
if (n.length === 0) return {};
|
|
409
|
-
const
|
|
410
|
-
for (let
|
|
411
|
-
const r = t.questions[
|
|
412
|
-
r.allowCustomAnswer && (
|
|
469
|
+
const s = {};
|
|
470
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
471
|
+
const r = t.questions[o];
|
|
472
|
+
r.allowCustomAnswer && (s[de(r, o)] = n);
|
|
413
473
|
}
|
|
414
|
-
return
|
|
415
|
-
},
|
|
474
|
+
return s;
|
|
475
|
+
}, Zo = (t, e, n) => {
|
|
416
476
|
if (!t) return typeof n == "string" ? n.trim() : "";
|
|
417
|
-
const
|
|
418
|
-
return r.length > 0 && !i &&
|
|
477
|
+
const s = qt(t, n), o = Yo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
|
|
478
|
+
return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
|
|
419
479
|
`);
|
|
420
|
-
},
|
|
421
|
-
const
|
|
422
|
-
return t.questions.map((
|
|
423
|
-
const i =
|
|
424
|
-
return c ? [...
|
|
480
|
+
}, es = (t, e, n) => {
|
|
481
|
+
const s = qt(t, n);
|
|
482
|
+
return t.questions.map((o, r) => {
|
|
483
|
+
const i = de(o, r), l = e[i] ?? [], c = s[i]?.trim();
|
|
484
|
+
return c ? [...l, c] : l;
|
|
425
485
|
});
|
|
426
|
-
},
|
|
486
|
+
}, ts = (t, e, n) => {
|
|
427
487
|
if (!t) return !1;
|
|
428
|
-
const
|
|
429
|
-
for (let
|
|
430
|
-
const r = t.questions[
|
|
488
|
+
const s = qt(t, n);
|
|
489
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
490
|
+
const r = t.questions[o];
|
|
431
491
|
if (!r.required) continue;
|
|
432
|
-
const i =
|
|
433
|
-
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer &&
|
|
492
|
+
const i = de(r, o);
|
|
493
|
+
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
|
|
434
494
|
return !0;
|
|
435
495
|
}
|
|
436
496
|
return !1;
|
|
437
|
-
},
|
|
438
|
-
id:
|
|
497
|
+
}, ns = (t) => t.questions.map((e, n) => ({
|
|
498
|
+
id: de(e, n),
|
|
439
499
|
question: e.question,
|
|
440
500
|
options: e.options,
|
|
441
501
|
multiple: !!e.multiple,
|
|
442
502
|
required: !!e.required,
|
|
443
503
|
allowCustomAnswer: !!e.allowCustomAnswer
|
|
444
|
-
})),
|
|
445
|
-
const
|
|
446
|
-
return (n[
|
|
447
|
-
},
|
|
448
|
-
const e =
|
|
504
|
+
})), os = (t, e, n, s) => {
|
|
505
|
+
const o = de(t, e);
|
|
506
|
+
return (n[o] ?? []).length > 0 || !!s[o]?.trim();
|
|
507
|
+
}, ss = (t) => {
|
|
508
|
+
const e = T(22), {
|
|
449
509
|
question: n,
|
|
450
|
-
sourceQuestion:
|
|
451
|
-
questionIndex:
|
|
510
|
+
sourceQuestion: s,
|
|
511
|
+
questionIndex: o,
|
|
452
512
|
isActive: r,
|
|
453
513
|
selectedOptionsByQuestion: i,
|
|
454
|
-
customAnswersByQuestion:
|
|
514
|
+
customAnswersByQuestion: l,
|
|
455
515
|
onSelectStep: c
|
|
456
516
|
} = t;
|
|
457
517
|
let u;
|
|
458
|
-
e[0] !==
|
|
459
|
-
const d = u,
|
|
460
|
-
let b;
|
|
461
|
-
e[5] !== c || e[6] !== s ? (b = () => c(s), e[5] = c, e[6] = s, e[7] = b) : b = e[7];
|
|
518
|
+
e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = os(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
|
|
519
|
+
const d = u, f = d ? "answered" : "not answered", m = r ? "outline" : "ghost", p = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
|
|
462
520
|
let y;
|
|
463
|
-
e[
|
|
521
|
+
e[5] !== c || e[6] !== o ? (y = () => c(o), e[5] = c, e[6] = o, e[7] = y) : y = e[7];
|
|
522
|
+
let b;
|
|
523
|
+
e[8] !== d || e[9] !== o ? (b = d ? /* @__PURE__ */ a(rn, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = b) : b = e[10];
|
|
464
524
|
let x;
|
|
465
|
-
e[11] !== r || e[12] !==
|
|
466
|
-
let
|
|
467
|
-
return e[19] !== n.question || e[20] !== x ? (
|
|
468
|
-
},
|
|
469
|
-
const e =
|
|
525
|
+
e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== y || e[16] !== b || e[17] !== m ? (x = /* @__PURE__ */ a(Ze, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: y, children: b }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = y, e[16] = b, e[17] = m, e[18] = x) : x = e[18];
|
|
526
|
+
let C;
|
|
527
|
+
return e[19] !== n.question || e[20] !== x ? (C = /* @__PURE__ */ a(cn, { content: n.question, showArrow: !0, children: x }), e[19] = n.question, e[20] = x, e[21] = C) : C = e[21], C;
|
|
528
|
+
}, rs = (t) => {
|
|
529
|
+
const e = T(31), {
|
|
470
530
|
questionPrompt: n,
|
|
471
|
-
selectedOptionsByQuestion:
|
|
472
|
-
customAnswersByQuestion:
|
|
531
|
+
selectedOptionsByQuestion: s,
|
|
532
|
+
customAnswersByQuestion: o,
|
|
473
533
|
onToggleOption: r,
|
|
474
534
|
onCustomAnswerChange: i
|
|
475
535
|
} = t, {
|
|
476
|
-
questions:
|
|
477
|
-
} = t, [c, u] = G(0), d = Math.min(c,
|
|
478
|
-
let
|
|
479
|
-
e[0] !==
|
|
480
|
-
const h = `question-step-panel-${
|
|
481
|
-
let
|
|
482
|
-
e[7] !==
|
|
536
|
+
questions: l
|
|
537
|
+
} = t, [c, u] = G(0), d = Math.min(c, l.length - 1), f = l[d], m = l.length > 1;
|
|
538
|
+
let p;
|
|
539
|
+
e[0] !== o || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (p = m ? /* @__PURE__ */ a(Me, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((M, P) => /* @__PURE__ */ a(ss, { question: M, sourceQuestion: n.questions[P], questionIndex: P, isActive: P === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, M.id)) }) : null, e[0] = o, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = p) : p = e[6];
|
|
540
|
+
const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, y = m ? `question-step-tab-${f.id}` : void 0;
|
|
541
|
+
let b;
|
|
542
|
+
e[7] !== f ? (b = [f], e[7] = f, e[8] = b) : b = e[8];
|
|
483
543
|
let x;
|
|
484
|
-
e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (
|
|
485
|
-
r(n.questions[d], d,
|
|
544
|
+
e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (M, P, v) => {
|
|
545
|
+
r(n.questions[d], d, v);
|
|
486
546
|
}, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = x) : x = e[12];
|
|
487
|
-
let _;
|
|
488
|
-
e[13] !== i || e[14] !== n.questions || e[15] !== d ? (_ = (B, M, P) => {
|
|
489
|
-
i(n.questions[d], d, P);
|
|
490
|
-
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = _) : _ = e[16];
|
|
491
547
|
let C;
|
|
492
|
-
e[
|
|
548
|
+
e[13] !== i || e[14] !== n.questions || e[15] !== d ? (C = (M, P, v) => {
|
|
549
|
+
i(n.questions[d], d, v);
|
|
550
|
+
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = C) : C = e[16];
|
|
551
|
+
let A;
|
|
552
|
+
e[17] !== o || e[18] !== s || e[19] !== b || e[20] !== x || e[21] !== C ? (A = /* @__PURE__ */ a(gn, { questions: b, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: x, onCustomAnswerChange: C }), e[17] = o, e[18] = s, e[19] = b, e[20] = x, e[21] = C, e[22] = A) : A = e[22];
|
|
493
553
|
let w;
|
|
494
|
-
e[23] !== h || e[24] !== g || e[25] !==
|
|
495
|
-
let
|
|
496
|
-
return e[28] !==
|
|
497
|
-
|
|
554
|
+
e[23] !== h || e[24] !== g || e[25] !== y || e[26] !== A ? (w = /* @__PURE__ */ a(Y, { id: h, role: g, "aria-labelledby": y, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = y, e[26] = A, e[27] = w) : w = e[27];
|
|
555
|
+
let _;
|
|
556
|
+
return e[28] !== p || e[29] !== w ? (_ = /* @__PURE__ */ k(Y, { gap: "xs", pb: "sm", children: [
|
|
557
|
+
p,
|
|
498
558
|
w
|
|
499
|
-
] }), e[28] =
|
|
500
|
-
},
|
|
501
|
-
const e =
|
|
559
|
+
] }), e[28] = p, e[29] = w, e[30] = _) : _ = e[30], _;
|
|
560
|
+
}, is = (t) => {
|
|
561
|
+
const e = T(8), {
|
|
502
562
|
questionPrompt: n
|
|
503
563
|
} = t;
|
|
504
|
-
let
|
|
505
|
-
e[0] !== n ? (
|
|
506
|
-
const
|
|
564
|
+
let s;
|
|
565
|
+
e[0] !== n ? (s = ns(n), e[0] = n, e[1] = s) : s = e[1];
|
|
566
|
+
const o = s;
|
|
507
567
|
let r;
|
|
508
|
-
e[2] !== n ? (r =
|
|
568
|
+
e[2] !== n ? (r = Dt(n), e[2] = n, e[3] = r) : r = e[3];
|
|
509
569
|
const i = r;
|
|
510
|
-
let
|
|
511
|
-
return e[4] !== t || e[5] !== i || e[6] !==
|
|
512
|
-
},
|
|
513
|
-
const e =
|
|
514
|
-
let n,
|
|
570
|
+
let l;
|
|
571
|
+
return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ a(rs, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
|
|
572
|
+
}, ls = (t) => {
|
|
573
|
+
const e = T(22);
|
|
574
|
+
let n, s, o, r;
|
|
515
575
|
e[0] !== t ? ({
|
|
516
576
|
title: r,
|
|
517
|
-
shortcut:
|
|
577
|
+
shortcut: o,
|
|
518
578
|
canInterrupt: n,
|
|
519
|
-
...
|
|
520
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
521
|
-
const i =
|
|
522
|
-
let
|
|
523
|
-
e[5] !== n ? (
|
|
524
|
-
const c =
|
|
579
|
+
...s
|
|
580
|
+
} = t, e[0] = t, e[1] = n, e[2] = s, e[3] = o, e[4] = r) : (n = e[1], s = e[2], o = e[3], r = e[4]);
|
|
581
|
+
const i = s["aria-label"] ?? r;
|
|
582
|
+
let l;
|
|
583
|
+
e[5] !== n ? (l = n ? /* @__PURE__ */ a(Jn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ a(Zn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
|
|
584
|
+
const c = l;
|
|
525
585
|
let u;
|
|
526
|
-
e[7] !== i || e[8] !== c || e[9] !==
|
|
586
|
+
e[7] !== i || e[8] !== c || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ a($t, { "data-testid": "send-message-button", size: "sm", variant: "primary", borderRadius: "full", "aria-label": i, title: r, ...s, children: c }), e[7] = i, e[8] = c, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
|
|
527
587
|
const d = u;
|
|
528
588
|
if (r) {
|
|
529
|
-
let
|
|
530
|
-
e[12] !==
|
|
589
|
+
let f;
|
|
590
|
+
e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(Ot, { children: [
|
|
531
591
|
r,
|
|
532
592
|
" ",
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
] }) : r, e[12] =
|
|
535
|
-
const m =
|
|
536
|
-
let
|
|
537
|
-
e[15] !== d ? (
|
|
593
|
+
/* @__PURE__ */ a(Nn, { fontSize: "xs", children: o })
|
|
594
|
+
] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
|
|
595
|
+
const m = f;
|
|
596
|
+
let p;
|
|
597
|
+
e[15] !== d ? (p = /* @__PURE__ */ a(dt.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
|
|
538
598
|
let h;
|
|
539
|
-
e[17] !== m ? (h = /* @__PURE__ */
|
|
599
|
+
e[17] !== m ? (h = /* @__PURE__ */ a(Wn, { children: /* @__PURE__ */ a(dt.Positioner, { children: /* @__PURE__ */ a(dt.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
|
|
540
600
|
let g;
|
|
541
|
-
return e[19] !==
|
|
542
|
-
|
|
601
|
+
return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(dt.Root, { closeDelay: 50, openDelay: 100, children: [
|
|
602
|
+
p,
|
|
543
603
|
h
|
|
544
|
-
] }), e[19] =
|
|
604
|
+
] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
|
|
545
605
|
}
|
|
546
606
|
return d;
|
|
547
|
-
},
|
|
548
|
-
const e =
|
|
607
|
+
}, as = (t) => {
|
|
608
|
+
const e = T(2), {
|
|
609
|
+
placeholder: n
|
|
610
|
+
} = t;
|
|
611
|
+
if (!n)
|
|
612
|
+
return null;
|
|
613
|
+
let s;
|
|
614
|
+
return e[0] !== n ? (s = /* @__PURE__ */ a(X, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = s) : s = e[1], s;
|
|
615
|
+
}, cs = (t) => {
|
|
616
|
+
const e = T(100), {
|
|
549
617
|
defaultState: n,
|
|
550
|
-
onSubmit:
|
|
551
|
-
onInterrupt:
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
618
|
+
onSubmit: s,
|
|
619
|
+
onInterrupt: o,
|
|
620
|
+
onAttachFiles: r,
|
|
621
|
+
onAttachText: i,
|
|
622
|
+
textAttachmentPasteLineThreshold: l,
|
|
623
|
+
streaming: c,
|
|
624
|
+
attachedResources: u,
|
|
625
|
+
onClearAttachments: d,
|
|
626
|
+
isDisabled: f,
|
|
627
|
+
onChange: m,
|
|
628
|
+
placeholder: p,
|
|
629
|
+
attachmentList: h,
|
|
630
|
+
actions: g,
|
|
631
|
+
attachedToTop: y,
|
|
632
|
+
questionPrompt: b,
|
|
633
|
+
autoFocus: x
|
|
634
|
+
} = t, C = s === void 0 ? us : s, A = l === void 0 ? mn : l, w = c === void 0 ? !1 : c;
|
|
635
|
+
let _;
|
|
636
|
+
e[0] !== u ? (_ = u === void 0 ? [] : u, e[0] = u, e[1] = _) : _ = e[1];
|
|
637
|
+
const M = _, P = f === void 0 ? !1 : f, v = y === void 0 ? !1 : y, L = x === void 0 ? !1 : x, [H, J] = G(!1), [B, ve] = G(n), [je, Le] = G(0);
|
|
638
|
+
let he;
|
|
639
|
+
e[2] !== n ? (he = () => Mt(n), e[2] = n, e[3] = he) : he = e[3];
|
|
640
|
+
const [F, z] = G(he);
|
|
567
641
|
let ee;
|
|
568
|
-
e[
|
|
569
|
-
const [
|
|
570
|
-
let
|
|
571
|
-
e[
|
|
572
|
-
const [
|
|
573
|
-
let
|
|
574
|
-
e[
|
|
575
|
-
const
|
|
576
|
-
let
|
|
577
|
-
e[
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
e[11]
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
let
|
|
589
|
-
e[
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
e[19]
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
let ve, N;
|
|
602
|
-
e[20] !== R ? (ve = () => {
|
|
603
|
-
if (!R)
|
|
642
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = {}, e[4] = ee) : ee = e[4];
|
|
643
|
+
const [E, ge] = G(ee);
|
|
644
|
+
let be;
|
|
645
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = {}, e[5] = be) : be = e[5];
|
|
646
|
+
const [O, De] = G(be), Ue = Ne(null), Ke = Ne(m);
|
|
647
|
+
let Be;
|
|
648
|
+
e[6] !== b ? (Be = Dt(b), e[6] = b, e[7] = Be) : Be = e[7];
|
|
649
|
+
const Ie = Ne(Be);
|
|
650
|
+
let te, Ge;
|
|
651
|
+
e[8] !== m ? (te = () => {
|
|
652
|
+
Ke.current = m;
|
|
653
|
+
}, Ge = [m], e[8] = m, e[9] = te, e[10] = Ge) : (te = e[9], Ge = e[10]), Ae(te, Ge);
|
|
654
|
+
let ye, ne;
|
|
655
|
+
e[11] !== n ? (ye = () => {
|
|
656
|
+
const R = Mt(n);
|
|
657
|
+
ve(n), Le(ds), z(R), ge({}), De({}), Ke.current?.(R);
|
|
658
|
+
}, ne = [n], e[11] = n, e[12] = ye, e[13] = ne) : (ye = e[12], ne = e[13]), Ae(ye, ne);
|
|
659
|
+
let xe;
|
|
660
|
+
e[14] !== b ? (xe = Dt(b), e[14] = b, e[15] = xe) : xe = e[15];
|
|
661
|
+
const oe = xe;
|
|
662
|
+
let se, re;
|
|
663
|
+
e[16] !== oe ? (se = () => {
|
|
664
|
+
Ie.current !== oe && (Ie.current = oe, ge({}), De({}));
|
|
665
|
+
}, re = [oe], e[16] = oe, e[17] = se, e[18] = re) : (se = e[17], re = e[18]), Ae(se, re);
|
|
666
|
+
let Oe;
|
|
667
|
+
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Oe = () => {
|
|
668
|
+
const R = Ue.current?.querySelector('[contenteditable="true"]');
|
|
669
|
+
R instanceof HTMLElement && R.focus();
|
|
670
|
+
}, e[19] = Oe) : Oe = e[19];
|
|
671
|
+
const ie = Oe;
|
|
672
|
+
let Se, Q;
|
|
673
|
+
e[20] !== L ? (Se = () => {
|
|
674
|
+
if (!L)
|
|
604
675
|
return;
|
|
605
|
-
const
|
|
606
|
-
const
|
|
607
|
-
|
|
676
|
+
const R = requestAnimationFrame(() => {
|
|
677
|
+
const ke = Ue.current?.querySelector('[contenteditable="true"]');
|
|
678
|
+
ke instanceof HTMLElement && ke.focus(), J(!0);
|
|
608
679
|
});
|
|
609
|
-
return () => cancelAnimationFrame(
|
|
610
|
-
},
|
|
611
|
-
let
|
|
612
|
-
e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
613
|
-
|
|
614
|
-
}, e[23] =
|
|
615
|
-
const
|
|
616
|
-
let
|
|
617
|
-
e[24] !== n ? (
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
680
|
+
return () => cancelAnimationFrame(R);
|
|
681
|
+
}, Q = [L], e[20] = L, e[21] = Se, e[22] = Q) : (Se = e[21], Q = e[22]), Ae(Se, Q);
|
|
682
|
+
let W;
|
|
683
|
+
e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => {
|
|
684
|
+
J(!0), ie();
|
|
685
|
+
}, e[23] = W) : W = e[23];
|
|
686
|
+
const Te = W;
|
|
687
|
+
let N;
|
|
688
|
+
e[24] !== n ? (N = (R) => {
|
|
689
|
+
const ke = R === void 0 ? !1 : R;
|
|
690
|
+
ve(n), Le(fs);
|
|
691
|
+
const ce = Mt(n);
|
|
692
|
+
z(ce), ge({}), De({}), Ke.current?.(ce), ke && requestAnimationFrame(() => {
|
|
693
|
+
ie();
|
|
623
694
|
});
|
|
624
|
-
}, e[24] = n, e[25] =
|
|
625
|
-
const
|
|
626
|
-
let
|
|
627
|
-
if (e[26] !==
|
|
628
|
-
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
canInterrupt:
|
|
632
|
-
isDisabled:
|
|
633
|
-
streaming:
|
|
634
|
-
text:
|
|
635
|
-
}, j =
|
|
695
|
+
}, e[24] = n, e[25] = N) : N = e[25];
|
|
696
|
+
const Z = N, V = w && !!o;
|
|
697
|
+
let $, D, j;
|
|
698
|
+
if (e[26] !== V || e[27] !== O || e[28] !== P || e[29] !== b || e[30] !== E || e[31] !== w || e[32] !== F) {
|
|
699
|
+
D = b ? Zo(b, E, O) : F.trim();
|
|
700
|
+
const R = ts(b, E, O);
|
|
701
|
+
$ = {
|
|
702
|
+
canInterrupt: V,
|
|
703
|
+
isDisabled: P || R,
|
|
704
|
+
streaming: w,
|
|
705
|
+
text: D
|
|
706
|
+
}, j = Wo($), e[26] = V, e[27] = O, e[28] = P, e[29] = b, e[30] = E, e[31] = w, e[32] = F, e[33] = $, e[34] = D, e[35] = j;
|
|
636
707
|
} else
|
|
637
|
-
|
|
708
|
+
$ = e[33], D = e[34], j = e[35];
|
|
638
709
|
const U = j;
|
|
639
|
-
let
|
|
640
|
-
e[36] !==
|
|
641
|
-
if (!
|
|
710
|
+
let le;
|
|
711
|
+
e[36] !== M || e[37] !== O || e[38] !== d || e[39] !== C || e[40] !== b || e[41] !== Z || e[42] !== D || e[43] !== E ? (le = () => {
|
|
712
|
+
if (!D)
|
|
642
713
|
return;
|
|
643
|
-
const
|
|
644
|
-
answers:
|
|
714
|
+
const R = b ? {
|
|
715
|
+
answers: es(b, E, O)
|
|
645
716
|
} : void 0;
|
|
646
|
-
|
|
647
|
-
}, e[36] =
|
|
648
|
-
const
|
|
649
|
-
let
|
|
650
|
-
e[45] !==
|
|
651
|
-
if (
|
|
652
|
-
|
|
717
|
+
C(D, M, R), Z(!0), d?.();
|
|
718
|
+
}, e[36] = M, e[37] = O, e[38] = d, e[39] = C, e[40] = b, e[41] = Z, e[42] = D, e[43] = E, e[44] = le) : le = e[44];
|
|
719
|
+
const q = le;
|
|
720
|
+
let we;
|
|
721
|
+
e[45] !== o || e[46] !== q ? (we = (R) => {
|
|
722
|
+
if (R === "interrupt") {
|
|
723
|
+
o?.();
|
|
653
724
|
return;
|
|
654
725
|
}
|
|
655
|
-
|
|
656
|
-
}, e[45] =
|
|
657
|
-
const
|
|
658
|
-
let
|
|
659
|
-
e[48] !==
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
e[54]
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
726
|
+
R === "submit" && q();
|
|
727
|
+
}, e[45] = o, e[46] = q, e[47] = we) : we = e[47];
|
|
728
|
+
const K = we;
|
|
729
|
+
let nt;
|
|
730
|
+
e[48] !== $ || e[49] !== K ? (nt = () => K(Qo($)), e[48] = $, e[49] = K, e[50] = nt) : nt = e[50];
|
|
731
|
+
const xt = nt;
|
|
732
|
+
let ot;
|
|
733
|
+
e[51] !== U || e[52] !== K ? (ot = () => K(U), e[51] = U, e[52] = K, e[53] = ot) : ot = e[53];
|
|
734
|
+
const St = ot;
|
|
735
|
+
let st;
|
|
736
|
+
e[54] !== r || e[55] !== i || e[56] !== A ? (st = Vo({
|
|
737
|
+
onAttachFiles: r,
|
|
738
|
+
onAttachText: i,
|
|
739
|
+
textAttachmentPasteLineThreshold: A
|
|
740
|
+
}), e[54] = r, e[55] = i, e[56] = A, e[57] = st) : st = e[57];
|
|
741
|
+
const ae = st;
|
|
742
|
+
let rt;
|
|
743
|
+
e[58] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (rt = (R, ke, ce) => {
|
|
744
|
+
const Xe = de(R, ke);
|
|
745
|
+
ge((Ye) => {
|
|
746
|
+
const Pt = Ye[Xe] ?? [], Vt = Pt.includes(ce);
|
|
747
|
+
return R.multiple ? {
|
|
748
|
+
...Ye,
|
|
749
|
+
[Xe]: Vt ? Pt.filter(($n) => $n !== ce) : [...Pt, ce]
|
|
676
750
|
} : {
|
|
677
|
-
...
|
|
678
|
-
[
|
|
751
|
+
...Ye,
|
|
752
|
+
[Xe]: Vt ? [] : [ce]
|
|
679
753
|
};
|
|
680
754
|
});
|
|
681
|
-
}, e[
|
|
682
|
-
const
|
|
683
|
-
let
|
|
684
|
-
e[
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
...
|
|
688
|
-
[
|
|
755
|
+
}, e[58] = rt) : rt = e[58];
|
|
756
|
+
const Bn = rt;
|
|
757
|
+
let it;
|
|
758
|
+
e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (it = (R, ke, ce) => {
|
|
759
|
+
const Xe = de(R, ke);
|
|
760
|
+
De((Ye) => ({
|
|
761
|
+
...Ye,
|
|
762
|
+
[Xe]: ce
|
|
689
763
|
}));
|
|
690
|
-
}, e[
|
|
691
|
-
const
|
|
692
|
-
let tt;
|
|
693
|
-
e[56] !== d ? (tt = d ? /* @__PURE__ */ l(q, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: d }) : void 0, e[56] = d, e[57] = tt) : tt = e[57];
|
|
694
|
-
const ht = tt, gt = w ? "-1px" : void 0, bt = w ? "0" : void 0, yt = B ? "blue.border" : "border.muted", xt = B ? "mid" : "low", St = B ? 1 : 0, kt = B ? "blue.border" : "border";
|
|
764
|
+
}, e[59] = it) : it = e[59];
|
|
765
|
+
const On = it, Tt = v ? "-1px" : void 0, wt = v ? "0" : void 0, kt = H ? "blue.border" : "border.muted", Ct = H ? 1 : 0, At = H ? "blue.border" : "border";
|
|
695
766
|
let $e;
|
|
696
|
-
e[
|
|
697
|
-
borderColor:
|
|
698
|
-
boxShadow: "mid",
|
|
767
|
+
e[60] !== At ? ($e = {
|
|
768
|
+
borderColor: At,
|
|
699
769
|
zIndex: 1
|
|
700
|
-
}, e[
|
|
701
|
-
let
|
|
702
|
-
e[
|
|
770
|
+
}, e[60] = At, e[61] = $e) : $e = e[61];
|
|
771
|
+
let lt;
|
|
772
|
+
e[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (lt = {
|
|
703
773
|
borderColor: "blue.border",
|
|
704
|
-
boxShadow: "mid",
|
|
705
774
|
zIndex: 1
|
|
706
|
-
}, e[
|
|
707
|
-
let
|
|
708
|
-
e[
|
|
709
|
-
let Oe;
|
|
710
|
-
e[62] !== O || e[63] !== L || e[64] !== P || e[65] !== xe || e[66] !== C || e[67] !== u || e[68] !== ht || e[69] !== h || e[70] !== E ? (Oe = h ? /* @__PURE__ */ l(Ks, { questionPrompt: h, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: Mn, onCustomAnswerChange: En }) : /* @__PURE__ */ l(ut, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
|
|
711
|
-
pr: "2xs"
|
|
712
|
-
}, children: /* @__PURE__ */ l(ds, { defaultState: P, isEditable: !C, placeholder: ht, onChange: (A) => {
|
|
713
|
-
Ae(A), u?.(A);
|
|
714
|
-
}, onSubmit: xe }, L) }), e[62] = O, e[63] = L, e[64] = P, e[65] = xe, e[66] = C, e[67] = u, e[68] = ht, e[69] = h, e[70] = E, e[71] = Oe) : Oe = e[71];
|
|
715
|
-
let ot;
|
|
716
|
-
e[72] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ot = /* @__PURE__ */ l(zn, {}), e[72] = ot) : ot = e[72];
|
|
717
|
-
const Tt = D ? "Stop Response" : "Message Sending", wt = y ? void 0 : "Enter", Ct = U === "none";
|
|
718
|
-
let De;
|
|
719
|
-
e[73] !== D || e[74] !== mt || e[75] !== Tt || e[76] !== wt || e[77] !== Ct ? (De = /* @__PURE__ */ l(Gs, { canInterrupt: D, title: Tt, shortcut: wt, onClick: mt, disabled: Ct }), e[73] = D, e[74] = mt, e[75] = Tt, e[76] = wt, e[77] = Ct, e[78] = De) : De = e[78];
|
|
775
|
+
}, e[62] = lt) : lt = e[62];
|
|
776
|
+
let at;
|
|
777
|
+
e[63] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (at = () => J(!1), e[63] = at) : at = e[63];
|
|
720
778
|
let Fe;
|
|
721
|
-
e[
|
|
722
|
-
m,
|
|
723
|
-
ot,
|
|
724
|
-
De
|
|
725
|
-
] }), e[79] = m, e[80] = De, e[81] = Fe) : Fe = e[81];
|
|
779
|
+
e[64] !== h ? (Fe = h ? /* @__PURE__ */ a(I, { mb: "xs", children: h }) : null, e[64] = h, e[65] = Fe) : Fe = e[65];
|
|
726
780
|
let ze;
|
|
727
|
-
e[
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
let
|
|
733
|
-
|
|
781
|
+
e[66] !== O || e[67] !== je || e[68] !== B || e[69] !== xt || e[70] !== P || e[71] !== m || e[72] !== p || e[73] !== b || e[74] !== E ? (ze = b ? /* @__PURE__ */ a(is, { questionPrompt: b, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: Bn, onCustomAnswerChange: On }) : /* @__PURE__ */ a(ht, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
|
|
782
|
+
pr: "2xs"
|
|
783
|
+
}, children: /* @__PURE__ */ a(So, { defaultState: B, isEditable: !P, placeholder: /* @__PURE__ */ a(as, { placeholder: p }), onChange: (R) => {
|
|
784
|
+
z(R), m?.(R);
|
|
785
|
+
}, onSubmit: xt }, je) }), e[66] = O, e[67] = je, e[68] = B, e[69] = xt, e[70] = P, e[71] = m, e[72] = p, e[73] = b, e[74] = E, e[75] = ze) : ze = e[75];
|
|
786
|
+
let ct;
|
|
787
|
+
e[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ct = /* @__PURE__ */ a(Vn, {}), e[76] = ct) : ct = e[76];
|
|
788
|
+
const _t = V ? "Stop Response" : "Message Sending", Rt = w ? void 0 : "Enter", It = U === "none";
|
|
789
|
+
let qe;
|
|
790
|
+
e[77] !== V || e[78] !== St || e[79] !== _t || e[80] !== Rt || e[81] !== It ? (qe = /* @__PURE__ */ a(ls, { canInterrupt: V, title: _t, shortcut: Rt, onClick: St, disabled: It }), e[77] = V, e[78] = St, e[79] = _t, e[80] = Rt, e[81] = It, e[82] = qe) : qe = e[82];
|
|
791
|
+
let He;
|
|
792
|
+
e[83] !== g || e[84] !== qe ? (He = /* @__PURE__ */ k(Me, { gap: "1", mt: "md", children: [
|
|
793
|
+
g,
|
|
794
|
+
ct,
|
|
795
|
+
qe
|
|
796
|
+
] }), e[83] = g, e[84] = qe, e[85] = He) : He = e[85];
|
|
797
|
+
let Qe;
|
|
798
|
+
e[86] !== Fe || e[87] !== ze || e[88] !== He ? (Qe = /* @__PURE__ */ k(Re, { direction: "column", color: "fg", children: [
|
|
799
|
+
Fe,
|
|
800
|
+
ze,
|
|
801
|
+
He
|
|
802
|
+
] }), e[86] = Fe, e[87] = ze, e[88] = He, e[89] = Qe) : Qe = e[89];
|
|
803
|
+
let ut;
|
|
804
|
+
return e[90] !== ae.onDragOver || e[91] !== ae.onDropCapture || e[92] !== ae.onPasteCapture || e[93] !== Tt || e[94] !== wt || e[95] !== kt || e[96] !== Ct || e[97] !== $e || e[98] !== Qe ? (ut = /* @__PURE__ */ a(I, { ref: Ue, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: Tt, bg: "bg", borderRadius: "xs", borderTopRadius: wt, borderWidth: "1px", borderStyle: "solid", borderColor: kt, zIndex: Ct, transition: "border-color 0.2s ease-in-out", _hover: $e, _focusWithin: lt, onPasteCapture: ae.onPasteCapture, onDropCapture: ae.onDropCapture, onDragOver: ae.onDragOver, onClick: Te, onBlur: at, children: Qe }), e[90] = ae.onDragOver, e[91] = ae.onDropCapture, e[92] = ae.onPasteCapture, e[93] = Tt, e[94] = wt, e[95] = kt, e[96] = Ct, e[97] = $e, e[98] = Qe, e[99] = ut) : ut = e[99], ut;
|
|
734
805
|
};
|
|
735
|
-
function
|
|
806
|
+
function us() {
|
|
736
807
|
}
|
|
737
|
-
function
|
|
808
|
+
function ds(t) {
|
|
738
809
|
return t + 1;
|
|
739
810
|
}
|
|
740
|
-
function
|
|
811
|
+
function fs(t) {
|
|
741
812
|
return t + 1;
|
|
742
813
|
}
|
|
743
|
-
const
|
|
814
|
+
const ps = (t = "") => JSON.stringify(To(t)), ms = 360, hs = 4, gs = "min(10vh, 4rem)", bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", vt = 1, bs = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
|
|
744
815
|
lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
|
|
745
816
|
textLength: e.textLength + n.text.length
|
|
746
817
|
}, {
|
|
747
818
|
lineCount: 0,
|
|
748
819
|
textLength: 0
|
|
749
|
-
}),
|
|
820
|
+
}), ys = (t) => {
|
|
750
821
|
if (t.role !== "user") return !1;
|
|
751
822
|
const {
|
|
752
823
|
lineCount: e,
|
|
753
824
|
textLength: n
|
|
754
|
-
} =
|
|
755
|
-
return n >
|
|
756
|
-
},
|
|
825
|
+
} = bs(t);
|
|
826
|
+
return n > ms || e > hs;
|
|
827
|
+
}, xs = (t, e) => {
|
|
757
828
|
const n = Math.max(0, t.scrollHeight - t.clientHeight);
|
|
758
|
-
return e === 0 || n <=
|
|
759
|
-
},
|
|
829
|
+
return e === 0 || n <= vt ? !1 : e < 0 ? t.scrollTop > vt : t.scrollTop < n - vt;
|
|
830
|
+
}, Ss = (t) => t.type === "text", Ts = (t) => (t.parts ?? []).filter(Ss).map((e) => e.text.trim()).filter(Boolean).join(`
|
|
760
831
|
|
|
761
|
-
`),
|
|
832
|
+
`), ws = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
|
|
762
833
|
hour: "numeric",
|
|
763
834
|
minute: "2-digit",
|
|
764
835
|
timeZone: n
|
|
765
|
-
}).format(new Date(t.createdAt)) : "",
|
|
766
|
-
const e =
|
|
836
|
+
}).format(new Date(t.createdAt)) : "", Bt = (t) => {
|
|
837
|
+
const e = T(20), {
|
|
767
838
|
message: n,
|
|
768
|
-
alwaysVisible:
|
|
769
|
-
copyAlwaysVisible:
|
|
770
|
-
} = t, r =
|
|
839
|
+
alwaysVisible: s,
|
|
840
|
+
copyAlwaysVisible: o
|
|
841
|
+
} = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, c] = G(!1), u = Ne(null);
|
|
771
842
|
let d;
|
|
772
|
-
e[0] !== n ? (d =
|
|
773
|
-
const
|
|
843
|
+
e[0] !== n ? (d = Ts(n), e[0] = n, e[1] = d) : d = e[1];
|
|
844
|
+
const f = d;
|
|
774
845
|
let m;
|
|
775
|
-
e[2] !== n ? (m =
|
|
776
|
-
const
|
|
846
|
+
e[2] !== n ? (m = ws(n), e[2] = n, e[3] = m) : m = e[3];
|
|
847
|
+
const p = m;
|
|
777
848
|
let h, g;
|
|
778
849
|
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
|
|
779
850
|
u.current !== null && window.clearTimeout(u.current);
|
|
780
|
-
}, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]),
|
|
781
|
-
let
|
|
782
|
-
e[6] !==
|
|
783
|
-
if (
|
|
851
|
+
}, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Ae(h, g);
|
|
852
|
+
let y;
|
|
853
|
+
e[6] !== f ? (y = async () => {
|
|
854
|
+
if (f)
|
|
784
855
|
try {
|
|
785
|
-
await navigator.clipboard.writeText(
|
|
856
|
+
await navigator.clipboard.writeText(f), c(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => c(!1), 1200);
|
|
786
857
|
} catch {
|
|
787
858
|
c(!1);
|
|
788
859
|
}
|
|
789
|
-
}, e[6] =
|
|
790
|
-
const
|
|
791
|
-
if (!
|
|
860
|
+
}, e[6] = f, e[7] = y) : y = e[7];
|
|
861
|
+
const b = y;
|
|
862
|
+
if (!f && !p)
|
|
792
863
|
return null;
|
|
793
|
-
const x = r ? "1" : "0",
|
|
794
|
-
let
|
|
795
|
-
e[8] !==
|
|
864
|
+
const x = r ? "1" : "0", C = r ? "auto" : "none";
|
|
865
|
+
let A;
|
|
866
|
+
e[8] !== p ? (A = p ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
|
|
796
867
|
let w;
|
|
797
|
-
e[10] !== i || e[11] !==
|
|
798
|
-
let
|
|
799
|
-
return e[15] !== w || e[16] !== x || e[17] !==
|
|
800
|
-
|
|
868
|
+
e[10] !== i || e[11] !== b || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ a(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Kt, children: /* @__PURE__ */ a(cn, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ a($t, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: b, children: l ? /* @__PURE__ */ a(rn, { size: 12 }) : /* @__PURE__ */ a(eo, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = b, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
|
|
869
|
+
let _;
|
|
870
|
+
return e[15] !== w || e[16] !== x || e[17] !== C || e[18] !== A ? (_ = /* @__PURE__ */ k(Me, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: C, transition: "opacity 120ms ease", css: Kt, children: [
|
|
871
|
+
A,
|
|
801
872
|
w
|
|
802
|
-
] }), e[15] = w, e[16] = x, e[17] =
|
|
803
|
-
},
|
|
873
|
+
] }), e[15] = w, e[16] = x, e[17] = C, e[18] = A, e[19] = _) : _ = e[19], _;
|
|
874
|
+
}, Kt = {
|
|
804
875
|
"[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
|
|
805
876
|
opacity: 1,
|
|
806
877
|
pointerEvents: "auto"
|
|
@@ -813,44 +884,44 @@ const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh,
|
|
|
813
884
|
opacity: 1,
|
|
814
885
|
pointerEvents: "auto"
|
|
815
886
|
}
|
|
816
|
-
},
|
|
817
|
-
const e =
|
|
818
|
-
let n,
|
|
887
|
+
}, ks = (t) => {
|
|
888
|
+
const e = T(8);
|
|
889
|
+
let n, s;
|
|
819
890
|
e[0] !== t ? ({
|
|
820
891
|
children: n,
|
|
821
|
-
...
|
|
822
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
823
|
-
let
|
|
824
|
-
e[3] !== n ? (
|
|
892
|
+
...s
|
|
893
|
+
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
894
|
+
let o;
|
|
895
|
+
e[3] !== n ? (o = /* @__PURE__ */ a(un, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
|
|
825
896
|
let r;
|
|
826
|
-
return e[5] !==
|
|
827
|
-
},
|
|
828
|
-
const e =
|
|
897
|
+
return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ a(I, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
|
|
898
|
+
}, Cs = ks, gt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), As = (t) => {
|
|
899
|
+
const e = gt(t), n = e.replace(/_/g, "");
|
|
829
900
|
return [.../* @__PURE__ */ new Set([t, e, n])];
|
|
830
|
-
},
|
|
831
|
-
shell:
|
|
832
|
-
ls:
|
|
833
|
-
read_file:
|
|
834
|
-
write_file:
|
|
835
|
-
delete_file:
|
|
836
|
-
patch:
|
|
837
|
-
upload_files:
|
|
838
|
-
download_file:
|
|
839
|
-
move_file:
|
|
840
|
-
},
|
|
841
|
-
dot:
|
|
842
|
-
danger:
|
|
843
|
-
search:
|
|
844
|
-
browser:
|
|
845
|
-
file:
|
|
846
|
-
question:
|
|
847
|
-
todo:
|
|
848
|
-
terminal:
|
|
849
|
-
...
|
|
850
|
-
},
|
|
851
|
-
if (!t) return
|
|
852
|
-
const e =
|
|
853
|
-
if (
|
|
901
|
+
}, yn = {
|
|
902
|
+
shell: ln,
|
|
903
|
+
ls: ao,
|
|
904
|
+
read_file: lo,
|
|
905
|
+
write_file: io,
|
|
906
|
+
delete_file: ro,
|
|
907
|
+
patch: so,
|
|
908
|
+
upload_files: oo,
|
|
909
|
+
download_file: no,
|
|
910
|
+
move_file: to
|
|
911
|
+
}, _s = {
|
|
912
|
+
dot: ho,
|
|
913
|
+
danger: an,
|
|
914
|
+
search: mo,
|
|
915
|
+
browser: po,
|
|
916
|
+
file: fo,
|
|
917
|
+
question: uo,
|
|
918
|
+
todo: co,
|
|
919
|
+
terminal: ln,
|
|
920
|
+
...yn
|
|
921
|
+
}, Gt = "dot", Rs = (t) => Object.hasOwn(yn, t), Is = (t) => _s[t], xn = (t) => {
|
|
922
|
+
if (!t) return Gt;
|
|
923
|
+
const e = gt(t);
|
|
924
|
+
if (Rs(e)) return e;
|
|
854
925
|
const n = e.replace(/_/g, "");
|
|
855
926
|
switch (e) {
|
|
856
927
|
case "read":
|
|
@@ -877,52 +948,52 @@ const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh,
|
|
|
877
948
|
case "file":
|
|
878
949
|
return "file";
|
|
879
950
|
default:
|
|
880
|
-
return n === "todowrite" || n === "todo" ? "todo" :
|
|
951
|
+
return n === "todowrite" || n === "todo" ? "todo" : Gt;
|
|
881
952
|
}
|
|
882
953
|
};
|
|
883
|
-
function
|
|
954
|
+
function Ht(t) {
|
|
884
955
|
const e = t.lastIndexOf("/");
|
|
885
956
|
return e >= 0 ? t.slice(e + 1) : t;
|
|
886
957
|
}
|
|
887
|
-
function
|
|
958
|
+
function ft(t) {
|
|
888
959
|
if (!t) return null;
|
|
889
960
|
const e = t.split(" ")[0].trim();
|
|
890
961
|
if (e === "/dev/null") return null;
|
|
891
962
|
let n = e;
|
|
892
963
|
return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
|
|
893
964
|
}
|
|
894
|
-
const
|
|
965
|
+
const bt = (t) => t.startsWith("--- "), Qt = (t) => t.startsWith("+++ "), Wt = (t) => t.startsWith("@@"), Ps = (t) => t.startsWith("+") && !(Qt(t) || t === "+++"), Ms = (t) => t.startsWith("-") && !(bt(t) || t === "---"), Es = (t, e) => {
|
|
895
966
|
t.has(e) || t.set(e, {
|
|
896
967
|
additions: 0,
|
|
897
968
|
deletions: 0
|
|
898
969
|
});
|
|
899
|
-
},
|
|
970
|
+
}, vs = (t, e) => {
|
|
900
971
|
const n = t.get(e);
|
|
901
972
|
n && (n.additions += 1);
|
|
902
|
-
},
|
|
973
|
+
}, Ls = (t, e) => {
|
|
903
974
|
const n = t.get(e);
|
|
904
975
|
n && (n.deletions += 1);
|
|
905
|
-
},
|
|
906
|
-
if (
|
|
976
|
+
}, Ds = (t, e, n) => {
|
|
977
|
+
if (bt(t))
|
|
907
978
|
return {
|
|
908
979
|
...e,
|
|
909
|
-
lastMinusHeader:
|
|
980
|
+
lastMinusHeader: ft(t.slice(4)),
|
|
910
981
|
inHunk: !1
|
|
911
982
|
};
|
|
912
|
-
if (
|
|
913
|
-
const
|
|
914
|
-
return
|
|
983
|
+
if (Qt(t)) {
|
|
984
|
+
const o = ft(t.slice(4)) ?? e.lastMinusHeader;
|
|
985
|
+
return o && Es(n, o), {
|
|
915
986
|
...e,
|
|
916
|
-
currentPath:
|
|
987
|
+
currentPath: o,
|
|
917
988
|
inHunk: !1
|
|
918
989
|
};
|
|
919
990
|
}
|
|
920
|
-
return e.currentPath ?
|
|
991
|
+
return e.currentPath ? Wt(t) ? {
|
|
921
992
|
...e,
|
|
922
993
|
inHunk: !0
|
|
923
|
-
} : e.inHunk ?
|
|
994
|
+
} : e.inHunk ? Ps(t) ? (vs(n, e.currentPath), e) : (Ms(t) && Ls(n, e.currentPath), e) : e : e;
|
|
924
995
|
};
|
|
925
|
-
function
|
|
996
|
+
function Sn(t) {
|
|
926
997
|
if (!t || typeof t != "string") return [];
|
|
927
998
|
const e = /* @__PURE__ */ new Map();
|
|
928
999
|
let n = {
|
|
@@ -930,34 +1001,34 @@ function mn(t) {
|
|
|
930
1001
|
lastMinusHeader: null,
|
|
931
1002
|
inHunk: !1
|
|
932
1003
|
};
|
|
933
|
-
const
|
|
934
|
-
for (const
|
|
935
|
-
n =
|
|
936
|
-
return Array.from(e.entries()).map(([
|
|
1004
|
+
const s = t.split(/\r?\n/);
|
|
1005
|
+
for (const o of s)
|
|
1006
|
+
n = Ds(o, n, e);
|
|
1007
|
+
return Array.from(e.entries()).map(([o, {
|
|
937
1008
|
additions: r,
|
|
938
1009
|
deletions: i
|
|
939
1010
|
}]) => ({
|
|
940
|
-
filePath:
|
|
1011
|
+
filePath: o,
|
|
941
1012
|
additions: r,
|
|
942
1013
|
deletions: i
|
|
943
1014
|
}));
|
|
944
1015
|
}
|
|
945
|
-
function
|
|
946
|
-
return
|
|
1016
|
+
function Bs(t) {
|
|
1017
|
+
return Sn(t).map((e) => ({
|
|
947
1018
|
kind: "diff",
|
|
948
|
-
fileName:
|
|
1019
|
+
fileName: Ht(e.filePath),
|
|
949
1020
|
filePath: e.filePath,
|
|
950
1021
|
additions: e.additions,
|
|
951
1022
|
deletions: e.deletions
|
|
952
1023
|
}));
|
|
953
1024
|
}
|
|
954
|
-
function
|
|
955
|
-
return
|
|
1025
|
+
function Os(t) {
|
|
1026
|
+
return Sn(t).map((e) => e.filePath);
|
|
956
1027
|
}
|
|
957
|
-
const
|
|
1028
|
+
const Tn = (t) => bt(t) || t.startsWith("diff --git "), $s = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Fs = (t, e, n) => {
|
|
958
1029
|
if (t.startsWith(" ")) {
|
|
959
|
-
const
|
|
960
|
-
e.push(
|
|
1030
|
+
const s = t.slice(1);
|
|
1031
|
+
e.push(s), n.push(s);
|
|
961
1032
|
return;
|
|
962
1033
|
}
|
|
963
1034
|
if (t.startsWith("-")) {
|
|
@@ -965,30 +1036,30 @@ const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith
|
|
|
965
1036
|
return;
|
|
966
1037
|
}
|
|
967
1038
|
t.startsWith("+") && n.push(t.slice(1));
|
|
968
|
-
},
|
|
969
|
-
let
|
|
970
|
-
for (;
|
|
971
|
-
const r = t[
|
|
972
|
-
if (
|
|
1039
|
+
}, zs = (t, e, n, s) => {
|
|
1040
|
+
let o = e;
|
|
1041
|
+
for (; o < t.length; ) {
|
|
1042
|
+
const r = t[o] || "";
|
|
1043
|
+
if (Tn(r) || Wt(r) || $s(r))
|
|
973
1044
|
break;
|
|
974
|
-
|
|
1045
|
+
Fs(r, n, s), o += 1;
|
|
975
1046
|
}
|
|
976
|
-
return (n.length > 0 ||
|
|
977
|
-
},
|
|
978
|
-
const n =
|
|
979
|
-
if (!
|
|
1047
|
+
return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
|
|
1048
|
+
}, qs = (t, e) => {
|
|
1049
|
+
const n = ft((t[e] || "").slice(4)), s = t[e + 1] || "";
|
|
1050
|
+
if (!Qt(s)) return {
|
|
980
1051
|
nextIndex: e + 1
|
|
981
1052
|
};
|
|
982
|
-
const r =
|
|
1053
|
+
const r = ft(s.slice(4)) ?? n ?? "", i = [], l = [];
|
|
983
1054
|
let c = e + 2;
|
|
984
1055
|
for (; c < t.length; ) {
|
|
985
1056
|
const u = t[c] || "";
|
|
986
|
-
if (
|
|
987
|
-
if (!
|
|
1057
|
+
if (Tn(u)) break;
|
|
1058
|
+
if (!Wt(u)) {
|
|
988
1059
|
c += 1;
|
|
989
1060
|
continue;
|
|
990
1061
|
}
|
|
991
|
-
c =
|
|
1062
|
+
c = zs(t, c + 1, i, l);
|
|
992
1063
|
}
|
|
993
1064
|
return {
|
|
994
1065
|
nextIndex: c,
|
|
@@ -996,30 +1067,30 @@ const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith
|
|
|
996
1067
|
filePath: r,
|
|
997
1068
|
original: i.join(`
|
|
998
1069
|
`),
|
|
999
|
-
modified:
|
|
1070
|
+
modified: l.join(`
|
|
1000
1071
|
`)
|
|
1001
1072
|
}
|
|
1002
1073
|
};
|
|
1003
1074
|
};
|
|
1004
|
-
function
|
|
1075
|
+
function Hs(t) {
|
|
1005
1076
|
if (!t || typeof t != "string") return [];
|
|
1006
1077
|
const e = t.split(/\r?\n/), n = [];
|
|
1007
|
-
let
|
|
1008
|
-
for (;
|
|
1009
|
-
const
|
|
1010
|
-
if (!
|
|
1011
|
-
|
|
1078
|
+
let s = 0;
|
|
1079
|
+
for (; s < e.length; ) {
|
|
1080
|
+
const o = e[s] || "";
|
|
1081
|
+
if (!bt(o)) {
|
|
1082
|
+
s += 1;
|
|
1012
1083
|
continue;
|
|
1013
1084
|
}
|
|
1014
1085
|
const {
|
|
1015
1086
|
nextIndex: r,
|
|
1016
1087
|
preview: i
|
|
1017
|
-
} =
|
|
1018
|
-
i && n.push(i),
|
|
1088
|
+
} = qs(e, s);
|
|
1089
|
+
i && n.push(i), s = Math.max(r, s + 1);
|
|
1019
1090
|
}
|
|
1020
1091
|
return n;
|
|
1021
1092
|
}
|
|
1022
|
-
const
|
|
1093
|
+
const Qs = {
|
|
1023
1094
|
apply_patch: "Apply patch",
|
|
1024
1095
|
bash: "Run command",
|
|
1025
1096
|
edit: "Edit file",
|
|
@@ -1028,7 +1099,7 @@ const Eo = {
|
|
|
1028
1099
|
read: "Read file",
|
|
1029
1100
|
skill: "Load skill",
|
|
1030
1101
|
todowrite: "Update todos"
|
|
1031
|
-
},
|
|
1102
|
+
}, Xt = {
|
|
1032
1103
|
pending: "queued",
|
|
1033
1104
|
error: "failed",
|
|
1034
1105
|
"output-error": "failed",
|
|
@@ -1037,126 +1108,126 @@ const Eo = {
|
|
|
1037
1108
|
running: "running",
|
|
1038
1109
|
completed: "completed",
|
|
1039
1110
|
failed: "failed"
|
|
1040
|
-
},
|
|
1041
|
-
const e =
|
|
1042
|
-
return
|
|
1043
|
-
},
|
|
1111
|
+
}, wn = (t) => t.replace(/^tool-/, "").toLowerCase(), Ws = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ns = (t) => wn(t.tool ?? "tool"), Vs = (t) => {
|
|
1112
|
+
const e = wn(t);
|
|
1113
|
+
return Qs[e] ?? Ws(e.replace(/_/g, " "));
|
|
1114
|
+
}, js = (t) => {
|
|
1044
1115
|
const e = t.state?.status ?? t.status;
|
|
1045
1116
|
if (!e || typeof e != "string") return null;
|
|
1046
1117
|
const n = e.replace(/-/g, "_");
|
|
1047
|
-
return
|
|
1048
|
-
},
|
|
1118
|
+
return Xt[n] ? Xt[n] : n.includes("stream") ? "running" : null;
|
|
1119
|
+
}, kn = (t) => {
|
|
1049
1120
|
const e = t.state?.status ?? t.status;
|
|
1050
1121
|
return e === "error" || e === "output-error" || e === "failed";
|
|
1051
|
-
},
|
|
1122
|
+
}, fe = (t) => kn(t) ? {
|
|
1052
1123
|
type: "icon",
|
|
1053
1124
|
icon: "danger"
|
|
1054
1125
|
} : {
|
|
1055
1126
|
type: "icon",
|
|
1056
|
-
icon:
|
|
1057
|
-
},
|
|
1058
|
-
const
|
|
1127
|
+
icon: xn(Ns(t))
|
|
1128
|
+
}, pe = (t, e, n) => {
|
|
1129
|
+
const o = [{
|
|
1059
1130
|
kind: "text",
|
|
1060
|
-
text: n ??
|
|
1131
|
+
text: n ?? Vs(t.tool ?? "tool"),
|
|
1061
1132
|
bold: !0
|
|
1062
1133
|
}];
|
|
1063
|
-
e &&
|
|
1134
|
+
e && o.push({
|
|
1064
1135
|
kind: "text",
|
|
1065
1136
|
text: e,
|
|
1066
1137
|
muted: !0
|
|
1067
1138
|
});
|
|
1068
|
-
const r =
|
|
1069
|
-
return r && r !== "completed" &&
|
|
1139
|
+
const r = js(t);
|
|
1140
|
+
return r && r !== "completed" && o.push({
|
|
1070
1141
|
kind: "text",
|
|
1071
1142
|
text: r,
|
|
1072
1143
|
muted: !0
|
|
1073
|
-
}),
|
|
1074
|
-
},
|
|
1144
|
+
}), o;
|
|
1145
|
+
}, Ee = (t) => {
|
|
1075
1146
|
const e = t.state?.input;
|
|
1076
1147
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1077
|
-
},
|
|
1148
|
+
}, et = (t) => {
|
|
1078
1149
|
const e = t.state?.output;
|
|
1079
1150
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1080
|
-
}, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null,
|
|
1081
|
-
const n =
|
|
1082
|
-
return n ?
|
|
1083
|
-
},
|
|
1084
|
-
const e =
|
|
1085
|
-
return [
|
|
1086
|
-
},
|
|
1087
|
-
const e =
|
|
1151
|
+
}, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Us = (t, e) => {
|
|
1152
|
+
const n = pt(t.state);
|
|
1153
|
+
return n ? pt(n[e]) : null;
|
|
1154
|
+
}, Ks = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Gs = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Cn = (t) => {
|
|
1155
|
+
const e = et(t);
|
|
1156
|
+
return [Us(t, "metadata"), pt(e?.metadata)].filter(Boolean);
|
|
1157
|
+
}, Xs = (t) => {
|
|
1158
|
+
const e = pt(t);
|
|
1088
1159
|
if (!e) return null;
|
|
1089
1160
|
const n = S(e.filePath) ?? S(e.relativePath) ?? S(e.path);
|
|
1090
1161
|
return n ? {
|
|
1091
|
-
filePath:
|
|
1162
|
+
filePath: Ks(n),
|
|
1092
1163
|
additions: typeof e.additions == "number" ? e.additions : 0,
|
|
1093
1164
|
deletions: typeof e.deletions == "number" ? e.deletions : 0,
|
|
1094
1165
|
diff: S(e.diff) ?? void 0,
|
|
1095
1166
|
before: S(e.before) ?? void 0,
|
|
1096
1167
|
after: S(e.after) ?? void 0
|
|
1097
1168
|
} : null;
|
|
1098
|
-
},
|
|
1169
|
+
}, An = (t) => {
|
|
1099
1170
|
const e = [];
|
|
1100
|
-
for (const n of
|
|
1101
|
-
const
|
|
1102
|
-
for (const
|
|
1103
|
-
const r =
|
|
1171
|
+
for (const n of Cn(t)) {
|
|
1172
|
+
const s = Array.isArray(n.files) ? n.files : [];
|
|
1173
|
+
for (const o of s) {
|
|
1174
|
+
const r = Xs(o);
|
|
1104
1175
|
r && e.push(r);
|
|
1105
1176
|
}
|
|
1106
1177
|
}
|
|
1107
1178
|
return e;
|
|
1108
|
-
},
|
|
1109
|
-
const e =
|
|
1179
|
+
}, Ys = (t) => {
|
|
1180
|
+
const e = Ee(t), n = S(e?.diff);
|
|
1110
1181
|
if (n) return n;
|
|
1111
|
-
for (const r of
|
|
1182
|
+
for (const r of Cn(t)) {
|
|
1112
1183
|
const i = S(r.diff);
|
|
1113
1184
|
if (i) return i;
|
|
1114
1185
|
}
|
|
1115
|
-
const
|
|
1116
|
-
if (
|
|
1186
|
+
const s = An(t).map((r) => r.diff).filter((r) => !!r);
|
|
1187
|
+
if (s.length > 0) return s.join(`
|
|
1117
1188
|
`);
|
|
1118
|
-
const
|
|
1119
|
-
return
|
|
1120
|
-
},
|
|
1189
|
+
const o = S(e?.patchText);
|
|
1190
|
+
return o && Gs(o) ? o : null;
|
|
1191
|
+
}, Js = (t) => {
|
|
1121
1192
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
1122
|
-
for (const
|
|
1123
|
-
e.has(
|
|
1193
|
+
for (const s of t)
|
|
1194
|
+
e.has(s.filePath) || (e.add(s.filePath), n.push({
|
|
1124
1195
|
kind: "diff",
|
|
1125
|
-
fileName:
|
|
1126
|
-
filePath:
|
|
1127
|
-
additions:
|
|
1128
|
-
deletions:
|
|
1196
|
+
fileName: Ht(s.filePath),
|
|
1197
|
+
filePath: s.filePath,
|
|
1198
|
+
additions: s.additions,
|
|
1199
|
+
deletions: s.deletions
|
|
1129
1200
|
}));
|
|
1130
1201
|
return n;
|
|
1131
|
-
},
|
|
1132
|
-
const e =
|
|
1202
|
+
}, Zs = (t) => Array.from(new Set(t.map((e) => e.filePath))), yt = (t) => {
|
|
1203
|
+
const e = et(t);
|
|
1133
1204
|
return S(t.state?.output) ?? S(e?.returnDisplay) ?? S(e?.preview) ?? S(e?.stdout) ?? S(e?.content);
|
|
1134
|
-
},
|
|
1205
|
+
}, er = (t) => {
|
|
1135
1206
|
const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
|
|
1136
1207
|
return e ? {
|
|
1137
1208
|
skillName: S(e[1]) ?? void 0,
|
|
1138
1209
|
content: S(e[2]) ?? ""
|
|
1139
1210
|
} : null;
|
|
1140
|
-
},
|
|
1141
|
-
const e =
|
|
1211
|
+
}, tr = (t) => {
|
|
1212
|
+
const e = Ee(t);
|
|
1142
1213
|
return S(e?.name) ?? S(e?.skillName) ?? S(e?.skill) ?? S(e?.skill_name) ?? void 0;
|
|
1143
|
-
},
|
|
1214
|
+
}, _n = (t) => ({
|
|
1144
1215
|
kind: "link",
|
|
1145
|
-
text:
|
|
1216
|
+
text: Ht(t),
|
|
1146
1217
|
filePath: t
|
|
1147
|
-
}),
|
|
1218
|
+
}), me = (t, e) => !kn(t) || !t.state?.errorText ? e : [{
|
|
1148
1219
|
type: "comment",
|
|
1149
1220
|
text: t.state.errorText
|
|
1150
|
-
}, ...e],
|
|
1221
|
+
}, ...e], Rn = (t) => Hs(t ?? void 0).map((e) => ({
|
|
1151
1222
|
type: "diff",
|
|
1152
1223
|
language: "diff",
|
|
1153
1224
|
original: e.original,
|
|
1154
1225
|
modified: e.modified,
|
|
1155
1226
|
sideBySide: !1
|
|
1156
|
-
})),
|
|
1157
|
-
const e =
|
|
1158
|
-
|
|
1159
|
-
const r = [...
|
|
1227
|
+
})), nr = (t) => Bs(t ?? void 0), or = (t) => Os(t ?? void 0), sr = (t) => {
|
|
1228
|
+
const e = Ys(t), n = An(t), s = pe(t, void 0, "Apply patch"), o = nr(e);
|
|
1229
|
+
o.length > 0 ? s.push(...o) : s.push(...Js(n));
|
|
1230
|
+
const r = [...Rn(e)];
|
|
1160
1231
|
if (r.length === 0)
|
|
1161
1232
|
for (const i of n)
|
|
1162
1233
|
!i.before && !i.after || r.push({
|
|
@@ -1167,252 +1238,252 @@ const Eo = {
|
|
|
1167
1238
|
sideBySide: !1
|
|
1168
1239
|
});
|
|
1169
1240
|
if (r.length === 0) {
|
|
1170
|
-
const i =
|
|
1171
|
-
i.length === 0 && i.push(...
|
|
1241
|
+
const i = or(e);
|
|
1242
|
+
i.length === 0 && i.push(...Zs(n)), i.length > 0 && r.push({
|
|
1172
1243
|
type: "references",
|
|
1173
1244
|
references: i
|
|
1174
1245
|
});
|
|
1175
1246
|
}
|
|
1176
1247
|
return {
|
|
1177
|
-
indicator:
|
|
1178
|
-
title:
|
|
1179
|
-
blocks:
|
|
1248
|
+
indicator: fe(t),
|
|
1249
|
+
title: s,
|
|
1250
|
+
blocks: me(t, r)
|
|
1180
1251
|
};
|
|
1181
|
-
},
|
|
1252
|
+
}, rr = (t, e) => [{
|
|
1182
1253
|
type: "diff",
|
|
1183
1254
|
language: "text",
|
|
1184
1255
|
original: t,
|
|
1185
1256
|
modified: e,
|
|
1186
1257
|
sideBySide: !1
|
|
1187
|
-
}],
|
|
1188
|
-
const e =
|
|
1189
|
-
|
|
1190
|
-
const
|
|
1258
|
+
}], ir = (t) => {
|
|
1259
|
+
const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(n?.filePath) ?? void 0, o = S(n?.oldString) ?? S(e?.old_string) ?? void 0, r = S(n?.newString) ?? S(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
|
|
1260
|
+
s && i.push(_n(s));
|
|
1261
|
+
const l = o !== void 0 && r !== void 0 ? rr(o, r) : Rn(S(n?.diff));
|
|
1191
1262
|
return {
|
|
1192
|
-
indicator:
|
|
1263
|
+
indicator: fe(t),
|
|
1193
1264
|
title: i,
|
|
1194
|
-
blocks:
|
|
1265
|
+
blocks: me(t, l)
|
|
1195
1266
|
};
|
|
1196
|
-
},
|
|
1267
|
+
}, tt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), lr = (t) => {
|
|
1197
1268
|
try {
|
|
1198
1269
|
const e = JSON.parse(t);
|
|
1199
|
-
return
|
|
1270
|
+
return tt(e) ? e : null;
|
|
1200
1271
|
} catch {
|
|
1201
1272
|
return null;
|
|
1202
1273
|
}
|
|
1203
|
-
},
|
|
1204
|
-
const e =
|
|
1274
|
+
}, ar = (t) => tt(t) ? t : typeof t == "string" && t.trim().length > 0 ? lr(t) : null, Ve = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pe = (t) => {
|
|
1275
|
+
const e = Ve(t);
|
|
1205
1276
|
if (e) return e;
|
|
1206
1277
|
if (Array.isArray(t)) {
|
|
1207
|
-
const n = t.map(
|
|
1278
|
+
const n = t.map(Pe).filter((s) => s !== null);
|
|
1208
1279
|
return n.length > 0 ? n.join(`
|
|
1209
1280
|
`) : null;
|
|
1210
1281
|
}
|
|
1211
|
-
return
|
|
1212
|
-
},
|
|
1282
|
+
return tt(t) ? Pe(t.response) ?? Pe(t.answer) ?? Pe(t.text) ?? Pe(t.answers) : null;
|
|
1283
|
+
}, cr = (t) => {
|
|
1213
1284
|
if (typeof t == "string" && t.trim().length > 0)
|
|
1214
1285
|
return {
|
|
1215
1286
|
label: t,
|
|
1216
1287
|
description: void 0
|
|
1217
1288
|
};
|
|
1218
|
-
if (!
|
|
1219
|
-
const e =
|
|
1289
|
+
if (!tt(t)) return null;
|
|
1290
|
+
const e = Ve(t.label);
|
|
1220
1291
|
return e ? {
|
|
1221
1292
|
label: e,
|
|
1222
|
-
description:
|
|
1293
|
+
description: Ve(t.description) ?? void 0
|
|
1223
1294
|
} : null;
|
|
1224
|
-
},
|
|
1225
|
-
if (!
|
|
1226
|
-
const n =
|
|
1295
|
+
}, ur = (t, e) => {
|
|
1296
|
+
if (!tt(t)) return null;
|
|
1297
|
+
const n = Ve(t.question);
|
|
1227
1298
|
if (!n) return null;
|
|
1228
|
-
const
|
|
1229
|
-
return
|
|
1230
|
-
id:
|
|
1299
|
+
const s = Array.isArray(t.options) ? t.options.map(cr).filter((i) => i !== null) : [], o = Ve(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o === "freeform" || o === "text";
|
|
1300
|
+
return s.length === 0 && !r ? null : {
|
|
1301
|
+
id: Ve(t.id) ?? `question-${e}`,
|
|
1231
1302
|
question: n,
|
|
1232
|
-
options:
|
|
1233
|
-
multiple: typeof t.multiple == "boolean" ? t.multiple :
|
|
1303
|
+
options: s,
|
|
1304
|
+
multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
|
|
1234
1305
|
required: typeof t.required == "boolean" ? t.required : !1,
|
|
1235
1306
|
allowCustomAnswer: r
|
|
1236
1307
|
};
|
|
1237
|
-
},
|
|
1238
|
-
const e =
|
|
1308
|
+
}, dr = (t) => {
|
|
1309
|
+
const e = ar(t);
|
|
1239
1310
|
if (!e || !Array.isArray(e.questions)) return null;
|
|
1240
|
-
const n = e.questions.map(
|
|
1311
|
+
const n = e.questions.map(ur).filter((s) => s !== null);
|
|
1241
1312
|
return n.length === 0 ? null : {
|
|
1242
1313
|
type: "question-form",
|
|
1243
1314
|
questions: n
|
|
1244
1315
|
};
|
|
1245
|
-
},
|
|
1316
|
+
}, fr = (t) => {
|
|
1246
1317
|
const {
|
|
1247
1318
|
buildBaseTitle: e,
|
|
1248
1319
|
buildIndicator: n,
|
|
1249
|
-
prependErrorBlock:
|
|
1320
|
+
prependErrorBlock: s
|
|
1250
1321
|
} = t;
|
|
1251
|
-
return (
|
|
1252
|
-
const r =
|
|
1322
|
+
return (o) => {
|
|
1323
|
+
const r = Pe(o.state?.output) ?? Pe(o.state?.metadata), i = dr(o.state?.input);
|
|
1253
1324
|
if (!r && !i) return null;
|
|
1254
|
-
const
|
|
1325
|
+
const l = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [i];
|
|
1255
1326
|
return {
|
|
1256
|
-
indicator: n(
|
|
1257
|
-
title: e(
|
|
1258
|
-
blocks: o
|
|
1327
|
+
indicator: n(o),
|
|
1328
|
+
title: e(o, l, "Question"),
|
|
1329
|
+
blocks: s(o, c),
|
|
1259
1330
|
expandable: !1
|
|
1260
1331
|
};
|
|
1261
1332
|
};
|
|
1262
|
-
},
|
|
1263
|
-
const e =
|
|
1264
|
-
return
|
|
1265
|
-
indicator:
|
|
1266
|
-
title:
|
|
1267
|
-
blocks:
|
|
1333
|
+
}, pr = (t) => {
|
|
1334
|
+
const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(e?.file) ?? S(n?.filePath) ?? S(n?.file) ?? S(n?.path) ?? void 0, o = pe(t, void 0, "Read file");
|
|
1335
|
+
return s && o.push(_n(s)), {
|
|
1336
|
+
indicator: fe(t),
|
|
1337
|
+
title: o,
|
|
1338
|
+
blocks: me(t, [])
|
|
1268
1339
|
};
|
|
1269
|
-
},
|
|
1270
|
-
const e =
|
|
1340
|
+
}, mr = (t) => {
|
|
1341
|
+
const e = Ee(t), n = et(t), s = S(e?.command) ?? void 0, o = pe(t, s, "Run command"), r = [], i = yt(t);
|
|
1271
1342
|
i && r.push({
|
|
1272
1343
|
type: "code",
|
|
1273
1344
|
language: "text",
|
|
1274
1345
|
code: i
|
|
1275
1346
|
});
|
|
1276
|
-
const
|
|
1277
|
-
return
|
|
1347
|
+
const l = S(n?.stderr);
|
|
1348
|
+
return l && l !== i && r.push({
|
|
1278
1349
|
type: "code",
|
|
1279
1350
|
language: "text",
|
|
1280
|
-
code:
|
|
1351
|
+
code: l
|
|
1281
1352
|
}), typeof n?.exitCode == "number" && r.push({
|
|
1282
1353
|
type: "text",
|
|
1283
1354
|
text: `Exit code: ${n.exitCode}`
|
|
1284
1355
|
}), {
|
|
1285
|
-
indicator:
|
|
1286
|
-
title:
|
|
1287
|
-
blocks:
|
|
1356
|
+
indicator: fe(t),
|
|
1357
|
+
title: o,
|
|
1358
|
+
blocks: me(t, r)
|
|
1288
1359
|
};
|
|
1289
|
-
},
|
|
1290
|
-
const e =
|
|
1360
|
+
}, hr = (t) => {
|
|
1361
|
+
const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Search files"), r = n ? [{
|
|
1291
1362
|
type: "code",
|
|
1292
1363
|
language: "text",
|
|
1293
1364
|
code: n
|
|
1294
1365
|
}] : [];
|
|
1295
1366
|
return {
|
|
1296
|
-
indicator:
|
|
1297
|
-
title:
|
|
1298
|
-
blocks:
|
|
1367
|
+
indicator: fe(t),
|
|
1368
|
+
title: o,
|
|
1369
|
+
blocks: me(t, r)
|
|
1299
1370
|
};
|
|
1300
|
-
},
|
|
1301
|
-
const e =
|
|
1371
|
+
}, gr = (t) => {
|
|
1372
|
+
const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Find files"), r = [];
|
|
1302
1373
|
if (n) {
|
|
1303
|
-
const i = n.split(/\r?\n/).map((
|
|
1374
|
+
const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
|
|
1304
1375
|
i.length > 0 && r.push({
|
|
1305
1376
|
type: "references",
|
|
1306
1377
|
references: i
|
|
1307
1378
|
});
|
|
1308
1379
|
}
|
|
1309
1380
|
return {
|
|
1310
|
-
indicator:
|
|
1311
|
-
title:
|
|
1312
|
-
blocks:
|
|
1381
|
+
indicator: fe(t),
|
|
1382
|
+
title: o,
|
|
1383
|
+
blocks: me(t, r)
|
|
1313
1384
|
};
|
|
1314
|
-
},
|
|
1315
|
-
const e =
|
|
1385
|
+
}, br = (t) => {
|
|
1386
|
+
const e = yt(t), n = e ? er(e) : null, s = tr(t) ?? n?.skillName, o = pe(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
|
|
1316
1387
|
type: "code",
|
|
1317
1388
|
language: "markdown",
|
|
1318
1389
|
code: r
|
|
1319
1390
|
}] : [];
|
|
1320
1391
|
return {
|
|
1321
|
-
indicator:
|
|
1322
|
-
title:
|
|
1323
|
-
blocks:
|
|
1392
|
+
indicator: fe(t),
|
|
1393
|
+
title: o,
|
|
1394
|
+
blocks: me(t, i)
|
|
1324
1395
|
};
|
|
1325
|
-
},
|
|
1326
|
-
const e =
|
|
1396
|
+
}, Lt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, In = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
|
|
1397
|
+
const e = In(t);
|
|
1327
1398
|
if (!e) return null;
|
|
1328
|
-
const n =
|
|
1399
|
+
const n = Lt(e.content) ?? Lt(e.title);
|
|
1329
1400
|
if (!n) return null;
|
|
1330
|
-
const
|
|
1401
|
+
const s = Lt(e.status);
|
|
1331
1402
|
return {
|
|
1332
1403
|
label: n,
|
|
1333
|
-
checked:
|
|
1404
|
+
checked: s === "completed"
|
|
1334
1405
|
};
|
|
1335
|
-
},
|
|
1406
|
+
}, Yt = (t) => {
|
|
1336
1407
|
if (!t) return {
|
|
1337
1408
|
items: [],
|
|
1338
1409
|
explicit: !1
|
|
1339
1410
|
};
|
|
1340
1411
|
const e = (() => {
|
|
1341
1412
|
if (Array.isArray(t)) return t;
|
|
1342
|
-
const n =
|
|
1413
|
+
const n = In(t);
|
|
1343
1414
|
return !n || !Array.isArray(n.todos) ? null : n.todos;
|
|
1344
1415
|
})();
|
|
1345
1416
|
return e ? {
|
|
1346
|
-
items: e.map(
|
|
1417
|
+
items: e.map(yr).filter((n) => n !== null),
|
|
1347
1418
|
explicit: !0
|
|
1348
1419
|
} : {
|
|
1349
1420
|
items: [],
|
|
1350
1421
|
explicit: !1
|
|
1351
1422
|
};
|
|
1352
|
-
},
|
|
1423
|
+
}, xr = (t) => {
|
|
1353
1424
|
const {
|
|
1354
1425
|
buildBaseTitle: e,
|
|
1355
1426
|
buildIndicator: n,
|
|
1356
|
-
prependErrorBlock:
|
|
1427
|
+
prependErrorBlock: s
|
|
1357
1428
|
} = t;
|
|
1358
|
-
return (
|
|
1359
|
-
const r =
|
|
1360
|
-
if (!
|
|
1361
|
-
const c =
|
|
1429
|
+
return (o) => {
|
|
1430
|
+
const r = Yt(o.state?.input), i = Yt(o.state?.output), l = i.explicit ? i : r;
|
|
1431
|
+
if (!l.explicit) return null;
|
|
1432
|
+
const c = l.items, u = `${c.length} item${c.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
|
|
1362
1433
|
if (c.length === 0)
|
|
1363
1434
|
return {
|
|
1364
|
-
indicator: n(
|
|
1435
|
+
indicator: n(o),
|
|
1365
1436
|
title: d,
|
|
1366
|
-
blocks: o
|
|
1437
|
+
blocks: s(o, [{
|
|
1367
1438
|
type: "comment",
|
|
1368
1439
|
text: "No todos"
|
|
1369
1440
|
}])
|
|
1370
1441
|
};
|
|
1371
|
-
const
|
|
1442
|
+
const f = [{
|
|
1372
1443
|
type: "todo-list",
|
|
1373
1444
|
items: c
|
|
1374
1445
|
}];
|
|
1375
1446
|
return {
|
|
1376
|
-
indicator: n(
|
|
1447
|
+
indicator: n(o),
|
|
1377
1448
|
title: d,
|
|
1378
|
-
blocks: o
|
|
1449
|
+
blocks: s(o, f)
|
|
1379
1450
|
};
|
|
1380
1451
|
};
|
|
1381
|
-
},
|
|
1382
|
-
buildBaseTitle:
|
|
1383
|
-
buildIndicator:
|
|
1384
|
-
prependErrorBlock:
|
|
1385
|
-
}),
|
|
1386
|
-
buildBaseTitle:
|
|
1387
|
-
buildIndicator:
|
|
1388
|
-
prependErrorBlock:
|
|
1389
|
-
}),
|
|
1390
|
-
apply_patch:
|
|
1391
|
-
bash:
|
|
1392
|
-
edit:
|
|
1393
|
-
glob:
|
|
1394
|
-
grep:
|
|
1395
|
-
question:
|
|
1396
|
-
read:
|
|
1397
|
-
skill:
|
|
1398
|
-
todo_write:
|
|
1399
|
-
todowrite:
|
|
1400
|
-
}),
|
|
1452
|
+
}, Sr = fr({
|
|
1453
|
+
buildBaseTitle: pe,
|
|
1454
|
+
buildIndicator: fe,
|
|
1455
|
+
prependErrorBlock: me
|
|
1456
|
+
}), Jt = xr({
|
|
1457
|
+
buildBaseTitle: pe,
|
|
1458
|
+
buildIndicator: fe,
|
|
1459
|
+
prependErrorBlock: me
|
|
1460
|
+
}), Zt = () => ({
|
|
1461
|
+
apply_patch: sr,
|
|
1462
|
+
bash: mr,
|
|
1463
|
+
edit: ir,
|
|
1464
|
+
glob: gr,
|
|
1465
|
+
grep: hr,
|
|
1466
|
+
question: Sr,
|
|
1467
|
+
read: pr,
|
|
1468
|
+
skill: br,
|
|
1469
|
+
todo_write: Jt,
|
|
1470
|
+
todowrite: Jt
|
|
1471
|
+
}), en = {
|
|
1401
1472
|
pending: "queued",
|
|
1402
1473
|
error: "failed",
|
|
1403
1474
|
"output-error": "failed",
|
|
1404
1475
|
"input-streaming": "running",
|
|
1405
1476
|
"input-available": "queued"
|
|
1406
|
-
},
|
|
1407
|
-
const e =
|
|
1408
|
-
return
|
|
1409
|
-
},
|
|
1477
|
+
}, Tr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), wr = (t) => {
|
|
1478
|
+
const e = gt(t ?? "tool").replace(/_/g, " ");
|
|
1479
|
+
return Tr(e);
|
|
1480
|
+
}, Pn = (t) => t === "error" || t === "output-error", kr = (t) => Pn(t.state?.status) ? {
|
|
1410
1481
|
type: "icon",
|
|
1411
1482
|
icon: "danger"
|
|
1412
1483
|
} : {
|
|
1413
1484
|
type: "icon",
|
|
1414
|
-
icon:
|
|
1415
|
-
},
|
|
1485
|
+
icon: xn(t.tool ?? "tool")
|
|
1486
|
+
}, Cr = (t) => !t || typeof t != "string" ? null : en[t] ? en[t] : t.includes("stream") ? "running" : null, tn = (t) => {
|
|
1416
1487
|
if (typeof t == "string") return t;
|
|
1417
1488
|
if (t == null) return null;
|
|
1418
1489
|
try {
|
|
@@ -1420,113 +1491,113 @@ const Eo = {
|
|
|
1420
1491
|
} catch {
|
|
1421
1492
|
return null;
|
|
1422
1493
|
}
|
|
1423
|
-
},
|
|
1494
|
+
}, Ar = (t) => {
|
|
1424
1495
|
const e = [];
|
|
1425
|
-
|
|
1496
|
+
Pn(t.state?.status) && t.state?.errorText && e.push({
|
|
1426
1497
|
type: "comment",
|
|
1427
1498
|
text: t.state.errorText
|
|
1428
1499
|
});
|
|
1429
|
-
const n =
|
|
1500
|
+
const n = tn(t.state?.input);
|
|
1430
1501
|
n && e.push({
|
|
1431
1502
|
type: "code",
|
|
1432
1503
|
language: "json",
|
|
1433
1504
|
code: n
|
|
1434
1505
|
});
|
|
1435
|
-
const
|
|
1436
|
-
return
|
|
1506
|
+
const s = tn(t.state?.output);
|
|
1507
|
+
return s && e.push({
|
|
1437
1508
|
type: "code",
|
|
1438
1509
|
language: "json",
|
|
1439
|
-
code:
|
|
1510
|
+
code: s
|
|
1440
1511
|
}), e;
|
|
1441
|
-
},
|
|
1512
|
+
}, _r = (t) => {
|
|
1442
1513
|
const e = [{
|
|
1443
1514
|
kind: "text",
|
|
1444
|
-
text:
|
|
1515
|
+
text: wr(t.tool),
|
|
1445
1516
|
bold: !0
|
|
1446
|
-
}], n =
|
|
1517
|
+
}], n = Cr(t.state?.status);
|
|
1447
1518
|
return n && e.push({
|
|
1448
1519
|
kind: "text",
|
|
1449
1520
|
text: n,
|
|
1450
1521
|
muted: !0
|
|
1451
1522
|
}), {
|
|
1452
|
-
indicator:
|
|
1523
|
+
indicator: kr(t),
|
|
1453
1524
|
title: e,
|
|
1454
|
-
blocks:
|
|
1525
|
+
blocks: Ar(t)
|
|
1455
1526
|
};
|
|
1456
|
-
},
|
|
1457
|
-
...
|
|
1527
|
+
}, Rr = (t) => t ? {
|
|
1528
|
+
...Zt(),
|
|
1458
1529
|
...t
|
|
1459
|
-
} :
|
|
1530
|
+
} : Zt(), Ir = (t, e) => {
|
|
1460
1531
|
const n = t.tool ?? "tool";
|
|
1461
|
-
for (const
|
|
1462
|
-
const
|
|
1463
|
-
if (
|
|
1532
|
+
for (const s of As(n)) {
|
|
1533
|
+
const o = e[s];
|
|
1534
|
+
if (o) return o;
|
|
1464
1535
|
}
|
|
1465
|
-
},
|
|
1466
|
-
const
|
|
1467
|
-
if (
|
|
1468
|
-
const
|
|
1469
|
-
if (
|
|
1536
|
+
}, Pr = (t, e, n) => {
|
|
1537
|
+
const s = Ir(t, e);
|
|
1538
|
+
if (s) {
|
|
1539
|
+
const o = s(t, n);
|
|
1540
|
+
if (o) return o;
|
|
1470
1541
|
}
|
|
1471
|
-
return
|
|
1472
|
-
},
|
|
1473
|
-
const n =
|
|
1542
|
+
return _r(t);
|
|
1543
|
+
}, Mr = (t, e) => {
|
|
1544
|
+
const n = Rr(e?.toolRenderers);
|
|
1474
1545
|
return {
|
|
1475
|
-
items: t.map((
|
|
1546
|
+
items: t.map((o) => Pr(o, n, e))
|
|
1476
1547
|
};
|
|
1477
|
-
},
|
|
1478
|
-
|
|
1548
|
+
}, Ce = jn, Mn = (t, e, n, s = !1) => {
|
|
1549
|
+
s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
|
|
1479
1550
|
};
|
|
1480
|
-
function
|
|
1481
|
-
const e =
|
|
1551
|
+
function Er(t) {
|
|
1552
|
+
const e = T(6), {
|
|
1482
1553
|
seg: n
|
|
1483
1554
|
} = t;
|
|
1484
|
-
let o;
|
|
1485
|
-
e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ l(qe.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
|
|
1486
1555
|
let s;
|
|
1487
|
-
e[
|
|
1556
|
+
e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
|
|
1557
|
+
let o;
|
|
1558
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ a(We.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
|
|
1488
1559
|
let r;
|
|
1489
|
-
return e[4] !==
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
] }), e[4] =
|
|
1560
|
+
return e[4] !== s ? (r = /* @__PURE__ */ k(We.Root, { width: "1.5rem", height: "1.5rem", children: [
|
|
1561
|
+
s,
|
|
1562
|
+
o
|
|
1563
|
+
] }), e[4] = s, e[5] = r) : r = e[5], r;
|
|
1493
1564
|
}
|
|
1494
|
-
function
|
|
1495
|
-
const e =
|
|
1565
|
+
function vr(t) {
|
|
1566
|
+
const e = T(9), {
|
|
1496
1567
|
seg: n,
|
|
1497
|
-
onOpenFile:
|
|
1498
|
-
} = t,
|
|
1568
|
+
onOpenFile: s
|
|
1569
|
+
} = t, o = n.additions ?? 0, r = n.deletions ?? 0;
|
|
1499
1570
|
let i;
|
|
1500
|
-
e[0] !==
|
|
1571
|
+
e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
|
|
1501
1572
|
const c = n.filePath ?? n.fileName;
|
|
1502
|
-
|
|
1503
|
-
}, e[0] =
|
|
1504
|
-
let
|
|
1505
|
-
return e[4] !== n.fileName || e[5] !==
|
|
1573
|
+
s?.(c);
|
|
1574
|
+
}, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
|
|
1575
|
+
let l;
|
|
1576
|
+
return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ a(fn, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
|
|
1506
1577
|
}
|
|
1507
|
-
function
|
|
1508
|
-
const e =
|
|
1578
|
+
function Lr(t) {
|
|
1579
|
+
const e = T(13), {
|
|
1509
1580
|
seg: n,
|
|
1510
|
-
onOpenFile:
|
|
1511
|
-
} = t,
|
|
1581
|
+
onOpenFile: s
|
|
1582
|
+
} = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), c = r ? "pointer" : "default";
|
|
1512
1583
|
let u;
|
|
1513
|
-
e[0] !==
|
|
1584
|
+
e[0] !== s || e[1] !== n ? (u = (p) => Mn(p, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
|
|
1514
1585
|
const d = n.muted ? "fg.muted" : "fg.blue-dark";
|
|
1515
|
-
let
|
|
1516
|
-
e[3] !== d ? (
|
|
1586
|
+
let f;
|
|
1587
|
+
e[3] !== d ? (f = {
|
|
1517
1588
|
textDecoration: "underline",
|
|
1518
1589
|
color: d
|
|
1519
|
-
}, e[3] = d, e[4] =
|
|
1590
|
+
}, e[3] = d, e[4] = f) : f = e[4];
|
|
1520
1591
|
let m;
|
|
1521
|
-
return e[5] !==
|
|
1592
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== c || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ a(sn, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: c, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = c, e[10] = u, e[11] = f, e[12] = m) : m = e[12], m;
|
|
1522
1593
|
}
|
|
1523
|
-
function
|
|
1524
|
-
const e =
|
|
1594
|
+
function Dr(t) {
|
|
1595
|
+
const e = T(12), {
|
|
1525
1596
|
seg: n,
|
|
1526
|
-
onOpenFile:
|
|
1527
|
-
} = t,
|
|
1528
|
-
let
|
|
1529
|
-
e[0] !==
|
|
1597
|
+
onOpenFile: s
|
|
1598
|
+
} = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
|
|
1599
|
+
let l;
|
|
1600
|
+
e[0] !== s || e[1] !== n ? (l = (f) => Mn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
|
|
1530
1601
|
const c = n.muted ? "fg.muted" : "accent.primary";
|
|
1531
1602
|
let u;
|
|
1532
1603
|
e[3] !== c ? (u = {
|
|
@@ -1534,246 +1605,252 @@ function Tr(t) {
|
|
|
1534
1605
|
textDecoration: "underline"
|
|
1535
1606
|
}, e[3] = c, e[4] = u) : u = e[4];
|
|
1536
1607
|
let d;
|
|
1537
|
-
return e[5] !==
|
|
1608
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ a(sn, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
|
|
1538
1609
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const e =
|
|
1610
|
+
function Br(t) {
|
|
1611
|
+
const e = T(6), {
|
|
1541
1612
|
seg: n,
|
|
1542
|
-
isClickable:
|
|
1543
|
-
} = t,
|
|
1613
|
+
isClickable: s
|
|
1614
|
+
} = t, o = n.bold ? "medium" : void 0, r = s && !n.muted ? "fg" : "fg.muted";
|
|
1544
1615
|
let i;
|
|
1545
1616
|
e[0] !== r ? (i = {
|
|
1546
1617
|
color: r
|
|
1547
1618
|
}, e[0] = r, e[1] = i) : i = e[1];
|
|
1548
|
-
let
|
|
1549
|
-
return e[2] !== n.text || e[3] !==
|
|
1619
|
+
let l;
|
|
1620
|
+
return e[2] !== n.text || e[3] !== o || e[4] !== i ? (l = /* @__PURE__ */ a(Je, { fontWeight: o, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = o, e[4] = i, e[5] = l) : l = e[5], l;
|
|
1550
1621
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const e =
|
|
1622
|
+
function Or(t) {
|
|
1623
|
+
const e = T(11), {
|
|
1553
1624
|
seg: n,
|
|
1554
|
-
isClickable:
|
|
1555
|
-
onOpenFile:
|
|
1625
|
+
isClickable: s,
|
|
1626
|
+
onOpenFile: o
|
|
1556
1627
|
} = t;
|
|
1557
1628
|
switch (n.kind) {
|
|
1558
1629
|
case "avatar": {
|
|
1559
1630
|
let r;
|
|
1560
|
-
return e[0] !== n ? (r = /* @__PURE__ */
|
|
1631
|
+
return e[0] !== n ? (r = /* @__PURE__ */ a(Er, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
|
|
1561
1632
|
}
|
|
1562
1633
|
case "diff": {
|
|
1563
1634
|
let r;
|
|
1564
|
-
return e[2] !==
|
|
1635
|
+
return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ a(vr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
|
|
1565
1636
|
}
|
|
1566
1637
|
case "link": {
|
|
1567
1638
|
let r;
|
|
1568
|
-
return e[5] !==
|
|
1639
|
+
return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ a(Lr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ a(Dr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
|
|
1569
1640
|
}
|
|
1570
1641
|
case "text": {
|
|
1571
1642
|
let r;
|
|
1572
|
-
return e[8] !==
|
|
1643
|
+
return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ a(Br, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
|
|
1573
1644
|
}
|
|
1574
1645
|
default:
|
|
1575
1646
|
return null;
|
|
1576
1647
|
}
|
|
1577
1648
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const e =
|
|
1649
|
+
function $r(t) {
|
|
1650
|
+
const e = T(10), {
|
|
1580
1651
|
ind: n
|
|
1581
1652
|
} = t;
|
|
1582
1653
|
if (!n || n.type === "none")
|
|
1583
1654
|
return null;
|
|
1584
1655
|
if (n.type === "icon") {
|
|
1585
1656
|
let i;
|
|
1586
|
-
e[0] !== n.icon ? (i =
|
|
1587
|
-
const
|
|
1657
|
+
e[0] !== n.icon ? (i = Is(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
|
|
1658
|
+
const l = i;
|
|
1588
1659
|
let c;
|
|
1589
|
-
return e[2] !==
|
|
1660
|
+
return e[2] !== l ? (c = /* @__PURE__ */ a(Ce.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ a(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = c) : c = e[3], c;
|
|
1590
1661
|
}
|
|
1591
|
-
let o;
|
|
1592
|
-
e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ l(qe.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
|
|
1593
1662
|
let s;
|
|
1594
|
-
e[
|
|
1663
|
+
e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
|
|
1664
|
+
let o;
|
|
1665
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ a(We.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
|
|
1595
1666
|
let r;
|
|
1596
|
-
return e[8] !==
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
] }) }), e[8] =
|
|
1667
|
+
return e[8] !== s ? (r = /* @__PURE__ */ a(Ce.Indicator, { children: /* @__PURE__ */ k(We.Root, { boxSize: "full", children: [
|
|
1668
|
+
s,
|
|
1669
|
+
o
|
|
1670
|
+
] }) }), e[8] = s, e[9] = r) : r = e[9], r;
|
|
1600
1671
|
}
|
|
1601
|
-
function
|
|
1602
|
-
const e =
|
|
1672
|
+
function Fr(t) {
|
|
1673
|
+
const e = T(5), {
|
|
1603
1674
|
code: n,
|
|
1604
|
-
language:
|
|
1605
|
-
} = t,
|
|
1675
|
+
language: s
|
|
1676
|
+
} = t, o = s ? `${s} code block` : "code block";
|
|
1606
1677
|
let r;
|
|
1607
|
-
e[0] !== n ? (r = /* @__PURE__ */
|
|
1678
|
+
e[0] !== n ? (r = /* @__PURE__ */ a(I, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
|
|
1608
1679
|
let i;
|
|
1609
|
-
return e[2] !==
|
|
1680
|
+
return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ a(ht, { background: "bg.code", color: "fg", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ a(I, { as: "pre", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
|
|
1610
1681
|
}
|
|
1611
|
-
function
|
|
1612
|
-
const e =
|
|
1682
|
+
function zr(t) {
|
|
1683
|
+
const e = T(30), {
|
|
1613
1684
|
b: n,
|
|
1614
|
-
onOpenFile:
|
|
1685
|
+
onOpenFile: s
|
|
1615
1686
|
} = t;
|
|
1616
1687
|
switch (n.type) {
|
|
1617
1688
|
case "comment": {
|
|
1618
|
-
let
|
|
1619
|
-
e[0] !== n.text ? (
|
|
1689
|
+
let o;
|
|
1690
|
+
e[0] !== n.text ? (o = /* @__PURE__ */ a(ue.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
|
|
1620
1691
|
let r;
|
|
1621
|
-
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */
|
|
1692
|
+
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ a(ue.Footer, { children: /* @__PURE__ */ k(Ze, { children: [
|
|
1622
1693
|
"👏 ",
|
|
1623
1694
|
n.reactions.clap
|
|
1624
1695
|
] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
|
|
1625
1696
|
let i;
|
|
1626
|
-
return e[4] !==
|
|
1627
|
-
|
|
1697
|
+
return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(ue.Root, { children: [
|
|
1698
|
+
o,
|
|
1628
1699
|
r
|
|
1629
|
-
] }), e[4] =
|
|
1700
|
+
] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
|
|
1630
1701
|
}
|
|
1631
1702
|
case "code": {
|
|
1632
|
-
let
|
|
1633
|
-
return e[7] !== n.code || e[8] !== n.language ? (
|
|
1703
|
+
let o;
|
|
1704
|
+
return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(Fr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
|
|
1634
1705
|
}
|
|
1635
1706
|
case "diff": {
|
|
1636
|
-
const
|
|
1707
|
+
const o = n.sideBySide ?? !1;
|
|
1637
1708
|
let r;
|
|
1638
|
-
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !==
|
|
1709
|
+
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ a(Co, { original: n.original, modified: n.modified, language: n.language, sideBySide: o, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = o, e[14] = r) : r = e[14], r;
|
|
1639
1710
|
}
|
|
1640
1711
|
case "text": {
|
|
1641
|
-
let
|
|
1642
|
-
return e[15] !== n.text ? (
|
|
1712
|
+
let o;
|
|
1713
|
+
return e[15] !== n.text ? (o = /* @__PURE__ */ a(ue.Root, { background: "transparent", children: /* @__PURE__ */ a(ue.Body, { padding: "sm", children: /* @__PURE__ */ a(X, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
|
|
1643
1714
|
}
|
|
1644
1715
|
case "todo-list": {
|
|
1645
|
-
let
|
|
1646
|
-
return e[17] !== n.items ? (
|
|
1716
|
+
let o;
|
|
1717
|
+
return e[17] !== n.items ? (o = /* @__PURE__ */ a(Go, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
|
|
1647
1718
|
}
|
|
1648
1719
|
case "question-form": {
|
|
1649
|
-
let
|
|
1650
|
-
return e[19] !== n.questions ? (
|
|
1720
|
+
let o;
|
|
1721
|
+
return e[19] !== n.questions ? (o = /* @__PURE__ */ a(gn, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
|
|
1651
1722
|
}
|
|
1652
1723
|
case "references": {
|
|
1653
|
-
let
|
|
1654
|
-
e[21] !== n.references ? (
|
|
1724
|
+
let o;
|
|
1725
|
+
e[21] !== n.references ? (o = n.references.map(qr), e[21] = n.references, e[22] = o) : o = e[22];
|
|
1655
1726
|
let r;
|
|
1656
|
-
return e[23] !==
|
|
1727
|
+
return e[23] !== o ? (r = /* @__PURE__ */ a(Y, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
|
|
1657
1728
|
}
|
|
1658
1729
|
case "component": {
|
|
1659
|
-
let
|
|
1660
|
-
e[25] !== n || e[26] !==
|
|
1661
|
-
onOpenFile:
|
|
1662
|
-
}), e[25] = n, e[26] =
|
|
1730
|
+
let o;
|
|
1731
|
+
e[25] !== n || e[26] !== s ? (o = n.render({
|
|
1732
|
+
onOpenFile: s
|
|
1733
|
+
}), e[25] = n, e[26] = s, e[27] = o) : o = e[27];
|
|
1663
1734
|
let r;
|
|
1664
|
-
return e[28] !==
|
|
1735
|
+
return e[28] !== o ? (r = /* @__PURE__ */ a(Ot, { children: o }), e[28] = o, e[29] = r) : r = e[29], r;
|
|
1665
1736
|
}
|
|
1666
1737
|
}
|
|
1667
1738
|
}
|
|
1668
|
-
function
|
|
1669
|
-
return /* @__PURE__ */
|
|
1739
|
+
function qr(t) {
|
|
1740
|
+
return /* @__PURE__ */ a(zt, { fileName: t }, t);
|
|
1670
1741
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const e =
|
|
1742
|
+
function Hr(t) {
|
|
1743
|
+
const e = T(23), {
|
|
1673
1744
|
item: n,
|
|
1674
|
-
itemKey:
|
|
1675
|
-
isOpen:
|
|
1745
|
+
itemKey: s,
|
|
1746
|
+
isOpen: o,
|
|
1676
1747
|
canExpand: r,
|
|
1677
1748
|
hasBlocks: i,
|
|
1678
|
-
onToggle:
|
|
1749
|
+
onToggle: l,
|
|
1679
1750
|
onOpenFile: c
|
|
1680
1751
|
} = t;
|
|
1681
1752
|
let u;
|
|
1682
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
1753
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ a(Ce.Separator, {}), e[0] = u) : u = e[0];
|
|
1683
1754
|
let d;
|
|
1684
|
-
e[1] !== n.indicator ? (d = /* @__PURE__ */
|
|
1755
|
+
e[1] !== n.indicator ? (d = /* @__PURE__ */ k(Ce.Connector, { children: [
|
|
1685
1756
|
u,
|
|
1686
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ a($r, { ind: n.indicator })
|
|
1687
1758
|
] }), e[1] = n.indicator, e[2] = d) : d = e[2];
|
|
1688
|
-
const
|
|
1759
|
+
const f = o ? "auto" : "20px";
|
|
1689
1760
|
let m;
|
|
1690
|
-
e[3] !== r || e[4] !==
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
-
r ? /* @__PURE__ */
|
|
1761
|
+
e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== c || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ a(Ce.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k(Je, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
|
|
1762
|
+
/* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((y, b) => /* @__PURE__ */ a(Or, { seg: y, isClickable: r, onOpenFile: c }, b)) }),
|
|
1763
|
+
r ? /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
|
|
1693
1764
|
color: "fg"
|
|
1694
|
-
}, children: /* @__PURE__ */
|
|
1695
|
-
] }) }), e[3] = r, e[4] =
|
|
1696
|
-
let
|
|
1697
|
-
e[10] !== i || e[11] !==
|
|
1765
|
+
}, children: /* @__PURE__ */ a(go, { size: 12 }) }) : null
|
|
1766
|
+
] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = c, e[8] = l, e[9] = m) : m = e[9];
|
|
1767
|
+
let p;
|
|
1768
|
+
e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = i ? /* @__PURE__ */ a(I, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ a(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((y, b) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(zr, { b: y, onOpenFile: c }) }, b)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = c, e[14] = p) : p = e[14];
|
|
1698
1769
|
let h;
|
|
1699
|
-
e[15] !==
|
|
1770
|
+
e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(Ce.Content, { pb: "xs", h: f, overflow: "hidden", children: [
|
|
1700
1771
|
m,
|
|
1701
|
-
|
|
1702
|
-
] }), e[15] =
|
|
1772
|
+
p
|
|
1773
|
+
] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
|
|
1703
1774
|
let g;
|
|
1704
|
-
return e[19] !==
|
|
1775
|
+
return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(Ce.Item, { gap: "xs", children: [
|
|
1705
1776
|
d,
|
|
1706
1777
|
h
|
|
1707
|
-
] },
|
|
1778
|
+
] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
|
|
1708
1779
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const e =
|
|
1780
|
+
function Qr(t) {
|
|
1781
|
+
const e = T(11), {
|
|
1711
1782
|
data: n,
|
|
1712
|
-
onOpenFile:
|
|
1783
|
+
onOpenFile: s
|
|
1713
1784
|
} = t;
|
|
1714
|
-
let
|
|
1715
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1716
|
-
const [r, i] = G(
|
|
1785
|
+
let o;
|
|
1786
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
|
|
1787
|
+
const [r, i] = G(o), l = Wr;
|
|
1717
1788
|
let c;
|
|
1718
1789
|
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (m) => {
|
|
1719
|
-
i((
|
|
1720
|
-
...
|
|
1721
|
-
[m]: !
|
|
1790
|
+
i((p) => ({
|
|
1791
|
+
...p,
|
|
1792
|
+
[m]: !p[m]
|
|
1722
1793
|
}));
|
|
1723
1794
|
}, e[1] = c) : c = e[1];
|
|
1724
1795
|
const u = c;
|
|
1725
1796
|
let d;
|
|
1726
|
-
if (e[2] !== n.items || e[3] !== r || e[4] !==
|
|
1797
|
+
if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
|
|
1727
1798
|
let m;
|
|
1728
|
-
e[6] !== r || e[7] !==
|
|
1729
|
-
const g =
|
|
1730
|
-
return /* @__PURE__ */
|
|
1731
|
-
}, e[6] = r, e[7] =
|
|
1799
|
+
e[6] !== r || e[7] !== s ? (m = (p, h) => {
|
|
1800
|
+
const g = l(p, h), y = (p.blocks?.length ?? 0) > 0, b = (p.expandable ?? !0) && y, x = b ? r[g] ?? !1 : y;
|
|
1801
|
+
return /* @__PURE__ */ a(Hr, { item: p, itemKey: g, isOpen: x, canExpand: b, hasBlocks: y, onToggle: u, onOpenFile: s }, g);
|
|
1802
|
+
}, e[6] = r, e[7] = s, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
|
|
1732
1803
|
} else
|
|
1733
1804
|
d = e[5];
|
|
1734
|
-
let
|
|
1735
|
-
return e[9] !== d ? (
|
|
1805
|
+
let f;
|
|
1806
|
+
return e[9] !== d ? (f = /* @__PURE__ */ a(Ce.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
|
|
1736
1807
|
}
|
|
1737
|
-
function
|
|
1808
|
+
function Wr(t, e) {
|
|
1738
1809
|
return t.id ? `id:${t.id}` : `idx:${e}`;
|
|
1739
1810
|
}
|
|
1740
|
-
const
|
|
1811
|
+
const Nr = (t) => gt(t.tool ?? "").replace(/_/g, "") === "question", Vr = (t) => {
|
|
1741
1812
|
const e = t.state?.output;
|
|
1742
1813
|
return typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : e && typeof e == "object" ? Object.keys(e).length > 0 : e != null;
|
|
1743
1814
|
};
|
|
1744
|
-
function
|
|
1745
|
-
const e =
|
|
1815
|
+
function jr(t) {
|
|
1816
|
+
const e = T(8), {
|
|
1746
1817
|
invocations: n,
|
|
1747
|
-
labeledBlocks:
|
|
1748
|
-
hideQuestionForms:
|
|
1818
|
+
labeledBlocks: s,
|
|
1819
|
+
hideQuestionForms: o,
|
|
1749
1820
|
onOpenFile: r
|
|
1750
|
-
} = t, i =
|
|
1751
|
-
let
|
|
1752
|
-
if (e[0] !== i || e[1] !== n || e[2] !==
|
|
1821
|
+
} = t, i = o === void 0 ? !1 : o;
|
|
1822
|
+
let l, c;
|
|
1823
|
+
if (e[0] !== i || e[1] !== n || e[2] !== s) {
|
|
1753
1824
|
c = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
1754
1825
|
e: {
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
1826
|
+
const f = i ? n.filter(Ur) : n;
|
|
1827
|
+
if (f.length === 0) {
|
|
1757
1828
|
c = null;
|
|
1758
1829
|
break e;
|
|
1759
1830
|
}
|
|
1760
|
-
|
|
1761
|
-
labeledBlocks:
|
|
1831
|
+
l = Mr(f, {
|
|
1832
|
+
labeledBlocks: s
|
|
1762
1833
|
});
|
|
1763
1834
|
}
|
|
1764
|
-
e[0] = i, e[1] = n, e[2] =
|
|
1835
|
+
e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = c;
|
|
1765
1836
|
} else
|
|
1766
|
-
|
|
1837
|
+
l = e[3], c = e[4];
|
|
1767
1838
|
if (c !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
1768
1839
|
return c;
|
|
1769
|
-
const u =
|
|
1840
|
+
const u = l;
|
|
1770
1841
|
let d;
|
|
1771
|
-
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */
|
|
1842
|
+
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ a(Qr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
|
|
1772
1843
|
}
|
|
1773
|
-
function
|
|
1774
|
-
return !
|
|
1844
|
+
function Ur(t) {
|
|
1845
|
+
return !Nr(t) || Vr(t);
|
|
1775
1846
|
}
|
|
1776
|
-
const
|
|
1847
|
+
const Kr = (t) => t.type === "tool", Nt = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", Gr = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Xr = (t) => t.mediaType?.startsWith("image/") || Gr.test(Nt(t)), Yr = (t) => Xr(t) ? /* @__PURE__ */ a(Un, { src: t.url, alt: `${Nt(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, Jr = (t, e) => {
|
|
1848
|
+
if (e) {
|
|
1849
|
+
e(t.url);
|
|
1850
|
+
return;
|
|
1851
|
+
}
|
|
1852
|
+
typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
|
|
1853
|
+
}, Zr = (t) => {
|
|
1777
1854
|
if (t.message && t.message.trim().length > 0)
|
|
1778
1855
|
return t.message;
|
|
1779
1856
|
const {
|
|
@@ -1789,100 +1866,95 @@ const Or = (t) => t.type === "tool", Et = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
|
|
|
1789
1866
|
default:
|
|
1790
1867
|
return "An error occurred.";
|
|
1791
1868
|
}
|
|
1792
|
-
},
|
|
1869
|
+
}, ei = {
|
|
1793
1870
|
info: "blue",
|
|
1794
1871
|
warning: "orange",
|
|
1795
1872
|
error: "red",
|
|
1796
1873
|
success: "green",
|
|
1797
1874
|
loading: "blue"
|
|
1798
|
-
},
|
|
1875
|
+
}, ti = (t, e) => {
|
|
1799
1876
|
const n = [];
|
|
1800
|
-
let
|
|
1801
|
-
for (;
|
|
1802
|
-
const
|
|
1803
|
-
if (!
|
|
1804
|
-
n.push(
|
|
1877
|
+
let s = e;
|
|
1878
|
+
for (; s < t.length; ) {
|
|
1879
|
+
const o = t[s];
|
|
1880
|
+
if (!Kr(o)) break;
|
|
1881
|
+
n.push(o), s += 1;
|
|
1805
1882
|
}
|
|
1806
1883
|
return {
|
|
1807
1884
|
invocations: n,
|
|
1808
|
-
nextIndex:
|
|
1885
|
+
nextIndex: s - 1
|
|
1809
1886
|
};
|
|
1810
1887
|
};
|
|
1811
|
-
function
|
|
1812
|
-
const e =
|
|
1888
|
+
function En(t) {
|
|
1889
|
+
const e = T(8), {
|
|
1813
1890
|
message: n,
|
|
1814
|
-
hideQuestionForms:
|
|
1815
|
-
onOpenFile:
|
|
1891
|
+
hideQuestionForms: s,
|
|
1892
|
+
onOpenFile: o,
|
|
1816
1893
|
toolInvocationTimeline: r
|
|
1817
|
-
} = t, i =
|
|
1894
|
+
} = t, i = s === void 0 ? !1 : s, l = r ?? jr;
|
|
1818
1895
|
let c;
|
|
1819
1896
|
e[0] !== n.parts ? (c = n.parts ?? [], e[0] = n.parts, e[1] = c) : c = e[1];
|
|
1820
1897
|
const u = c;
|
|
1821
1898
|
let d;
|
|
1822
|
-
if (e[2] !==
|
|
1823
|
-
const
|
|
1899
|
+
if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
|
|
1900
|
+
const f = [];
|
|
1824
1901
|
for (let m = 0; m < u.length; m = m + 1, m) {
|
|
1825
|
-
const
|
|
1826
|
-
e: switch (
|
|
1902
|
+
const p = u[m], h = `${n.id}-${m}`;
|
|
1903
|
+
e: switch (p.type) {
|
|
1827
1904
|
case "text": {
|
|
1828
|
-
|
|
1905
|
+
f.push(/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(Cs, { children: p.text }) }, h));
|
|
1829
1906
|
break e;
|
|
1830
1907
|
}
|
|
1831
1908
|
case "reasoning": {
|
|
1832
|
-
|
|
1909
|
+
f.push(/* @__PURE__ */ a(I, { padding: "0", css: {
|
|
1833
1910
|
"& .rich-text, & .rich-text *": {
|
|
1834
1911
|
color: "fg.subtle !important",
|
|
1835
1912
|
fontSize: ".75rem !important",
|
|
1836
1913
|
fontWeight: "normal !important"
|
|
1837
1914
|
}
|
|
1838
|
-
}, children: /* @__PURE__ */
|
|
1915
|
+
}, children: /* @__PURE__ */ a(un, { defaultState: p.text, fullWidth: !0 }) }, h));
|
|
1839
1916
|
break e;
|
|
1840
1917
|
}
|
|
1841
1918
|
case "tool": {
|
|
1842
1919
|
const {
|
|
1843
1920
|
invocations: g,
|
|
1844
|
-
nextIndex:
|
|
1845
|
-
} =
|
|
1846
|
-
m =
|
|
1921
|
+
nextIndex: y
|
|
1922
|
+
} = ti(u, m);
|
|
1923
|
+
m = y, f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
|
|
1847
1924
|
break e;
|
|
1848
1925
|
}
|
|
1849
|
-
case "
|
|
1850
|
-
|
|
1926
|
+
case "file": {
|
|
1927
|
+
f.push(/* @__PURE__ */ a(I, { width: "fit-content", children: /* @__PURE__ */ a(zt, { fileName: Nt(p), size: "sm", tone: "neutral", icon: Yr(p), onSelect: () => Jr(p, o) }) }, h));
|
|
1851
1928
|
break e;
|
|
1852
1929
|
}
|
|
1853
|
-
case "
|
|
1854
|
-
|
|
1855
|
-
"Tokens: ",
|
|
1856
|
-
Et(f.inputTokens),
|
|
1857
|
-
" in / ",
|
|
1858
|
-
Et(f.outputTokens),
|
|
1859
|
-
" out",
|
|
1860
|
-
f.cacheReadTokens ? ` / ${Et(f.cacheReadTokens)} cache read` : ""
|
|
1861
|
-
] }) }, h));
|
|
1930
|
+
case "error": {
|
|
1931
|
+
f.push(/* @__PURE__ */ a(I, { py: "2", width: "full", children: /* @__PURE__ */ a(Ut, { borderRadius: "xs", status: "error", colorPalette: "red", title: Zr(p), size: "sm" }) }, h));
|
|
1862
1932
|
break e;
|
|
1863
1933
|
}
|
|
1934
|
+
case "token_usage":
|
|
1935
|
+
break e;
|
|
1864
1936
|
case "alert": {
|
|
1865
|
-
|
|
1937
|
+
f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(Ut, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: ei[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ a(Ft, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
|
|
1866
1938
|
break e;
|
|
1867
1939
|
}
|
|
1868
1940
|
default:
|
|
1869
|
-
|
|
1941
|
+
f.push(null);
|
|
1870
1942
|
}
|
|
1871
1943
|
}
|
|
1872
|
-
d = /* @__PURE__ */
|
|
1944
|
+
d = /* @__PURE__ */ a(Ot, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
|
|
1873
1945
|
} else
|
|
1874
1946
|
d = e[7];
|
|
1875
1947
|
return d;
|
|
1876
1948
|
}
|
|
1877
|
-
const
|
|
1949
|
+
const ni = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", oi = (t) => {
|
|
1878
1950
|
const e = t.parts ?? [];
|
|
1879
|
-
return e.length === 0 || e.some((
|
|
1880
|
-
},
|
|
1951
|
+
return e.length === 0 || e.some((s) => s.type === "text" && "text" in s) ? !1 : e.some((s) => s.type === "reasoning" || s.type === "tool");
|
|
1952
|
+
}, si = (t) => {
|
|
1881
1953
|
const e = [];
|
|
1882
1954
|
for (const n of t) {
|
|
1883
|
-
const
|
|
1884
|
-
if (
|
|
1885
|
-
|
|
1955
|
+
const s = e[e.length - 1];
|
|
1956
|
+
if (s && s.role === n.role && oi(n)) {
|
|
1957
|
+
s.parts = [...s.parts ?? [], ...n.parts ?? []];
|
|
1886
1958
|
continue;
|
|
1887
1959
|
}
|
|
1888
1960
|
e.push({
|
|
@@ -1891,325 +1963,328 @@ const qr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
1891
1963
|
});
|
|
1892
1964
|
}
|
|
1893
1965
|
return e;
|
|
1894
|
-
},
|
|
1966
|
+
}, ri = (t) => {
|
|
1895
1967
|
const e = [], n = [];
|
|
1896
|
-
for (const
|
|
1897
|
-
|
|
1898
|
-
userMessage:
|
|
1968
|
+
for (const s of t)
|
|
1969
|
+
s.role === "user" ? e.push({
|
|
1970
|
+
userMessage: s,
|
|
1899
1971
|
responses: []
|
|
1900
|
-
}) : e.length > 0 ? e[e.length - 1].responses.push(
|
|
1972
|
+
}) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
|
|
1901
1973
|
return {
|
|
1902
1974
|
groups: e,
|
|
1903
1975
|
leadingResponses: n
|
|
1904
1976
|
};
|
|
1905
|
-
},
|
|
1977
|
+
}, vn = 720, ii = 1, li = 3, ai = 20, nn = 1, ci = 4, Ln = 8, ui = (t, e) => [...t.map((n) => ({
|
|
1906
1978
|
type: "leading-response",
|
|
1907
1979
|
key: n.id,
|
|
1908
1980
|
message: n
|
|
1909
|
-
})), ...e.map((n,
|
|
1981
|
+
})), ...e.map((n, s) => ({
|
|
1910
1982
|
type: "group",
|
|
1911
1983
|
key: n.userMessage.id,
|
|
1912
1984
|
group: n,
|
|
1913
|
-
groupIndex:
|
|
1914
|
-
}))],
|
|
1985
|
+
groupIndex: s
|
|
1986
|
+
}))], di = (t, e) => {
|
|
1915
1987
|
if (t === 0) return 0;
|
|
1916
|
-
const n = t *
|
|
1988
|
+
const n = t * vn + (t - 1) * Ln;
|
|
1917
1989
|
return Math.max(n - e, 0);
|
|
1918
|
-
},
|
|
1990
|
+
}, fi = (t) => t?.clientHeight || ii, pi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= nn && Math.abs(t.totalSize - e.totalSize) <= nn, mi = (t, e) => ({
|
|
1919
1991
|
scrollTop: t?.scrollTop ?? 0,
|
|
1920
1992
|
totalSize: e
|
|
1921
|
-
}),
|
|
1922
|
-
const e =
|
|
1993
|
+
}), hi = (t) => {
|
|
1994
|
+
const e = T(8), {
|
|
1923
1995
|
itemCount: n,
|
|
1924
|
-
onReady:
|
|
1925
|
-
scrollRef:
|
|
1996
|
+
onReady: s,
|
|
1997
|
+
scrollRef: o,
|
|
1926
1998
|
totalSize: r
|
|
1927
|
-
} = t, i =
|
|
1928
|
-
let
|
|
1929
|
-
e[0] !==
|
|
1930
|
-
i.current =
|
|
1931
|
-
}, c = [
|
|
1999
|
+
} = t, i = Ne(s);
|
|
2000
|
+
let l, c;
|
|
2001
|
+
e[0] !== s ? (l = () => {
|
|
2002
|
+
i.current = s;
|
|
2003
|
+
}, c = [s], e[0] = s, e[1] = l, e[2] = c) : (l = e[1], c = e[2]), Ae(l, c);
|
|
1932
2004
|
let u, d;
|
|
1933
|
-
e[3] !== n || e[4] !==
|
|
2005
|
+
e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
|
|
1934
2006
|
if (n === 0 || typeof requestAnimationFrame > "u") {
|
|
1935
2007
|
i.current?.();
|
|
1936
2008
|
return;
|
|
1937
2009
|
}
|
|
1938
|
-
let
|
|
2010
|
+
let f = 0, m = 0, p = 0, h = null;
|
|
1939
2011
|
const g = () => {
|
|
1940
2012
|
m = m + 1;
|
|
1941
|
-
const
|
|
1942
|
-
if (
|
|
2013
|
+
const y = mi(o.current, r);
|
|
2014
|
+
if (p = h && pi(y, h) ? p + 1 : 0, h = y, p >= li || m >= ai) {
|
|
1943
2015
|
i.current?.();
|
|
1944
2016
|
return;
|
|
1945
2017
|
}
|
|
1946
|
-
|
|
2018
|
+
f = requestAnimationFrame(g);
|
|
1947
2019
|
};
|
|
1948
|
-
return
|
|
1949
|
-
}, d = [n,
|
|
1950
|
-
},
|
|
1951
|
-
const e =
|
|
2020
|
+
return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
|
|
2021
|
+
}, d = [n, o, r], e[3] = n, e[4] = o, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), Ae(u, d);
|
|
2022
|
+
}, gi = (t) => {
|
|
2023
|
+
const e = T(7), {
|
|
1952
2024
|
label: n,
|
|
1953
|
-
onClick:
|
|
1954
|
-
actionPanel:
|
|
1955
|
-
} = t, r =
|
|
2025
|
+
onClick: s,
|
|
2026
|
+
actionPanel: o
|
|
2027
|
+
} = t, r = o ? "space-between" : "flex-end";
|
|
1956
2028
|
let i;
|
|
1957
|
-
e[0] !== n || e[1] !==
|
|
1958
|
-
let
|
|
1959
|
-
return e[3] !==
|
|
1960
|
-
|
|
2029
|
+
e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ a(Ze, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
|
|
2030
|
+
let l;
|
|
2031
|
+
return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(Re, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
|
|
2032
|
+
o,
|
|
1961
2033
|
i
|
|
1962
|
-
] }), e[3] =
|
|
1963
|
-
},
|
|
1964
|
-
const
|
|
1965
|
-
return /* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
|
|
2034
|
+
] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
|
|
2035
|
+
}, Dn = (t, e, n = !1) => {
|
|
2036
|
+
const s = ni(t.role);
|
|
2037
|
+
return /* @__PURE__ */ a(_e.Root, { from: s, children: /* @__PURE__ */ k(_e.Content, { from: s, children: [
|
|
2038
|
+
/* @__PURE__ */ a(En, { message: t, streaming: e, hideQuestionForms: n }),
|
|
2039
|
+
s === "assistant" || s === "user" ? /* @__PURE__ */ a(Bt, { message: t, alwaysVisible: s === "user", copyAlwaysVisible: s !== "user" }) : null
|
|
1968
2040
|
] }) });
|
|
1969
|
-
},
|
|
1970
|
-
|
|
1971
|
-
},
|
|
2041
|
+
}, bi = (t) => {
|
|
2042
|
+
xs(t.currentTarget, t.deltaY) && t.stopPropagation();
|
|
2043
|
+
}, yi = (t, e) => {
|
|
1972
2044
|
if (t)
|
|
1973
|
-
return e ?
|
|
1974
|
-
},
|
|
2045
|
+
return e ? bn : gs;
|
|
2046
|
+
}, xi = (t) => {
|
|
1975
2047
|
if (t)
|
|
1976
|
-
return
|
|
1977
|
-
},
|
|
1978
|
-
const e =
|
|
2048
|
+
return bn;
|
|
2049
|
+
}, Si = (t) => {
|
|
2050
|
+
const e = T(43), {
|
|
1979
2051
|
group: n,
|
|
1980
|
-
streaming:
|
|
1981
|
-
hideQuestionForms:
|
|
2052
|
+
streaming: s,
|
|
2053
|
+
hideQuestionForms: o,
|
|
1982
2054
|
isExpanded: r,
|
|
1983
2055
|
onToggleStickyMessage: i
|
|
1984
2056
|
} = t;
|
|
1985
|
-
let
|
|
1986
|
-
e[0] !== n.userMessage || e[1] !== r ? (
|
|
2057
|
+
let l, c, u;
|
|
2058
|
+
e[0] !== n.userMessage || e[1] !== r ? (l = ys(n.userMessage), c = l && r, u = yi(l, r), e[0] = n.userMessage, e[1] = r, e[2] = l, e[3] = c, e[4] = u) : (l = e[2], c = e[3], u = e[4]);
|
|
1987
2059
|
const d = u;
|
|
1988
|
-
let
|
|
1989
|
-
e[5] !== n.userMessage.id || e[6] !== i ? (
|
|
1990
|
-
const m =
|
|
1991
|
-
let
|
|
1992
|
-
e[8] !== c ? (
|
|
1993
|
-
const
|
|
1994
|
-
let
|
|
1995
|
-
e[10] !== n.userMessage || e[11] !==
|
|
1996
|
-
let B;
|
|
1997
|
-
e[13] !== w || e[14] !== R || e[15] !== g || e[16] !== b || e[17] !== y || e[18] !== x || e[19] !== _ || e[20] !== C ? (B = /* @__PURE__ */ l(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: b, minH: "0", overflowY: y, px: x, py: _, pb: C, onWheel: w, children: R }), e[13] = w, e[14] = R, e[15] = g, e[16] = b, e[17] = y, e[18] = x, e[19] = _, e[20] = C, e[21] = B) : B = e[21];
|
|
2060
|
+
let f;
|
|
2061
|
+
e[5] !== n.userMessage.id || e[6] !== i ? (f = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = f) : f = e[7];
|
|
2062
|
+
const m = f, p = l ? "0" : void 0, h = l ? "relative" : void 0, g = l ? r ? "expanded" : "collapsed" : void 0;
|
|
2063
|
+
let y;
|
|
2064
|
+
e[8] !== c ? (y = xi(c), e[8] = c, e[9] = y) : y = e[9];
|
|
2065
|
+
const b = c ? "auto" : "visible", x = l ? "xs" : void 0, C = l ? "xs" : void 0, A = c ? "3rem" : void 0, w = c ? bi : void 0;
|
|
2066
|
+
let _;
|
|
2067
|
+
e[10] !== n.userMessage || e[11] !== s ? (_ = /* @__PURE__ */ a(En, { message: n.userMessage, streaming: s }), e[10] = n.userMessage, e[11] = s, e[12] = _) : _ = e[12];
|
|
1998
2068
|
let M;
|
|
1999
|
-
e[
|
|
2069
|
+
e[13] !== w || e[14] !== _ || e[15] !== g || e[16] !== y || e[17] !== b || e[18] !== x || e[19] !== C || e[20] !== A ? (M = /* @__PURE__ */ a(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: y, minH: "0", overflowY: b, px: x, py: C, pb: A, onWheel: w, children: _ }), e[13] = w, e[14] = _, e[15] = g, e[16] = y, e[17] = b, e[18] = x, e[19] = C, e[20] = A, e[21] = M) : M = e[21];
|
|
2000
2070
|
let P;
|
|
2001
|
-
e[
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
let H;
|
|
2008
|
-
e[37] !== s || e[38] !== o ? (H = (ee) => /* @__PURE__ */ l(I, { children: In(ee, o, s) }, ee.id), e[37] = s, e[38] = o, e[39] = H) : H = e[39], Q = n.responses.map(H), e[33] = n.responses, e[34] = s, e[35] = o, e[36] = Q;
|
|
2009
|
-
} else
|
|
2010
|
-
Q = e[36];
|
|
2071
|
+
e[22] !== n.userMessage || e[23] !== l || e[24] !== r || e[25] !== m ? (P = l ? /* @__PURE__ */ a(gi, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ a(Bt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ a(Bt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[22] = n.userMessage, e[23] = l, e[24] = r, e[25] = m, e[26] = P) : P = e[26];
|
|
2072
|
+
let v;
|
|
2073
|
+
e[27] !== d || e[28] !== M || e[29] !== P || e[30] !== p || e[31] !== h ? (v = /* @__PURE__ */ a(I, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ k(_e.Content, { from: "user", maxH: d, overflow: "hidden", p, position: h, children: [
|
|
2074
|
+
M,
|
|
2075
|
+
P
|
|
2076
|
+
] }) }) }), e[27] = d, e[28] = M, e[29] = P, e[30] = p, e[31] = h, e[32] = v) : v = e[32];
|
|
2011
2077
|
let L;
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2078
|
+
if (e[33] !== n.responses || e[34] !== o || e[35] !== s) {
|
|
2079
|
+
let J;
|
|
2080
|
+
e[37] !== o || e[38] !== s ? (J = (B) => /* @__PURE__ */ a(I, { children: Dn(B, s, o) }, B.id), e[37] = o, e[38] = s, e[39] = J) : J = e[39], L = n.responses.map(J), e[33] = n.responses, e[34] = o, e[35] = s, e[36] = L;
|
|
2081
|
+
} else
|
|
2082
|
+
L = e[36];
|
|
2083
|
+
let H;
|
|
2084
|
+
return e[40] !== v || e[41] !== L ? (H = /* @__PURE__ */ k(I, { children: [
|
|
2085
|
+
v,
|
|
2086
|
+
L
|
|
2087
|
+
] }), e[40] = v, e[41] = L, e[42] = H) : H = e[42], H;
|
|
2088
|
+
}, Ti = (t, e) => {
|
|
2017
2089
|
const {
|
|
2018
2090
|
groups: n,
|
|
2019
|
-
streaming:
|
|
2020
|
-
hideActiveQuestionForms:
|
|
2091
|
+
streaming: s,
|
|
2092
|
+
hideActiveQuestionForms: o,
|
|
2021
2093
|
expandedStickyMessageIds: r,
|
|
2022
2094
|
onToggleStickyMessage: i
|
|
2023
2095
|
} = e;
|
|
2024
|
-
return t.type === "leading-response" ?
|
|
2025
|
-
},
|
|
2096
|
+
return t.type === "leading-response" ? Dn(t.message, s, n.length > 0 || o) : /* @__PURE__ */ a(Si, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), onToggleStickyMessage: i });
|
|
2097
|
+
}, wi = (t) => {
|
|
2026
2098
|
const {
|
|
2027
2099
|
leadingResponses: e,
|
|
2028
2100
|
groups: n,
|
|
2029
|
-
streaming:
|
|
2030
|
-
hideActiveQuestionForms:
|
|
2101
|
+
streaming: s,
|
|
2102
|
+
hideActiveQuestionForms: o,
|
|
2031
2103
|
expandedStickyMessageIds: r,
|
|
2032
2104
|
onToggleStickyMessage: i,
|
|
2033
|
-
onReady:
|
|
2105
|
+
onReady: l
|
|
2034
2106
|
} = t, {
|
|
2035
2107
|
scrollRef: c
|
|
2036
|
-
} =
|
|
2108
|
+
} = mt(), u = ui(e, n), d = fi(c.current), f = _o({
|
|
2037
2109
|
count: u.length,
|
|
2038
2110
|
getScrollElement: () => c.current,
|
|
2039
|
-
estimateSize: () =>
|
|
2040
|
-
getItemKey: (
|
|
2041
|
-
overscan:
|
|
2042
|
-
gap:
|
|
2111
|
+
estimateSize: () => vn,
|
|
2112
|
+
getItemKey: (p) => u[p]?.key ?? p,
|
|
2113
|
+
overscan: ci,
|
|
2114
|
+
gap: Ln,
|
|
2043
2115
|
initialRect: {
|
|
2044
2116
|
width: 0,
|
|
2045
2117
|
height: d
|
|
2046
2118
|
},
|
|
2047
|
-
initialOffset: () =>
|
|
2048
|
-
}), m =
|
|
2049
|
-
return
|
|
2119
|
+
initialOffset: () => di(u.length, d)
|
|
2120
|
+
}), m = f.getTotalSize();
|
|
2121
|
+
return hi({
|
|
2050
2122
|
itemCount: u.length,
|
|
2051
|
-
onReady:
|
|
2123
|
+
onReady: l,
|
|
2052
2124
|
scrollRef: c,
|
|
2053
2125
|
totalSize: m
|
|
2054
|
-
}), /* @__PURE__ */
|
|
2126
|
+
}), /* @__PURE__ */ a(I, { px: "xs", children: /* @__PURE__ */ a(I, { position: "relative", width: "100%", style: {
|
|
2055
2127
|
height: m
|
|
2056
|
-
}, children:
|
|
2057
|
-
const h = u[
|
|
2058
|
-
return h ? /* @__PURE__ */
|
|
2059
|
-
top:
|
|
2060
|
-
}, children:
|
|
2128
|
+
}, children: f.getVirtualItems().map((p) => {
|
|
2129
|
+
const h = u[p.index];
|
|
2130
|
+
return h ? /* @__PURE__ */ a(I, { ref: f.measureElement, "data-index": p.index, "data-chat-message-list-item": h.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
|
|
2131
|
+
top: p.start
|
|
2132
|
+
}, children: Ti(h, {
|
|
2061
2133
|
groups: n,
|
|
2062
|
-
streaming:
|
|
2063
|
-
hideActiveQuestionForms:
|
|
2134
|
+
streaming: s,
|
|
2135
|
+
hideActiveQuestionForms: o,
|
|
2064
2136
|
expandedStickyMessageIds: r,
|
|
2065
2137
|
onToggleStickyMessage: i
|
|
2066
|
-
}) },
|
|
2138
|
+
}) }, p.key) : null;
|
|
2067
2139
|
}) }) });
|
|
2068
|
-
},
|
|
2069
|
-
const e =
|
|
2140
|
+
}, dl = (t) => {
|
|
2141
|
+
const e = T(64), {
|
|
2070
2142
|
conversationKey: n,
|
|
2071
|
-
messages:
|
|
2072
|
-
loading:
|
|
2143
|
+
messages: s,
|
|
2144
|
+
loading: o,
|
|
2073
2145
|
streaming: r,
|
|
2074
2146
|
emptyStateTitle: i,
|
|
2075
|
-
emptyStateDescription:
|
|
2147
|
+
emptyStateDescription: l,
|
|
2076
2148
|
emptyStateContent: c,
|
|
2077
2149
|
loaderComponent: u,
|
|
2078
2150
|
chatInputPlaceholder: d,
|
|
2079
|
-
chatInputDefaultValue:
|
|
2151
|
+
chatInputDefaultValue: f,
|
|
2080
2152
|
onSubmitMessage: m,
|
|
2081
|
-
onInterrupt:
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2153
|
+
onInterrupt: p,
|
|
2154
|
+
onAttachFiles: h,
|
|
2155
|
+
onAttachText: g,
|
|
2156
|
+
onChatInputChange: y,
|
|
2157
|
+
actions: b,
|
|
2158
|
+
repoMenu: x,
|
|
2159
|
+
attachedResources: C,
|
|
2160
|
+
onClearAttachments: A,
|
|
2161
|
+
attachmentList: w,
|
|
2162
|
+
approvalPrompt: _,
|
|
2163
|
+
workspaceHub: M,
|
|
2164
|
+
workspaceInitializing: P,
|
|
2165
|
+
inputDisabled: v,
|
|
2166
|
+
chatInputQuestionPrompt: L,
|
|
2167
|
+
chatInputAutoFocus: H
|
|
2168
|
+
} = t, J = o === void 0 ? !1 : o, B = r === void 0 ? !1 : r, ve = f === void 0 ? "" : f, je = P === void 0 ? !1 : P, Le = v === void 0 ? !1 : v, he = H === void 0 ? !1 : H;
|
|
2169
|
+
let F, z, ee, E;
|
|
2170
|
+
if (e[0] !== n || e[1] !== s) {
|
|
2171
|
+
const q = si(s);
|
|
2172
|
+
F = q.length > 0;
|
|
2173
|
+
const we = n ?? q[0]?.id;
|
|
2174
|
+
z = F ? we ?? "active-conversation" : null, E = q.reduce(ki, 0), ee = ri(q), e[0] = n, e[1] = s, e[2] = F, e[3] = z, e[4] = ee, e[5] = E;
|
|
2101
2175
|
} else
|
|
2102
|
-
|
|
2176
|
+
F = e[2], z = e[3], ee = e[4], E = e[5];
|
|
2103
2177
|
const {
|
|
2104
|
-
groups:
|
|
2105
|
-
leadingResponses:
|
|
2106
|
-
} =
|
|
2107
|
-
let ne;
|
|
2108
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ l(cs, { size: 48, strokeWidth: 1.5 }), e[6] = ne) : ne = e[6];
|
|
2109
|
-
let se;
|
|
2110
|
-
e[7] !== a || e[8] !== i ? (se = /* @__PURE__ */ l(bs, { icon: ne, title: i, description: a }), e[7] = a, e[8] = i, e[9] = se) : se = e[9];
|
|
2111
|
-
const pe = Le ? u : c ?? se, X = !!w, me = !!M, he = L && $ && !ee, oe = !E || Pe === E;
|
|
2178
|
+
groups: ge,
|
|
2179
|
+
leadingResponses: be
|
|
2180
|
+
} = ee, [O, De] = G(Ci), [Ue, Ke] = G(null), Be = !F && J;
|
|
2112
2181
|
let Ie;
|
|
2113
|
-
e[
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2182
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ a(bo, { size: 48, strokeWidth: 1.5 }), e[6] = Ie) : Ie = e[6];
|
|
2183
|
+
let te;
|
|
2184
|
+
e[7] !== l || e[8] !== i ? (te = /* @__PURE__ */ a(Ao, { icon: Ie, title: i, description: l }), e[7] = l, e[8] = i, e[9] = te) : te = e[9];
|
|
2185
|
+
const ye = Be ? u : c ?? te, ne = !!M, xe = !!L, oe = B && F && !je, se = !z || Ue === z;
|
|
2186
|
+
let re;
|
|
2187
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = (q) => {
|
|
2188
|
+
De((we) => {
|
|
2189
|
+
const K = new Set(we);
|
|
2190
|
+
return K.has(q) ? K.delete(q) : K.add(q), K;
|
|
2117
2191
|
});
|
|
2118
|
-
}, e[10] =
|
|
2119
|
-
const
|
|
2192
|
+
}, e[10] = re) : re = e[10];
|
|
2193
|
+
const Oe = re;
|
|
2194
|
+
let ie;
|
|
2195
|
+
e[11] !== E ? (ie = /* @__PURE__ */ a(Ho, { userMessageCount: E }), e[11] = E, e[12] = ie) : ie = e[12];
|
|
2196
|
+
const Se = se ? "visible" : "hidden";
|
|
2197
|
+
let Q;
|
|
2198
|
+
e[13] !== ye || e[14] !== O || e[15] !== ge || e[16] !== F || e[17] !== xe || e[18] !== be || e[19] !== z || e[20] !== B ? (Q = F ? /* @__PURE__ */ a(wi, { leadingResponses: be, groups: ge, streaming: B, hideActiveQuestionForms: xe, expandedStickyMessageIds: O, onToggleStickyMessage: Oe, onReady: () => Ke(z) }, z) : ye, e[13] = ye, e[14] = O, e[15] = ge, e[16] = F, e[17] = xe, e[18] = be, e[19] = z, e[20] = B, e[21] = Q) : Q = e[21];
|
|
2199
|
+
let W;
|
|
2200
|
+
e[22] !== Se || e[23] !== Q ? (W = /* @__PURE__ */ a(Et.Viewport, { visibility: Se, children: Q }), e[22] = Se, e[23] = Q, e[24] = W) : W = e[24];
|
|
2201
|
+
let Te;
|
|
2202
|
+
e[25] !== se ? (Te = se ? /* @__PURE__ */ a(Et.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[25] = se, e[26] = Te) : Te = e[26];
|
|
2120
2203
|
let N;
|
|
2121
|
-
e[
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2204
|
+
e[27] !== ie || e[28] !== W || e[29] !== Te ? (N = /* @__PURE__ */ k(Et.Root, { children: [
|
|
2205
|
+
ie,
|
|
2206
|
+
W,
|
|
2207
|
+
Te
|
|
2208
|
+
] }), e[27] = ie, e[28] = W, e[29] = Te, e[30] = N) : N = e[30];
|
|
2209
|
+
let Z;
|
|
2210
|
+
e[31] !== oe ? (Z = oe ? /* @__PURE__ */ k(Me, { gap: "xs", px: "sm", py: "2xs", children: [
|
|
2211
|
+
/* @__PURE__ */ a(Ft, { size: "xs", color: "fg.muted" }),
|
|
2212
|
+
/* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
|
|
2213
|
+
] }) : null, e[31] = oe, e[32] = Z) : Z = e[32];
|
|
2214
|
+
const V = ne ? "0" : "xs";
|
|
2215
|
+
let $;
|
|
2216
|
+
e[33] !== ve ? ($ = ps(ve), e[33] = ve, e[34] = $) : $ = e[34];
|
|
2129
2217
|
let D;
|
|
2130
|
-
e[
|
|
2131
|
-
N,
|
|
2132
|
-
V,
|
|
2133
|
-
Y
|
|
2134
|
-
] }), e[27] = N, e[28] = V, e[29] = Y, e[30] = D) : D = e[30];
|
|
2135
|
-
let F;
|
|
2136
|
-
e[31] !== he ? (F = he ? /* @__PURE__ */ T(Ee, { gap: "xs", px: "sm", py: "2xs", children: [
|
|
2137
|
-
/* @__PURE__ */ l($t, { size: "xs", color: "fg.muted" }),
|
|
2138
|
-
/* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
|
|
2139
|
-
] }) : null, e[31] = he, e[32] = F) : F = e[32];
|
|
2140
|
-
const z = X ? "0" : "xs";
|
|
2218
|
+
e[35] !== b || e[36] !== C || e[37] !== w || e[38] !== he || e[39] !== d || e[40] !== L || e[41] !== ne || e[42] !== Le || e[43] !== h || e[44] !== g || e[45] !== y || e[46] !== A || e[47] !== p || e[48] !== m || e[49] !== B || e[50] !== $ ? (D = /* @__PURE__ */ a(cs, { placeholder: d, defaultState: $, streaming: B, onSubmit: m, onInterrupt: p, onAttachFiles: h, onAttachText: g, onChange: y, actions: b, attachedResources: C, onClearAttachments: A, attachmentList: w, isDisabled: Le, attachedToTop: ne, questionPrompt: L, autoFocus: he }), e[35] = b, e[36] = C, e[37] = w, e[38] = he, e[39] = d, e[40] = L, e[41] = ne, e[42] = Le, e[43] = h, e[44] = g, e[45] = y, e[46] = A, e[47] = p, e[48] = m, e[49] = B, e[50] = $, e[51] = D) : D = e[51];
|
|
2141
2219
|
let j;
|
|
2142
|
-
e[
|
|
2220
|
+
e[52] !== V || e[53] !== D || e[54] !== M ? (j = /* @__PURE__ */ k(Y, { px: "xs", gap: V, children: [
|
|
2221
|
+
M,
|
|
2222
|
+
D
|
|
2223
|
+
] }), e[52] = V, e[53] = D, e[54] = M, e[55] = j) : j = e[55];
|
|
2143
2224
|
let U;
|
|
2144
|
-
e[
|
|
2145
|
-
let
|
|
2146
|
-
e[
|
|
2147
|
-
|
|
2225
|
+
e[56] !== x ? (U = /* @__PURE__ */ a(Re, { p: "2xs", justifyContent: "flex-end", children: x }), e[56] = x, e[57] = U) : U = e[57];
|
|
2226
|
+
let le;
|
|
2227
|
+
return e[58] !== _ || e[59] !== N || e[60] !== Z || e[61] !== j || e[62] !== U ? (le = /* @__PURE__ */ k(Re, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
|
|
2228
|
+
N,
|
|
2229
|
+
_,
|
|
2230
|
+
Z,
|
|
2231
|
+
j,
|
|
2148
2232
|
U
|
|
2149
|
-
] }), e[
|
|
2150
|
-
let J;
|
|
2151
|
-
e[54] !== b ? (J = /* @__PURE__ */ l(Ce, { p: "2xs", justifyContent: "flex-end", children: b }), e[54] = b, e[55] = J) : J = e[55];
|
|
2152
|
-
let re;
|
|
2153
|
-
return e[56] !== C || e[57] !== D || e[58] !== F || e[59] !== K || e[60] !== J ? (re = /* @__PURE__ */ T(Ce, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
|
|
2154
|
-
D,
|
|
2155
|
-
C,
|
|
2156
|
-
F,
|
|
2157
|
-
K,
|
|
2158
|
-
J
|
|
2159
|
-
] }), e[56] = C, e[57] = D, e[58] = F, e[59] = K, e[60] = J, e[61] = re) : re = e[61], re;
|
|
2233
|
+
] }), e[58] = _, e[59] = N, e[60] = Z, e[61] = j, e[62] = U, e[63] = le) : le = e[63], le;
|
|
2160
2234
|
};
|
|
2161
|
-
function
|
|
2235
|
+
function ki(t, e) {
|
|
2162
2236
|
return t + (e.role === "user" ? 1 : 0);
|
|
2163
2237
|
}
|
|
2164
|
-
function
|
|
2238
|
+
function Ci() {
|
|
2165
2239
|
return /* @__PURE__ */ new Set();
|
|
2166
2240
|
}
|
|
2167
|
-
const
|
|
2168
|
-
const t =
|
|
2241
|
+
const on = (t) => /* @__PURE__ */ a(Y, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ a(Kn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), fl = () => {
|
|
2242
|
+
const t = T(2);
|
|
2169
2243
|
let e;
|
|
2170
|
-
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
2244
|
+
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ a(_e.Content, { from: "user", children: on(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
|
|
2171
2245
|
let n;
|
|
2172
|
-
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */
|
|
2246
|
+
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(Y, { minH: "full", py: "xs", gap: "0", children: [
|
|
2173
2247
|
e,
|
|
2174
|
-
/* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ a(_e.Root, { from: "assistant", children: /* @__PURE__ */ a(_e.Content, { from: "assistant", children: on(["76%", "62%", "40%"]) }) })
|
|
2175
2249
|
] }), t[1] = n) : n = t[1], n;
|
|
2176
|
-
},
|
|
2177
|
-
const e =
|
|
2250
|
+
}, pl = (t) => {
|
|
2251
|
+
const e = T(14), {
|
|
2178
2252
|
changesLabel: n,
|
|
2179
|
-
additions:
|
|
2180
|
-
deletions:
|
|
2253
|
+
additions: s,
|
|
2254
|
+
deletions: o,
|
|
2181
2255
|
action: r,
|
|
2182
2256
|
status: i,
|
|
2183
|
-
statusLabel:
|
|
2184
|
-
} = t, c = i === void 0 ? "ready" : i, u =
|
|
2257
|
+
statusLabel: l
|
|
2258
|
+
} = t, c = i === void 0 ? "ready" : i, u = s > 0 || o > 0, d = c === "error" ? "border.error" : "border.muted", f = c === "error" ? "bg.error" : "bg.subtle";
|
|
2185
2259
|
let m;
|
|
2186
|
-
e[0] !==
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
] }) : c === "error" ? /* @__PURE__ */
|
|
2190
|
-
/* @__PURE__ */
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
] }) : u ? /* @__PURE__ */
|
|
2260
|
+
e[0] !== s || e[1] !== n || e[2] !== o || e[3] !== u || e[4] !== c || e[5] !== l ? (m = c === "loading" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
|
|
2261
|
+
/* @__PURE__ */ a(Ft, { size: "xs", color: "fg.muted" }),
|
|
2262
|
+
/* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: l ?? "Setting up workspace..." })
|
|
2263
|
+
] }) : c === "error" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
|
|
2264
|
+
/* @__PURE__ */ a(an, { size: 14, color: "var(--chakra-colors-fg-error)" }),
|
|
2265
|
+
/* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: l ?? "Workspace setup failed" })
|
|
2266
|
+
] }) : u ? /* @__PURE__ */ a(fn, { label: n, additions: s, deletions: o, variant: "ghost", size: "small", _hover: {
|
|
2193
2267
|
background: "transparent"
|
|
2194
|
-
} }) : /* @__PURE__ */
|
|
2195
|
-
let
|
|
2196
|
-
e[7] !== r ? (
|
|
2268
|
+
} }) : /* @__PURE__ */ a(Re, { flex: "1" }), e[0] = s, e[1] = n, e[2] = o, e[3] = u, e[4] = c, e[5] = l, e[6] = m) : m = e[6];
|
|
2269
|
+
let p;
|
|
2270
|
+
e[7] !== r ? (p = r ? /* @__PURE__ */ a(Re, { flexShrink: 0, ml: "auto", children: r }) : null, e[7] = r, e[8] = p) : p = e[8];
|
|
2197
2271
|
let h;
|
|
2198
|
-
return e[9] !== d || e[10] !==
|
|
2272
|
+
return e[9] !== d || e[10] !== f || e[11] !== m || e[12] !== p ? (h = /* @__PURE__ */ k(Re, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: d, borderRadius: "xs", borderBottomRadius: "0", bg: f, children: [
|
|
2199
2273
|
m,
|
|
2200
|
-
|
|
2201
|
-
] }), e[9] = d, e[10] =
|
|
2274
|
+
p
|
|
2275
|
+
] }), e[9] = d, e[10] = f, e[11] = m, e[12] = p, e[13] = h) : h = e[13], h;
|
|
2202
2276
|
};
|
|
2203
2277
|
export {
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2278
|
+
cl as ApprovalPrompt,
|
|
2279
|
+
ul as AttachmentList,
|
|
2280
|
+
Ho as AutoScroll,
|
|
2281
|
+
cs as ChatInput,
|
|
2282
|
+
_e as ChatMessage,
|
|
2283
|
+
dl as ChatPanel,
|
|
2284
|
+
Et as ChatPrimitives,
|
|
2285
|
+
fl as ChatSkeleton,
|
|
2286
|
+
pl as ChatWorkspaceHub,
|
|
2287
|
+
ls as SendButton,
|
|
2288
|
+
ps as createSerializedPromptState
|
|
2214
2289
|
};
|
|
2215
2290
|
//# sourceMappingURL=chat-ui.js.map
|