@pstdio/ui 0.2.3 → 0.2.5

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.
Files changed (38) hide show
  1. package/dist/chat-ui.js +627 -570
  2. package/dist/chat-ui.js.map +1 -1
  3. package/dist/components/chat-ui/agent-types.d.ts +7 -1
  4. package/dist/components/chat-ui/components/ai-message.d.ts +3 -10
  5. package/dist/components/chat-ui/components/chat-input.d.ts +1 -0
  6. package/dist/components/chat-ui/components/chat-panel-alerts.stories.d.ts +9 -0
  7. package/dist/components/chat-ui/components/chat-panel.d.ts +5 -0
  8. package/dist/components/chat-ui/components/chat-panel.stories.d.ts +1 -0
  9. package/dist/components/chat-ui/components/chat-skeleton.d.ts +1 -0
  10. package/dist/components/chat-ui/components/message-parts-renderer.stories.d.ts +1 -0
  11. package/dist/components/chat-ui/components/workspace-hub.d.ts +12 -0
  12. package/dist/components/chat-ui/components/workspace-hub.stories.d.ts +6 -0
  13. package/dist/components/chat-ui/index.d.ts +3 -0
  14. package/dist/components/diff-editor.d.ts +2 -0
  15. package/dist/components/diff-view-adapter.d.ts +14 -0
  16. package/dist/components/diff-view-adapter.test.d.ts +1 -0
  17. package/dist/components/menu-item.d.ts +0 -1
  18. package/dist/components/searchable-menu.d.ts +32 -0
  19. package/dist/components/searchable-menu.stories.d.ts +6 -0
  20. package/dist/components/searchable-menu.test.d.ts +1 -0
  21. package/dist/components/sidebar-tree/searchable-action-menu.d.ts +6 -0
  22. package/dist/components/sidebar-tree/sidebar-tree-searchable-action-menu.stories.d.ts +6 -0
  23. package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +2 -0
  24. package/dist/components/tickets/ticket-card.stories.d.ts +1 -0
  25. package/dist/components/tickets/types.d.ts +4 -6
  26. package/dist/empty-state-yGspgiPl.js +185 -0
  27. package/dist/empty-state-yGspgiPl.js.map +1 -0
  28. package/dist/index.d.ts +3 -1
  29. package/dist/index.js +1682 -1586
  30. package/dist/index.js.map +1 -1
  31. package/dist/theme/global.d.ts +10 -0
  32. package/dist/{theme-C7CIuIPZ.js → theme-BFV2Q048.js} +18 -8
  33. package/dist/theme-BFV2Q048.js.map +1 -0
  34. package/dist/theme.js +1 -1
  35. package/package.json +5 -3
  36. package/dist/empty-state-kQR0gd4j.js +0 -232
  37. package/dist/empty-state-kQR0gd4j.js.map +0 -1
  38. package/dist/theme-C7CIuIPZ.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as i, jsxs as b, Fragment as Le } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as b, Fragment as Ve } from "react/jsx-runtime";
2
2
  import { c as y } from "react/compiler-runtime";
3
- import { chakra as bt, AbsoluteCenter as xt, IconButton as Je, defineSlotRecipe as yt, createSlotRecipeContext as St, Text as Q, Code as Ue, Button as le, HStack as Qe, Box as k, Flex as X, Tooltip as xe, Portal as kt, Kbd as Tt, Spacer as wt, Timeline as Ct, Span as ie, Avatar as Z, Card as z, Link as Ze, Stack as et, Spinner as _t } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Pt, ShieldX as Rt, ShieldCheck as It, Square as Mt, ArrowUp as Bt, Move as vt, FileDown as At, FileUp as Dt, FileDiff as zt, Trash2 as Et, FilePen as Ft, FileText as $t, ListTree as Lt, Terminal as tt, File as Ot, Globe as Ht, Search as Wt, AlertTriangle as jt, DotIcon as Nt, ChevronUpIcon as Ut, MessageCircleIcon as Vt } from "lucide-react";
5
- import { StickToBottom as qt, useStickToBottomContext as Oe } from "use-stick-to-bottom";
6
- import { S as nt } from "./tooltip-Dze4WXVl.js";
7
- import { useRef as Fe, useEffect as $e, useState as J } from "react";
8
- import { f as De, P as Gt, g as Kt, R as rt, h as Yt } from "./rich-message-ZT2CEiwt.js";
3
+ import { chakra as Pt, AbsoluteCenter as It, IconButton as lt, defineSlotRecipe as vt, createSlotRecipeContext as At, Text as Y, Code as Qe, Button as Se, HStack as ke, Box as k, Flex as $, Tooltip as Ae, Portal as Bt, Kbd as Dt, Spacer as Mt, Timeline as zt, Span as ye, Avatar as ae, Card as E, Link as at, Stack as Te, Spinner as qe, Skeleton as Et } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as $t, ShieldX as Lt, ShieldCheck as Ft, Square as Ot, ArrowUp as Wt, Move as Ht, FileDown as jt, FileUp as Nt, FileDiff as Ut, Trash2 as Vt, FilePen as qt, FileText as Gt, ListTree as Kt, Terminal as ct, File as Xt, Globe as Yt, Search as Jt, AlertTriangle as dt, DotIcon as Qt, ChevronUpIcon as Zt, MessageCircleIcon as en } from "lucide-react";
5
+ import { StickToBottom as tn, useStickToBottomContext as Ge } from "use-stick-to-bottom";
6
+ import { S as ut } from "./tooltip-Dze4WXVl.js";
7
+ import { useRef as Ne, useEffect as Ue, useState as le } from "react";
8
+ import { f as We, P as nn, g as rn, R as ft, h as on } from "./rich-message-ZT2CEiwt.js";
9
9
  import "@lexical/react/LexicalCollaborationContext";
10
10
  import "@lexical/react/LexicalCollaborationPlugin";
11
11
  import "@lexical/react/LexicalComposer";
@@ -29,13 +29,13 @@ import "@lexical/react/LexicalAutoFocusPlugin";
29
29
  import "@lexical/react/LexicalHistoryPlugin";
30
30
  import "@lexical/react/LexicalOnChangePlugin";
31
31
  import "@lexical/react/LexicalTreeView";
32
- import { D as Xt, a as Jt, E as Qt } from "./empty-state-kQR0gd4j.js";
33
- const Zt = {
32
+ import { D as sn, a as pt, A as Ze, E as ln } from "./empty-state-yGspgiPl.js";
33
+ const an = {
34
34
  "aria-roledescription": "conversation",
35
35
  initial: "instant",
36
36
  resize: "instant",
37
37
  role: "log"
38
- }, en = bt(qt, {
38
+ }, cn = Pt(tn, {
39
39
  base: {
40
40
  position: "relative",
41
41
  flex: 1,
@@ -44,8 +44,8 @@ const Zt = {
44
44
  }
45
45
  }, {
46
46
  forwardProps: ["resize"],
47
- defaultProps: Zt
48
- }), tn = (t) => {
47
+ defaultProps: an
48
+ }), dn = (t) => {
49
49
  const e = y(9);
50
50
  let n, r;
51
51
  e[0] !== t ? ({
@@ -55,31 +55,31 @@ const Zt = {
55
55
  const {
56
56
  contentRef: o,
57
57
  scrollRef: s
58
- } = Oe(), l = s, c = o;
59
- let d;
60
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {
58
+ } = Ge(), l = s, a = o;
59
+ let c;
60
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
61
61
  p: "sm",
62
62
  "aria-live": "polite",
63
63
  role: "list"
64
- }, e[3] = d) : d = e[3];
65
- let a;
66
- return e[4] !== n || e[5] !== r || e[6] !== l || e[7] !== c ? (a = /* @__PURE__ */ i(nt, { ...r, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: l, contentRef: c, contentProps: d, children: n }), e[4] = n, e[5] = r, e[6] = l, e[7] = c, e[8] = a) : a = e[8], a;
67
- }, nn = {
64
+ }, e[3] = c) : c = e[3];
65
+ let d;
66
+ return e[4] !== n || e[5] !== r || e[6] !== l || e[7] !== a ? (d = /* @__PURE__ */ i(ut, { ...r, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: l, contentRef: a, contentProps: c, children: n }), e[4] = n, e[5] = r, e[6] = l, e[7] = a, e[8] = d) : d = e[8], d;
67
+ }, un = {
68
68
  axis: "horizontal",
69
69
  bottom: "md",
70
70
  zIndex: 2
71
- }, rn = (t) => {
71
+ }, fn = (t) => {
72
72
  const e = y(4), {
73
73
  isAtBottom: n,
74
74
  scrollToBottom: r
75
- } = Oe();
75
+ } = Ge();
76
76
  let o;
77
- return e[0] !== n || e[1] !== t || e[2] !== r ? (o = !n && /* @__PURE__ */ i(xt, { ...nn, children: /* @__PURE__ */ i(Je, { rounded: "full", onClick: () => r(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ i(Pt, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = r, e[3] = o) : o = e[3], o;
78
- }, ze = {
79
- Root: en,
80
- Viewport: tn,
81
- ScrollToBottom: rn
82
- }, on = yt({
77
+ return e[0] !== n || e[1] !== t || e[2] !== r ? (o = !n && /* @__PURE__ */ i(It, { ...un, children: /* @__PURE__ */ i(lt, { rounded: "full", onClick: () => r(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ i($t, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = r, e[3] = o) : o = e[3], o;
78
+ }, He = {
79
+ Root: cn,
80
+ Viewport: dn,
81
+ ScrollToBottom: fn
82
+ }, pn = vt({
83
83
  className: "ai-message",
84
84
  slots: ["root", "content"],
85
85
  base: {
@@ -89,6 +89,9 @@ const Zt = {
89
89
  alignItems: "end",
90
90
  justifyContent: "end",
91
91
  gap: "sm",
92
+ animationName: "message-fade-in",
93
+ animationDuration: "200ms",
94
+ animationTimingFunction: "ease-out",
92
95
  "&:has(+ [data-scope='ai-message'][data-part='root'])": {
93
96
  mb: 0
94
97
  }
@@ -112,6 +115,8 @@ const Zt = {
112
115
  border: "1px solid",
113
116
  borderColor: "border.muted",
114
117
  bg: "bg.subtle",
118
+ px: "xs",
119
+ py: "xs",
115
120
  width: "full",
116
121
  borderBottomRightRadius: 0
117
122
  }
@@ -142,24 +147,15 @@ const Zt = {
142
147
  gap: "xs"
143
148
  },
144
149
  content: {
145
- px: "xs",
146
- py: "xs",
147
150
  textStyle: "xs"
148
151
  }
149
152
  },
150
- md: {
151
- content: {
152
- px: "xs",
153
- py: "xs"
154
- }
155
- },
153
+ md: {},
156
154
  lg: {
157
155
  root: {
158
156
  gap: "md"
159
157
  },
160
158
  content: {
161
- px: "sm",
162
- py: "xs",
163
159
  textStyle: "md"
164
160
  }
165
161
  }
@@ -188,18 +184,18 @@ const Zt = {
188
184
  shape: "rounded"
189
185
  }
190
186
  }), {
191
- withProvider: sn,
192
- withContext: ln
193
- } = St({
194
- recipe: on
195
- }), cn = sn("div", "root"), an = ln("div", "content"), ye = {
196
- Root: cn,
197
- Content: an
198
- }, dn = (t) => {
187
+ withProvider: mn,
188
+ withContext: hn
189
+ } = At({
190
+ recipe: pn
191
+ }), gn = mn("div", "root"), bn = hn("div", "content"), V = {
192
+ Root: gn,
193
+ Content: bn
194
+ }, xn = (t) => {
199
195
  if (t == null) return null;
200
196
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
201
197
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
202
- }, So = (t) => {
198
+ }, vo = (t) => {
203
199
  const e = y(19), {
204
200
  toolName: n,
205
201
  toolInput: r,
@@ -207,63 +203,63 @@ const Zt = {
207
203
  onDeny: s
208
204
  } = t;
209
205
  let l;
210
- e[0] !== r ? (l = dn(r), e[0] = r, e[1] = l) : l = e[1];
211
- const c = l;
212
- let d;
213
- e[2] !== n ? (d = /* @__PURE__ */ b(Q, { textStyle: "label/S/medium", color: "fg", children: [
206
+ e[0] !== r ? (l = xn(r), e[0] = r, e[1] = l) : l = e[1];
207
+ const a = l;
208
+ let c;
209
+ e[2] !== n ? (c = /* @__PURE__ */ b(Y, { textStyle: "label/S/medium", color: "fg", children: [
214
210
  "Allow ",
215
- /* @__PURE__ */ i(Ue, { size: "sm", children: n }),
211
+ /* @__PURE__ */ i(Qe, { size: "sm", children: n }),
216
212
  "?"
217
- ] }), e[2] = n, e[3] = d) : d = e[3];
218
- let a;
219
- e[4] !== c ? (a = c ? /* @__PURE__ */ i(Ue, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = a) : a = e[5];
220
- let u;
221
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ i(Rt, { size: 14 }), e[6] = u) : u = e[6];
213
+ ] }), e[2] = n, e[3] = c) : c = e[3];
214
+ let d;
215
+ e[4] !== a ? (d = a ? /* @__PURE__ */ i(Qe, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: a }) : null, e[4] = a, e[5] = d) : d = e[5];
222
216
  let f;
223
- e[7] !== s ? (f = /* @__PURE__ */ b(le, { size: "xs", variant: "outline", onClick: s, children: [
224
- u,
217
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ i(Lt, { size: 14 }), e[6] = f) : f = e[6];
218
+ let u;
219
+ e[7] !== s ? (u = /* @__PURE__ */ b(Se, { size: "xs", variant: "outline", onClick: s, children: [
220
+ f,
225
221
  "Deny"
226
- ] }), e[7] = s, e[8] = f) : f = e[8];
222
+ ] }), e[7] = s, e[8] = u) : u = e[8];
227
223
  let p;
228
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(It, { size: 14 }), e[9] = p) : p = e[9];
224
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(Ft, { size: 14 }), e[9] = p) : p = e[9];
229
225
  let m;
230
- e[10] !== o ? (m = /* @__PURE__ */ b(le, { size: "xs", colorPalette: "green", onClick: o, children: [
226
+ e[10] !== o ? (m = /* @__PURE__ */ b(Se, { size: "xs", colorPalette: "green", onClick: o, children: [
231
227
  p,
232
228
  "Allow"
233
229
  ] }), e[10] = o, e[11] = m) : m = e[11];
234
230
  let h;
235
- e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ b(Qe, { gap: "xs", justifyContent: "flex-end", children: [
236
- f,
231
+ e[12] !== u || e[13] !== m ? (h = /* @__PURE__ */ b(ke, { gap: "xs", justifyContent: "flex-end", children: [
232
+ u,
237
233
  m
238
- ] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
239
- let x;
240
- return e[15] !== d || e[16] !== a || e[17] !== h ? (x = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ b(X, { direction: "column", gap: "xs", children: [
234
+ ] }), e[12] = u, e[13] = m, e[14] = h) : h = e[14];
235
+ let g;
236
+ return e[15] !== c || e[16] !== d || e[17] !== h ? (g = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ b($, { direction: "column", gap: "xs", children: [
237
+ c,
241
238
  d,
242
- a,
243
239
  h
244
- ] }) }), e[15] = d, e[16] = a, e[17] = h, e[18] = x) : x = e[18], x;
245
- }, un = (t) => {
240
+ ] }) }), e[15] = c, e[16] = d, e[17] = h, e[18] = g) : g = e[18], g;
241
+ }, yn = (t) => {
246
242
  const {
247
243
  previousUserMessageCount: e,
248
244
  userMessageCount: n
249
245
  } = t;
250
246
  return e === 0 ? !1 : n > e;
251
247
  };
252
- function fn(t) {
248
+ function Sn(t) {
253
249
  const e = y(4), {
254
250
  userMessageCount: n
255
251
  } = t, {
256
252
  scrollToBottom: r
257
- } = Oe(), o = Fe(n);
253
+ } = Ge(), o = Ne(n);
258
254
  let s, l;
259
255
  return e[0] !== r || e[1] !== n ? (s = () => {
260
- un({
256
+ yn({
261
257
  previousUserMessageCount: o.current,
262
258
  userMessageCount: n
263
259
  }) && r(), o.current = n;
264
- }, l = [n, r], e[0] = r, e[1] = n, e[2] = s, e[3] = l) : (s = e[2], l = e[3]), $e(s, l), null;
260
+ }, l = [n, r], e[0] = r, e[1] = n, e[2] = s, e[3] = l) : (s = e[2], l = e[3]), Ue(s, l), null;
265
261
  }
266
- const pn = (t) => {
262
+ const kn = (t) => {
267
263
  const e = y(22);
268
264
  let n, r, o, s;
269
265
  e[0] !== t ? ({
@@ -273,150 +269,153 @@ const pn = (t) => {
273
269
  ...r
274
270
  } = t, e[0] = t, e[1] = n, e[2] = r, e[3] = o, e[4] = s) : (n = e[1], r = e[2], o = e[3], s = e[4]);
275
271
  const l = r["aria-label"] ?? s;
276
- let c;
277
- e[5] !== n ? (c = n ? /* @__PURE__ */ i(Mt, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ i(Bt, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
278
- const d = c;
279
272
  let a;
280
- e[7] !== l || e[8] !== d || e[9] !== r || e[10] !== s ? (a = /* @__PURE__ */ i(Je, { "data-testid": "send-message-button", size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": l, title: s, ...r, children: d }), e[7] = l, e[8] = d, e[9] = r, e[10] = s, e[11] = a) : a = e[11];
281
- const u = a;
273
+ e[5] !== n ? (a = n ? /* @__PURE__ */ i(Ot, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ i(Wt, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = a) : a = e[6];
274
+ const c = a;
275
+ let d;
276
+ e[7] !== l || e[8] !== c || e[9] !== r || e[10] !== s ? (d = /* @__PURE__ */ i(lt, { "data-testid": "send-message-button", size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": l, title: s, ...r, children: c }), e[7] = l, e[8] = c, e[9] = r, e[10] = s, e[11] = d) : d = e[11];
277
+ const f = d;
282
278
  if (s) {
283
- let f;
284
- e[12] !== o || e[13] !== s ? (f = o ? /* @__PURE__ */ b(Le, { children: [
279
+ let u;
280
+ e[12] !== o || e[13] !== s ? (u = o ? /* @__PURE__ */ b(Ve, { children: [
285
281
  s,
286
282
  " ",
287
- /* @__PURE__ */ i(Tt, { fontSize: "xs", children: o })
288
- ] }) : s, e[12] = o, e[13] = s, e[14] = f) : f = e[14];
289
- const p = f;
283
+ /* @__PURE__ */ i(Dt, { fontSize: "xs", children: o })
284
+ ] }) : s, e[12] = o, e[13] = s, e[14] = u) : u = e[14];
285
+ const p = u;
290
286
  let m;
291
- e[15] !== u ? (m = /* @__PURE__ */ i(xe.Trigger, { asChild: !0, children: u }), e[15] = u, e[16] = m) : m = e[16];
287
+ e[15] !== f ? (m = /* @__PURE__ */ i(Ae.Trigger, { asChild: !0, children: f }), e[15] = f, e[16] = m) : m = e[16];
292
288
  let h;
293
- e[17] !== p ? (h = /* @__PURE__ */ i(kt, { children: /* @__PURE__ */ i(xe.Positioner, { children: /* @__PURE__ */ i(xe.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
294
- let x;
295
- return e[19] !== m || e[20] !== h ? (x = /* @__PURE__ */ b(xe.Root, { closeDelay: 50, openDelay: 100, children: [
289
+ e[17] !== p ? (h = /* @__PURE__ */ i(Bt, { children: /* @__PURE__ */ i(Ae.Positioner, { children: /* @__PURE__ */ i(Ae.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
290
+ let g;
291
+ return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ b(Ae.Root, { closeDelay: 50, openDelay: 100, children: [
296
292
  m,
297
293
  h
298
- ] }), e[19] = m, e[20] = h, e[21] = x) : x = e[21], x;
294
+ ] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
299
295
  }
300
- return u;
301
- }, mn = (t) => {
302
- const e = y(63), {
296
+ return f;
297
+ }, Tn = (t) => {
298
+ const e = y(66), {
303
299
  defaultState: n,
304
300
  onSubmit: r,
305
301
  onInterrupt: o,
306
302
  streaming: s,
307
303
  attachedResources: l,
308
- onClearAttachments: c,
309
- isDisabled: d,
310
- onChange: a,
311
- placeholder: u,
312
- attachmentList: f,
313
- actions: p
314
- } = t, m = r === void 0 ? hn : r, h = s === void 0 ? !1 : s;
315
- let x;
316
- e[0] !== l ? (x = l === void 0 ? [] : l, e[0] = l, e[1] = x) : x = e[1];
317
- const S = x, w = d === void 0 ? !1 : d, [M, ce] = J(!1), [oe, ae] = J(n), [se, de] = J(0);
318
- let L;
319
- e[2] !== n ? (L = () => De(n), e[2] = n, e[3] = L) : L = e[3];
320
- const [_, O] = J(L), H = Fe(null), F = Fe(a);
321
- let B, v;
322
- e[4] !== a ? (B = () => {
323
- F.current = a;
324
- }, v = [a], e[4] = a, e[5] = B, e[6] = v) : (B = e[5], v = e[6]), $e(B, v);
325
- let P, A;
326
- e[7] !== n ? (P = () => {
327
- const C = De(n);
328
- ae(n), de(gn), O(C), F.current?.(C);
329
- }, A = [n], e[7] = n, e[8] = P, e[9] = A) : (P = e[8], A = e[9]), $e(P, A);
330
- let D;
331
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = () => {
332
- const C = H.current?.querySelector('[contenteditable="true"]');
333
- C instanceof HTMLElement && C.focus();
334
- }, e[10] = D) : D = e[10];
335
- const T = D;
336
- let R;
337
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = () => {
338
- ce(!0), T();
339
- }, e[11] = R) : R = e[11];
340
- const I = R;
304
+ onClearAttachments: a,
305
+ isDisabled: c,
306
+ onChange: d,
307
+ placeholder: f,
308
+ attachmentList: u,
309
+ actions: p,
310
+ attachedToTop: m
311
+ } = t, h = r === void 0 ? wn : r, g = s === void 0 ? !1 : s;
312
+ let T;
313
+ e[0] !== l ? (T = l === void 0 ? [] : l, e[0] = l, e[1] = T) : T = e[1];
314
+ const L = T, w = c === void 0 ? !1 : c, pe = m === void 0 ? !1 : m, [q, P] = le(!1), [G, we] = le(n), [K, J] = le(0);
315
+ let X;
316
+ e[2] !== n ? (X = () => We(n), e[2] = n, e[3] = X) : X = e[3];
317
+ const [F, me] = le(X), Ce = Ne(null), he = Ne(d);
318
+ let Q, Z;
319
+ e[4] !== d ? (Q = () => {
320
+ he.current = d;
321
+ }, Z = [d], e[4] = d, e[5] = Q, e[6] = Z) : (Q = e[5], Z = e[6]), Ue(Q, Z);
322
+ let A, O;
323
+ e[7] !== n ? (O = () => {
324
+ const _ = We(n);
325
+ we(n), J(Cn), me(_), he.current?.(_);
326
+ }, A = [n], e[7] = n, e[8] = A, e[9] = O) : (A = e[8], O = e[9]), Ue(O, A);
327
+ let B;
328
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = () => {
329
+ const _ = Ce.current?.querySelector('[contenteditable="true"]');
330
+ _ instanceof HTMLElement && _.focus();
331
+ }, e[10] = B) : B = e[10];
332
+ const ge = B;
341
333
  let W;
342
- e[12] !== n ? (W = (C) => {
343
- const gt = C === void 0 ? !1 : C;
344
- ae(n), de(bn);
345
- const Ne = De(n);
346
- O(Ne), F.current?.(Ne), gt && requestAnimationFrame(() => {
347
- T();
334
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => {
335
+ P(!0), ge();
336
+ }, e[11] = W) : W = e[11];
337
+ const be = W;
338
+ let D;
339
+ e[12] !== n ? (D = (_) => {
340
+ const Rt = _ === void 0 ? !1 : _;
341
+ we(n), J(_n);
342
+ const Je = We(n);
343
+ me(Je), he.current?.(Je), Rt && requestAnimationFrame(() => {
344
+ ge();
348
345
  });
349
- }, e[12] = n, e[13] = W) : W = e[13];
350
- const _e = W;
351
- let ue;
352
- e[14] !== S || e[15] !== w || e[16] !== c || e[17] !== o || e[18] !== m || e[19] !== _e || e[20] !== h || e[21] !== _ ? (ue = () => {
346
+ }, e[12] = n, e[13] = D) : D = e[13];
347
+ const H = D;
348
+ let M;
349
+ e[14] !== L || e[15] !== w || e[16] !== a || e[17] !== o || e[18] !== h || e[19] !== H || e[20] !== g || e[21] !== F ? (M = () => {
353
350
  if (w)
354
351
  return;
355
- if (h) {
352
+ if (g) {
356
353
  o?.();
357
354
  return;
358
355
  }
359
- const C = _.trim();
360
- C && (m(C, S), _e(!0), c?.());
361
- }, e[14] = S, e[15] = w, e[16] = c, e[17] = o, e[18] = m, e[19] = _e, e[20] = h, e[21] = _, e[22] = ue) : ue = e[22];
362
- const j = ue, $ = h && !!o;
363
- let fe;
364
- e[23] !== u ? (fe = u ? /* @__PURE__ */ i(Q, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: u }) : void 0, e[23] = u, e[24] = fe) : fe = e[24];
365
- const Pe = fe, Re = M ? "blue.border" : "border.muted", Ie = M ? "mid" : "low", Me = M ? "blue.border" : "border";
366
- let N;
367
- e[25] !== Me ? (N = {
368
- borderColor: Me,
369
- boxShadow: "mid"
370
- }, e[25] = Me, e[26] = N) : N = e[26];
371
- let pe;
372
- e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (pe = {
356
+ const _ = F.trim();
357
+ _ && (h(_, L), H(!0), a?.());
358
+ }, e[14] = L, e[15] = w, e[16] = a, e[17] = o, e[18] = h, e[19] = H, e[20] = g, e[21] = F, e[22] = M) : M = e[22];
359
+ const v = M, C = g && !!o;
360
+ let I;
361
+ e[23] !== f ? (I = f ? /* @__PURE__ */ i(Y, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: f }) : void 0, e[23] = f, e[24] = I) : I = e[24];
362
+ const j = I, N = pe ? "-1px" : void 0, S = pe ? "0" : void 0, z = q ? "blue.border" : "border.muted", R = q ? "mid" : "low", xe = q ? 1 : 0, $e = q ? "blue.border" : "border";
363
+ let ee;
364
+ e[25] !== $e ? (ee = {
365
+ borderColor: $e,
366
+ boxShadow: "mid",
367
+ zIndex: 1
368
+ }, e[25] = $e, e[26] = ee) : ee = e[26];
369
+ let _e;
370
+ e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_e = {
373
371
  borderColor: "blue.border",
374
- boxShadow: "mid"
375
- }, e[27] = pe) : pe = e[27];
376
- let me;
377
- e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (me = () => ce(!1), e[28] = me) : me = e[28];
378
- let he;
379
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (he = {
372
+ boxShadow: "mid",
373
+ zIndex: 1
374
+ }, e[27] = _e) : _e = e[27];
375
+ let Re;
376
+ e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Re = () => P(!1), e[28] = Re) : Re = e[28];
377
+ let Pe;
378
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Pe = {
380
379
  pr: "2xs"
381
- }, e[29] = he) : he = e[29];
382
- const Be = !w;
383
- let U;
384
- e[30] !== a ? (U = (C) => {
385
- O(C), a?.(C);
386
- }, e[30] = a, e[31] = U) : U = e[31];
387
- let V;
388
- e[32] !== se || e[33] !== oe || e[34] !== j || e[35] !== Pe || e[36] !== Be || e[37] !== U ? (V = /* @__PURE__ */ i(nt, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: he, children: /* @__PURE__ */ i(Gt, { defaultState: oe, isEditable: Be, placeholder: Pe, onChange: U, onSubmit: j }, se) }), e[32] = se, e[33] = oe, e[34] = j, e[35] = Pe, e[36] = Be, e[37] = U, e[38] = V) : V = e[38];
389
- let ge;
390
- e[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ge = /* @__PURE__ */ i(wt, {}), e[39] = ge) : ge = e[39];
391
- const ve = $ ? "Stop Response" : "Message Sending", Ae = h ? void 0 : "Enter";
392
- let q;
393
- e[40] !== $ || e[41] !== w || e[42] !== h || e[43] !== _ ? (q = h && !$ || !h && !_.trim() || w, e[40] = $, e[41] = w, e[42] = h, e[43] = _, e[44] = q) : q = e[44];
394
- let G;
395
- e[45] !== $ || e[46] !== j || e[47] !== ve || e[48] !== Ae || e[49] !== q ? (G = /* @__PURE__ */ i(pn, { canInterrupt: $, title: ve, shortcut: Ae, onClick: j, disabled: q }), e[45] = $, e[46] = j, e[47] = ve, e[48] = Ae, e[49] = q, e[50] = G) : G = e[50];
396
- let K;
397
- e[51] !== p || e[52] !== G ? (K = /* @__PURE__ */ b(Qe, { gap: "1", mt: "md", children: [
380
+ }, e[29] = Pe) : Pe = e[29];
381
+ const Le = !w;
382
+ let te;
383
+ e[30] !== d ? (te = (_) => {
384
+ me(_), d?.(_);
385
+ }, e[30] = d, e[31] = te) : te = e[31];
386
+ let ne;
387
+ e[32] !== K || e[33] !== G || e[34] !== v || e[35] !== j || e[36] !== Le || e[37] !== te ? (ne = /* @__PURE__ */ i(ut, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: Pe, children: /* @__PURE__ */ i(nn, { defaultState: G, isEditable: Le, placeholder: j, onChange: te, onSubmit: v }, K) }), e[32] = K, e[33] = G, e[34] = v, e[35] = j, e[36] = Le, e[37] = te, e[38] = ne) : ne = e[38];
388
+ let Ie;
389
+ e[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ i(Mt, {}), e[39] = Ie) : Ie = e[39];
390
+ const Fe = C ? "Stop Response" : "Message Sending", Oe = g ? void 0 : "Enter";
391
+ let re;
392
+ e[40] !== C || e[41] !== w || e[42] !== g || e[43] !== F ? (re = g && !C || !g && !F.trim() || w, e[40] = C, e[41] = w, e[42] = g, e[43] = F, e[44] = re) : re = e[44];
393
+ let oe;
394
+ e[45] !== C || e[46] !== v || e[47] !== Fe || e[48] !== Oe || e[49] !== re ? (oe = /* @__PURE__ */ i(kn, { canInterrupt: C, title: Fe, shortcut: Oe, onClick: v, disabled: re }), e[45] = C, e[46] = v, e[47] = Fe, e[48] = Oe, e[49] = re, e[50] = oe) : oe = e[50];
395
+ let se;
396
+ e[51] !== p || e[52] !== oe ? (se = /* @__PURE__ */ b(ke, { gap: "1", mt: "md", children: [
398
397
  p,
399
- ge,
400
- G
401
- ] }), e[51] = p, e[52] = G, e[53] = K) : K = e[53];
402
- let Y;
403
- e[54] !== f || e[55] !== V || e[56] !== K ? (Y = /* @__PURE__ */ b(X, { direction: "column", color: "fg", children: [
404
- f,
405
- V,
406
- K
407
- ] }), e[54] = f, e[55] = V, e[56] = K, e[57] = Y) : Y = e[57];
408
- let be;
409
- return e[58] !== Re || e[59] !== Ie || e[60] !== N || e[61] !== Y ? (be = /* @__PURE__ */ i(k, { ref: H, width: "100%", paddingX: "lg", paddingY: "md", bg: "bg", borderRadius: "md", borderWidth: "1px", borderStyle: "solid", borderColor: Re, boxShadow: Ie, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: N, _focusWithin: pe, onClick: I, onBlur: me, children: Y }), e[58] = Re, e[59] = Ie, e[60] = N, e[61] = Y, e[62] = be) : be = e[62], be;
398
+ Ie,
399
+ oe
400
+ ] }), e[51] = p, e[52] = oe, e[53] = se) : se = e[53];
401
+ let ie;
402
+ e[54] !== u || e[55] !== ne || e[56] !== se ? (ie = /* @__PURE__ */ b($, { direction: "column", color: "fg", children: [
403
+ u,
404
+ ne,
405
+ se
406
+ ] }), e[54] = u, e[55] = ne, e[56] = se, e[57] = ie) : ie = e[57];
407
+ let ve;
408
+ return e[58] !== N || e[59] !== S || e[60] !== z || e[61] !== R || e[62] !== xe || e[63] !== ee || e[64] !== ie ? (ve = /* @__PURE__ */ i(k, { ref: Ce, position: "relative", width: "100%", paddingX: "lg", paddingY: "md", mt: N, bg: "bg", borderRadius: "md", borderTopRadius: S, borderWidth: "1px", borderStyle: "solid", borderColor: z, boxShadow: R, zIndex: xe, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: ee, _focusWithin: _e, onClick: be, onBlur: Re, children: ie }), e[58] = N, e[59] = S, e[60] = z, e[61] = R, e[62] = xe, e[63] = ee, e[64] = ie, e[65] = ve) : ve = e[65], ve;
410
409
  };
411
- function hn() {
410
+ function wn() {
412
411
  }
413
- function gn(t) {
412
+ function Cn(t) {
414
413
  return t + 1;
415
414
  }
416
- function bn(t) {
415
+ function _n(t) {
417
416
  return t + 1;
418
417
  }
419
- const xn = (t = "") => JSON.stringify(Kt(t)), yn = 360, Sn = "min(20vh, 8rem)", kn = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : e + n.text.length, 0), Tn = (t) => t.role !== "user" ? !1 : kn(t) > yn, wn = (t) => {
418
+ const Rn = (t = "") => JSON.stringify(rn(t)), Pn = 360, In = "min(20vh, 8rem)", vn = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : e + n.text.length, 0), An = (t) => t.role !== "user" ? !1 : vn(t) > Pn, Bn = (t) => {
420
419
  const e = y(8);
421
420
  let n, r;
422
421
  e[0] !== t ? ({
@@ -424,31 +423,31 @@ const xn = (t = "") => JSON.stringify(Kt(t)), yn = 360, Sn = "min(20vh, 8rem)",
424
423
  ...r
425
424
  } = t, e[0] = t, e[1] = n, e[2] = r) : (n = e[1], r = e[2]);
426
425
  let o;
427
- e[3] !== n ? (o = /* @__PURE__ */ i(rt, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
426
+ e[3] !== n ? (o = /* @__PURE__ */ i(ft, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
428
427
  let s;
429
428
  return e[5] !== r || e[6] !== o ? (s = /* @__PURE__ */ i(k, { ...r, children: o }), e[5] = r, e[6] = o, e[7] = s) : s = e[7], s;
430
- }, Cn = wn, ot = {
431
- shell: tt,
432
- ls: Lt,
433
- read_file: $t,
434
- write_file: Ft,
435
- delete_file: Et,
436
- patch: zt,
437
- upload_files: Dt,
438
- download_file: At,
439
- move_file: vt
440
- }, _n = {
441
- dot: Nt,
442
- danger: jt,
443
- search: Wt,
444
- browser: Ht,
445
- file: Ot,
446
- terminal: tt,
447
- ...ot
448
- }, Ve = "dot", Pn = (t) => Object.hasOwn(ot, t), Rn = (t) => _n[t], st = (t) => {
449
- if (!t) return Ve;
429
+ }, Dn = Bn, mt = {
430
+ shell: ct,
431
+ ls: Kt,
432
+ read_file: Gt,
433
+ write_file: qt,
434
+ delete_file: Vt,
435
+ patch: Ut,
436
+ upload_files: Nt,
437
+ download_file: jt,
438
+ move_file: Ht
439
+ }, Mn = {
440
+ dot: Qt,
441
+ danger: dt,
442
+ search: Jt,
443
+ browser: Yt,
444
+ file: Xt,
445
+ terminal: ct,
446
+ ...mt
447
+ }, et = "dot", zn = (t) => Object.hasOwn(mt, t), En = (t) => Mn[t], ht = (t) => {
448
+ if (!t) return et;
450
449
  const e = t.replace(/^tool-/, "");
451
- if (Pn(e)) return e;
450
+ if (zn(e)) return e;
452
451
  switch (e) {
453
452
  case "read":
454
453
  return "file";
@@ -468,52 +467,52 @@ const xn = (t = "") => JSON.stringify(Kt(t)), yn = 360, Sn = "min(20vh, 8rem)",
468
467
  case "file":
469
468
  return "file";
470
469
  default:
471
- return Ve;
470
+ return et;
472
471
  }
473
472
  };
474
- function He(t) {
473
+ function Ke(t) {
475
474
  const e = t.lastIndexOf("/");
476
475
  return e >= 0 ? t.slice(e + 1) : t;
477
476
  }
478
- function Se(t) {
477
+ function Be(t) {
479
478
  if (!t) return null;
480
479
  const e = t.split(" ")[0].trim();
481
480
  if (e === "/dev/null") return null;
482
481
  let n = e;
483
482
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
484
483
  }
485
- const Te = (t) => t.startsWith("--- "), We = (t) => t.startsWith("+++ "), je = (t) => t.startsWith("@@"), In = (t) => t.startsWith("+") && !(We(t) || t === "+++"), Mn = (t) => t.startsWith("-") && !(Te(t) || t === "---"), Bn = (t, e) => {
484
+ const Me = (t) => t.startsWith("--- "), Xe = (t) => t.startsWith("+++ "), Ye = (t) => t.startsWith("@@"), $n = (t) => t.startsWith("+") && !(Xe(t) || t === "+++"), Ln = (t) => t.startsWith("-") && !(Me(t) || t === "---"), Fn = (t, e) => {
486
485
  t.has(e) || t.set(e, {
487
486
  additions: 0,
488
487
  deletions: 0
489
488
  });
490
- }, vn = (t, e) => {
489
+ }, On = (t, e) => {
491
490
  const n = t.get(e);
492
491
  n && (n.additions += 1);
493
- }, An = (t, e) => {
492
+ }, Wn = (t, e) => {
494
493
  const n = t.get(e);
495
494
  n && (n.deletions += 1);
496
- }, Dn = (t, e, n) => {
497
- if (Te(t))
495
+ }, Hn = (t, e, n) => {
496
+ if (Me(t))
498
497
  return {
499
498
  ...e,
500
- lastMinusHeader: Se(t.slice(4)),
499
+ lastMinusHeader: Be(t.slice(4)),
501
500
  inHunk: !1
502
501
  };
503
- if (We(t)) {
504
- const o = Se(t.slice(4)) ?? e.lastMinusHeader;
505
- return o && Bn(n, o), {
502
+ if (Xe(t)) {
503
+ const o = Be(t.slice(4)) ?? e.lastMinusHeader;
504
+ return o && Fn(n, o), {
506
505
  ...e,
507
506
  currentPath: o,
508
507
  inHunk: !1
509
508
  };
510
509
  }
511
- return e.currentPath ? je(t) ? {
510
+ return e.currentPath ? Ye(t) ? {
512
511
  ...e,
513
512
  inHunk: !0
514
- } : e.inHunk ? In(t) ? (vn(n, e.currentPath), e) : (Mn(t) && An(n, e.currentPath), e) : e : e;
513
+ } : e.inHunk ? $n(t) ? (On(n, e.currentPath), e) : (Ln(t) && Wn(n, e.currentPath), e) : e : e;
515
514
  };
516
- function it(t) {
515
+ function gt(t) {
517
516
  if (!t || typeof t != "string") return [];
518
517
  const e = /* @__PURE__ */ new Map();
519
518
  let n = {
@@ -523,7 +522,7 @@ function it(t) {
523
522
  };
524
523
  const r = t.split(/\r?\n/);
525
524
  for (const o of r)
526
- n = Dn(o, n, e);
525
+ n = Hn(o, n, e);
527
526
  return Array.from(e.entries()).map(([o, {
528
527
  additions: s,
529
528
  deletions: l
@@ -533,19 +532,19 @@ function it(t) {
533
532
  deletions: l
534
533
  }));
535
534
  }
536
- function zn(t) {
537
- return it(t).map((e) => ({
535
+ function jn(t) {
536
+ return gt(t).map((e) => ({
538
537
  kind: "diff",
539
- fileName: He(e.filePath),
538
+ fileName: Ke(e.filePath),
540
539
  filePath: e.filePath,
541
540
  additions: e.additions,
542
541
  deletions: e.deletions
543
542
  }));
544
543
  }
545
- function En(t) {
546
- return it(t).map((e) => e.filePath);
544
+ function Nn(t) {
545
+ return gt(t).map((e) => e.filePath);
547
546
  }
548
- const lt = (t) => Te(t) || t.startsWith("diff --git "), Fn = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", $n = (t, e, n) => {
547
+ const bt = (t) => Me(t) || t.startsWith("diff --git "), Un = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Vn = (t, e, n) => {
549
548
  if (t.startsWith(" ")) {
550
549
  const r = t.slice(1);
551
550
  e.push(r), n.push(r);
@@ -556,86 +555,86 @@ const lt = (t) => Te(t) || t.startsWith("diff --git "), Fn = (t) => t.startsWith
556
555
  return;
557
556
  }
558
557
  t.startsWith("+") && n.push(t.slice(1));
559
- }, Ln = (t, e, n, r) => {
558
+ }, qn = (t, e, n, r) => {
560
559
  let o = e;
561
560
  for (; o < t.length; ) {
562
561
  const s = t[o] || "";
563
- if (lt(s) || je(s) || Fn(s))
562
+ if (bt(s) || Ye(s) || Un(s))
564
563
  break;
565
- $n(s, n, r), o += 1;
564
+ Vn(s, n, r), o += 1;
566
565
  }
567
566
  return (n.length > 0 || r.length > 0) && (n.push(""), r.push("")), o;
568
- }, On = (t, e) => {
569
- const n = Se((t[e] || "").slice(4)), r = t[e + 1] || "";
570
- if (!We(r)) return {
567
+ }, Gn = (t, e) => {
568
+ const n = Be((t[e] || "").slice(4)), r = t[e + 1] || "";
569
+ if (!Xe(r)) return {
571
570
  nextIndex: e + 1
572
571
  };
573
- const s = Se(r.slice(4)) ?? n ?? "", l = [], c = [];
574
- let d = e + 2;
575
- for (; d < t.length; ) {
576
- const a = t[d] || "";
577
- if (lt(a)) break;
578
- if (!je(a)) {
579
- d += 1;
572
+ const s = Be(r.slice(4)) ?? n ?? "", l = [], a = [];
573
+ let c = e + 2;
574
+ for (; c < t.length; ) {
575
+ const d = t[c] || "";
576
+ if (bt(d)) break;
577
+ if (!Ye(d)) {
578
+ c += 1;
580
579
  continue;
581
580
  }
582
- d = Ln(t, d + 1, l, c);
581
+ c = qn(t, c + 1, l, a);
583
582
  }
584
583
  return {
585
- nextIndex: d,
584
+ nextIndex: c,
586
585
  preview: {
587
586
  filePath: s,
588
587
  original: l.join(`
589
588
  `),
590
- modified: c.join(`
589
+ modified: a.join(`
591
590
  `)
592
591
  }
593
592
  };
594
593
  };
595
- function Hn(t) {
594
+ function Kn(t) {
596
595
  if (!t || typeof t != "string") return [];
597
596
  const e = t.split(/\r?\n/), n = [];
598
597
  let r = 0;
599
598
  for (; r < e.length; ) {
600
599
  const o = e[r] || "";
601
- if (!Te(o)) {
600
+ if (!Me(o)) {
602
601
  r += 1;
603
602
  continue;
604
603
  }
605
604
  const {
606
605
  nextIndex: s,
607
606
  preview: l
608
- } = On(e, r);
607
+ } = Gn(e, r);
609
608
  l && n.push(l), r = Math.max(s, r + 1);
610
609
  }
611
610
  return n;
612
611
  }
613
- const Wn = {
612
+ const Xn = {
614
613
  apply_patch: "Apply patch",
615
614
  read: "Read file",
616
615
  bash: "Run",
617
616
  grep: "Search files",
618
617
  glob: "Find files",
619
618
  skill: "Load skill"
620
- }, qe = {
619
+ }, tt = {
621
620
  pending: "queued",
622
621
  error: "failed",
623
622
  "output-error": "failed",
624
623
  "input-streaming": "running",
625
624
  "input-available": "queued"
626
- }, ct = (t) => t.replace(/^tool-/, ""), jn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Nn = (t) => ct(t.tool ?? "tool"), Un = (t) => {
627
- const e = ct(t);
628
- return Wn[e] ?? jn(e.replace(/_/g, " "));
629
- }, Vn = (t) => !t || typeof t != "string" ? null : qe[t] ? qe[t] : t.includes("stream") ? "running" : null, at = (t) => t === "error" || t === "output-error", ee = (t) => at(t.state?.status) ? {
625
+ }, xt = (t) => t.replace(/^tool-/, ""), Yn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Jn = (t) => xt(t.tool ?? "tool"), Qn = (t) => {
626
+ const e = xt(t);
627
+ return Xn[e] ?? Yn(e.replace(/_/g, " "));
628
+ }, Zn = (t) => !t || typeof t != "string" ? null : tt[t] ? tt[t] : t.includes("stream") ? "running" : null, yt = (t) => t === "error" || t === "output-error", ce = (t) => yt(t.state?.status) ? {
630
629
  type: "icon",
631
630
  icon: "danger"
632
631
  } : {
633
632
  type: "icon",
634
- icon: st(Nn(t))
635
- }, te = (t, e, n) => {
633
+ icon: ht(Jn(t))
634
+ }, de = (t, e, n) => {
636
635
  const o = [{
637
636
  kind: "text",
638
- text: n ?? Un(t.tool ?? "tool"),
637
+ text: n ?? Qn(t.tool ?? "tool"),
639
638
  bold: !0
640
639
  }];
641
640
  e && o.push({
@@ -643,207 +642,207 @@ const Wn = {
643
642
  text: e,
644
643
  muted: !0
645
644
  });
646
- const s = Vn(t.state?.status);
645
+ const s = Zn(t.state?.status);
647
646
  return s && o.push({
648
647
  kind: "text",
649
648
  text: s,
650
649
  muted: !0
651
650
  }), o;
652
- }, ne = (t) => {
651
+ }, ue = (t) => {
653
652
  const e = t.state?.input;
654
653
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
655
- }, we = (t) => {
654
+ }, ze = (t) => {
656
655
  const e = t.state?.output;
657
656
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
658
- }, g = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ke = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, qn = (t, e) => {
659
- const n = ke(t.state);
660
- return n ? ke(n[e]) : null;
661
- }, Gn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Kn = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), dt = (t) => {
662
- const e = we(t);
663
- return [qn(t, "metadata"), ke(e?.metadata)].filter(Boolean);
664
- }, Yn = (t) => {
665
- const e = ke(t);
657
+ }, x = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, De = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, er = (t, e) => {
658
+ const n = De(t.state);
659
+ return n ? De(n[e]) : null;
660
+ }, tr = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), nr = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), St = (t) => {
661
+ const e = ze(t);
662
+ return [er(t, "metadata"), De(e?.metadata)].filter(Boolean);
663
+ }, rr = (t) => {
664
+ const e = De(t);
666
665
  if (!e) return null;
667
- const n = g(e.filePath) ?? g(e.relativePath) ?? g(e.path);
666
+ const n = x(e.filePath) ?? x(e.relativePath) ?? x(e.path);
668
667
  return n ? {
669
- filePath: Gn(n),
668
+ filePath: tr(n),
670
669
  additions: typeof e.additions == "number" ? e.additions : 0,
671
670
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
672
- diff: g(e.diff) ?? void 0,
673
- before: g(e.before) ?? void 0,
674
- after: g(e.after) ?? void 0
671
+ diff: x(e.diff) ?? void 0,
672
+ before: x(e.before) ?? void 0,
673
+ after: x(e.after) ?? void 0
675
674
  } : null;
676
- }, ut = (t) => {
675
+ }, kt = (t) => {
677
676
  const e = [];
678
- for (const n of dt(t)) {
677
+ for (const n of St(t)) {
679
678
  const r = Array.isArray(n.files) ? n.files : [];
680
679
  for (const o of r) {
681
- const s = Yn(o);
680
+ const s = rr(o);
682
681
  s && e.push(s);
683
682
  }
684
683
  }
685
684
  return e;
686
- }, Xn = (t) => {
687
- const e = ne(t), n = g(e?.diff);
685
+ }, or = (t) => {
686
+ const e = ue(t), n = x(e?.diff);
688
687
  if (n) return n;
689
- for (const s of dt(t)) {
690
- const l = g(s.diff);
688
+ for (const s of St(t)) {
689
+ const l = x(s.diff);
691
690
  if (l) return l;
692
691
  }
693
- const r = ut(t).map((s) => s.diff).filter((s) => !!s);
692
+ const r = kt(t).map((s) => s.diff).filter((s) => !!s);
694
693
  if (r.length > 0) return r.join(`
695
694
  `);
696
- const o = g(e?.patchText);
697
- return o && Kn(o) ? o : null;
698
- }, Jn = (t) => {
695
+ const o = x(e?.patchText);
696
+ return o && nr(o) ? o : null;
697
+ }, sr = (t) => {
699
698
  const e = /* @__PURE__ */ new Set(), n = [];
700
699
  for (const r of t)
701
700
  e.has(r.filePath) || (e.add(r.filePath), n.push({
702
701
  kind: "diff",
703
- fileName: He(r.filePath),
702
+ fileName: Ke(r.filePath),
704
703
  filePath: r.filePath,
705
704
  additions: r.additions,
706
705
  deletions: r.deletions
707
706
  }));
708
707
  return n;
709
- }, Qn = (t) => Array.from(new Set(t.map((e) => e.filePath))), Ce = (t) => {
710
- const e = we(t);
711
- return g(t.state?.output) ?? g(e?.returnDisplay) ?? g(e?.preview) ?? g(e?.stdout);
712
- }, Zn = (t) => {
708
+ }, ir = (t) => Array.from(new Set(t.map((e) => e.filePath))), Ee = (t) => {
709
+ const e = ze(t);
710
+ return x(t.state?.output) ?? x(e?.returnDisplay) ?? x(e?.preview) ?? x(e?.stdout);
711
+ }, lr = (t) => {
713
712
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
714
713
  return e ? {
715
- skillName: g(e[1]) ?? void 0,
716
- content: g(e[2]) ?? ""
714
+ skillName: x(e[1]) ?? void 0,
715
+ content: x(e[2]) ?? ""
717
716
  } : null;
718
- }, er = (t) => {
719
- const e = ne(t);
720
- return g(e?.name) ?? g(e?.skillName) ?? g(e?.skill) ?? g(e?.skill_name) ?? void 0;
721
- }, tr = (t) => ({
717
+ }, ar = (t) => {
718
+ const e = ue(t);
719
+ return x(e?.name) ?? x(e?.skillName) ?? x(e?.skill) ?? x(e?.skill_name) ?? void 0;
720
+ }, cr = (t) => ({
722
721
  kind: "link",
723
- text: He(t),
722
+ text: Ke(t),
724
723
  filePath: t
725
- }), re = (t, e) => !at(t.state?.status) || !t.state?.errorText ? e : [{
724
+ }), fe = (t, e) => !yt(t.state?.status) || !t.state?.errorText ? e : [{
726
725
  type: "comment",
727
726
  text: t.state.errorText
728
- }, ...e], nr = (t) => {
729
- const e = Xn(t), n = ut(t), r = te(t, void 0, "Apply patch"), o = zn(e ?? void 0);
730
- o.length > 0 ? r.push(...o) : r.push(...Jn(n));
731
- const s = [], l = Hn(e ?? void 0);
732
- for (const c of l)
727
+ }, ...e], dr = (t) => {
728
+ const e = or(t), n = kt(t), r = de(t, void 0, "Apply patch"), o = jn(e ?? void 0);
729
+ o.length > 0 ? r.push(...o) : r.push(...sr(n));
730
+ const s = [], l = Kn(e ?? void 0);
731
+ for (const a of l)
733
732
  s.push({
734
733
  type: "diff",
735
734
  language: "diff",
736
- original: c.original,
737
- modified: c.modified,
735
+ original: a.original,
736
+ modified: a.modified,
738
737
  sideBySide: !1
739
738
  });
740
739
  if (s.length === 0)
741
- for (const c of n)
742
- !c.before && !c.after || s.push({
740
+ for (const a of n)
741
+ !a.before && !a.after || s.push({
743
742
  type: "diff",
744
743
  language: "diff",
745
- original: c.before ?? "",
746
- modified: c.after ?? "",
744
+ original: a.before ?? "",
745
+ modified: a.after ?? "",
747
746
  sideBySide: !1
748
747
  });
749
748
  if (s.length === 0) {
750
- const c = En(e ?? void 0);
751
- c.length === 0 && c.push(...Qn(n)), c.length > 0 && s.push({
749
+ const a = Nn(e ?? void 0);
750
+ a.length === 0 && a.push(...ir(n)), a.length > 0 && s.push({
752
751
  type: "references",
753
- references: c
752
+ references: a
754
753
  });
755
754
  }
756
755
  return {
757
- indicator: ee(t),
756
+ indicator: ce(t),
758
757
  title: r,
759
- blocks: re(t, s)
758
+ blocks: fe(t, s)
760
759
  };
761
- }, rr = (t) => {
762
- const e = ne(t), n = we(t), r = g(e?.filePath) ?? g(e?.file) ?? g(n?.filePath) ?? g(n?.file) ?? g(n?.path) ?? void 0, o = te(t, void 0, "Read file");
763
- return r && o.push(tr(r)), {
764
- indicator: ee(t),
760
+ }, ur = (t) => {
761
+ const e = ue(t), n = ze(t), r = x(e?.filePath) ?? x(e?.file) ?? x(n?.filePath) ?? x(n?.file) ?? x(n?.path) ?? void 0, o = de(t, void 0, "Read file");
762
+ return r && o.push(cr(r)), {
763
+ indicator: ce(t),
765
764
  title: o,
766
- blocks: re(t, [])
765
+ blocks: fe(t, [])
767
766
  };
768
- }, or = (t) => {
769
- const e = ne(t), n = we(t), r = g(e?.command) ?? void 0, o = te(t, r, "Run command"), s = [], l = Ce(t);
767
+ }, fr = (t) => {
768
+ const e = ue(t), n = ze(t), r = x(e?.command) ?? void 0, o = de(t, r, "Run command"), s = [], l = Ee(t);
770
769
  l && s.push({
771
770
  type: "code",
772
771
  language: "text",
773
772
  code: l
774
773
  });
775
- const c = g(n?.stderr);
776
- return c && c !== l && s.push({
774
+ const a = x(n?.stderr);
775
+ return a && a !== l && s.push({
777
776
  type: "code",
778
777
  language: "text",
779
- code: c
778
+ code: a
780
779
  }), typeof n?.exitCode == "number" && s.push({
781
780
  type: "text",
782
781
  text: `Exit code: ${n.exitCode}`
783
782
  }), {
784
- indicator: ee(t),
783
+ indicator: ce(t),
785
784
  title: o,
786
- blocks: re(t, s)
785
+ blocks: fe(t, s)
787
786
  };
788
- }, sr = (t) => {
789
- const e = ne(t), n = Ce(t), r = g(e?.pattern) ?? void 0, o = te(t, r, "Search files"), s = n ? [{
787
+ }, pr = (t) => {
788
+ const e = ue(t), n = Ee(t), r = x(e?.pattern) ?? void 0, o = de(t, r, "Search files"), s = n ? [{
790
789
  type: "code",
791
790
  language: "text",
792
791
  code: n
793
792
  }] : [];
794
793
  return {
795
- indicator: ee(t),
794
+ indicator: ce(t),
796
795
  title: o,
797
- blocks: re(t, s)
796
+ blocks: fe(t, s)
798
797
  };
799
- }, ir = (t) => {
800
- const e = ne(t), n = Ce(t), r = g(e?.pattern) ?? void 0, o = te(t, r, "Find files"), s = [];
798
+ }, mr = (t) => {
799
+ const e = ue(t), n = Ee(t), r = x(e?.pattern) ?? void 0, o = de(t, r, "Find files"), s = [];
801
800
  if (n) {
802
- const l = n.split(/\r?\n/).map((c) => c.trim()).filter((c) => c.length > 0);
801
+ const l = n.split(/\r?\n/).map((a) => a.trim()).filter((a) => a.length > 0);
803
802
  l.length > 0 && s.push({
804
803
  type: "references",
805
804
  references: l
806
805
  });
807
806
  }
808
807
  return {
809
- indicator: ee(t),
808
+ indicator: ce(t),
810
809
  title: o,
811
- blocks: re(t, s)
810
+ blocks: fe(t, s)
812
811
  };
813
- }, lr = (t) => {
814
- const e = Ce(t), n = e ? Zn(e) : null, r = er(t) ?? n?.skillName, o = te(t, r, "Load skill"), s = n?.content ?? e, l = s ? [{
812
+ }, hr = (t) => {
813
+ const e = Ee(t), n = e ? lr(e) : null, r = ar(t) ?? n?.skillName, o = de(t, r, "Load skill"), s = n?.content ?? e, l = s ? [{
815
814
  type: "code",
816
815
  language: "markdown",
817
816
  code: s
818
817
  }] : [];
819
818
  return {
820
- indicator: ee(t),
819
+ indicator: ce(t),
821
820
  title: o,
822
- blocks: re(t, l)
821
+ blocks: fe(t, l)
823
822
  };
824
- }, Ge = () => ({
825
- apply_patch: nr,
826
- read: rr,
827
- bash: or,
828
- grep: sr,
829
- glob: ir,
830
- skill: lr
831
- }), Ke = {
823
+ }, nt = () => ({
824
+ apply_patch: dr,
825
+ read: ur,
826
+ bash: fr,
827
+ grep: pr,
828
+ glob: mr,
829
+ skill: hr
830
+ }), rt = {
832
831
  pending: "queued",
833
832
  error: "failed",
834
833
  "output-error": "failed",
835
834
  "input-streaming": "running",
836
835
  "input-available": "queued"
837
- }, ft = (t) => t.replace(/^tool-/, ""), cr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), ar = (t) => {
838
- const e = ft(t ?? "tool").replace(/_/g, " ");
839
- return cr(e);
840
- }, pt = (t) => t === "error" || t === "output-error", dr = (t) => pt(t.state?.status) ? {
836
+ }, Tt = (t) => t.replace(/^tool-/, ""), gr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), br = (t) => {
837
+ const e = Tt(t ?? "tool").replace(/_/g, " ");
838
+ return gr(e);
839
+ }, wt = (t) => t === "error" || t === "output-error", xr = (t) => wt(t.state?.status) ? {
841
840
  type: "icon",
842
841
  icon: "danger"
843
842
  } : {
844
843
  type: "icon",
845
- icon: st(t.tool ?? "tool")
846
- }, ur = (t) => !t || typeof t != "string" ? null : Ke[t] ? Ke[t] : t.includes("stream") ? "running" : null, Ye = (t) => {
844
+ icon: ht(t.tool ?? "tool")
845
+ }, yr = (t) => !t || typeof t != "string" ? null : rt[t] ? rt[t] : t.includes("stream") ? "running" : null, ot = (t) => {
847
846
  if (typeof t == "string") return t;
848
847
  if (t == null) return null;
849
848
  try {
@@ -851,120 +850,120 @@ const Wn = {
851
850
  } catch {
852
851
  return null;
853
852
  }
854
- }, fr = (t) => {
853
+ }, Sr = (t) => {
855
854
  const e = [];
856
- pt(t.state?.status) && t.state?.errorText && e.push({
855
+ wt(t.state?.status) && t.state?.errorText && e.push({
857
856
  type: "comment",
858
857
  text: t.state.errorText
859
858
  });
860
- const n = Ye(t.state?.input);
859
+ const n = ot(t.state?.input);
861
860
  n && e.push({
862
861
  type: "code",
863
862
  language: "json",
864
863
  code: n
865
864
  });
866
- const r = Ye(t.state?.output);
865
+ const r = ot(t.state?.output);
867
866
  return r && e.push({
868
867
  type: "code",
869
868
  language: "json",
870
869
  code: r
871
870
  }), e;
872
- }, pr = (t) => {
871
+ }, kr = (t) => {
873
872
  const e = [{
874
873
  kind: "text",
875
- text: ar(t.tool),
874
+ text: br(t.tool),
876
875
  bold: !0
877
- }], n = ur(t.state?.status);
876
+ }], n = yr(t.state?.status);
878
877
  return n && e.push({
879
878
  kind: "text",
880
879
  text: n,
881
880
  muted: !0
882
881
  }), {
883
- indicator: dr(t),
882
+ indicator: xr(t),
884
883
  title: e,
885
- blocks: fr(t)
884
+ blocks: Sr(t)
886
885
  };
887
- }, mr = (t) => t ? {
888
- ...Ge(),
886
+ }, Tr = (t) => t ? {
887
+ ...nt(),
889
888
  ...t
890
- } : Ge(), hr = (t, e) => {
889
+ } : nt(), wr = (t, e) => {
891
890
  const n = t.tool ?? "tool";
892
- return e[n] ?? e[ft(n)];
893
- }, gr = (t, e, n) => {
894
- const r = hr(t, e);
891
+ return e[n] ?? e[Tt(n)];
892
+ }, Cr = (t, e, n) => {
893
+ const r = wr(t, e);
895
894
  if (r) {
896
895
  const o = r(t, n);
897
896
  if (o) return o;
898
897
  }
899
- return pr(t);
900
- }, br = (t, e) => {
901
- const n = mr(e?.toolRenderers);
898
+ return kr(t);
899
+ }, _r = (t, e) => {
900
+ const n = Tr(e?.toolRenderers);
902
901
  return {
903
- items: t.map((o) => gr(o, n, e))
902
+ items: t.map((o) => Cr(o, n, e))
904
903
  };
905
- }, E = Ct, mt = (t, e, n, r = !1) => {
904
+ }, U = zt, Ct = (t, e, n, r = !1) => {
906
905
  r && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
907
906
  };
908
- function xr(t) {
907
+ function Rr(t) {
909
908
  const e = y(6), {
910
909
  seg: n
911
910
  } = t;
912
911
  let r;
913
- e[0] !== n.alt || e[1] !== n.src ? (r = /* @__PURE__ */ i(Z.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = r) : r = e[2];
912
+ e[0] !== n.alt || e[1] !== n.src ? (r = /* @__PURE__ */ i(ae.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = r) : r = e[2];
914
913
  let o;
915
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(Z.Fallback, {}), e[3] = o) : o = e[3];
914
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(ae.Fallback, {}), e[3] = o) : o = e[3];
916
915
  let s;
917
- return e[4] !== r ? (s = /* @__PURE__ */ b(Z.Root, { width: "1.5rem", height: "1.5rem", children: [
916
+ return e[4] !== r ? (s = /* @__PURE__ */ b(ae.Root, { width: "1.5rem", height: "1.5rem", children: [
918
917
  r,
919
918
  o
920
919
  ] }), e[4] = r, e[5] = s) : s = e[5], s;
921
920
  }
922
- function yr(t) {
921
+ function Pr(t) {
923
922
  const e = y(9), {
924
923
  seg: n,
925
924
  onOpenFile: r
926
925
  } = t, o = n.additions ?? 0, s = n.deletions ?? 0;
927
926
  let l;
928
927
  e[0] !== r || e[1] !== n.fileName || e[2] !== n.filePath ? (l = () => {
929
- const d = n.filePath ?? n.fileName;
930
- r?.(d);
928
+ const c = n.filePath ?? n.fileName;
929
+ r?.(c);
931
930
  }, e[0] = r, e[1] = n.fileName, e[2] = n.filePath, e[3] = l) : l = e[3];
932
- let c;
933
- return e[4] !== n.fileName || e[5] !== o || e[6] !== s || e[7] !== l ? (c = /* @__PURE__ */ i(Jt, { fileName: n.fileName, additions: o, deletions: s, onClickFileLink: l }), e[4] = n.fileName, e[5] = o, e[6] = s, e[7] = l, e[8] = c) : c = e[8], c;
931
+ let a;
932
+ return e[4] !== n.fileName || e[5] !== o || e[6] !== s || e[7] !== l ? (a = /* @__PURE__ */ i(pt, { fileName: n.fileName, additions: o, deletions: s, onClickFileLink: l }), e[4] = n.fileName, e[5] = o, e[6] = s, e[7] = l, e[8] = a) : a = e[8], a;
934
933
  }
935
- function Sr(t) {
934
+ function Ir(t) {
936
935
  const e = y(13), {
937
936
  seg: n,
938
937
  onOpenFile: r
939
- } = t, o = n.bold ? "medium" : void 0, s = !!(n.href || n.filePath), l = n.href ?? "#", c = (n.muted, "fg.muted"), d = s ? "pointer" : "default";
940
- let a;
941
- e[0] !== r || e[1] !== n ? (a = (m) => mt(m, n, r, !0), e[0] = r, e[1] = n, e[2] = a) : a = e[2];
942
- const u = n.muted ? "fg.muted" : "fg.blue-dark";
943
- let f;
944
- e[3] !== u ? (f = {
938
+ } = t, o = n.bold ? "medium" : void 0, s = !!(n.href || n.filePath), l = n.href ?? "#", a = (n.muted, "fg.muted"), c = s ? "pointer" : "default";
939
+ let d;
940
+ e[0] !== r || e[1] !== n ? (d = (m) => Ct(m, n, r, !0), e[0] = r, e[1] = n, e[2] = d) : d = e[2];
941
+ const f = n.muted ? "fg.muted" : "fg.blue-dark";
942
+ let u;
943
+ e[3] !== f ? (u = {
945
944
  textDecoration: "underline",
946
- color: u
947
- }, e[3] = u, e[4] = f) : f = e[4];
945
+ color: f
946
+ }, e[3] = f, e[4] = u) : u = e[4];
948
947
  let p;
949
- return e[5] !== o || e[6] !== n.text || e[7] !== l || e[8] !== c || e[9] !== d || e[10] !== a || e[11] !== f ? (p = /* @__PURE__ */ i(Ze, { href: l, fontWeight: o, color: c, textDecoration: "none", cursor: d, onClick: a, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = l, e[8] = c, e[9] = d, e[10] = a, e[11] = f, e[12] = p) : p = e[12], p;
948
+ return e[5] !== o || e[6] !== n.text || e[7] !== l || e[8] !== a || e[9] !== c || e[10] !== d || e[11] !== u ? (p = /* @__PURE__ */ i(at, { href: l, fontWeight: o, color: a, textDecoration: "none", cursor: c, onClick: d, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = l, e[8] = a, e[9] = c, e[10] = d, e[11] = u, e[12] = p) : p = e[12], p;
950
949
  }
951
- function kr(t) {
950
+ function vr(t) {
952
951
  const e = y(12), {
953
952
  seg: n,
954
953
  onOpenFile: r
955
954
  } = t, o = n.bold ? "medium" : void 0, s = n.href ?? "#", l = n.muted ? "fg.muted" : "accent.primary";
956
- let c;
957
- e[0] !== r || e[1] !== n ? (c = (f) => mt(f, n, r), e[0] = r, e[1] = n, e[2] = c) : c = e[2];
958
- const d = n.muted ? "fg.muted" : "accent.primary";
959
955
  let a;
960
- e[3] !== d ? (a = {
961
- color: d,
956
+ e[0] !== r || e[1] !== n ? (a = (u) => Ct(u, n, r), e[0] = r, e[1] = n, e[2] = a) : a = e[2];
957
+ const c = n.muted ? "fg.muted" : "accent.primary";
958
+ let d;
959
+ e[3] !== c ? (d = {
960
+ color: c,
962
961
  textDecoration: "underline"
963
- }, e[3] = d, e[4] = a) : a = e[4];
964
- let u;
965
- return e[5] !== o || e[6] !== n.text || e[7] !== s || e[8] !== l || e[9] !== c || e[10] !== a ? (u = /* @__PURE__ */ i(Ze, { href: s, fontWeight: o, color: l, textDecoration: "underline", onClick: c, _hover: a, children: n.text }), e[5] = o, e[6] = n.text, e[7] = s, e[8] = l, e[9] = c, e[10] = a, e[11] = u) : u = e[11], u;
962
+ }, e[3] = c, e[4] = d) : d = e[4];
963
+ let f;
964
+ return e[5] !== o || e[6] !== n.text || e[7] !== s || e[8] !== l || e[9] !== a || e[10] !== d ? (f = /* @__PURE__ */ i(at, { href: s, fontWeight: o, color: l, textDecoration: "underline", onClick: a, _hover: d, children: n.text }), e[5] = o, e[6] = n.text, e[7] = s, e[8] = l, e[9] = a, e[10] = d, e[11] = f) : f = e[11], f;
966
965
  }
967
- function Tr(t) {
966
+ function Ar(t) {
968
967
  const e = y(6), {
969
968
  seg: n,
970
969
  isClickable: r
@@ -973,10 +972,10 @@ function Tr(t) {
973
972
  e[0] !== s ? (l = {
974
973
  color: s
975
974
  }, e[0] = s, e[1] = l) : l = e[1];
976
- let c;
977
- return e[2] !== n.text || e[3] !== o || e[4] !== l ? (c = /* @__PURE__ */ i(ie, { fontWeight: o, color: "fg.muted", _groupHover: l, children: n.text }), e[2] = n.text, e[3] = o, e[4] = l, e[5] = c) : c = e[5], c;
975
+ let a;
976
+ return e[2] !== n.text || e[3] !== o || e[4] !== l ? (a = /* @__PURE__ */ i(ye, { fontWeight: o, color: "fg.muted", _groupHover: l, children: n.text }), e[2] = n.text, e[3] = o, e[4] = l, e[5] = a) : a = e[5], a;
978
977
  }
979
- function wr(t) {
978
+ function Br(t) {
980
979
  const e = y(11), {
981
980
  seg: n,
982
981
  isClickable: r,
@@ -985,25 +984,25 @@ function wr(t) {
985
984
  switch (n.kind) {
986
985
  case "avatar": {
987
986
  let s;
988
- return e[0] !== n ? (s = /* @__PURE__ */ i(xr, { seg: n }), e[0] = n, e[1] = s) : s = e[1], s;
987
+ return e[0] !== n ? (s = /* @__PURE__ */ i(Rr, { seg: n }), e[0] = n, e[1] = s) : s = e[1], s;
989
988
  }
990
989
  case "diff": {
991
990
  let s;
992
- return e[2] !== o || e[3] !== n ? (s = /* @__PURE__ */ i(yr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = s) : s = e[4], s;
991
+ return e[2] !== o || e[3] !== n ? (s = /* @__PURE__ */ i(Pr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = s) : s = e[4], s;
993
992
  }
994
993
  case "link": {
995
994
  let s;
996
- return e[5] !== o || e[6] !== n ? (s = n.variant === "bubble" ? /* @__PURE__ */ i(Sr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ i(kr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = s) : s = e[7], s;
995
+ return e[5] !== o || e[6] !== n ? (s = n.variant === "bubble" ? /* @__PURE__ */ i(Ir, { seg: n, onOpenFile: o }) : /* @__PURE__ */ i(vr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = s) : s = e[7], s;
997
996
  }
998
997
  case "text": {
999
998
  let s;
1000
- return e[8] !== r || e[9] !== n ? (s = /* @__PURE__ */ i(Tr, { seg: n, isClickable: r }), e[8] = r, e[9] = n, e[10] = s) : s = e[10], s;
999
+ return e[8] !== r || e[9] !== n ? (s = /* @__PURE__ */ i(Ar, { seg: n, isClickable: r }), e[8] = r, e[9] = n, e[10] = s) : s = e[10], s;
1001
1000
  }
1002
1001
  default:
1003
1002
  return null;
1004
1003
  }
1005
1004
  }
1006
- function Cr(t) {
1005
+ function Dr(t) {
1007
1006
  const e = y(10), {
1008
1007
  ind: n
1009
1008
  } = t;
@@ -1011,22 +1010,22 @@ function Cr(t) {
1011
1010
  return null;
1012
1011
  if (n.type === "icon") {
1013
1012
  let l;
1014
- e[0] !== n.icon ? (l = Rn(n.icon), e[0] = n.icon, e[1] = l) : l = e[1];
1015
- const c = l;
1016
- let d;
1017
- return e[2] !== c ? (d = /* @__PURE__ */ i(E.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ i(ie, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ i(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = d) : d = e[3], d;
1013
+ e[0] !== n.icon ? (l = En(n.icon), e[0] = n.icon, e[1] = l) : l = e[1];
1014
+ const a = l;
1015
+ let c;
1016
+ return e[2] !== a ? (c = /* @__PURE__ */ i(U.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ i(ye, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ i(a, { size: 14, strokeWidth: 1 }) }) }), e[2] = a, e[3] = c) : c = e[3], c;
1018
1017
  }
1019
1018
  let r;
1020
- e[4] !== n.alt || e[5] !== n.src ? (r = /* @__PURE__ */ i(Z.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = r) : r = e[6];
1019
+ e[4] !== n.alt || e[5] !== n.src ? (r = /* @__PURE__ */ i(ae.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = r) : r = e[6];
1021
1020
  let o;
1022
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(Z.Fallback, {}), e[7] = o) : o = e[7];
1021
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(ae.Fallback, {}), e[7] = o) : o = e[7];
1023
1022
  let s;
1024
- return e[8] !== r ? (s = /* @__PURE__ */ i(E.Indicator, { children: /* @__PURE__ */ b(Z.Root, { boxSize: "full", children: [
1023
+ return e[8] !== r ? (s = /* @__PURE__ */ i(U.Indicator, { children: /* @__PURE__ */ b(ae.Root, { boxSize: "full", children: [
1025
1024
  r,
1026
1025
  o
1027
1026
  ] }) }), e[8] = r, e[9] = s) : s = e[9], s;
1028
1027
  }
1029
- function _r(t) {
1028
+ function Mr(t) {
1030
1029
  const e = y(5), {
1031
1030
  code: n,
1032
1031
  language: r
@@ -1036,7 +1035,7 @@ function _r(t) {
1036
1035
  let l;
1037
1036
  return e[2] !== o || e[3] !== s ? (l = /* @__PURE__ */ i(k, { as: "pre", background: "bg.muted", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": o, children: s }), e[2] = o, e[3] = s, e[4] = l) : l = e[4], l;
1038
1037
  }
1039
- function Pr(t) {
1038
+ function zr(t) {
1040
1039
  const e = y(26), {
1041
1040
  b: n,
1042
1041
  onOpenFile: r
@@ -1044,36 +1043,36 @@ function Pr(t) {
1044
1043
  switch (n.type) {
1045
1044
  case "comment": {
1046
1045
  let o;
1047
- e[0] !== n.text ? (o = /* @__PURE__ */ i(z.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1046
+ e[0] !== n.text ? (o = /* @__PURE__ */ i(E.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1048
1047
  let s;
1049
- e[2] !== n.reactions ? (s = n.reactions?.clap ? /* @__PURE__ */ i(z.Footer, { children: /* @__PURE__ */ b(le, { children: [
1048
+ e[2] !== n.reactions ? (s = n.reactions?.clap ? /* @__PURE__ */ i(E.Footer, { children: /* @__PURE__ */ b(Se, { children: [
1050
1049
  "👏 ",
1051
1050
  n.reactions.clap
1052
1051
  ] }) }) : null, e[2] = n.reactions, e[3] = s) : s = e[3];
1053
1052
  let l;
1054
- return e[4] !== o || e[5] !== s ? (l = /* @__PURE__ */ b(z.Root, { children: [
1053
+ return e[4] !== o || e[5] !== s ? (l = /* @__PURE__ */ b(E.Root, { children: [
1055
1054
  o,
1056
1055
  s
1057
1056
  ] }), e[4] = o, e[5] = s, e[6] = l) : l = e[6], l;
1058
1057
  }
1059
1058
  case "code": {
1060
1059
  let o;
1061
- return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ i(z.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(z.Body, { padding: "0", children: /* @__PURE__ */ i(_r, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1060
+ return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ i(E.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(E.Body, { padding: "0", children: /* @__PURE__ */ i(Mr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1062
1061
  }
1063
1062
  case "diff": {
1064
1063
  const o = n.sideBySide ?? !1;
1065
1064
  let s;
1066
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (s = /* @__PURE__ */ i(z.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(z.Body, { padding: "0", children: /* @__PURE__ */ i(k, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ i(Xt, { 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] = s) : s = e[14], s;
1065
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (s = /* @__PURE__ */ i(E.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(E.Body, { padding: "0", children: /* @__PURE__ */ i(k, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ i(sn, { 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] = s) : s = e[14], s;
1067
1066
  }
1068
1067
  case "text": {
1069
1068
  let o;
1070
- return e[15] !== n.text ? (o = /* @__PURE__ */ i(z.Root, { background: "transparent", children: /* @__PURE__ */ i(z.Body, { padding: "sm", children: /* @__PURE__ */ i(Q, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1069
+ return e[15] !== n.text ? (o = /* @__PURE__ */ i(E.Root, { background: "transparent", children: /* @__PURE__ */ i(E.Body, { padding: "sm", children: /* @__PURE__ */ i(Y, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1071
1070
  }
1072
1071
  case "references": {
1073
1072
  let o;
1074
- e[17] !== n.references ? (o = n.references.map(Rr), e[17] = n.references, e[18] = o) : o = e[18];
1073
+ e[17] !== n.references ? (o = n.references.map(Er), e[17] = n.references, e[18] = o) : o = e[18];
1075
1074
  let s;
1076
- return e[19] !== o ? (s = /* @__PURE__ */ i(et, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[19] = o, e[20] = s) : s = e[20], s;
1075
+ return e[19] !== o ? (s = /* @__PURE__ */ i(Te, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[19] = o, e[20] = s) : s = e[20], s;
1077
1076
  }
1078
1077
  case "component": {
1079
1078
  let o;
@@ -1081,96 +1080,96 @@ function Pr(t) {
1081
1080
  onOpenFile: r
1082
1081
  }), e[21] = n, e[22] = r, e[23] = o) : o = e[23];
1083
1082
  let s;
1084
- return e[24] !== o ? (s = /* @__PURE__ */ i(Le, { children: o }), e[24] = o, e[25] = s) : s = e[25], s;
1083
+ return e[24] !== o ? (s = /* @__PURE__ */ i(Ve, { children: o }), e[24] = o, e[25] = s) : s = e[25], s;
1085
1084
  }
1086
1085
  }
1087
1086
  }
1088
- function Rr(t) {
1089
- return /* @__PURE__ */ i(Yt, { fileName: t }, t);
1087
+ function Er(t) {
1088
+ return /* @__PURE__ */ i(on, { fileName: t }, t);
1090
1089
  }
1091
- function Ir(t) {
1090
+ function $r(t) {
1092
1091
  const e = y(22), {
1093
1092
  item: n,
1094
1093
  itemKey: r,
1095
1094
  isOpen: o,
1096
1095
  canExpand: s,
1097
1096
  hasBlocks: l,
1098
- onToggle: c,
1099
- onOpenFile: d
1097
+ onToggle: a,
1098
+ onOpenFile: c
1100
1099
  } = t;
1101
- let a;
1102
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ i(E.Separator, {}), e[0] = a) : a = e[0];
1103
- let u;
1104
- e[1] !== n.indicator ? (u = /* @__PURE__ */ b(E.Connector, { children: [
1105
- a,
1106
- /* @__PURE__ */ i(Cr, { ind: n.indicator })
1107
- ] }), e[1] = n.indicator, e[2] = u) : u = e[2];
1100
+ let d;
1101
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(U.Separator, {}), e[0] = d) : d = e[0];
1108
1102
  let f;
1109
- e[3] !== s || e[4] !== o || e[5] !== n.title || e[6] !== r || e[7] !== d || e[8] !== c ? (f = n.title.length > 0 && /* @__PURE__ */ i(E.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: s ? "pointer" : "default", onClick: s ? () => c(r) : void 0, children: /* @__PURE__ */ b(ie, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1110
- /* @__PURE__ */ i(ie, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((x, S) => /* @__PURE__ */ i(wr, { seg: x, isClickable: s, onOpenFile: d }, S)) }),
1111
- s ? /* @__PURE__ */ i(ie, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1103
+ e[1] !== n.indicator ? (f = /* @__PURE__ */ b(U.Connector, { children: [
1104
+ d,
1105
+ /* @__PURE__ */ i(Dr, { ind: n.indicator })
1106
+ ] }), e[1] = n.indicator, e[2] = f) : f = e[2];
1107
+ let u;
1108
+ e[3] !== s || e[4] !== o || e[5] !== n.title || e[6] !== r || e[7] !== c || e[8] !== a ? (u = n.title.length > 0 && /* @__PURE__ */ i(U.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: s ? "pointer" : "default", onClick: s ? () => a(r) : void 0, children: /* @__PURE__ */ b(ye, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1109
+ /* @__PURE__ */ i(ye, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((g, T) => /* @__PURE__ */ i(Br, { seg: g, isClickable: s, onOpenFile: c }, T)) }),
1110
+ s ? /* @__PURE__ */ i(ye, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1112
1111
  color: "fg"
1113
- }, children: /* @__PURE__ */ i(Ut, { size: 12 }) }) : null
1114
- ] }) }), e[3] = s, e[4] = o, e[5] = n.title, e[6] = r, e[7] = d, e[8] = c, e[9] = f) : f = e[9];
1112
+ }, children: /* @__PURE__ */ i(Zt, { size: 12 }) }) : null
1113
+ ] }) }), e[3] = s, e[4] = o, e[5] = n.title, e[6] = r, e[7] = c, e[8] = a, e[9] = u) : u = e[9];
1115
1114
  let p;
1116
- e[10] !== l || e[11] !== o || e[12] !== n.blocks || e[13] !== d ? (p = l ? /* @__PURE__ */ i(k, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ i(k, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((x, S) => /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(Pr, { b: x, onOpenFile: d }) }, S)) }) : null }) : null, e[10] = l, e[11] = o, e[12] = n.blocks, e[13] = d, e[14] = p) : p = e[14];
1115
+ e[10] !== l || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = l ? /* @__PURE__ */ i(k, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ i(k, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((g, T) => /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(zr, { b: g, onOpenFile: c }) }, T)) }) : null }) : null, e[10] = l, e[11] = o, e[12] = n.blocks, e[13] = c, e[14] = p) : p = e[14];
1117
1116
  let m;
1118
- e[15] !== f || e[16] !== p ? (m = /* @__PURE__ */ b(E.Content, { pb: "xs", children: [
1119
- f,
1117
+ e[15] !== u || e[16] !== p ? (m = /* @__PURE__ */ b(U.Content, { pb: "xs", children: [
1118
+ u,
1120
1119
  p
1121
- ] }), e[15] = f, e[16] = p, e[17] = m) : m = e[17];
1120
+ ] }), e[15] = u, e[16] = p, e[17] = m) : m = e[17];
1122
1121
  let h;
1123
- return e[18] !== r || e[19] !== u || e[20] !== m ? (h = /* @__PURE__ */ b(E.Item, { gap: "xs", children: [
1124
- u,
1122
+ return e[18] !== r || e[19] !== f || e[20] !== m ? (h = /* @__PURE__ */ b(U.Item, { gap: "xs", children: [
1123
+ f,
1125
1124
  m
1126
- ] }, r), e[18] = r, e[19] = u, e[20] = m, e[21] = h) : h = e[21], h;
1125
+ ] }, r), e[18] = r, e[19] = f, e[20] = m, e[21] = h) : h = e[21], h;
1127
1126
  }
1128
- function Mr(t) {
1127
+ function Lr(t) {
1129
1128
  const e = y(11), {
1130
1129
  data: n,
1131
1130
  onOpenFile: r
1132
1131
  } = t;
1133
1132
  let o;
1134
1133
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1135
- const [s, l] = J(o), c = Br;
1136
- let d;
1137
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = (p) => {
1134
+ const [s, l] = le(o), a = Fr;
1135
+ let c;
1136
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (p) => {
1138
1137
  l((m) => ({
1139
1138
  ...m,
1140
1139
  [p]: !m[p]
1141
1140
  }));
1142
- }, e[1] = d) : d = e[1];
1143
- const a = d;
1144
- let u;
1141
+ }, e[1] = c) : c = e[1];
1142
+ const d = c;
1143
+ let f;
1145
1144
  if (e[2] !== n.items || e[3] !== s || e[4] !== r) {
1146
1145
  let p;
1147
1146
  e[6] !== s || e[7] !== r ? (p = (m, h) => {
1148
- const x = c(m, h), S = (m.blocks?.length ?? 0) > 0, w = (m.expandable ?? !0) && S, M = w ? s[x] ?? !1 : S;
1149
- return /* @__PURE__ */ i(Ir, { item: m, itemKey: x, isOpen: M, canExpand: w, hasBlocks: S, onToggle: a, onOpenFile: r }, x);
1150
- }, e[6] = s, e[7] = r, e[8] = p) : p = e[8], u = n.items.map(p), e[2] = n.items, e[3] = s, e[4] = r, e[5] = u;
1147
+ const g = a(m, h), T = (m.blocks?.length ?? 0) > 0, L = (m.expandable ?? !0) && T, w = L ? s[g] ?? !1 : T;
1148
+ return /* @__PURE__ */ i($r, { item: m, itemKey: g, isOpen: w, canExpand: L, hasBlocks: T, onToggle: d, onOpenFile: r }, g);
1149
+ }, e[6] = s, e[7] = r, e[8] = p) : p = e[8], f = n.items.map(p), e[2] = n.items, e[3] = s, e[4] = r, e[5] = f;
1151
1150
  } else
1152
- u = e[5];
1153
- let f;
1154
- return e[9] !== u ? (f = /* @__PURE__ */ i(E.Root, { children: u }), e[9] = u, e[10] = f) : f = e[10], f;
1151
+ f = e[5];
1152
+ let u;
1153
+ return e[9] !== f ? (u = /* @__PURE__ */ i(U.Root, { children: f }), e[9] = f, e[10] = u) : u = e[10], u;
1155
1154
  }
1156
- function Br(t, e) {
1155
+ function Fr(t, e) {
1157
1156
  return t.id ? `id:${t.id}` : `idx:${e}`;
1158
1157
  }
1159
- function vr(t) {
1158
+ function Or(t) {
1160
1159
  const e = y(6), {
1161
1160
  invocations: n,
1162
1161
  labeledBlocks: r,
1163
1162
  onOpenFile: o
1164
1163
  } = t;
1165
1164
  let s;
1166
- e[0] !== n || e[1] !== r ? (s = br(n, {
1165
+ e[0] !== n || e[1] !== r ? (s = _r(n, {
1167
1166
  labeledBlocks: r
1168
1167
  }), e[0] = n, e[1] = r, e[2] = s) : s = e[2];
1169
1168
  const l = s;
1170
- let c;
1171
- return e[3] !== l || e[4] !== o ? (c = /* @__PURE__ */ i(Mr, { data: l, onOpenFile: o }), e[3] = l, e[4] = o, e[5] = c) : c = e[5], c;
1169
+ let a;
1170
+ return e[3] !== l || e[4] !== o ? (a = /* @__PURE__ */ i(Lr, { data: l, onOpenFile: o }), e[3] = l, e[4] = o, e[5] = a) : a = e[5], a;
1172
1171
  }
1173
- const Ar = (t) => t.type === "tool", Ee = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Dr = (t) => {
1172
+ const Wr = (t) => t.type === "tool", je = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Hr = (t) => {
1174
1173
  if (t.message && t.message.trim().length > 0)
1175
1174
  return t.message;
1176
1175
  const {
@@ -1186,12 +1185,18 @@ const Ar = (t) => t.type === "tool", Ee = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1186
1185
  default:
1187
1186
  return "An error occurred.";
1188
1187
  }
1189
- }, zr = (t, e) => {
1188
+ }, jr = {
1189
+ info: "blue",
1190
+ warning: "orange",
1191
+ error: "red",
1192
+ success: "green",
1193
+ loading: "blue"
1194
+ }, Nr = (t, e) => {
1190
1195
  const n = [];
1191
1196
  let r = e;
1192
1197
  for (; r < t.length; ) {
1193
1198
  const o = t[r];
1194
- if (!Ar(o)) break;
1199
+ if (!Wr(o)) break;
1195
1200
  n.push(o), r += 1;
1196
1201
  }
1197
1202
  return {
@@ -1199,82 +1204,79 @@ const Ar = (t) => t.type === "tool", Ee = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1199
1204
  nextIndex: r - 1
1200
1205
  };
1201
1206
  };
1202
- function ht(t) {
1207
+ function _t(t) {
1203
1208
  const e = y(7), {
1204
1209
  message: n,
1205
1210
  onOpenFile: r,
1206
1211
  toolInvocationTimeline: o
1207
- } = t, s = o ?? vr;
1212
+ } = t, s = o ?? Or;
1208
1213
  let l;
1209
1214
  e[0] !== n.parts ? (l = n.parts ?? [], e[0] = n.parts, e[1] = l) : l = e[1];
1210
- const c = l;
1211
- let d;
1212
- if (e[2] !== s || e[3] !== n.id || e[4] !== r || e[5] !== c) {
1213
- const a = [];
1214
- for (let u = 0; u < c.length; u = u + 1, u) {
1215
- const f = c[u], p = `${n.id}-${u}`;
1216
- e: switch (f.type) {
1215
+ const a = l;
1216
+ let c;
1217
+ if (e[2] !== s || e[3] !== n.id || e[4] !== r || e[5] !== a) {
1218
+ const d = [];
1219
+ for (let f = 0; f < a.length; f = f + 1, f) {
1220
+ const u = a[f], p = `${n.id}-${f}`;
1221
+ e: switch (u.type) {
1217
1222
  case "text": {
1218
- a.push(/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(Cn, { children: f.text }) }, p));
1223
+ d.push(/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(Dn, { children: u.text }) }, p));
1219
1224
  break e;
1220
1225
  }
1221
1226
  case "reasoning": {
1222
- a.push(/* @__PURE__ */ i(k, { padding: "0", css: {
1227
+ d.push(/* @__PURE__ */ i(k, { padding: "0", css: {
1223
1228
  "& .rich-text, & .rich-text *": {
1224
1229
  color: "fg.subtle !important",
1225
1230
  fontSize: ".75rem !important",
1226
1231
  fontWeight: "normal !important"
1227
1232
  }
1228
- }, children: /* @__PURE__ */ i(rt, { defaultState: f.text, fullWidth: !0 }) }, p));
1233
+ }, children: /* @__PURE__ */ i(ft, { defaultState: u.text, fullWidth: !0 }) }, p));
1229
1234
  break e;
1230
1235
  }
1231
1236
  case "tool": {
1232
1237
  const {
1233
1238
  invocations: m,
1234
1239
  nextIndex: h
1235
- } = zr(c, u);
1236
- u = h, a.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(s, { invocations: m, labeledBlocks: !0, onOpenFile: r }) }, p));
1237
- break e;
1238
- }
1239
- case "loading": {
1240
- a.push(/* @__PURE__ */ b(k, { display: "flex", alignItems: "center", gap: "2", py: "2", children: [
1241
- /* @__PURE__ */ i(_t, { size: "sm" }),
1242
- /* @__PURE__ */ i(Q, { fontSize: "sm", color: "fg.muted", children: "Thinking..." })
1243
- ] }, p));
1240
+ } = Nr(a, f);
1241
+ f = h, d.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(s, { invocations: m, labeledBlocks: !0, onOpenFile: r }) }, p));
1244
1242
  break e;
1245
1243
  }
1246
1244
  case "error": {
1247
- a.push(/* @__PURE__ */ i(k, { py: "2", children: /* @__PURE__ */ i(Q, { fontSize: "sm", color: "fg.error", children: Dr(f) }) }, p));
1245
+ d.push(/* @__PURE__ */ i(k, { py: "2", width: "full", children: /* @__PURE__ */ i(Ze, { borderRadius: "xs", status: "error", colorPalette: "red", title: Hr(u), size: "sm" }) }, p));
1248
1246
  break e;
1249
1247
  }
1250
1248
  case "token_usage": {
1251
- a.push(/* @__PURE__ */ i(k, { py: "1", children: /* @__PURE__ */ b(Q, { fontSize: "xs", color: "fg.subtle", children: [
1249
+ d.push(/* @__PURE__ */ i(k, { children: /* @__PURE__ */ b(Y, { fontSize: "xs", color: "fg.subtle", children: [
1252
1250
  "Tokens: ",
1253
- Ee(f.inputTokens),
1251
+ je(u.inputTokens),
1254
1252
  " in / ",
1255
- Ee(f.outputTokens),
1253
+ je(u.outputTokens),
1256
1254
  " out",
1257
- f.cacheReadTokens ? ` / ${Ee(f.cacheReadTokens)} cache read` : ""
1255
+ u.cacheReadTokens ? ` / ${je(u.cacheReadTokens)} cache read` : ""
1258
1256
  ] }) }, p));
1259
1257
  break e;
1260
1258
  }
1259
+ case "alert": {
1260
+ d.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(Ze, { borderRadius: "xs", status: u.status === "loading" ? "info" : u.status, colorPalette: jr[u.status], title: u.title, icon: u.status === "loading" ? /* @__PURE__ */ i(qe, { size: "sm" }) : void 0, size: "sm", children: u.message }) }, p));
1261
+ break e;
1262
+ }
1261
1263
  default:
1262
- a.push(null);
1264
+ d.push(null);
1263
1265
  }
1264
1266
  }
1265
- d = /* @__PURE__ */ i(Le, { children: a }), e[2] = s, e[3] = n.id, e[4] = r, e[5] = c, e[6] = d;
1267
+ c = /* @__PURE__ */ i(Ve, { children: d }), e[2] = s, e[3] = n.id, e[4] = r, e[5] = a, e[6] = c;
1266
1268
  } else
1267
- d = e[6];
1268
- return d;
1269
+ c = e[6];
1270
+ return c;
1269
1271
  }
1270
- const Er = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Fr = (t) => {
1272
+ const Ur = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Vr = (t) => {
1271
1273
  const e = t.parts ?? [];
1272
1274
  return e.length === 0 || e.some((r) => r.type === "text" && "text" in r) ? !1 : e.some((r) => r.type === "reasoning" || r.type === "tool");
1273
- }, $r = (t) => {
1275
+ }, qr = (t) => {
1274
1276
  const e = [];
1275
1277
  for (const n of t) {
1276
1278
  const r = e[e.length - 1];
1277
- if (r && r.role === n.role && Fr(n)) {
1279
+ if (r && r.role === n.role && Vr(n)) {
1278
1280
  r.parts = [...r.parts ?? [], ...n.parts ?? []];
1279
1281
  continue;
1280
1282
  }
@@ -1284,7 +1286,7 @@ const Er = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1284
1286
  });
1285
1287
  }
1286
1288
  return e;
1287
- }, Lr = (t) => {
1289
+ }, Gr = (t) => {
1288
1290
  const e = [], n = [];
1289
1291
  for (const r of t)
1290
1292
  r.role === "user" ? e.push({
@@ -1295,86 +1297,141 @@ const Er = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1295
1297
  groups: e,
1296
1298
  leadingResponses: n
1297
1299
  };
1298
- }, Xe = (t, e) => {
1299
- const n = Er(t.role);
1300
- return /* @__PURE__ */ i(ye.Root, { from: n, children: /* @__PURE__ */ i(ye.Content, { from: n, children: /* @__PURE__ */ i(ht, { message: t, streaming: e }) }) }, t.id);
1301
- }, ko = (t) => {
1302
- const e = y(19), {
1300
+ }, st = (t, e) => {
1301
+ const n = Ur(t.role);
1302
+ return /* @__PURE__ */ i(V.Root, { from: n, children: /* @__PURE__ */ i(V.Content, { from: n, children: /* @__PURE__ */ i(_t, { message: t, streaming: e }) }) }, t.id);
1303
+ }, Ao = (t) => {
1304
+ const e = y(27), {
1303
1305
  messages: n,
1304
1306
  streaming: r,
1305
1307
  emptyStateTitle: o,
1306
1308
  emptyStateDescription: s,
1307
- chatInputPlaceholder: l,
1308
- chatInputDefaultValue: c,
1309
- onSubmitMessage: d,
1310
- onChatInputChange: a,
1311
- actions: u,
1312
- repoMenu: f,
1313
- attachedResources: p,
1314
- onClearAttachments: m,
1315
- attachmentList: h,
1316
- approvalPrompt: x
1317
- } = t, S = r === void 0 ? !1 : r, w = c === void 0 ? "" : c, M = $r(n), ce = M.length > 0, oe = M.reduce(Or, 0), {
1318
- groups: ae,
1319
- leadingResponses: se
1320
- } = Lr(M), [de, L] = J(Hr);
1321
- let _;
1322
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = (T) => {
1323
- L((R) => {
1324
- const I = new Set(R);
1325
- return I.has(T) ? I.delete(T) : I.add(T), I;
1309
+ emptyStateContent: l,
1310
+ loadingContent: a,
1311
+ chatInputPlaceholder: c,
1312
+ chatInputDefaultValue: d,
1313
+ onSubmitMessage: f,
1314
+ onChatInputChange: u,
1315
+ actions: p,
1316
+ repoMenu: m,
1317
+ attachedResources: h,
1318
+ onClearAttachments: g,
1319
+ attachmentList: T,
1320
+ approvalPrompt: L,
1321
+ workspaceHub: w,
1322
+ workspaceInitializing: pe,
1323
+ inputDisabled: q
1324
+ } = t, P = r === void 0 ? !1 : r, G = d === void 0 ? "" : d, we = pe === void 0 ? !1 : pe, K = q === void 0 ? !1 : q, J = qr(n), X = J.length > 0, F = J.reduce(Kr, 0), {
1325
+ groups: me,
1326
+ leadingResponses: Ce
1327
+ } = Gr(J), [he, Q] = le(Xr), Z = P ? a ?? l : l, A = !!w, O = P && X && !we;
1328
+ let B;
1329
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = (S) => {
1330
+ Q((z) => {
1331
+ const R = new Set(z);
1332
+ return R.has(S) ? R.delete(S) : R.add(S), R;
1326
1333
  });
1327
- }, e[0] = _) : _ = e[0];
1328
- const O = _, H = ze, F = ce ? /* @__PURE__ */ b(et, { gap: "sm", children: [
1329
- se.map((T) => Xe(T, S)),
1330
- ae.map((T) => {
1331
- const R = Tn(T.userMessage), I = de.has(T.userMessage.id);
1334
+ }, e[0] = B) : B = e[0];
1335
+ const ge = B, W = He, be = X ? /* @__PURE__ */ b(Te, { gap: "sm", children: [
1336
+ Ce.map((S) => st(S, P)),
1337
+ me.map((S) => {
1338
+ const z = An(S.userMessage), R = he.has(S.userMessage.id);
1332
1339
  return /* @__PURE__ */ b(k, { children: [
1333
1340
  /* @__PURE__ */ b(k, { position: "sticky", top: "0", zIndex: 1, children: [
1334
1341
  /* @__PURE__ */ b(k, { position: "relative", children: [
1335
- /* @__PURE__ */ i(ye.Root, { from: "user", children: /* @__PURE__ */ i(ye.Content, { from: "user", maxH: R && !I ? Sn : void 0, overflowY: "hidden", children: /* @__PURE__ */ i(ht, { message: T.userMessage, streaming: S }) }) }),
1336
- R && !I && /* @__PURE__ */ i(X, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: "flex-end", alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", children: /* @__PURE__ */ i(le, { size: "2xs", variant: "solid", onClick: () => O(T.userMessage.id), children: "Show more" }) })
1342
+ /* @__PURE__ */ i(V.Root, { from: "user", children: /* @__PURE__ */ i(V.Content, { from: "user", maxH: z && !R ? In : void 0, overflowY: "hidden", children: /* @__PURE__ */ i(_t, { message: S.userMessage, streaming: P }) }) }),
1343
+ z && !R && /* @__PURE__ */ i($, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: "flex-end", alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", children: /* @__PURE__ */ i(Se, { size: "2xs", variant: "solid", onClick: () => ge(S.userMessage.id), children: "Show more" }) })
1337
1344
  ] }),
1338
- R && I && /* @__PURE__ */ i(X, { justifyContent: "flex-end", mt: "2xs", mb: "sm", children: /* @__PURE__ */ i(le, { size: "2xs", variant: "ghost", onClick: () => O(T.userMessage.id), children: "Show less" }) })
1345
+ z && R && /* @__PURE__ */ i($, { justifyContent: "flex-end", mt: "2xs", mb: "sm", children: /* @__PURE__ */ i(Se, { size: "2xs", variant: "ghost", onClick: () => ge(S.userMessage.id), children: "Show less" }) })
1339
1346
  ] }),
1340
- T.responses.map((W) => Xe(W, S))
1341
- ] }, T.userMessage.id);
1347
+ S.responses.map((xe) => st(xe, P))
1348
+ ] }, S.userMessage.id);
1342
1349
  })
1343
- ] }) : /* @__PURE__ */ i(Qt, { icon: /* @__PURE__ */ i(Vt, { size: 48, strokeWidth: 1.5 }), title: o, description: s });
1344
- let B;
1345
- e[1] !== H.Viewport || e[2] !== F ? (B = /* @__PURE__ */ i(H.Viewport, { children: F }), e[1] = H.Viewport, e[2] = F, e[3] = B) : B = e[3];
1346
- let v;
1347
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ i(ze.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = v) : v = e[4];
1348
- let P;
1349
- e[5] !== w ? (P = xn(w), e[5] = w, e[6] = P) : P = e[6];
1350
- let A;
1351
- e[7] !== u || e[8] !== p || e[9] !== h || e[10] !== l || e[11] !== a || e[12] !== m || e[13] !== d || e[14] !== S || e[15] !== P ? (A = /* @__PURE__ */ i(k, { px: "sm", children: /* @__PURE__ */ i(mn, { placeholder: l, defaultState: P, streaming: S, onSubmit: d, onChange: a, actions: u, attachedResources: p, onClearAttachments: m, attachmentList: h }) }), e[7] = u, e[8] = p, e[9] = h, e[10] = l, e[11] = a, e[12] = m, e[13] = d, e[14] = S, e[15] = P, e[16] = A) : A = e[16];
1350
+ ] }) : Z ?? /* @__PURE__ */ i(ln, { icon: /* @__PURE__ */ i(en, { size: 48, strokeWidth: 1.5 }), title: o, description: s });
1352
1351
  let D;
1353
- return e[17] !== f ? (D = /* @__PURE__ */ i(X, { p: "2xs", justifyContent: "flex-end", children: f }), e[17] = f, e[18] = D) : D = e[18], /* @__PURE__ */ b(X, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
1354
- /* @__PURE__ */ b(ze.Root, { children: [
1355
- /* @__PURE__ */ i(fn, { userMessageCount: oe }),
1356
- B,
1357
- v
1352
+ e[1] !== W.Viewport || e[2] !== be ? (D = /* @__PURE__ */ i(W.Viewport, { children: be }), e[1] = W.Viewport, e[2] = be, e[3] = D) : D = e[3];
1353
+ let H;
1354
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ i(He.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = H) : H = e[4];
1355
+ let M;
1356
+ e[5] !== O ? (M = O ? /* @__PURE__ */ b(ke, { gap: "xs", px: "sm", py: "2xs", children: [
1357
+ /* @__PURE__ */ i(qe, { size: "xs", color: "fg.muted" }),
1358
+ /* @__PURE__ */ i(Y, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
1359
+ ] }) : null, e[5] = O, e[6] = M) : M = e[6];
1360
+ const v = A ? "0" : "xs";
1361
+ let C;
1362
+ e[7] !== G ? (C = Rn(G), e[7] = G, e[8] = C) : C = e[8];
1363
+ let I;
1364
+ e[9] !== p || e[10] !== h || e[11] !== T || e[12] !== c || e[13] !== A || e[14] !== K || e[15] !== u || e[16] !== g || e[17] !== f || e[18] !== P || e[19] !== C ? (I = /* @__PURE__ */ i(Tn, { placeholder: c, defaultState: C, streaming: P, onSubmit: f, onChange: u, actions: p, attachedResources: h, onClearAttachments: g, attachmentList: T, isDisabled: K, attachedToTop: A }), e[9] = p, e[10] = h, e[11] = T, e[12] = c, e[13] = A, e[14] = K, e[15] = u, e[16] = g, e[17] = f, e[18] = P, e[19] = C, e[20] = I) : I = e[20];
1365
+ let j;
1366
+ e[21] !== v || e[22] !== I || e[23] !== w ? (j = /* @__PURE__ */ b(Te, { px: "sm", gap: v, children: [
1367
+ w,
1368
+ I
1369
+ ] }), e[21] = v, e[22] = I, e[23] = w, e[24] = j) : j = e[24];
1370
+ let N;
1371
+ return e[25] !== m ? (N = /* @__PURE__ */ i($, { p: "2xs", justifyContent: "flex-end", children: m }), e[25] = m, e[26] = N) : N = e[26], /* @__PURE__ */ b($, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
1372
+ /* @__PURE__ */ b(He.Root, { children: [
1373
+ /* @__PURE__ */ i(Sn, { userMessageCount: F }),
1374
+ D,
1375
+ H
1358
1376
  ] }),
1359
- x,
1360
- A,
1361
- D
1377
+ L,
1378
+ M,
1379
+ j,
1380
+ N
1362
1381
  ] });
1363
1382
  };
1364
- function Or(t, e) {
1383
+ function Kr(t, e) {
1365
1384
  return t + (e.role === "user" ? 1 : 0);
1366
1385
  }
1367
- function Hr() {
1386
+ function Xr() {
1368
1387
  return /* @__PURE__ */ new Set();
1369
1388
  }
1389
+ const it = (t) => /* @__PURE__ */ i(Te, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ i(Et, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), Bo = () => {
1390
+ const t = y(2);
1391
+ let e;
1392
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ i(V.Root, { from: "user", children: /* @__PURE__ */ i(V.Content, { from: "user", children: it(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
1393
+ let n;
1394
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ b(Te, { minH: "full", py: "xs", gap: "0", children: [
1395
+ e,
1396
+ /* @__PURE__ */ i(V.Root, { from: "assistant", children: /* @__PURE__ */ i(V.Content, { from: "assistant", children: it(["76%", "62%", "40%"]) }) })
1397
+ ] }), t[1] = n) : n = t[1], n;
1398
+ }, Do = (t) => {
1399
+ const e = y(14), {
1400
+ changesLabel: n,
1401
+ additions: r,
1402
+ deletions: o,
1403
+ action: s,
1404
+ status: l,
1405
+ statusLabel: a
1406
+ } = t, c = l === void 0 ? "ready" : l, d = r > 0 || o > 0, f = c === "error" ? "border.error" : "border.muted", u = c === "error" ? "bg.error" : "bg.subtle";
1407
+ let p;
1408
+ e[0] !== r || e[1] !== n || e[2] !== o || e[3] !== d || e[4] !== c || e[5] !== a ? (p = c === "loading" ? /* @__PURE__ */ b(ke, { gap: "xs", minW: "0", children: [
1409
+ /* @__PURE__ */ i(qe, { size: "xs", color: "fg.muted" }),
1410
+ /* @__PURE__ */ i(Y, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: a ?? "Setting up workspace..." })
1411
+ ] }) : c === "error" ? /* @__PURE__ */ b(ke, { gap: "xs", minW: "0", children: [
1412
+ /* @__PURE__ */ i(dt, { size: 14, color: "var(--chakra-colors-fg-error)" }),
1413
+ /* @__PURE__ */ i(Y, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: a ?? "Workspace setup failed" })
1414
+ ] }) : d ? /* @__PURE__ */ i(pt, { label: n, additions: r, deletions: o, variant: "ghost", size: "small", _hover: {
1415
+ background: "transparent"
1416
+ } }) : /* @__PURE__ */ i($, { flex: "1" }), e[0] = r, e[1] = n, e[2] = o, e[3] = d, e[4] = c, e[5] = a, e[6] = p) : p = e[6];
1417
+ let m;
1418
+ e[7] !== s ? (m = s ? /* @__PURE__ */ i($, { flexShrink: 0, ml: "auto", children: s }) : null, e[7] = s, e[8] = m) : m = e[8];
1419
+ let h;
1420
+ return e[9] !== f || e[10] !== u || e[11] !== p || e[12] !== m ? (h = /* @__PURE__ */ b($, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: f, borderRadius: "xs", borderBottomRadius: "0", bg: u, children: [
1421
+ p,
1422
+ m
1423
+ ] }), e[9] = f, e[10] = u, e[11] = p, e[12] = m, e[13] = h) : h = e[13], h;
1424
+ };
1370
1425
  export {
1371
- So as ApprovalPrompt,
1372
- fn as AutoScroll,
1373
- mn as ChatInput,
1374
- ye as ChatMessage,
1375
- ko as ChatPanel,
1376
- ze as ChatPrimitives,
1377
- pn as SendButton,
1378
- xn as createSerializedPromptState
1426
+ vo as ApprovalPrompt,
1427
+ Sn as AutoScroll,
1428
+ Tn as ChatInput,
1429
+ V as ChatMessage,
1430
+ Ao as ChatPanel,
1431
+ He as ChatPrimitives,
1432
+ Bo as ChatSkeleton,
1433
+ Do as ChatWorkspaceHub,
1434
+ kn as SendButton,
1435
+ Rn as createSerializedPromptState
1379
1436
  };
1380
1437
  //# sourceMappingURL=chat-ui.js.map