@pstdio/ui 0.5.1 → 0.6.0

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