@pstdio/ui 0.24.2 → 0.26.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 (109) hide show
  1. package/README.md +8 -1
  2. package/dist/{MermaidComponent-DSvPk-J8.js → MermaidComponent-X__B6qib.js} +3 -3
  3. package/dist/{MermaidComponent-DSvPk-J8.js.map → MermaidComponent-X__B6qib.js.map} +1 -1
  4. package/dist/activity-timeline-BynMjXSB.js +283 -0
  5. package/dist/activity-timeline-BynMjXSB.js.map +1 -0
  6. package/dist/alert-ubcrW24X.js +33 -0
  7. package/dist/alert-ubcrW24X.js.map +1 -0
  8. package/dist/browser-storage-BinyFNJX.js +40 -0
  9. package/dist/browser-storage-BinyFNJX.js.map +1 -0
  10. package/dist/chat-ui.js +1515 -1428
  11. package/dist/chat-ui.js.map +1 -1
  12. package/dist/components/activity/activity-comment.d.ts +10 -2
  13. package/dist/components/chat-ui/components/chat-history-story.d.ts +14 -0
  14. package/dist/components/chat-ui/components/chat-input-history.d.ts +6 -0
  15. package/dist/components/chat-ui/components/chat-input.d.ts +2 -0
  16. package/dist/components/chat-ui/components/chat-panel-composer.d.ts +49 -0
  17. package/dist/components/chat-ui/components/use-chat-input-history.d.ts +16 -0
  18. package/dist/components/diff-viewer/code-editor.d.ts +2 -0
  19. package/dist/components/rich-text/index.d.ts +2 -0
  20. package/dist/components/rich-text/markdown-editor/markdown-editor-scrolling.play.d.ts +4 -0
  21. package/dist/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.d.ts +3 -1
  22. package/dist/components/rich-text/prompt-input/plugins/keyboard-shortcuts.d.ts +2 -0
  23. package/dist/components/rich-text/prompt-input/prompt-input.d.ts +2 -0
  24. package/dist/components/rich-text/resource-activity-feed/resource-activity-feed.d.ts +58 -0
  25. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/should-show-floating-toolbar.d.ts +1 -0
  26. package/dist/data-table.js +6 -6
  27. package/dist/diff.js +524 -522
  28. package/dist/diff.js.map +1 -1
  29. package/dist/{edit-mode-data-table-2E4GSOou.js → edit-mode-data-table-Nfmfi7bz.js} +23 -22
  30. package/dist/{edit-mode-data-table-2E4GSOou.js.map → edit-mode-data-table-Nfmfi7bz.js.map} +1 -1
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.js +1619 -1852
  33. package/dist/index.js.map +1 -1
  34. package/dist/{kanban-renderer-toolbar-Dcbxujbk.js → kanban-renderer-toolbar-Buek4icz.js} +34 -33
  35. package/dist/{kanban-renderer-toolbar-Dcbxujbk.js.map → kanban-renderer-toolbar-Buek4icz.js.map} +1 -1
  36. package/dist/kanban-renderer.js +31 -30
  37. package/dist/kanban-renderer.js.map +1 -1
  38. package/dist/lazy-markdown-editor-PzIBc9-l.js +42 -0
  39. package/dist/lazy-markdown-editor-PzIBc9-l.js.map +1 -0
  40. package/dist/{list-row-BDoV_iMV.js → list-row-DHzRa9-O.js} +2 -2
  41. package/dist/{list-row-BDoV_iMV.js.map → list-row-DHzRa9-O.js.map} +1 -1
  42. package/dist/{markdown-Cli3KGu9.js → markdown-BCfPxNpb.js} +322 -302
  43. package/dist/markdown-BCfPxNpb.js.map +1 -0
  44. package/dist/markdown-editor-CsJ4KNGu.js +1034 -0
  45. package/dist/markdown-editor-CsJ4KNGu.js.map +1 -0
  46. package/dist/{mermaid-renderer-CVnuKs-A.js → mermaid-renderer-D0YP0FmJ.js} +3 -3
  47. package/dist/{mermaid-renderer-CVnuKs-A.js.map → mermaid-renderer-D0YP0FmJ.js.map} +1 -1
  48. package/dist/mermaid.js +1 -1
  49. package/dist/{param-editor-CaRflJ3e.js → param-editor-CFM2Nf3l.js} +2 -2
  50. package/dist/{param-editor-CaRflJ3e.js.map → param-editor-CFM2Nf3l.js.map} +1 -1
  51. package/dist/param-editor-field-Bj-AGUY6.js +1728 -0
  52. package/dist/param-editor-field-Bj-AGUY6.js.map +1 -0
  53. package/dist/param-editor.d.ts +2 -0
  54. package/dist/param-editor.js +47 -0
  55. package/dist/param-editor.js.map +1 -0
  56. package/dist/prism-n5gcERyD.js +202 -0
  57. package/dist/prism-n5gcERyD.js.map +1 -0
  58. package/dist/radio-BfjibByI.js +51 -0
  59. package/dist/radio-BfjibByI.js.map +1 -0
  60. package/dist/rich-message-q6Y6QJOq.js +633 -0
  61. package/dist/rich-message-q6Y6QJOq.js.map +1 -0
  62. package/dist/rich-text.js +342 -177
  63. package/dist/rich-text.js.map +1 -1
  64. package/dist/scroll-area-BMbg1WcD.js +91 -0
  65. package/dist/scroll-area-BMbg1WcD.js.map +1 -0
  66. package/dist/slider-DBHjdxsU.js +1092 -0
  67. package/dist/slider-DBHjdxsU.js.map +1 -0
  68. package/dist/style.css +1 -1
  69. package/dist/terminal.js +96 -93
  70. package/dist/terminal.js.map +1 -1
  71. package/dist/theme/primitives/colors.d.ts +0 -23
  72. package/dist/theme/recipes/activity-comment.d.ts +36 -0
  73. package/dist/theme/recipes/alert.d.ts +1 -1
  74. package/dist/theme/recipes/dialog.d.ts +1 -1
  75. package/dist/theme/recipes/drawer.d.ts +1 -1
  76. package/dist/theme/recipes/menu.d.ts +1 -1
  77. package/dist/theme/recipes/popover.d.ts +1 -1
  78. package/dist/theme/recipes/progress-circle.d.ts +3 -3
  79. package/dist/theme/recipes/switch.d.ts +1 -1
  80. package/dist/theme/recipes/timeline.d.ts +10 -1
  81. package/dist/theme/recipes/tooltip.d.ts +1 -1
  82. package/dist/theme/recipes/window-title-bar.d.ts +1 -1
  83. package/dist/{theme-B5OVwYEU.js → theme-AzJH4Om3.js} +127 -808
  84. package/dist/theme-AzJH4Om3.js.map +1 -0
  85. package/dist/{theme-preference-Bpobguh4.js → theme-preference-DxGW1qg-.js} +2 -2
  86. package/dist/{theme-preference-Bpobguh4.js.map → theme-preference-DxGW1qg-.js.map} +1 -1
  87. package/dist/theme.js +1 -1
  88. package/dist/{tree-list-CZvcg3_6.js → tree-list-CPjbGTvs.js} +2 -2
  89. package/dist/{tree-list-CZvcg3_6.js.map → tree-list-CPjbGTvs.js.map} +1 -1
  90. package/dist/{workspace-badge-BR_GgsAG.js → workspace-badge-CuOcmnZc.js} +2 -2
  91. package/dist/{workspace-badge-BR_GgsAG.js.map → workspace-badge-CuOcmnZc.js.map} +1 -1
  92. package/package.json +7 -2
  93. package/dist/browser-storage-DPtOQJx0.js +0 -127
  94. package/dist/browser-storage-DPtOQJx0.js.map +0 -1
  95. package/dist/lazy-markdown-editor-DSlelhHV.js +0 -235
  96. package/dist/lazy-markdown-editor-DSlelhHV.js.map +0 -1
  97. package/dist/markdown-Cli3KGu9.js.map +0 -1
  98. package/dist/markdown-editor-BHoRATej.js +0 -1019
  99. package/dist/markdown-editor-BHoRATej.js.map +0 -1
  100. package/dist/param-editor-field-DVQlXbid.js +0 -2810
  101. package/dist/param-editor-field-DVQlXbid.js.map +0 -1
  102. package/dist/radio-cLMEBBZk.js +0 -76
  103. package/dist/radio-cLMEBBZk.js.map +0 -1
  104. package/dist/rich-message-gWYlm8Ji.js +0 -628
  105. package/dist/rich-message-gWYlm8Ji.js.map +0 -1
  106. package/dist/theme/recipes/landing-story.d.ts +0 -10
  107. package/dist/theme/recipes/landing-tool-demo.d.ts +0 -1
  108. package/dist/theme/recipes/landing.d.ts +0 -23
  109. package/dist/theme-B5OVwYEU.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,22 +1,23 @@
1
- import { jsx as c, jsxs as k, Fragment as At } from "react/jsx-runtime";
2
- import { c as A } from "react/compiler-runtime";
3
- import { AbsoluteCenter as zn, IconButton as Pe, chakra as Gt, createSlotRecipeContext as Qn, defineSlotRecipe as qn, Text as U, Code as Bt, Button as Oe, HStack as Z, Box as P, Flex as be, Stack as j, Textarea as Wn, Tooltip as Ke, Portal as Yt, Kbd as Hn, Spacer as Vn, Link as Jt, Span as $e, Avatar as Ee, Timeline as Nn, Image as Zt, Card as Y, Spinner as kt, Badge as Un, Icon as dt, Skeleton as jn } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Kn, ShieldX as Xn, ShieldCheck as Gn, Check as en, Pause as Yn, ArrowUp as Jn, Copy as Zn, Move as es, FileDown as ts, FileUp as ns, FileDiff as ss, Trash2 as tn, FilePen as os, FileText as rs, ListTree as is, Terminal as nn, ListTodo as ls, CircleQuestionMark as as, File as cs, Globe as us, Search as ds, AlertTriangle as sn, DotIcon as fs, ChevronUpIcon as ps, GripVertical as ms, Pencil as hs, MessageCircleIcon as gs } from "lucide-react";
5
- import { useStickToBottomContext as Ge, StickToBottom as bs } from "use-stick-to-bottom";
6
- import { S as Ye, T as Ct } from "./browser-storage-DPtOQJx0.js";
7
- import { Fragment as ys, useRef as ie, useEffect as J, useState as V } from "react";
8
- import { R as It, C as on } from "./lazy-markdown-editor-DSlelhHV.js";
9
- import { a as ft, P as xs, g as Ss, R as rn } from "./rich-message-gWYlm8Ji.js";
10
- import { R as ws, a as Ts, A as Ft } from "./radio-cLMEBBZk.js";
11
- import { E as As } from "./empty-state-Bo4HVrgr.js";
12
- import { useVirtualizer as ks } from "@tanstack/react-virtual";
13
- import { a as Cs, D as Is } from "./diff-bubble-DvUPRnfB.js";
14
- const _s = {
1
+ import { jsx as u, jsxs as k, Fragment as It } from "react/jsx-runtime";
2
+ import { c as C } from "react/compiler-runtime";
3
+ import { AbsoluteCenter as Wn, IconButton as Pe, chakra as Jt, createSlotRecipeContext as Hn, defineSlotRecipe as Nn, Text as U, Code as Lt, Button as Qe, HStack as oe, Box as D, Flex as ye, Stack as X, Textarea as Vn, Tooltip as Je, Portal as Zt, Kbd as Un, Spacer as jn, Link as en, Span as ze, Avatar as Ee, Timeline as Kn, Image as tn, Card as se, Spinner as _t, Badge as Xn, Icon as mt, Skeleton as Gn } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as Yn, ShieldX as Jn, ShieldCheck as Zn, Check as nn, Pause as es, ArrowUp as ts, Copy as ns, Move as ss, FileDown as os, FileUp as rs, FileDiff as is, Trash2 as sn, FilePen as ls, FileText as as, ListTree as cs, Terminal as on, ListTodo as us, CircleQuestionMark as ds, File as fs, Globe as ps, Search as ms, AlertTriangle as rn, DotIcon as hs, ChevronUpIcon as gs, GripVertical as bs, Pencil as ys, MessageCircleIcon as xs } from "lucide-react";
5
+ import { useStickToBottomContext as et, StickToBottom as Ss } from "use-stick-to-bottom";
6
+ import { S as tt, T as vt } from "./scroll-area-BMbg1WcD.js";
7
+ import { Fragment as ws, useRef as J, useEffect as Z, useState as W } from "react";
8
+ import { R as Mt, C as ln } from "./prism-n5gcERyD.js";
9
+ import { a as ht, P as Ts, R as an, g as As } from "./rich-message-q6Y6QJOq.js";
10
+ import { R as Cs, a as ks } from "./radio-BfjibByI.js";
11
+ import { E as Is } from "./empty-state-Bo4HVrgr.js";
12
+ import { useVirtualizer as _s } from "@tanstack/react-virtual";
13
+ import { A as $t } from "./alert-ubcrW24X.js";
14
+ import { a as vs, D as Ms } from "./diff-bubble-DvUPRnfB.js";
15
+ const Rs = {
15
16
  "aria-roledescription": "conversation",
16
17
  initial: "instant",
17
18
  resize: "instant",
18
19
  role: "log"
19
- }, Rs = Gt(bs, {
20
+ }, Ps = Jt(Ss, {
20
21
  base: {
21
22
  position: "relative",
22
23
  flex: 1,
@@ -25,44 +26,44 @@ const _s = {
25
26
  }
26
27
  }, {
27
28
  forwardProps: ["initial", "resize"],
28
- defaultProps: _s
29
- }), vs = (t) => {
30
- const e = A(10);
31
- let n, s;
29
+ defaultProps: Rs
30
+ }), Es = (t) => {
31
+ const e = C(10);
32
+ let n, o;
32
33
  e[0] !== t ? ({
33
34
  children: n,
34
- ...s
35
- } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
35
+ ...o
36
+ } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
36
37
  const {
37
- contentRef: o,
38
+ contentRef: s,
38
39
  scrollRef: r
39
- } = Ge(), i = r, l = o;
40
- let a, u;
40
+ } = et(), i = r, l = s;
41
+ let a, c;
41
42
  e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
42
43
  zIndex: 2
43
- }, u = {
44
+ }, c = {
44
45
  py: "sm",
45
46
  "aria-live": "polite",
46
47
  role: "list"
47
- }, e[3] = a, e[4] = u) : (a = e[3], u = e[4]);
48
+ }, e[3] = a, e[4] = c) : (a = e[3], c = e[4]);
48
49
  let d;
49
- return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ c(Ye, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
50
- }, Ms = {
50
+ return e[5] !== n || e[6] !== o || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ u(tt, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: c, children: n }), e[5] = n, e[6] = o, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
51
+ }, Ds = {
51
52
  axis: "horizontal",
52
53
  bottom: "md",
53
54
  zIndex: 2
54
- }, Ps = (t) => {
55
- const e = A(4), {
55
+ }, Bs = (t) => {
56
+ const e = C(4), {
56
57
  isAtBottom: n,
57
- scrollToBottom: s
58
- } = Ge();
59
- let o;
60
- return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ c(zn, { ...Ms, children: /* @__PURE__ */ c(Pe, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ c(Kn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
61
- }, pt = {
62
- Root: Rs,
63
- Viewport: vs,
64
- ScrollToBottom: Ps
65
- }, Es = qn({
58
+ scrollToBottom: o
59
+ } = et();
60
+ let s;
61
+ return e[0] !== n || e[1] !== t || e[2] !== o ? (s = !n && /* @__PURE__ */ u(Wn, { ...Ds, children: /* @__PURE__ */ u(Pe, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ u(Yn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = s) : s = e[3], s;
62
+ }, gt = {
63
+ Root: Ps,
64
+ Viewport: Es,
65
+ ScrollToBottom: Bs
66
+ }, Fs = Nn({
66
67
  className: "ai-message",
67
68
  slots: ["root", "content"],
68
69
  base: {
@@ -169,102 +170,102 @@ const _s = {
169
170
  shape: "rounded"
170
171
  }
171
172
  }), {
172
- withProvider: Ds,
173
- withContext: Bs
174
- } = Qn({
175
- recipe: Es
176
- }), Fs = Ds("div", "root"), Ls = Bs("div", "content"), ge = {
177
- Root: Fs,
178
- Content: Ls
179
- }, $s = (t) => {
173
+ withProvider: Ls,
174
+ withContext: $s
175
+ } = Hn({
176
+ recipe: Fs
177
+ }), Os = Ls("div", "root"), zs = $s("div", "content"), be = {
178
+ Root: Os,
179
+ Content: zs
180
+ }, Qs = (t) => {
180
181
  if (t == null) return null;
181
182
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
182
183
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
183
- }, bl = (t) => {
184
- const e = A(19), {
184
+ }, kl = (t) => {
185
+ const e = C(19), {
185
186
  toolName: n,
186
- toolInput: s,
187
- onApprove: o,
187
+ toolInput: o,
188
+ onApprove: s,
188
189
  onDeny: r
189
190
  } = t;
190
191
  let i;
191
- e[0] !== s ? (i = $s(s), e[0] = s, e[1] = i) : i = e[1];
192
+ e[0] !== o ? (i = Qs(o), e[0] = o, e[1] = i) : i = e[1];
192
193
  const l = i;
193
194
  let a;
194
195
  e[2] !== n ? (a = /* @__PURE__ */ k(U, { textStyle: "label/S/medium", color: "fg", children: [
195
196
  "Allow ",
196
- /* @__PURE__ */ c(Bt, { size: "sm", children: n }),
197
+ /* @__PURE__ */ u(Lt, { size: "sm", children: n }),
197
198
  "?"
198
199
  ] }), e[2] = n, e[3] = a) : a = e[3];
199
- let u;
200
- e[4] !== l ? (u = l ? /* @__PURE__ */ c(Ye, { maxH: "6rem", children: /* @__PURE__ */ c(Bt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
200
+ let c;
201
+ e[4] !== l ? (c = l ? /* @__PURE__ */ u(tt, { maxH: "6rem", children: /* @__PURE__ */ u(Lt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = c) : c = e[5];
201
202
  let d;
202
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(Xn, { size: 14 }), e[6] = d) : d = e[6];
203
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ u(Jn, { size: 14 }), e[6] = d) : d = e[6];
203
204
  let f;
204
- e[7] !== r ? (f = /* @__PURE__ */ k(Oe, { size: "xs", variant: "outline", onClick: r, children: [
205
+ e[7] !== r ? (f = /* @__PURE__ */ k(Qe, { size: "xs", variant: "outline", onClick: r, children: [
205
206
  d,
206
207
  "Deny"
207
208
  ] }), e[7] = r, e[8] = f) : f = e[8];
208
- let p;
209
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ c(Gn, { size: 14 }), e[9] = p) : p = e[9];
210
209
  let m;
211
- e[10] !== o ? (m = /* @__PURE__ */ k(Oe, { size: "xs", colorPalette: "green", onClick: o, children: [
212
- p,
210
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ u(Zn, { size: 14 }), e[9] = m) : m = e[9];
211
+ let p;
212
+ e[10] !== s ? (p = /* @__PURE__ */ k(Qe, { size: "xs", colorPalette: "green", onClick: s, children: [
213
+ m,
213
214
  "Allow"
214
- ] }), e[10] = o, e[11] = m) : m = e[11];
215
+ ] }), e[10] = s, e[11] = p) : p = e[11];
215
216
  let h;
216
- e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ k(Z, { gap: "xs", justifyContent: "flex-end", children: [
217
+ e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ k(oe, { gap: "xs", justifyContent: "flex-end", children: [
217
218
  f,
218
- m
219
- ] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
219
+ p
220
+ ] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
220
221
  let g;
221
- return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ c(P, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(be, { direction: "column", gap: "xs", children: [
222
+ return e[15] !== a || e[16] !== c || e[17] !== h ? (g = /* @__PURE__ */ u(D, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(ye, { direction: "column", gap: "xs", children: [
222
223
  a,
223
- u,
224
+ c,
224
225
  h
225
- ] }) }), e[15] = a, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
226
- }, Os = "md", zs = "neutral", yl = (t) => {
227
- const e = A(17), {
226
+ ] }) }), e[15] = a, e[16] = c, e[17] = h, e[18] = g) : g = e[18], g;
227
+ }, qs = "md", Ws = "neutral", Il = (t) => {
228
+ const e = C(17), {
228
229
  attachments: n,
229
- onSelect: s,
230
- onRemove: o,
230
+ onSelect: o,
231
+ onRemove: s,
231
232
  renderBadge: r,
232
233
  size: i,
233
234
  tone: l
234
235
  } = t;
235
236
  let a;
236
237
  e[0] !== n ? (a = n === void 0 ? [] : n, e[0] = n, e[1] = a) : a = e[1];
237
- const u = a, d = i === void 0 ? Os : i, f = l === void 0 ? zs : l;
238
- if (u.length === 0)
238
+ const c = a, d = i === void 0 ? qs : i, f = l === void 0 ? Ws : l;
239
+ if (c.length === 0)
239
240
  return null;
240
- let p;
241
- if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
241
+ let m;
242
+ if (e[2] !== c || e[3] !== s || e[4] !== o || e[5] !== r || e[6] !== d || e[7] !== f) {
242
243
  let h;
243
- e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
244
- const b = s ? () => s(g) : void 0, x = o ? () => o(g) : void 0;
244
+ e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
245
+ const b = o ? () => o(g) : void 0, y = s ? () => s(g) : void 0;
245
246
  if (r) {
246
- const y = r({
247
+ const x = r({
247
248
  attachmentId: g,
248
249
  onSelect: b,
249
- onRemove: x,
250
+ onRemove: y,
250
251
  size: d,
251
252
  tone: f
252
253
  });
253
- return /* @__PURE__ */ c(ys, { children: y }, g);
254
+ return /* @__PURE__ */ u(ws, { children: x }, g);
254
255
  }
255
- return /* @__PURE__ */ c(It, { fileName: g, onSelect: b, onRemove: x, size: d, tone: f }, g);
256
- }, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], p = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = p;
256
+ return /* @__PURE__ */ u(Mt, { fileName: g, onSelect: b, onRemove: y, size: d, tone: f }, g);
257
+ }, e[9] = s, e[10] = o, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = c.map(h), e[2] = c, e[3] = s, e[4] = o, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
257
258
  } else
258
- p = e[8];
259
- let m;
260
- return e[15] !== p ? (m = /* @__PURE__ */ c(j, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: p }), e[15] = p, e[16] = m) : m = e[16], m;
261
- }, Qs = (t) => {
259
+ m = e[8];
260
+ let p;
261
+ return e[15] !== m ? (p = /* @__PURE__ */ u(X, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
262
+ }, Hs = (t) => {
262
263
  const {
263
264
  previousUserMessageCount: e,
264
265
  userMessageCount: n
265
266
  } = t;
266
267
  return e === 0 ? !1 : n > e;
267
- }, qs = (t) => {
268
+ }, Ns = (t) => {
268
269
  const e = t.conversationKey ?? null;
269
270
  return t.state.conversationKey !== e ? {
270
271
  shouldScroll: !1,
@@ -273,7 +274,7 @@ const _s = {
273
274
  userMessageCount: t.userMessageCount
274
275
  }
275
276
  } : {
276
- shouldScroll: Qs({
277
+ shouldScroll: Hs({
277
278
  previousUserMessageCount: t.state.userMessageCount,
278
279
  userMessageCount: t.userMessageCount
279
280
  }),
@@ -282,56 +283,56 @@ const _s = {
282
283
  userMessageCount: Math.max(t.state.userMessageCount, t.userMessageCount)
283
284
  }
284
285
  };
285
- }, Ws = (t) => {
286
- const e = qs(t);
286
+ }, Vs = (t) => {
287
+ const e = Ns(t);
287
288
  return e.shouldScroll && t.scrollToBottom("instant"), e;
288
289
  };
289
- function Hs(t) {
290
- const e = A(8), {
290
+ function Us(t) {
291
+ const e = C(8), {
291
292
  conversationKey: n,
292
- userMessageCount: s
293
+ userMessageCount: o
293
294
  } = t, {
294
- scrollToBottom: o
295
- } = Ge(), r = n ?? null;
295
+ scrollToBottom: s
296
+ } = et(), r = n ?? null;
296
297
  let i;
297
- e[0] !== r || e[1] !== s ? (i = {
298
+ e[0] !== r || e[1] !== o ? (i = {
298
299
  conversationKey: r,
299
- userMessageCount: s
300
- }, e[0] = r, e[1] = s, e[2] = i) : i = e[2];
301
- const l = ie(i);
302
- let a, u;
303
- return e[3] !== n || e[4] !== o || e[5] !== s ? (a = () => {
304
- const d = Ws({
300
+ userMessageCount: o
301
+ }, e[0] = r, e[1] = o, e[2] = i) : i = e[2];
302
+ const l = J(i);
303
+ let a, c;
304
+ return e[3] !== n || e[4] !== s || e[5] !== o ? (a = () => {
305
+ const d = Vs({
305
306
  state: l.current,
306
307
  conversationKey: n,
307
- userMessageCount: s,
308
- scrollToBottom: o
308
+ userMessageCount: o,
309
+ scrollToBottom: s
309
310
  });
310
311
  l.current = d.state;
311
- }, u = [n, s, o], e[3] = n, e[4] = o, e[5] = s, e[6] = a, e[7] = u) : (a = e[6], u = e[7]), J(a, u), null;
312
+ }, c = [n, o, s], e[3] = n, e[4] = s, e[5] = o, e[6] = a, e[7] = c) : (a = e[6], c = e[7]), Z(a, c), null;
312
313
  }
313
- const ln = (t) => t.trim().length > 0, Vs = (t) => {
314
+ const cn = (t) => t.trim().length > 0, js = (t) => {
314
315
  const {
315
316
  canSubmit: e,
316
317
  isDisabled: n,
317
- text: s
318
+ text: o
318
319
  } = t;
319
- return n || !e || !ln(s) ? "none" : "submit";
320
- }, Ns = (t) => {
320
+ return n || !e || !cn(o) ? "none" : "submit";
321
+ }, Ks = (t) => {
321
322
  const {
322
323
  canInterrupt: e,
323
324
  canSubmit: n,
324
- hasQuestionPrompt: s,
325
- isDisabled: o,
325
+ hasQuestionPrompt: o,
326
+ isDisabled: s,
326
327
  streaming: r,
327
328
  text: i
328
329
  } = t;
329
- return o ? "none" : n && ln(i) ? "submit" : r && !s && e ? "interrupt" : "none";
330
- }, an = 200, Us = (t, e = an) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, js = (t) => {
330
+ return s ? "none" : n && cn(i) ? "submit" : r && !o && e ? "interrupt" : "none";
331
+ }, un = 200, Xs = (t, e = un) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Gs = (t) => {
331
332
  const {
332
333
  onAttachFiles: e,
333
334
  onAttachText: n,
334
- textAttachmentPasteLineThreshold: s
335
+ textAttachmentPasteLineThreshold: o
335
336
  } = t;
336
337
  return {
337
338
  onDragOver: (l) => {
@@ -347,467 +348,547 @@ const ln = (t) => t.trim().length > 0, Vs = (t) => {
347
348
  l.preventDefault(), e(a);
348
349
  return;
349
350
  }
350
- const u = l.clipboardData.getData("text/plain");
351
- n && Us(u, s) && (l.preventDefault(), n(u));
351
+ const c = l.clipboardData.getData("text/plain");
352
+ n && Xs(c, o) && (l.preventDefault(), n(c));
352
353
  }
353
354
  };
354
- }, Ks = (t) => {
355
+ }, Ys = (t) => {
355
356
  t.preventDefault();
356
- }, cn = (t) => {
357
- const e = A(7), {
357
+ }, dn = (t) => {
358
+ const e = C(7), {
358
359
  option: n
359
360
  } = t;
360
- let s;
361
- e[0] !== n.label ? (s = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
362
361
  let o;
363
- e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
362
+ e[0] !== n.label ? (o = /* @__PURE__ */ u(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
363
+ let s;
364
+ e[2] !== n.description ? (s = n.description ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = s) : s = e[3];
364
365
  let r;
365
- return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(j, { gap: "0", minWidth: "0", children: [
366
- s,
367
- o
368
- ] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
369
- }, Xs = (t) => {
370
- const e = A(12), {
366
+ return e[4] !== o || e[5] !== s ? (r = /* @__PURE__ */ k(X, { gap: "0", minWidth: "0", children: [
367
+ o,
368
+ s
369
+ ] }), e[4] = o, e[5] = s, e[6] = r) : r = e[6], r;
370
+ }, Js = (t) => {
371
+ const e = C(12), {
371
372
  option: n,
372
- name: s,
373
- checked: o,
373
+ name: o,
374
+ checked: s,
374
375
  editable: r,
375
376
  onToggle: i
376
377
  } = t, l = !r, a = r ? void 0 : "true";
377
- let u;
378
- e[0] !== r ? (u = r ? void 0 : {
378
+ let c;
379
+ e[0] !== r ? (c = r ? void 0 : {
379
380
  tabIndex: -1
380
- }, e[0] = r, e[1] = u) : u = e[1];
381
+ }, e[0] = r, e[1] = c) : c = e[1];
381
382
  const d = r ? i : void 0;
382
383
  let f;
383
- e[2] !== n ? (f = /* @__PURE__ */ c(cn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
384
- let p;
385
- return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== d || e[10] !== f ? (p = /* @__PURE__ */ c(on, { name: s, checked: o, readOnly: l, "aria-readonly": a, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = a, e[8] = u, e[9] = d, e[10] = f, e[11] = p) : p = e[11], p;
386
- }, Gs = (t) => {
387
- const e = A(17), {
384
+ e[2] !== n ? (f = /* @__PURE__ */ u(dn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
385
+ let m;
386
+ return e[4] !== s || e[5] !== o || e[6] !== l || e[7] !== a || e[8] !== c || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ u(ln, { name: o, checked: s, readOnly: l, "aria-readonly": a, inputProps: c, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = s, e[5] = o, e[6] = l, e[7] = a, e[8] = c, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
387
+ }, Zs = (t) => {
388
+ const e = C(17), {
388
389
  question: n,
389
- questionIndex: s,
390
- name: o,
390
+ questionIndex: o,
391
+ name: s,
391
392
  selectedOption: r,
392
393
  editable: i,
393
394
  onToggleOption: l
394
- } = t, a = r ?? null, u = !i, d = i ? void 0 : "true";
395
+ } = t, a = r ?? null, c = !i, d = i ? void 0 : "true";
395
396
  let f;
396
- e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
397
- h.value && l?.(n, s, h.value);
398
- } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
399
- let p;
397
+ e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== o ? (f = i ? (h) => {
398
+ h.value && l?.(n, o, h.value);
399
+ } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = o, e[4] = f) : f = e[4];
400
+ let m;
400
401
  if (e[5] !== i || e[6] !== n.options) {
401
402
  let h;
402
- e[8] !== i ? (h = (g) => /* @__PURE__ */ c(ws, { value: g.label, inputProps: i ? void 0 : {
403
+ e[8] !== i ? (h = (g) => /* @__PURE__ */ u(Cs, { value: g.label, inputProps: i ? void 0 : {
403
404
  tabIndex: -1
404
- }, alignItems: "flex-start", children: /* @__PURE__ */ c(cn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], p = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = p;
405
+ }, alignItems: "flex-start", children: /* @__PURE__ */ u(dn, { 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;
405
406
  } else
406
- p = e[7];
407
- let m;
408
- return e[10] !== o || e[11] !== a || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== p ? (m = /* @__PURE__ */ c(Ts, { name: o, value: a, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: p }), e[10] = o, e[11] = a, e[12] = u, e[13] = d, e[14] = f, e[15] = p, e[16] = m) : m = e[16], m;
409
- }, Ys = (t) => {
410
- const e = A(4), {
407
+ m = e[7];
408
+ let p;
409
+ return e[10] !== s || e[11] !== a || e[12] !== c || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ u(ks, { name: s, value: a, readOnly: c, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = s, e[11] = a, e[12] = c, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
410
+ }, eo = (t) => {
411
+ const e = C(4), {
411
412
  items: n
412
413
  } = t;
413
- let s;
414
- e[0] !== n ? (s = n.map(Js), e[0] = n, e[1] = s) : s = e[1];
415
414
  let o;
416
- return e[2] !== s ? (o = /* @__PURE__ */ c(j, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
417
- }, un = (t) => {
418
- const e = A(19), {
415
+ e[0] !== n ? (o = n.map(to), e[0] = n, e[1] = o) : o = e[1];
416
+ let s;
417
+ return e[2] !== o ? (s = /* @__PURE__ */ u(X, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: o }), e[2] = o, e[3] = s) : s = e[3], s;
418
+ }, fn = (t) => {
419
+ const e = C(19), {
419
420
  questions: n,
420
- editable: s,
421
- selectedOptionsByQuestion: o,
421
+ editable: o,
422
+ selectedOptionsByQuestion: s,
422
423
  customAnswersByQuestion: r,
423
424
  onToggleOption: i,
424
425
  onCustomAnswerChange: l
425
- } = t, a = s === void 0 ? !1 : s;
426
- let u;
427
- e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
428
- const d = u;
426
+ } = t, a = o === void 0 ? !1 : o;
427
+ let c;
428
+ e[0] !== s ? (c = s === void 0 ? {} : s, e[0] = s, e[1] = c) : c = e[1];
429
+ const d = c;
429
430
  let f;
430
431
  e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
431
- const p = f;
432
- let m;
433
- if (e[4] !== p || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
432
+ const m = f;
433
+ let p;
434
+ if (e[4] !== m || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
434
435
  let g;
435
- e[11] !== p || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, x) => {
436
- const y = b.id ?? `question-${x}`, T = b.multiple ? "checkbox" : "radio", S = d[y] ?? [];
437
- return /* @__PURE__ */ k(j, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
438
- /* @__PURE__ */ c(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
439
- T === "radio" ? /* @__PURE__ */ c(Gs, { question: b, questionIndex: x, name: y, selectedOption: S[0], editable: a, onToggleOption: i }) : b.options.map((w) => /* @__PURE__ */ c(Xs, { option: w, name: y, checked: S.includes(w.label), editable: a, onToggle: () => i?.(b, x, w.label) }, w.label)),
440
- b.allowCustomAnswer ? /* @__PURE__ */ c(Wn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: p[y] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (w) => l?.(b, x, w.currentTarget.value) }) : null
441
- ] }, y);
442
- }, e[11] = p, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], m = n.map(g), e[4] = p, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = m;
436
+ e[11] !== m || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, y) => {
437
+ const x = b.id ?? `question-${y}`, S = b.multiple ? "checkbox" : "radio", A = d[x] ?? [];
438
+ return /* @__PURE__ */ k(X, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
439
+ /* @__PURE__ */ u(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
440
+ S === "radio" ? /* @__PURE__ */ u(Zs, { question: b, questionIndex: y, name: x, selectedOption: A[0], editable: a, onToggleOption: i }) : b.options.map((T) => /* @__PURE__ */ u(Js, { option: T, name: x, checked: A.includes(T.label), editable: a, onToggle: () => i?.(b, y, T.label) }, T.label)),
441
+ b.allowCustomAnswer ? /* @__PURE__ */ u(Vn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: m[x] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (T) => l?.(b, y, T.currentTarget.value) }) : null
442
+ ] }, x);
443
+ }, e[11] = m, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
443
444
  } else
444
- m = e[10];
445
+ p = e[10];
445
446
  let h;
446
- return e[17] !== m ? (h = /* @__PURE__ */ c(j, { as: "form", gap: "sm", onSubmit: Ks, "aria-label": "Question form", children: m }), e[17] = m, e[18] = h) : h = e[18], h;
447
+ return e[17] !== p ? (h = /* @__PURE__ */ u(X, { as: "form", gap: "sm", onSubmit: Ys, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
447
448
  };
448
- function Js(t, e) {
449
- return /* @__PURE__ */ c(P, { as: "li", children: /* @__PURE__ */ c(on, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
449
+ function to(t, e) {
450
+ return /* @__PURE__ */ u(D, { as: "li", children: /* @__PURE__ */ u(ln, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
450
451
  tabIndex: -1
451
- }, size: "xs", children: /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
452
+ }, size: "xs", children: /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
452
453
  }
453
- const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
454
- const o = le(e, n), r = t[o] ?? [], i = r.includes(s);
454
+ const de = (t, e) => t.id ?? `question-${e}`, no = (t, e, n, o) => {
455
+ const s = de(e, n), r = t[s] ?? [], i = r.includes(o);
455
456
  return e.multiple ? {
456
457
  ...t,
457
- [o]: i ? r.filter((l) => l !== s) : [...r, s]
458
+ [s]: i ? r.filter((l) => l !== o) : [...r, o]
458
459
  } : {
459
460
  ...t,
460
- [o]: i ? [] : [s]
461
+ [s]: i ? [] : [o]
461
462
  };
462
- }, bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
463
- id: le(e, n),
463
+ }, St = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
464
+ id: de(e, n),
464
465
  question: e.question,
465
466
  multiple: !!e.multiple,
466
467
  required: !!e.required,
467
468
  allowCustomAnswer: !!e.allowCustomAnswer,
468
- options: e.options.map((s) => ({
469
- label: s.label,
470
- description: s.description ?? ""
469
+ options: e.options.map((o) => ({
470
+ label: o.label,
471
+ description: o.description ?? ""
471
472
  }))
472
- }))) : "", eo = (t, e, n) => {
473
- const s = [];
474
- for (let o = 0; o < t.questions.length; o += 1) {
475
- const r = t.questions[o], i = le(r, o), l = e[i] ?? [], a = n[i]?.trim(), u = a ? [...l, a] : l;
476
- u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
473
+ }))) : "", so = (t, e, n) => {
474
+ const o = [];
475
+ for (let s = 0; s < t.questions.length; s += 1) {
476
+ const r = t.questions[s], i = de(r, s), l = e[i] ?? [], a = n[i]?.trim(), c = a ? [...l, a] : l;
477
+ c.length !== 0 && o.push(`${r.question}: ${c.join(", ")}`);
477
478
  }
478
- return s;
479
- }, to = (t) => typeof t != "string", _t = (t, e) => {
480
- if (to(e)) return e;
479
+ return o;
480
+ }, oo = (t) => typeof t != "string", Rt = (t, e) => {
481
+ if (oo(e)) return e;
481
482
  const n = e.trim();
482
483
  if (n.length === 0) return {};
483
- const s = {};
484
- for (let o = 0; o < t.questions.length; o += 1) {
485
- const r = t.questions[o];
486
- r.allowCustomAnswer && (s[le(r, o)] = n);
484
+ const o = {};
485
+ for (let s = 0; s < t.questions.length; s += 1) {
486
+ const r = t.questions[s];
487
+ r.allowCustomAnswer && (o[de(r, s)] = n);
487
488
  }
488
- return s;
489
- }, no = (t, e, n) => {
489
+ return o;
490
+ }, ro = (t, e, n) => {
490
491
  if (!t) return typeof n == "string" ? n.trim() : "";
491
- const s = _t(t, n), o = eo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
492
- return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
492
+ const o = Rt(t, n), s = so(t, e, o), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
493
+ return r.length > 0 && !i && s.push(`Additional response: ${r}`), s.join(`
493
494
  `);
494
- }, so = (t, e, n) => {
495
- const s = _t(t, n);
496
- return t.questions.map((o, r) => {
497
- const i = le(o, r), l = e[i] ?? [], a = s[i]?.trim();
495
+ }, io = (t, e, n) => {
496
+ const o = Rt(t, n);
497
+ return t.questions.map((s, r) => {
498
+ const i = de(s, r), l = e[i] ?? [], a = o[i]?.trim();
498
499
  return a ? [...l, a] : l;
499
500
  });
500
- }, oo = (t, e, n) => {
501
+ }, lo = (t, e, n) => {
501
502
  if (!t) return !1;
502
- const s = _t(t, n);
503
- for (let o = 0; o < t.questions.length; o += 1) {
504
- const r = t.questions[o];
503
+ const o = Rt(t, n);
504
+ for (let s = 0; s < t.questions.length; s += 1) {
505
+ const r = t.questions[s];
505
506
  if (!r.required) continue;
506
- const i = le(r, o);
507
- if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
507
+ const i = de(r, s);
508
+ if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && o[i]?.trim()))
508
509
  return !0;
509
510
  }
510
511
  return !1;
511
- }, ro = (t) => t.questions.map((e, n) => ({
512
- id: le(e, n),
512
+ }, ao = (t) => t.questions.map((e, n) => ({
513
+ id: de(e, n),
513
514
  question: e.question,
514
515
  options: e.options,
515
516
  multiple: !!e.multiple,
516
517
  required: !!e.required,
517
518
  allowCustomAnswer: !!e.allowCustomAnswer
518
- })), io = (t, e, n, s) => {
519
- const o = le(t, e);
520
- return (n[o] ?? []).length > 0 || !!s[o]?.trim();
521
- }, lo = (t) => {
522
- const e = A(22), {
519
+ })), co = (t, e, n, o) => {
520
+ const s = de(t, e);
521
+ return (n[s] ?? []).length > 0 || !!o[s]?.trim();
522
+ }, uo = (t) => {
523
+ const e = C(22), {
523
524
  question: n,
524
- sourceQuestion: s,
525
- questionIndex: o,
525
+ sourceQuestion: o,
526
+ questionIndex: s,
526
527
  isActive: r,
527
528
  selectedOptionsByQuestion: i,
528
529
  customAnswersByQuestion: l,
529
530
  onSelectStep: a
530
531
  } = t;
531
- let u;
532
- e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = io(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
533
- const d = u, f = d ? "answered" : "not answered", p = r ? "outline" : "ghost", m = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
532
+ let c;
533
+ e[0] !== l || e[1] !== s || e[2] !== i || e[3] !== o ? (c = co(o, s, i, l), e[0] = l, e[1] = s, e[2] = i, e[3] = o, e[4] = c) : c = e[4];
534
+ const d = c, 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}`;
534
535
  let b;
535
- e[5] !== a || e[6] !== o ? (b = () => a(o), e[5] = a, e[6] = o, e[7] = b) : b = e[7];
536
- let x;
537
- e[8] !== d || e[9] !== o ? (x = d ? /* @__PURE__ */ c(en, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = x) : x = e[10];
536
+ e[5] !== a || e[6] !== s ? (b = () => a(s), e[5] = a, e[6] = s, e[7] = b) : b = e[7];
538
537
  let y;
539
- e[11] !== r || e[12] !== m || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== x || e[17] !== p ? (y = /* @__PURE__ */ c(Oe, { id: m, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: p, minW: "8", onClick: b, children: x }), e[11] = r, e[12] = m, e[13] = h, e[14] = g, e[15] = b, e[16] = x, e[17] = p, e[18] = y) : y = e[18];
540
- let T;
541
- return e[19] !== n.question || e[20] !== y ? (T = /* @__PURE__ */ c(Ct, { content: n.question, children: y }), e[19] = n.question, e[20] = y, e[21] = T) : T = e[21], T;
542
- }, ao = (t) => {
543
- const e = A(31), {
538
+ e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ u(nn, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
539
+ let x;
540
+ e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (x = /* @__PURE__ */ u(Qe, { 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] = x) : x = e[18];
541
+ let S;
542
+ return e[19] !== n.question || e[20] !== x ? (S = /* @__PURE__ */ u(vt, { content: n.question, children: x }), e[19] = n.question, e[20] = x, e[21] = S) : S = e[21], S;
543
+ }, fo = (t) => {
544
+ const e = C(31), {
544
545
  questionPrompt: n,
545
- selectedOptionsByQuestion: s,
546
- customAnswersByQuestion: o,
546
+ selectedOptionsByQuestion: o,
547
+ customAnswersByQuestion: s,
547
548
  onToggleOption: r,
548
549
  onCustomAnswerChange: i
549
550
  } = t, {
550
551
  questions: l
551
- } = t, [a, u] = V(0), d = Math.min(a, l.length - 1), f = l[d], p = l.length > 1;
552
- let m;
553
- e[0] !== o || e[1] !== p || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (m = p ? /* @__PURE__ */ c(Z, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((_, R) => /* @__PURE__ */ c(lo, { question: _, sourceQuestion: n.questions[R], questionIndex: R, isActive: R === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, _.id)) }) : null, e[0] = o, e[1] = p, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = m) : m = e[6];
554
- const h = `question-step-panel-${f.id}`, g = p ? "tabpanel" : void 0, b = p ? `question-step-tab-${f.id}` : void 0;
555
- let x;
556
- e[7] !== f ? (x = [f], e[7] = f, e[8] = x) : x = e[8];
552
+ } = t, [a, c] = W(0), d = Math.min(a, l.length - 1), f = l[d], m = l.length > 1;
553
+ let p;
554
+ e[0] !== s || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== o ? (p = m ? /* @__PURE__ */ u(oe, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((I, _) => /* @__PURE__ */ u(uo, { question: I, sourceQuestion: n.questions[_], questionIndex: _, isActive: _ === d, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: c }, I.id)) }) : null, e[0] = s, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = o, e[6] = p) : p = e[6];
555
+ const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${f.id}` : void 0;
557
556
  let y;
558
- e[9] !== r || e[10] !== n.questions || e[11] !== d ? (y = (_, R, L) => {
559
- r(n.questions[d], d, L);
560
- }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = y) : y = e[12];
561
- let T;
562
- e[13] !== i || e[14] !== n.questions || e[15] !== d ? (T = (_, R, L) => {
563
- i(n.questions[d], d, L);
564
- }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = T) : T = e[16];
557
+ e[7] !== f ? (y = [f], e[7] = f, e[8] = y) : y = e[8];
558
+ let x;
559
+ e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (I, _, P) => {
560
+ r(n.questions[d], d, P);
561
+ }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = x) : x = e[12];
565
562
  let S;
566
- e[17] !== o || e[18] !== s || e[19] !== x || e[20] !== y || e[21] !== T ? (S = /* @__PURE__ */ c(un, { questions: x, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: y, onCustomAnswerChange: T }), e[17] = o, e[18] = s, e[19] = x, e[20] = y, e[21] = T, e[22] = S) : S = e[22];
563
+ e[13] !== i || e[14] !== n.questions || e[15] !== d ? (S = (I, _, P) => {
564
+ i(n.questions[d], d, P);
565
+ }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = S) : S = e[16];
566
+ let A;
567
+ e[17] !== s || e[18] !== o || e[19] !== y || e[20] !== x || e[21] !== S ? (A = /* @__PURE__ */ u(fn, { questions: y, editable: !0, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onToggleOption: x, onCustomAnswerChange: S }), e[17] = s, e[18] = o, e[19] = y, e[20] = x, e[21] = S, e[22] = A) : A = e[22];
568
+ let T;
569
+ e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== A ? (T = /* @__PURE__ */ u(X, { 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] = T) : T = e[27];
567
570
  let w;
568
- e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== S ? (w = /* @__PURE__ */ c(j, { id: h, role: g, "aria-labelledby": b, gap: "0", children: S }), e[23] = h, e[24] = g, e[25] = b, e[26] = S, e[27] = w) : w = e[27];
569
- let C;
570
- return e[28] !== m || e[29] !== w ? (C = /* @__PURE__ */ k(j, { gap: "xs", pb: "sm", children: [
571
- m,
572
- w
573
- ] }), e[28] = m, e[29] = w, e[30] = C) : C = e[30], C;
574
- }, co = (t) => {
575
- const e = A(8), {
571
+ return e[28] !== p || e[29] !== T ? (w = /* @__PURE__ */ k(X, { gap: "xs", pb: "sm", children: [
572
+ p,
573
+ T
574
+ ] }), e[28] = p, e[29] = T, e[30] = w) : w = e[30], w;
575
+ }, po = (t) => {
576
+ const e = C(8), {
576
577
  questionPrompt: n
577
578
  } = t;
578
- let s;
579
- e[0] !== n ? (s = ro(n), e[0] = n, e[1] = s) : s = e[1];
580
- const o = s;
579
+ let o;
580
+ e[0] !== n ? (o = ao(n), e[0] = n, e[1] = o) : o = e[1];
581
+ const s = o;
581
582
  let r;
582
- e[2] !== n ? (r = bt(n), e[2] = n, e[3] = r) : r = e[3];
583
+ e[2] !== n ? (r = St(n), e[2] = n, e[3] = r) : r = e[3];
583
584
  const i = r;
584
585
  let l;
585
- return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ c(ao, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
586
- }, Lt = "7", uo = (t) => {
587
- const e = A(22);
588
- let n, s, o, r;
586
+ return e[4] !== t || e[5] !== i || e[6] !== s ? (l = /* @__PURE__ */ u(fo, { ...t, questions: s }, i), e[4] = t, e[5] = i, e[6] = s, e[7] = l) : l = e[7], l;
587
+ }, Ot = "7", mo = (t) => {
588
+ const e = C(22);
589
+ let n, o, s, r;
589
590
  e[0] !== t ? ({
590
591
  title: r,
591
- shortcut: o,
592
+ shortcut: s,
592
593
  canInterrupt: n,
593
- ...s
594
- } = 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]);
595
- const i = s["aria-label"] ?? r;
594
+ ...o
595
+ } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = s, e[4] = r) : (n = e[1], o = e[2], s = e[3], r = e[4]);
596
+ const i = o["aria-label"] ?? r;
596
597
  let l;
597
- e[5] !== n ? (l = n ? /* @__PURE__ */ c(Yn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ c(Jn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
598
+ e[5] !== n ? (l = n ? /* @__PURE__ */ u(es, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ u(ts, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
598
599
  const a = l;
599
- let u;
600
- e[7] !== i || e[8] !== a || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ c(Pe, { "data-testid": "send-message-button", size: "xs", variant: "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];
601
- const d = u;
600
+ let c;
601
+ e[7] !== i || e[8] !== a || e[9] !== o || e[10] !== r ? (c = /* @__PURE__ */ u(Pe, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...o, children: a }), e[7] = i, e[8] = a, e[9] = o, e[10] = r, e[11] = c) : c = e[11];
602
+ const d = c;
602
603
  if (r) {
603
604
  let f;
604
- e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(At, { children: [
605
+ e[12] !== s || e[13] !== r ? (f = s ? /* @__PURE__ */ k(It, { children: [
605
606
  r,
606
607
  " ",
607
- /* @__PURE__ */ c(Hn, { fontSize: "xs", children: o })
608
- ] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
609
- const p = f;
610
- let m;
611
- e[15] !== d ? (m = /* @__PURE__ */ c(Ke.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = m) : m = e[16];
608
+ /* @__PURE__ */ u(Un, { fontSize: "xs", children: s })
609
+ ] }) : r, e[12] = s, e[13] = r, e[14] = f) : f = e[14];
610
+ const m = f;
611
+ let p;
612
+ e[15] !== d ? (p = /* @__PURE__ */ u(Je.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
612
613
  let h;
613
- e[17] !== p ? (h = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(Ke.Positioner, { children: /* @__PURE__ */ c(Ke.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
614
+ e[17] !== m ? (h = /* @__PURE__ */ u(Zt, { children: /* @__PURE__ */ u(Je.Positioner, { children: /* @__PURE__ */ u(Je.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
614
615
  let g;
615
- return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ k(Ke.Root, { closeDelay: 50, openDelay: 100, children: [
616
- m,
616
+ return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(Je.Root, { closeDelay: 50, openDelay: 100, children: [
617
+ p,
617
618
  h
618
- ] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
619
+ ] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
619
620
  }
620
621
  return d;
621
- }, fo = (t) => {
622
- const e = A(2), {
622
+ }, pn = 10, ho = (t) => {
623
+ const e = [];
624
+ for (let n = t.length - 1; n >= 0 && e.length < pn; n--) {
625
+ const o = t[n];
626
+ if (o.role !== "user") continue;
627
+ const s = o.parts.flatMap((r) => r.type === "text" ? [r.text] : []).join("");
628
+ s.trim() && e.push(s);
629
+ }
630
+ return e;
631
+ }, go = (t, e, n, o) => o === 0 ? null : t === null ? e === "previous" && n === "" ? {
632
+ index: 0
633
+ } : null : e === "previous" ? {
634
+ index: Math.min(t + 1, o - 1)
635
+ } : {
636
+ index: t === 0 ? null : t - 1
637
+ }, bo = (t) => {
638
+ const e = C(24), {
639
+ recentUserMessages: n,
640
+ text: o,
641
+ blocked: s,
642
+ resetKey: r,
643
+ onChange: i
644
+ } = t, l = J(null), a = J(null);
645
+ let c, d;
646
+ if (e[0] !== s || e[1] !== n || e[2] !== r) {
647
+ c = n.slice(0, pn);
648
+ const _ = JSON.stringify(c);
649
+ d = JSON.stringify([_, r, s]), e[0] = s, e[1] = n, e[2] = r, e[3] = c, e[4] = d;
650
+ } else
651
+ c = e[3], d = e[4];
652
+ const f = d, m = J(f);
653
+ let p, h;
654
+ e[5] !== f ? (p = () => {
655
+ m.current !== f && (m.current = f, a.current = null);
656
+ }, h = [f], e[5] = f, e[6] = p, e[7] = h) : (p = e[6], h = e[7]), Z(p, h);
657
+ let g;
658
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => {
659
+ a.current = null;
660
+ }, e[8] = g) : g = e[8];
661
+ const b = g;
662
+ let y;
663
+ e[9] !== i || e[10] !== c ? (y = (_) => {
664
+ a.current !== null && _ !== c[a.current] && b(), i(_);
665
+ }, e[9] = i, e[10] = c, e[11] = y) : y = e[11];
666
+ const x = y;
667
+ let S;
668
+ e[12] !== s || e[13] !== i || e[14] !== c || e[15] !== o ? (S = (_) => {
669
+ if (s)
670
+ return !1;
671
+ const P = go(a.current, _, o, c.length);
672
+ if (!P)
673
+ return !1;
674
+ a.current = P.index;
675
+ const M = P.index === null ? "" : c[P.index];
676
+ return l.current?.setEditorValue(M), i(M), !0;
677
+ }, e[12] = s, e[13] = i, e[14] = c, e[15] = o, e[16] = S) : S = e[16];
678
+ const A = S;
679
+ let T, w;
680
+ e[17] !== A ? (T = () => A("previous"), w = () => A("next"), e[17] = A, e[18] = T, e[19] = w) : (T = e[18], w = e[19]);
681
+ let I;
682
+ return e[20] !== x || e[21] !== T || e[22] !== w ? (I = {
683
+ editorRef: l,
684
+ reset: b,
685
+ change: x,
686
+ recallPrevious: T,
687
+ recallNext: w
688
+ }, e[20] = x, e[21] = T, e[22] = w, e[23] = I) : I = e[23], I;
689
+ }, yo = (t) => {
690
+ const e = C(2), {
623
691
  placeholder: n
624
692
  } = t;
625
693
  if (!n)
626
694
  return null;
627
- let s;
628
- return e[0] !== n ? (s = /* @__PURE__ */ c(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = s) : s = e[1], s;
629
- }, mt = "border.accent-light", yt = (t) => {
695
+ let o;
696
+ return e[0] !== n ? (o = /* @__PURE__ */ u(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = o) : o = e[1], o;
697
+ }, bt = "border.accent-light", wt = (t) => {
630
698
  const e = t?.querySelector('[contenteditable="true"]');
631
699
  e instanceof HTMLElement && e.focus();
632
- }, $t = (t, e) => requestAnimationFrame(() => {
633
- yt(t), e?.();
634
- }), po = (t) => {
700
+ }, zt = (t, e) => requestAnimationFrame(() => {
701
+ wt(t), e?.();
702
+ }), xo = (t, e, n, o) => {
703
+ const s = C(10);
704
+ let r, i;
705
+ s[0] !== e || s[1] !== t || s[2] !== o ? (r = () => {
706
+ if (!e)
707
+ return;
708
+ const c = zt(t.current, () => o(!0));
709
+ return () => cancelAnimationFrame(c);
710
+ }, i = [e, t, o], s[0] = e, s[1] = t, s[2] = o, s[3] = r, s[4] = i) : (r = s[3], i = s[4]), Z(r, i);
711
+ let l, a;
712
+ s[5] !== t || s[6] !== n || s[7] !== o ? (l = () => {
713
+ if (n === 0)
714
+ return;
715
+ const c = zt(t.current, () => o(!0));
716
+ return () => cancelAnimationFrame(c);
717
+ }, a = [n, t, o], s[5] = t, s[6] = n, s[7] = o, s[8] = l, s[9] = a) : (l = s[8], a = s[9]), Z(l, a);
718
+ }, So = (t) => {
635
719
  const {
636
720
  defaultState: e,
637
- onSubmit: n = () => {
721
+ recentUserMessages: n = [],
722
+ onSubmit: o = () => {
638
723
  },
639
724
  onInterrupt: s,
640
- onAttachFiles: o,
641
- onAttachText: r,
642
- textAttachmentPasteLineThreshold: i = an,
643
- streaming: l = !1,
644
- attachedResources: a = [],
645
- onClearAttachments: u,
646
- isDisabled: d = !1,
647
- submitDisabled: f = !1,
725
+ onAttachFiles: r,
726
+ onAttachText: i,
727
+ textAttachmentPasteLineThreshold: l = un,
728
+ streaming: a = !1,
729
+ attachedResources: c = [],
730
+ onClearAttachments: d,
731
+ isDisabled: f = !1,
732
+ submitDisabled: m = !1,
648
733
  onChange: p,
649
- placeholder: m,
650
- attachmentList: h,
651
- actions: g,
652
- attachedToTop: b = !1,
734
+ placeholder: h,
735
+ attachmentList: g,
736
+ actions: b,
737
+ attachedToTop: y = !1,
653
738
  recessed: x = !1,
654
- questionPrompt: y,
655
- autoFocus: T = !1,
656
- focusSignal: S = 0,
739
+ questionPrompt: S,
740
+ autoFocus: A = !1,
741
+ focusSignal: T = 0,
657
742
  submitTitle: w,
658
- references: C = [],
743
+ references: I = [],
659
744
  onAddReference: _
660
- } = t, R = x ? "border.subtle" : "border", [L, E] = V(!1), [Q, M] = V(!1), [D, B] = V(e), [$, O] = V(0), [F, z] = V(() => ft(e)), [v, W] = V({}), [H, K] = V({}), oe = ie(null), xe = ie(p), Se = ie(bt(y));
661
- J(() => {
662
- xe.current = p;
663
- }, [p]), J(() => {
664
- const q = ft(e);
665
- B(e), O((ne) => ne + 1), z(q), W({}), K({}), xe.current?.(q);
745
+ } = t, P = x ? "border.subtle" : "border", [M, z] = W(!1), [B, E] = W(!1), [F, L] = W(e), [$, O] = W(0), [H, R] = W(() => ht(e)), [q, V] = W({}), [j, K] = W({}), G = J(null), Se = J(p), re = J(St(S));
746
+ Z(() => {
747
+ Se.current = p;
748
+ }, [p]), Z(() => {
749
+ const Q = ht(e);
750
+ L(e), O((Y) => Y + 1), R(Q), V({}), K({}), Se.current?.(Q);
666
751
  }, [e]);
667
- const ee = bt(y);
668
- J(() => {
669
- Se.current !== ee && (Se.current = ee, W({}), K({}));
670
- }, [ee]), J(() => {
671
- if (!T) return;
672
- const q = $t(oe.current, () => M(!0));
673
- return () => cancelAnimationFrame(q);
674
- }, [T]), J(() => {
675
- if (S === 0) return;
676
- const q = $t(oe.current, () => M(!0));
677
- return () => cancelAnimationFrame(q);
678
- }, [S]);
679
- const Te = () => {
680
- M(!0), yt(oe.current);
681
- }, Be = (q = !1) => {
682
- B(e), O((se) => se + 1);
683
- const ne = ft(e);
684
- z(ne), W({}), K({}), xe.current?.(ne), q && requestAnimationFrame(() => {
685
- yt(oe.current);
752
+ const ie = St(S);
753
+ Z(() => {
754
+ re.current !== ie && (re.current = ie, V({}), K({}));
755
+ }, [ie]), xo(G, A, T, E);
756
+ const ee = bo({
757
+ recentUserMessages: n,
758
+ text: H,
759
+ blocked: f || M || !!S,
760
+ resetKey: JSON.stringify([e, $, ie]),
761
+ onChange: (Q) => {
762
+ R(Q), p?.(Q);
763
+ }
764
+ }), te = () => {
765
+ E(!0), wt(G.current);
766
+ }, ne = (Q = !1) => {
767
+ O((Y) => Y + 1), V({}), K({}), ee.reset(), ee.change(ht(e)), Q && requestAnimationFrame(() => {
768
+ wt(G.current);
686
769
  });
687
- }, X = y ? no(y, v, H) : F.trim(), G = oo(y, v, H), de = {
688
- canInterrupt: l && !y && !!s,
689
- canSubmit: !f,
690
- hasQuestionPrompt: !!y,
691
- isDisabled: d || L || G,
692
- streaming: l,
693
- text: X
694
- }, te = Ns(de), fe = l && !y ? "Queue message" : "Send message", Fe = async () => {
695
- if (!X) return;
696
- const q = y ? {
697
- answers: so(y, v, H)
770
+ }, le = S ? ro(S, q, j) : H.trim(), Te = lo(S, q, j), ae = {
771
+ canInterrupt: a && !S && !!s,
772
+ canSubmit: !m,
773
+ hasQuestionPrompt: !!S,
774
+ isDisabled: f || M || Te,
775
+ streaming: a,
776
+ text: le
777
+ }, ce = Ks(ae), Be = a && !S ? "Queue message" : "Send message", Fe = async () => {
778
+ if (!le) return;
779
+ const Q = S ? {
780
+ answers: io(S, q, j)
698
781
  } : void 0;
699
- E(!0);
782
+ ee.reset(), z(!0);
700
783
  try {
701
- await n(X, a, q), Be(!0), u?.();
784
+ await o(le, c, Q), ne(!0), d?.();
702
785
  } catch {
703
786
  } finally {
704
- E(!1);
787
+ z(!1);
705
788
  }
706
- }, Ae = (q) => {
707
- q === "interrupt" && s?.(), q === "submit" && Fe();
708
- }, we = js({
709
- onAttachFiles: o,
710
- onAttachText: r,
711
- textAttachmentPasteLineThreshold: i
712
- }), nt = (q, ne, se) => {
713
- W((pe) => Zs(pe, q, ne, se));
714
- }, st = (q, ne, se) => {
715
- const pe = le(q, ne);
716
- K((Dt) => ({
717
- ...Dt,
718
- [pe]: se
789
+ }, Ne = (Q) => {
790
+ Q === "interrupt" && s?.(), Q === "submit" && Fe();
791
+ }, Le = Gs({
792
+ onAttachFiles: r,
793
+ onAttachText: i,
794
+ textAttachmentPasteLineThreshold: l
795
+ }), it = (Q, Y, Ve) => {
796
+ V((we) => no(we, Q, Y, Ve));
797
+ }, lt = (Q, Y, Ve) => {
798
+ const we = de(Q, Y);
799
+ K(($e) => ({
800
+ ...$e,
801
+ [we]: Ve
719
802
  }));
720
803
  };
721
- return /* @__PURE__ */ c(P, { ref: oe, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: b ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: b ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: Q ? mt : R, zIndex: Q ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
722
- borderColor: Q ? mt : R,
804
+ return /* @__PURE__ */ u(D, { ref: G, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: y ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: y ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: B ? bt : P, zIndex: B ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
805
+ borderColor: B ? bt : P,
723
806
  zIndex: 1
724
807
  }, _focusWithin: {
725
- borderColor: mt,
808
+ borderColor: bt,
726
809
  zIndex: 1
727
- }, onPasteCapture: we.onPasteCapture, onDropCapture: we.onDropCapture, onDragOver: we.onDragOver, onClick: Te, onBlur: () => M(!1), children: /* @__PURE__ */ k(be, { direction: "column", color: "fg", gap: "xs", children: [
728
- h ? /* @__PURE__ */ c(P, { children: h }) : null,
729
- y ? /* @__PURE__ */ c(co, { questionPrompt: y, selectedOptionsByQuestion: v, customAnswersByQuestion: H, onToggleOption: nt, onCustomAnswerChange: st }) : (
810
+ }, onPasteCapture: Le.onPasteCapture, onDropCapture: Le.onDropCapture, onDragOver: Le.onDragOver, onClick: te, onBlur: () => E(!1), children: /* @__PURE__ */ k(ye, { direction: "column", color: "fg", gap: "xs", children: [
811
+ g ? /* @__PURE__ */ u(D, { children: g }) : null,
812
+ S ? /* @__PURE__ */ u(po, { questionPrompt: S, selectedOptionsByQuestion: q, customAnswersByQuestion: j, onToggleOption: it, onCustomAnswerChange: lt }) : (
730
813
  // The editor is its own composer row: it centres a single line at the shared
731
814
  // control height and grows with content, never shrinking below it, so the row
732
815
  // aligns with the toolbar beneath it.
733
- /* @__PURE__ */ c(Ye, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
816
+ /* @__PURE__ */ u(tt, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
734
817
  pr: "2xs"
735
- }, children: /* @__PURE__ */ c(be, { minH: Lt, align: "center", children: /* @__PURE__ */ c(xs, { defaultState: D, isEditable: !d && !L, placeholder: /* @__PURE__ */ c(fo, { placeholder: m }), onChange: (q) => {
736
- z(q), p?.(q);
737
- }, onSubmit: () => Ae(Vs(de)), references: C, onAddReference: _ }, $) }) })
818
+ }, children: /* @__PURE__ */ u(ye, { minH: Ot, align: "center", children: /* @__PURE__ */ u(Ts, { ref: ee.editorRef, onRecallPrevious: ee.recallPrevious, onRecallNext: ee.recallNext, defaultState: F, isEditable: !f && !M, placeholder: /* @__PURE__ */ u(yo, { placeholder: h }), onChange: ee.change, onSubmit: () => Ne(js(ae)), references: I, onAddReference: _ }, $) }) })
738
819
  ),
739
- /* @__PURE__ */ k(Z, { gap: "1", minH: Lt, align: "center", children: [
740
- g,
741
- /* @__PURE__ */ c(Vn, {}),
742
- /* @__PURE__ */ c(uo, { canInterrupt: te === "interrupt", title: te === "interrupt" ? "Stop Response" : w ?? fe, shortcut: te === "submit" ? "Enter" : void 0, onClick: () => Ae(te), disabled: te === "none" })
820
+ /* @__PURE__ */ k(oe, { gap: "1", minH: Ot, align: "center", children: [
821
+ b,
822
+ /* @__PURE__ */ u(jn, {}),
823
+ /* @__PURE__ */ u(mo, { canInterrupt: ce === "interrupt", title: ce === "interrupt" ? "Stop Response" : w ?? Be, shortcut: ce === "submit" ? "Enter" : void 0, onClick: () => Ne(ce), disabled: ce === "none" })
743
824
  ] })
744
825
  ] }) });
745
- }, Qe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), mo = (t) => {
826
+ }, We = (t) => typeof t == "object" && t !== null && !Array.isArray(t), wo = (t) => {
746
827
  try {
747
828
  const e = JSON.parse(t);
748
- return Qe(e) ? e : null;
829
+ return We(e) ? e : null;
749
830
  } catch {
750
831
  return null;
751
832
  }
752
- }, ho = (t) => Qe(t) ? t : typeof t == "string" && t.trim().length > 0 ? mo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, re = (t) => {
833
+ }, To = (t) => We(t) ? t : typeof t == "string" && t.trim().length > 0 ? wo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ue = (t) => {
753
834
  const e = De(t);
754
835
  if (e) return e;
755
836
  if (Array.isArray(t)) {
756
- const n = t.map(re).filter((s) => s !== null);
837
+ const n = t.map(ue).filter((o) => o !== null);
757
838
  return n.length > 0 ? n.join(`
758
839
  `) : null;
759
840
  }
760
- return Qe(t) ? re(t.response) ?? re(t.answer) ?? re(t.text) ?? re(t.answers) : null;
761
- }, go = (t) => {
841
+ return We(t) ? ue(t.response) ?? ue(t.answer) ?? ue(t.text) ?? ue(t.answers) : null;
842
+ }, Ao = (t) => {
762
843
  if (typeof t == "string" && t.trim().length > 0)
763
844
  return {
764
845
  label: t,
765
846
  description: void 0
766
847
  };
767
- if (!Qe(t)) return null;
848
+ if (!We(t)) return null;
768
849
  const e = De(t.label);
769
850
  return e ? {
770
851
  label: e,
771
852
  description: De(t.description) ?? void 0
772
853
  } : null;
773
- }, bo = (t, e) => {
774
- if (!Qe(t)) return null;
854
+ }, Co = (t, e) => {
855
+ if (!We(t)) return null;
775
856
  const n = De(t.question);
776
857
  if (!n) return null;
777
- const s = Array.isArray(t.options) ? t.options.map(go).filter((i) => i !== null) : [], o = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : s.length === 0 || o === "freeform" || o === "text";
858
+ const o = Array.isArray(t.options) ? t.options.map(Ao).filter((i) => i !== null) : [], s = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o.length === 0 || s === "freeform" || s === "text";
778
859
  return {
779
860
  id: De(t.id) ?? `question-${e}`,
780
861
  question: n,
781
- options: s,
782
- multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
862
+ options: o,
863
+ multiple: typeof t.multiple == "boolean" ? t.multiple : s === "multi_choice" || s === "multiple_choice",
783
864
  required: typeof t.required == "boolean" ? t.required : !0,
784
865
  allowCustomAnswer: r
785
866
  };
786
- }, dn = (t) => {
787
- const e = ho(t);
867
+ }, mn = (t) => {
868
+ const e = To(t);
788
869
  if (!e || !Array.isArray(e.questions)) return null;
789
- const n = e.questions.map(bo).filter((s) => s !== null);
870
+ const n = e.questions.map(Co).filter((o) => o !== null);
790
871
  return n.length === 0 ? null : {
791
872
  questions: n
792
873
  };
793
- }, yo = (t) => t.tool.toLowerCase() === "question", xo = (t) => {
874
+ }, ko = (t) => t.tool.toLowerCase() === "question", Io = (t) => {
794
875
  for (let e = t.length - 1; e >= 0; e -= 1) {
795
876
  const n = t[e];
796
877
  if (n.role === "assistant")
797
- for (let s = n.parts.length - 1; s >= 0; s -= 1) {
798
- const o = n.parts[s];
799
- if (o.type !== "tool" || !yo(o)) continue;
800
- return re(o.state?.output) ?? re(o.state?.metadata) ? void 0 : dn(o.state?.input) ?? void 0;
878
+ for (let o = n.parts.length - 1; o >= 0; o -= 1) {
879
+ const s = n.parts[o];
880
+ if (s.type !== "tool" || !ko(s)) continue;
881
+ return ue(s.state?.output) ?? ue(s.state?.metadata) ? void 0 : mn(s.state?.input) ?? void 0;
801
882
  }
802
883
  }
803
- }, So = (t = "") => JSON.stringify(Ss(t)), fn = {
884
+ }, hn = {
804
885
  animationName: "message-fade-in",
805
886
  animationDuration: "200ms",
806
887
  animationTimingFunction: "ease-out"
807
- }, wo = (t) => {
888
+ }, _o = (t) => {
808
889
  const e = /* @__PURE__ */ new Set(), n = new Set(t.state.seenKeys);
809
- for (const s of t.itemKeys)
810
- t.state.initialized && !n.has(s) && e.add(s), n.add(s);
890
+ for (const o of t.itemKeys)
891
+ t.state.initialized && !n.has(o) && e.add(o), n.add(o);
811
892
  return {
812
893
  animatedKeys: e,
813
894
  state: {
@@ -815,70 +896,70 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
815
896
  seenKeys: n
816
897
  }
817
898
  };
818
- }, To = (t, e) => {
899
+ }, vo = (t, e) => {
819
900
  if (t.length !== e.length) return !1;
820
901
  for (let n = 0; n < t.length; n += 1) if (t[n] !== e[n]) return !1;
821
902
  return !0;
822
- }, Ao = (t) => {
823
- const e = ie({
903
+ }, Mo = (t) => {
904
+ const e = J({
824
905
  initialized: !1,
825
906
  seenKeys: /* @__PURE__ */ new Set()
826
- }), n = ie(null);
827
- if (n.current && To(n.current.itemKeys, t))
907
+ }), n = J(null);
908
+ if (n.current && vo(n.current.itemKeys, t))
828
909
  return n.current.animatedKeys;
829
- const s = wo({
910
+ const o = _o({
830
911
  itemKeys: t,
831
912
  state: e.current
832
913
  });
833
- return e.current = s.state, n.current = {
914
+ return e.current = o.state, n.current = {
834
915
  itemKeys: [...t],
835
- animatedKeys: s.animatedKeys
836
- }, s.animatedKeys;
837
- }, ko = (t) => t.type === "text", Co = (t) => (t.parts ?? []).filter(ko).map((e) => e.text.trim()).filter(Boolean).join(`
916
+ animatedKeys: o.animatedKeys
917
+ }, o.animatedKeys;
918
+ }, Ro = (t) => t.type === "text", Po = (t) => (t.parts ?? []).filter(Ro).map((e) => e.text.trim()).filter(Boolean).join(`
838
919
 
839
- `), Io = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
920
+ `), Eo = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
840
921
  hour: "numeric",
841
922
  minute: "2-digit",
842
923
  timeZone: n
843
- }).format(new Date(t.createdAt)) : "", xt = (t) => {
844
- const e = A(20), {
924
+ }).format(new Date(t.createdAt)) : "", Tt = (t) => {
925
+ const e = C(20), {
845
926
  message: n,
846
- alwaysVisible: s,
847
- copyAlwaysVisible: o
848
- } = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, a] = V(!1), u = ie(null);
927
+ alwaysVisible: o,
928
+ copyAlwaysVisible: s
929
+ } = t, r = o === void 0 ? !1 : o, i = s === void 0 ? r : s, [l, a] = W(!1), c = J(null);
849
930
  let d;
850
- e[0] !== n ? (d = Co(n), e[0] = n, e[1] = d) : d = e[1];
931
+ e[0] !== n ? (d = Po(n), e[0] = n, e[1] = d) : d = e[1];
851
932
  const f = d;
852
- let p;
853
- e[2] !== n ? (p = Io(n), e[2] = n, e[3] = p) : p = e[3];
854
- const m = p;
933
+ let m;
934
+ e[2] !== n ? (m = Eo(n), e[2] = n, e[3] = m) : m = e[3];
935
+ const p = m;
855
936
  let h, g;
856
937
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
857
- u.current !== null && window.clearTimeout(u.current);
858
- }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), J(h, g);
938
+ c.current !== null && window.clearTimeout(c.current);
939
+ }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Z(h, g);
859
940
  let b;
860
941
  e[6] !== f ? (b = async () => {
861
942
  if (f)
862
943
  try {
863
- await navigator.clipboard.writeText(f), a(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => a(!1), 1200);
944
+ await navigator.clipboard.writeText(f), a(!0), c.current !== null && window.clearTimeout(c.current), c.current = window.setTimeout(() => a(!1), 1200);
864
945
  } catch {
865
946
  a(!1);
866
947
  }
867
948
  }, e[6] = f, e[7] = b) : b = e[7];
868
- const x = b;
869
- if (!f && !m)
949
+ const y = b;
950
+ if (!f && !p)
870
951
  return null;
871
- const y = r ? "1" : "0", T = r ? "auto" : "none";
872
- let S;
873
- e[8] !== m ? (S = m ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: m }) : null, e[8] = m, e[9] = S) : S = e[9];
952
+ const x = r ? "1" : "0", S = r ? "auto" : "none";
953
+ let A;
954
+ e[8] !== p ? (A = p ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
955
+ let T;
956
+ e[10] !== i || e[11] !== y || e[12] !== f || e[13] !== l ? (T = f ? /* @__PURE__ */ u(D, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Qt, children: /* @__PURE__ */ u(vt, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ u(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: y, children: l ? /* @__PURE__ */ u(nn, { size: 12 }) : /* @__PURE__ */ u(ns, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = y, e[12] = f, e[13] = l, e[14] = T) : T = e[14];
874
957
  let w;
875
- e[10] !== i || e[11] !== x || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ c(P, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Ot, children: /* @__PURE__ */ c(Ct, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ c(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: x, children: l ? /* @__PURE__ */ c(en, { size: 12 }) : /* @__PURE__ */ c(Zn, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = x, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
876
- let C;
877
- return e[15] !== w || e[16] !== y || e[17] !== T || e[18] !== S ? (C = /* @__PURE__ */ k(Z, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: y, pointerEvents: T, transition: "opacity 120ms ease", css: Ot, children: [
878
- S,
879
- w
880
- ] }), e[15] = w, e[16] = y, e[17] = T, e[18] = S, e[19] = C) : C = e[19], C;
881
- }, Ot = {
958
+ return e[15] !== T || e[16] !== x || e[17] !== S || e[18] !== A ? (w = /* @__PURE__ */ k(oe, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: S, transition: "opacity 120ms ease", css: Qt, children: [
959
+ A,
960
+ T
961
+ ] }), e[15] = T, e[16] = x, e[17] = S, e[18] = A, e[19] = w) : w = e[19], w;
962
+ }, Qt = {
882
963
  "[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
883
964
  opacity: 1,
884
965
  pointerEvents: "auto"
@@ -891,44 +972,44 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
891
972
  opacity: 1,
892
973
  pointerEvents: "auto"
893
974
  }
894
- }, _o = (t) => {
895
- const e = A(8);
896
- let n, s;
975
+ }, Do = (t) => {
976
+ const e = C(8);
977
+ let n, o;
897
978
  e[0] !== t ? ({
898
979
  children: n,
899
- ...s
900
- } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
901
- let o;
902
- e[3] !== n ? (o = /* @__PURE__ */ c(rn, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
980
+ ...o
981
+ } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
982
+ let s;
983
+ e[3] !== n ? (s = /* @__PURE__ */ u(an, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = s) : s = e[4];
903
984
  let r;
904
- return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ c(P, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
905
- }, Ro = _o, Je = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), vo = (t) => {
906
- const e = Je(t), n = e.replace(/_/g, "");
985
+ return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ u(D, { ...o, children: s }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
986
+ }, Bo = Do, nt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), Fo = (t) => {
987
+ const e = nt(t), n = e.replace(/_/g, "");
907
988
  return [.../* @__PURE__ */ new Set([t, e, n])];
908
- }, pn = {
909
- shell: nn,
910
- ls: is,
911
- read_file: rs,
912
- write_file: os,
913
- delete_file: tn,
914
- patch: ss,
915
- upload_files: ns,
916
- download_file: ts,
917
- move_file: es
918
- }, Mo = {
919
- dot: fs,
920
- danger: sn,
921
- search: ds,
922
- browser: us,
923
- file: cs,
924
- question: as,
925
- todo: ls,
926
- terminal: nn,
927
- ...pn
928
- }, zt = "dot", Po = (t) => Object.hasOwn(pn, t), Eo = (t) => Mo[t], mn = (t) => {
929
- if (!t) return zt;
930
- const e = Je(t);
931
- if (Po(e)) return e;
989
+ }, gn = {
990
+ shell: on,
991
+ ls: cs,
992
+ read_file: as,
993
+ write_file: ls,
994
+ delete_file: sn,
995
+ patch: is,
996
+ upload_files: rs,
997
+ download_file: os,
998
+ move_file: ss
999
+ }, Lo = {
1000
+ dot: hs,
1001
+ danger: rn,
1002
+ search: ms,
1003
+ browser: ps,
1004
+ file: fs,
1005
+ question: ds,
1006
+ todo: us,
1007
+ terminal: on,
1008
+ ...gn
1009
+ }, qt = "dot", $o = (t) => Object.hasOwn(gn, t), Oo = (t) => Lo[t], bn = (t) => {
1010
+ if (!t) return qt;
1011
+ const e = nt(t);
1012
+ if ($o(e)) return e;
932
1013
  const n = e.replace(/_/g, "");
933
1014
  switch (e) {
934
1015
  case "read":
@@ -955,52 +1036,52 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
955
1036
  case "file":
956
1037
  return "file";
957
1038
  default:
958
- return n === "todowrite" || n === "todo" ? "todo" : zt;
1039
+ return n === "todowrite" || n === "todo" ? "todo" : qt;
959
1040
  }
960
1041
  };
961
- function Rt(t) {
1042
+ function Pt(t) {
962
1043
  const e = t.lastIndexOf("/");
963
1044
  return e >= 0 ? t.slice(e + 1) : t;
964
1045
  }
965
- function Xe(t) {
1046
+ function Ze(t) {
966
1047
  if (!t) return null;
967
1048
  const e = t.split(" ")[0].trim();
968
1049
  if (e === "/dev/null") return null;
969
1050
  let n = e;
970
1051
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
971
1052
  }
972
- const Ze = (t) => t.startsWith("--- "), vt = (t) => t.startsWith("+++ "), Mt = (t) => t.startsWith("@@"), Do = (t) => t.startsWith("+") && !(vt(t) || t === "+++"), Bo = (t) => t.startsWith("-") && !(Ze(t) || t === "---"), Fo = (t, e) => {
1053
+ const st = (t) => t.startsWith("--- "), Et = (t) => t.startsWith("+++ "), Dt = (t) => t.startsWith("@@"), zo = (t) => t.startsWith("+") && !(Et(t) || t === "+++"), Qo = (t) => t.startsWith("-") && !(st(t) || t === "---"), qo = (t, e) => {
973
1054
  t.has(e) || t.set(e, {
974
1055
  additions: 0,
975
1056
  deletions: 0
976
1057
  });
977
- }, Lo = (t, e) => {
1058
+ }, Wo = (t, e) => {
978
1059
  const n = t.get(e);
979
1060
  n && (n.additions += 1);
980
- }, $o = (t, e) => {
1061
+ }, Ho = (t, e) => {
981
1062
  const n = t.get(e);
982
1063
  n && (n.deletions += 1);
983
- }, Oo = (t, e, n) => {
984
- if (Ze(t))
1064
+ }, No = (t, e, n) => {
1065
+ if (st(t))
985
1066
  return {
986
1067
  ...e,
987
- lastMinusHeader: Xe(t.slice(4)),
1068
+ lastMinusHeader: Ze(t.slice(4)),
988
1069
  inHunk: !1
989
1070
  };
990
- if (vt(t)) {
991
- const o = Xe(t.slice(4)) ?? e.lastMinusHeader;
992
- return o && Fo(n, o), {
1071
+ if (Et(t)) {
1072
+ const s = Ze(t.slice(4)) ?? e.lastMinusHeader;
1073
+ return s && qo(n, s), {
993
1074
  ...e,
994
- currentPath: o,
1075
+ currentPath: s,
995
1076
  inHunk: !1
996
1077
  };
997
1078
  }
998
- return e.currentPath ? Mt(t) ? {
1079
+ return e.currentPath ? Dt(t) ? {
999
1080
  ...e,
1000
1081
  inHunk: !0
1001
- } : e.inHunk ? Do(t) ? (Lo(n, e.currentPath), e) : (Bo(t) && $o(n, e.currentPath), e) : e : e;
1082
+ } : e.inHunk ? zo(t) ? (Wo(n, e.currentPath), e) : (Qo(t) && Ho(n, e.currentPath), e) : e : e;
1002
1083
  };
1003
- function hn(t) {
1084
+ function yn(t) {
1004
1085
  if (!t || typeof t != "string") return [];
1005
1086
  const e = /* @__PURE__ */ new Map();
1006
1087
  let n = {
@@ -1008,34 +1089,34 @@ function hn(t) {
1008
1089
  lastMinusHeader: null,
1009
1090
  inHunk: !1
1010
1091
  };
1011
- const s = t.split(/\r?\n/);
1012
- for (const o of s)
1013
- n = Oo(o, n, e);
1014
- return Array.from(e.entries()).map(([o, {
1092
+ const o = t.split(/\r?\n/);
1093
+ for (const s of o)
1094
+ n = No(s, n, e);
1095
+ return Array.from(e.entries()).map(([s, {
1015
1096
  additions: r,
1016
1097
  deletions: i
1017
1098
  }]) => ({
1018
- filePath: o,
1099
+ filePath: s,
1019
1100
  additions: r,
1020
1101
  deletions: i
1021
1102
  }));
1022
1103
  }
1023
- function zo(t) {
1024
- return hn(t).map((e) => ({
1104
+ function Vo(t) {
1105
+ return yn(t).map((e) => ({
1025
1106
  kind: "diff",
1026
- fileName: Rt(e.filePath),
1107
+ fileName: Pt(e.filePath),
1027
1108
  filePath: e.filePath,
1028
1109
  additions: e.additions,
1029
1110
  deletions: e.deletions
1030
1111
  }));
1031
1112
  }
1032
- function Qo(t) {
1033
- return hn(t).map((e) => e.filePath);
1113
+ function Uo(t) {
1114
+ return yn(t).map((e) => e.filePath);
1034
1115
  }
1035
- const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Wo = (t, e, n) => {
1116
+ const xn = (t) => st(t) || t.startsWith("diff --git "), jo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Ko = (t, e, n) => {
1036
1117
  if (t.startsWith(" ")) {
1037
- const s = t.slice(1);
1038
- e.push(s), n.push(s);
1118
+ const o = t.slice(1);
1119
+ e.push(o), n.push(o);
1039
1120
  return;
1040
1121
  }
1041
1122
  if (t.startsWith("-")) {
@@ -1043,30 +1124,30 @@ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith
1043
1124
  return;
1044
1125
  }
1045
1126
  t.startsWith("+") && n.push(t.slice(1));
1046
- }, Ho = (t, e, n, s) => {
1047
- let o = e;
1048
- for (; o < t.length; ) {
1049
- const r = t[o] || "";
1050
- if (gn(r) || Mt(r) || qo(r))
1127
+ }, Xo = (t, e, n, o) => {
1128
+ let s = e;
1129
+ for (; s < t.length; ) {
1130
+ const r = t[s] || "";
1131
+ if (xn(r) || Dt(r) || jo(r))
1051
1132
  break;
1052
- Wo(r, n, s), o += 1;
1133
+ Ko(r, n, o), s += 1;
1053
1134
  }
1054
- return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
1055
- }, Vo = (t, e) => {
1056
- const n = Xe((t[e] || "").slice(4)), s = t[e + 1] || "";
1057
- if (!vt(s)) return {
1135
+ return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), s;
1136
+ }, Go = (t, e) => {
1137
+ const n = Ze((t[e] || "").slice(4)), o = t[e + 1] || "";
1138
+ if (!Et(o)) return {
1058
1139
  nextIndex: e + 1
1059
1140
  };
1060
- const r = Xe(s.slice(4)) ?? n ?? "", i = [], l = [];
1141
+ const r = Ze(o.slice(4)) ?? n ?? "", i = [], l = [];
1061
1142
  let a = e + 2;
1062
1143
  for (; a < t.length; ) {
1063
- const u = t[a] || "";
1064
- if (gn(u)) break;
1065
- if (!Mt(u)) {
1144
+ const c = t[a] || "";
1145
+ if (xn(c)) break;
1146
+ if (!Dt(c)) {
1066
1147
  a += 1;
1067
1148
  continue;
1068
1149
  }
1069
- a = Ho(t, a + 1, i, l);
1150
+ a = Xo(t, a + 1, i, l);
1070
1151
  }
1071
1152
  return {
1072
1153
  nextIndex: a,
@@ -1079,25 +1160,25 @@ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith
1079
1160
  }
1080
1161
  };
1081
1162
  };
1082
- function No(t) {
1163
+ function Yo(t) {
1083
1164
  if (!t || typeof t != "string") return [];
1084
1165
  const e = t.split(/\r?\n/), n = [];
1085
- let s = 0;
1086
- for (; s < e.length; ) {
1087
- const o = e[s] || "";
1088
- if (!Ze(o)) {
1089
- s += 1;
1166
+ let o = 0;
1167
+ for (; o < e.length; ) {
1168
+ const s = e[o] || "";
1169
+ if (!st(s)) {
1170
+ o += 1;
1090
1171
  continue;
1091
1172
  }
1092
1173
  const {
1093
1174
  nextIndex: r,
1094
1175
  preview: i
1095
- } = Vo(e, s);
1096
- i && n.push(i), s = Math.max(r, s + 1);
1176
+ } = Go(e, o);
1177
+ i && n.push(i), o = Math.max(r, o + 1);
1097
1178
  }
1098
1179
  return n;
1099
1180
  }
1100
- const Uo = {
1181
+ const Jo = {
1101
1182
  apply_patch: "Apply patch",
1102
1183
  bash: "Run command",
1103
1184
  edit: "Edit file",
@@ -1106,143 +1187,143 @@ const Uo = {
1106
1187
  read: "Read file",
1107
1188
  skill: "Load skill",
1108
1189
  todowrite: "Update todos"
1109
- }, Qt = {
1190
+ }, Wt = {
1110
1191
  error: "failed",
1111
1192
  "output-error": "failed",
1112
1193
  input_streaming: "running",
1113
1194
  running: "running",
1114
1195
  completed: "completed",
1115
1196
  failed: "failed"
1116
- }, bn = (t) => t.replace(/^tool-/, "").toLowerCase(), jo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ko = (t) => bn(t.tool ?? "tool"), Xo = (t) => {
1117
- const e = bn(t);
1118
- return Uo[e] ?? jo(e.replace(/_/g, " "));
1119
- }, Go = (t) => {
1197
+ }, Sn = (t) => t.replace(/^tool-/, "").toLowerCase(), Zo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), er = (t) => Sn(t.tool ?? "tool"), tr = (t) => {
1198
+ const e = Sn(t);
1199
+ return Jo[e] ?? Zo(e.replace(/_/g, " "));
1200
+ }, nr = (t) => {
1120
1201
  const e = t.state?.status ?? t.status;
1121
1202
  if (!e || typeof e != "string") return null;
1122
1203
  const n = e.replace(/-/g, "_");
1123
- return Qt[n] ? Qt[n] : n.includes("stream") ? "running" : null;
1124
- }, yn = (t) => {
1204
+ return Wt[n] ? Wt[n] : n.includes("stream") ? "running" : null;
1205
+ }, wn = (t) => {
1125
1206
  const e = t.state?.status ?? t.status;
1126
1207
  return e === "error" || e === "output-error" || e === "failed";
1127
- }, ae = (t) => yn(t) ? {
1208
+ }, fe = (t) => wn(t) ? {
1128
1209
  type: "icon",
1129
1210
  icon: "danger"
1130
1211
  } : {
1131
1212
  type: "icon",
1132
- icon: mn(Ko(t))
1133
- }, ce = (t, e, n, s) => {
1213
+ icon: bn(er(t))
1214
+ }, pe = (t, e, n, o) => {
1134
1215
  const r = [{
1135
1216
  kind: "text",
1136
- text: n ?? Xo(t.tool ?? "tool"),
1217
+ text: n ?? tr(t.tool ?? "tool"),
1137
1218
  bold: !0
1138
1219
  }];
1139
1220
  e && r.push({
1140
1221
  kind: "text",
1141
1222
  text: e,
1142
1223
  muted: !0,
1143
- ...s === "monospace" ? {
1224
+ ...o === "monospace" ? {
1144
1225
  truncate: !0,
1145
1226
  monospace: !0
1146
1227
  } : {}
1147
1228
  });
1148
- const i = Go(t);
1229
+ const i = nr(t);
1149
1230
  return i && i !== "completed" && r.push({
1150
1231
  kind: "text",
1151
1232
  text: i,
1152
1233
  muted: !0
1153
1234
  }), r;
1154
- }, ye = (t) => {
1235
+ }, xe = (t) => {
1155
1236
  const e = t.state?.input;
1156
1237
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1157
- }, qe = (t) => {
1238
+ }, He = (t) => {
1158
1239
  const e = t.state?.output;
1159
1240
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1160
- }, I = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ze = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Yo = (t, e) => {
1161
- const n = ze(t.state);
1162
- return n ? ze(n[e]) : null;
1163
- }, xn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Jo = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Sn = (t) => {
1241
+ }, v = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, qe = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, sr = (t, e) => {
1242
+ const n = qe(t.state);
1243
+ return n ? qe(n[e]) : null;
1244
+ }, Tn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), or = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), An = (t) => {
1245
+ const e = He(t);
1246
+ return [sr(t, "metadata"), qe(e?.metadata)].filter(Boolean);
1247
+ }, rr = (t) => {
1164
1248
  const e = qe(t);
1165
- return [Yo(t, "metadata"), ze(e?.metadata)].filter(Boolean);
1166
- }, Zo = (t) => {
1167
- const e = ze(t);
1168
1249
  if (!e) return null;
1169
- const n = I(e.filePath) ?? I(e.relativePath) ?? I(e.path);
1250
+ const n = v(e.filePath) ?? v(e.relativePath) ?? v(e.path);
1170
1251
  return n ? {
1171
- filePath: xn(n),
1252
+ filePath: Tn(n),
1172
1253
  additions: typeof e.additions == "number" ? e.additions : 0,
1173
1254
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
1174
- diff: I(e.diff) ?? void 0,
1175
- before: I(e.before) ?? void 0,
1176
- after: I(e.after) ?? void 0
1255
+ diff: v(e.diff) ?? void 0,
1256
+ before: v(e.before) ?? void 0,
1257
+ after: v(e.after) ?? void 0
1177
1258
  } : null;
1178
- }, wn = (t) => {
1259
+ }, Cn = (t) => {
1179
1260
  const e = [];
1180
- for (const n of Sn(t)) {
1181
- const s = Array.isArray(n.files) ? n.files : [];
1182
- for (const o of s) {
1183
- const r = Zo(o);
1261
+ for (const n of An(t)) {
1262
+ const o = Array.isArray(n.files) ? n.files : [];
1263
+ for (const s of o) {
1264
+ const r = rr(s);
1184
1265
  r && e.push(r);
1185
1266
  }
1186
1267
  }
1187
1268
  return e;
1188
- }, er = (t) => {
1189
- const e = ye(t), s = (Array.isArray(e?.changes) ? e.changes : []).map((o) => I(ze(o)?.path)).filter((o) => !!o).map(xn);
1190
- return Array.from(new Set(s));
1191
- }, tr = (t) => {
1192
- const e = ye(t), n = I(e?.diff);
1269
+ }, ir = (t) => {
1270
+ const e = xe(t), o = (Array.isArray(e?.changes) ? e.changes : []).map((s) => v(qe(s)?.path)).filter((s) => !!s).map(Tn);
1271
+ return Array.from(new Set(o));
1272
+ }, lr = (t) => {
1273
+ const e = xe(t), n = v(e?.diff);
1193
1274
  if (n) return n;
1194
- for (const r of Sn(t)) {
1195
- const i = I(r.diff);
1275
+ for (const r of An(t)) {
1276
+ const i = v(r.diff);
1196
1277
  if (i) return i;
1197
1278
  }
1198
- const s = wn(t).map((r) => r.diff).filter((r) => !!r);
1199
- if (s.length > 0) return s.join(`
1279
+ const o = Cn(t).map((r) => r.diff).filter((r) => !!r);
1280
+ if (o.length > 0) return o.join(`
1200
1281
  `);
1201
- const o = I(e?.patchText);
1202
- return o && Jo(o) ? o : null;
1203
- }, nr = (t) => {
1282
+ const s = v(e?.patchText);
1283
+ return s && or(s) ? s : null;
1284
+ }, ar = (t) => {
1204
1285
  const e = /* @__PURE__ */ new Set(), n = [];
1205
- for (const s of t)
1206
- e.has(s.filePath) || (e.add(s.filePath), n.push({
1286
+ for (const o of t)
1287
+ e.has(o.filePath) || (e.add(o.filePath), n.push({
1207
1288
  kind: "diff",
1208
- fileName: Rt(s.filePath),
1209
- filePath: s.filePath,
1210
- additions: s.additions,
1211
- deletions: s.deletions
1289
+ fileName: Pt(o.filePath),
1290
+ filePath: o.filePath,
1291
+ additions: o.additions,
1292
+ deletions: o.deletions
1212
1293
  }));
1213
1294
  return n;
1214
- }, sr = (t) => Array.from(new Set(t.map((e) => e.filePath))), et = (t) => {
1215
- const e = qe(t);
1216
- return I(t.state?.output) ?? I(e?.returnDisplay) ?? I(e?.preview) ?? I(e?.stdout) ?? I(e?.content);
1217
- }, or = (t) => {
1295
+ }, cr = (t) => Array.from(new Set(t.map((e) => e.filePath))), ot = (t) => {
1296
+ const e = He(t);
1297
+ return v(t.state?.output) ?? v(e?.returnDisplay) ?? v(e?.preview) ?? v(e?.stdout) ?? v(e?.content);
1298
+ }, ur = (t) => {
1218
1299
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
1219
1300
  return e ? {
1220
- skillName: I(e[1]) ?? void 0,
1221
- content: I(e[2]) ?? ""
1301
+ skillName: v(e[1]) ?? void 0,
1302
+ content: v(e[2]) ?? ""
1222
1303
  } : null;
1223
- }, rr = (t) => {
1224
- const e = ye(t);
1225
- return I(e?.name) ?? I(e?.skillName) ?? I(e?.skill) ?? I(e?.skill_name) ?? void 0;
1226
- }, Pt = (t, e) => ({
1304
+ }, dr = (t) => {
1305
+ const e = xe(t);
1306
+ return v(e?.name) ?? v(e?.skillName) ?? v(e?.skill) ?? v(e?.skill_name) ?? void 0;
1307
+ }, Bt = (t, e) => ({
1227
1308
  kind: "link",
1228
- text: Rt(t),
1309
+ text: Pt(t),
1229
1310
  filePath: t,
1230
1311
  ...e ? {
1231
1312
  variant: e
1232
1313
  } : {}
1233
- }), ue = (t, e) => !yn(t) || !t.state?.errorText ? e : [{
1314
+ }), me = (t, e) => !wn(t) || !t.state?.errorText ? e : [{
1234
1315
  type: "comment",
1235
1316
  text: t.state.errorText
1236
- }, ...e], Tn = (t) => No(t ?? void 0).map((e) => ({
1317
+ }, ...e], kn = (t) => Yo(t ?? void 0).map((e) => ({
1237
1318
  type: "diff",
1238
1319
  language: "diff",
1239
1320
  original: e.original,
1240
1321
  modified: e.modified,
1241
1322
  sideBySide: !1
1242
- })), ir = (t) => zo(t ?? void 0), lr = (t) => Qo(t ?? void 0), ar = (t) => {
1243
- const e = tr(t), n = wn(t), s = er(t), o = ce(t, void 0, "Apply patch"), r = ir(e);
1244
- r.length > 0 ? o.push(...r) : n.length > 0 ? o.push(...nr(n)) : o.push(...s.map((l) => Pt(l, "bubble")));
1245
- const i = [...Tn(e)];
1323
+ })), fr = (t) => Vo(t ?? void 0), pr = (t) => Uo(t ?? void 0), mr = (t) => {
1324
+ const e = lr(t), n = Cn(t), o = ir(t), s = pe(t, void 0, "Apply patch"), r = fr(e);
1325
+ r.length > 0 ? s.push(...r) : n.length > 0 ? s.push(...ar(n)) : s.push(...o.map((l) => Bt(l, "bubble")));
1326
+ const i = [...kn(e)];
1246
1327
  if (i.length === 0)
1247
1328
  for (const l of n)
1248
1329
  !l.before && !l.after || i.push({
@@ -1253,92 +1334,92 @@ const Uo = {
1253
1334
  sideBySide: !1
1254
1335
  });
1255
1336
  if (i.length === 0) {
1256
- const l = lr(e);
1257
- l.length === 0 && l.push(...sr(n)), l.length === 0 && l.push(...s), l.length > 0 && i.push({
1337
+ const l = pr(e);
1338
+ l.length === 0 && l.push(...cr(n)), l.length === 0 && l.push(...o), l.length > 0 && i.push({
1258
1339
  type: "references",
1259
1340
  references: l
1260
1341
  });
1261
1342
  }
1262
1343
  return {
1263
- indicator: ae(t),
1264
- title: o,
1265
- blocks: ue(t, i)
1344
+ indicator: fe(t),
1345
+ title: s,
1346
+ blocks: me(t, i)
1266
1347
  };
1267
- }, cr = (t, e) => [{
1348
+ }, hr = (t, e) => [{
1268
1349
  type: "diff",
1269
1350
  language: "text",
1270
1351
  original: t,
1271
1352
  modified: e,
1272
1353
  sideBySide: !1
1273
- }], ur = (t) => {
1274
- const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(n?.filePath) ?? void 0, o = I(n?.oldString) ?? I(e?.old_string) ?? void 0, r = I(n?.newString) ?? I(e?.new_string) ?? void 0, i = ce(t, void 0, "Edit file");
1275
- s && i.push(Pt(s));
1276
- const l = o !== void 0 && r !== void 0 ? cr(o, r) : Tn(I(n?.diff));
1354
+ }], gr = (t) => {
1355
+ const e = xe(t), n = He(t), o = v(e?.filePath) ?? v(e?.file_path) ?? v(n?.filePath) ?? void 0, s = v(n?.oldString) ?? v(e?.old_string) ?? void 0, r = v(n?.newString) ?? v(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
1356
+ o && i.push(Bt(o));
1357
+ const l = s !== void 0 && r !== void 0 ? hr(s, r) : kn(v(n?.diff));
1277
1358
  return {
1278
- indicator: ae(t),
1359
+ indicator: fe(t),
1279
1360
  title: i,
1280
- blocks: ue(t, l)
1361
+ blocks: me(t, l)
1281
1362
  };
1282
- }, dr = (t) => {
1363
+ }, br = (t) => {
1283
1364
  const {
1284
1365
  buildBaseTitle: e,
1285
1366
  buildIndicator: n,
1286
- prependErrorBlock: s
1367
+ prependErrorBlock: o
1287
1368
  } = t;
1288
- return (o) => {
1289
- const r = re(o.state?.output) ?? re(o.state?.metadata), i = dn(o.state?.input), l = i ? {
1369
+ return (s) => {
1370
+ const r = ue(s.state?.output) ?? ue(s.state?.metadata), i = mn(s.state?.input), l = i ? {
1290
1371
  type: "question-form",
1291
1372
  questions: i.questions
1292
1373
  } : null;
1293
1374
  if (!r && !l) return null;
1294
- const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, u = r ? [] : [l];
1375
+ const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [l];
1295
1376
  return {
1296
- indicator: n(o),
1297
- title: e(o, a, "Question"),
1298
- blocks: s(o, u),
1377
+ indicator: n(s),
1378
+ title: e(s, a, "Question"),
1379
+ blocks: o(s, c),
1299
1380
  expandable: !1
1300
1381
  };
1301
1382
  };
1302
- }, fr = (t) => {
1303
- const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(e?.file) ?? I(n?.filePath) ?? I(n?.file) ?? I(n?.path) ?? void 0, o = ce(t, void 0, "Read file");
1304
- return s && o.push(Pt(s)), {
1305
- indicator: ae(t),
1306
- title: o,
1307
- blocks: ue(t, [])
1383
+ }, yr = (t) => {
1384
+ const e = xe(t), n = He(t), o = v(e?.filePath) ?? v(e?.file_path) ?? v(e?.file) ?? v(n?.filePath) ?? v(n?.file) ?? v(n?.path) ?? void 0, s = pe(t, void 0, "Read file");
1385
+ return o && s.push(Bt(o)), {
1386
+ indicator: fe(t),
1387
+ title: s,
1388
+ blocks: me(t, [])
1308
1389
  };
1309
- }, An = (t, e) => {
1310
- const n = ye(t), s = qe(t), o = I(n?.command) ?? void 0, r = ce(t, o, e, "monospace"), i = [], l = et(t);
1390
+ }, In = (t, e) => {
1391
+ const n = xe(t), o = He(t), s = v(n?.command) ?? void 0, r = pe(t, s, e, "monospace"), i = [], l = ot(t);
1311
1392
  l && i.push({
1312
1393
  type: "code",
1313
1394
  language: "text",
1314
1395
  code: l
1315
1396
  });
1316
- const a = I(s?.stderr);
1397
+ const a = v(o?.stderr);
1317
1398
  return a && a !== l && i.push({
1318
1399
  type: "code",
1319
1400
  language: "text",
1320
1401
  code: a
1321
- }), typeof s?.exitCode == "number" && i.push({
1402
+ }), typeof o?.exitCode == "number" && i.push({
1322
1403
  type: "text",
1323
- text: `Exit code: ${s.exitCode}`
1404
+ text: `Exit code: ${o.exitCode}`
1324
1405
  }), {
1325
- indicator: ae(t),
1406
+ indicator: fe(t),
1326
1407
  title: r,
1327
- blocks: ue(t, i)
1408
+ blocks: me(t, i)
1328
1409
  };
1329
- }, pr = (t) => An(t, "Run command"), mr = (t) => An(t, "Shell"), hr = (t) => {
1330
- const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Search files"), r = n ? [{
1410
+ }, xr = (t) => In(t, "Run command"), Sr = (t) => In(t, "Shell"), wr = (t) => {
1411
+ const e = xe(t), n = ot(t), o = v(e?.pattern) ?? void 0, s = pe(t, o, "Search files"), r = n ? [{
1331
1412
  type: "code",
1332
1413
  language: "text",
1333
1414
  code: n
1334
1415
  }] : [];
1335
1416
  return {
1336
- indicator: ae(t),
1337
- title: o,
1338
- blocks: ue(t, r)
1417
+ indicator: fe(t),
1418
+ title: s,
1419
+ blocks: me(t, r)
1339
1420
  };
1340
- }, gr = (t) => {
1341
- const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Find files"), r = [];
1421
+ }, Tr = (t) => {
1422
+ const e = xe(t), n = ot(t), o = v(e?.pattern) ?? void 0, s = pe(t, o, "Find files"), r = [];
1342
1423
  if (n) {
1343
1424
  const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
1344
1425
  i.length > 0 && r.push({
@@ -1347,63 +1428,63 @@ const Uo = {
1347
1428
  });
1348
1429
  }
1349
1430
  return {
1350
- indicator: ae(t),
1351
- title: o,
1352
- blocks: ue(t, r)
1431
+ indicator: fe(t),
1432
+ title: s,
1433
+ blocks: me(t, r)
1353
1434
  };
1354
- }, br = (t) => {
1355
- const e = et(t), n = e ? or(e) : null, s = rr(t) ?? n?.skillName, o = ce(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
1435
+ }, Ar = (t) => {
1436
+ const e = ot(t), n = e ? ur(e) : null, o = dr(t) ?? n?.skillName, s = pe(t, o, "Load skill"), r = n?.content ?? e, i = r ? [{
1356
1437
  type: "code",
1357
1438
  language: "markdown",
1358
1439
  code: r
1359
1440
  }] : [];
1360
1441
  return {
1361
- indicator: ae(t),
1362
- title: o,
1363
- blocks: ue(t, i)
1442
+ indicator: fe(t),
1443
+ title: s,
1444
+ blocks: me(t, i)
1364
1445
  };
1365
- }, ht = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, kn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
1366
- const e = kn(t);
1446
+ }, yt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, _n = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Cr = (t) => {
1447
+ const e = _n(t);
1367
1448
  if (!e) return null;
1368
- const n = ht(e.content) ?? ht(e.title);
1449
+ const n = yt(e.content) ?? yt(e.title);
1369
1450
  if (!n) return null;
1370
- const s = ht(e.status);
1451
+ const o = yt(e.status);
1371
1452
  return {
1372
1453
  label: n,
1373
- checked: s === "completed"
1454
+ checked: o === "completed"
1374
1455
  };
1375
- }, qt = (t) => {
1456
+ }, Ht = (t) => {
1376
1457
  if (!t) return {
1377
1458
  items: [],
1378
1459
  explicit: !1
1379
1460
  };
1380
1461
  const e = (() => {
1381
1462
  if (Array.isArray(t)) return t;
1382
- const n = kn(t);
1463
+ const n = _n(t);
1383
1464
  return !n || !Array.isArray(n.todos) ? null : n.todos;
1384
1465
  })();
1385
1466
  return e ? {
1386
- items: e.map(yr).filter((n) => n !== null),
1467
+ items: e.map(Cr).filter((n) => n !== null),
1387
1468
  explicit: !0
1388
1469
  } : {
1389
1470
  items: [],
1390
1471
  explicit: !1
1391
1472
  };
1392
- }, xr = (t) => {
1473
+ }, kr = (t) => {
1393
1474
  const {
1394
1475
  buildBaseTitle: e,
1395
1476
  buildIndicator: n,
1396
- prependErrorBlock: s
1477
+ prependErrorBlock: o
1397
1478
  } = t;
1398
- return (o) => {
1399
- const r = qt(o.state?.input), i = qt(o.state?.output), l = i.explicit ? i : r;
1479
+ return (s) => {
1480
+ const r = Ht(s.state?.input), i = Ht(s.state?.output), l = i.explicit ? i : r;
1400
1481
  if (!l.explicit) return null;
1401
- const a = l.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
1482
+ const a = l.items, c = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(s, c, "Update todos");
1402
1483
  if (a.length === 0)
1403
1484
  return {
1404
- indicator: n(o),
1485
+ indicator: n(s),
1405
1486
  title: d,
1406
- blocks: s(o, [{
1487
+ blocks: o(s, [{
1407
1488
  type: "comment",
1408
1489
  text: "No todos"
1409
1490
  }])
@@ -1413,45 +1494,45 @@ const Uo = {
1413
1494
  items: a
1414
1495
  }];
1415
1496
  return {
1416
- indicator: n(o),
1497
+ indicator: n(s),
1417
1498
  title: d,
1418
- blocks: s(o, f)
1499
+ blocks: o(s, f)
1419
1500
  };
1420
1501
  };
1421
- }, Sr = dr({
1422
- buildBaseTitle: ce,
1423
- buildIndicator: ae,
1424
- prependErrorBlock: ue
1425
- }), Wt = xr({
1426
- buildBaseTitle: ce,
1427
- buildIndicator: ae,
1428
- prependErrorBlock: ue
1429
- }), Ht = () => ({
1430
- apply_patch: ar,
1431
- bash: pr,
1432
- edit: ur,
1433
- glob: gr,
1434
- grep: hr,
1435
- question: Sr,
1436
- read: fr,
1437
- shell: mr,
1438
- skill: br,
1439
- todo_write: Wt,
1440
- todowrite: Wt
1441
- }), Vt = {
1502
+ }, Ir = br({
1503
+ buildBaseTitle: pe,
1504
+ buildIndicator: fe,
1505
+ prependErrorBlock: me
1506
+ }), Nt = kr({
1507
+ buildBaseTitle: pe,
1508
+ buildIndicator: fe,
1509
+ prependErrorBlock: me
1510
+ }), Vt = () => ({
1511
+ apply_patch: mr,
1512
+ bash: xr,
1513
+ edit: gr,
1514
+ glob: Tr,
1515
+ grep: wr,
1516
+ question: Ir,
1517
+ read: yr,
1518
+ shell: Sr,
1519
+ skill: Ar,
1520
+ todo_write: Nt,
1521
+ todowrite: Nt
1522
+ }), Ut = {
1442
1523
  error: "failed",
1443
1524
  "output-error": "failed",
1444
1525
  "input-streaming": "running"
1445
- }, wr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Cn = (t) => {
1446
- const e = Je(t ?? "tool").replace(/_/g, " ");
1447
- return wr(e);
1448
- }, In = (t) => t === "error" || t === "output-error", Tr = (t) => In(t.state?.status) ? {
1526
+ }, _r = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), vn = (t) => {
1527
+ const e = nt(t ?? "tool").replace(/_/g, " ");
1528
+ return _r(e);
1529
+ }, Mn = (t) => t === "error" || t === "output-error", vr = (t) => Mn(t.state?.status) ? {
1449
1530
  type: "icon",
1450
1531
  icon: "danger"
1451
1532
  } : {
1452
1533
  type: "icon",
1453
- icon: mn(t.tool ?? "tool")
1454
- }, Ar = (t) => !t || typeof t != "string" ? null : Vt[t] ? Vt[t] : t.includes("stream") ? "running" : null, kr = (t) => {
1534
+ icon: bn(t.tool ?? "tool")
1535
+ }, Mr = (t) => !t || typeof t != "string" ? null : Ut[t] ? Ut[t] : t.includes("stream") ? "running" : null, Rr = (t) => {
1455
1536
  if (typeof t == "string") return t;
1456
1537
  if (t == null) return null;
1457
1538
  try {
@@ -1459,31 +1540,31 @@ const Uo = {
1459
1540
  } catch {
1460
1541
  return null;
1461
1542
  }
1462
- }, St = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(St) : typeof t == "object" ? Object.values(t).every(St) : !1, tt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Cr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), Nt = (t) => !!t?.startsWith("image/"), Ir = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, _n = (t, e) => {
1463
- const n = tt(t);
1543
+ }, At = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(At) : typeof t == "object" ? Object.values(t).every(At) : !1, rt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), jt = (t) => !!t?.startsWith("image/"), Er = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, Rn = (t, e) => {
1544
+ const n = rt(t);
1464
1545
  if (!n) return null;
1465
- const s = Cr(n), o = N(n.data);
1466
- if (o && Nt(s))
1546
+ const o = Pr(n), s = N(n.data);
1547
+ if (s && jt(o))
1467
1548
  return {
1468
1549
  type: "image",
1469
- src: `data:${s};base64,${o}`,
1550
+ src: `data:${o};base64,${s}`,
1470
1551
  alt: e
1471
1552
  };
1472
1553
  const r = N(n.url) ?? N(n.src);
1473
- return r && (Nt(s) || Ir.test(r)) ? {
1554
+ return r && (jt(o) || Er.test(r)) ? {
1474
1555
  type: "image",
1475
1556
  src: r,
1476
1557
  alt: e
1477
1558
  } : null;
1478
- }, Rn = (t) => {
1479
- const e = tt(t);
1559
+ }, Pn = (t) => {
1560
+ const e = rt(t);
1480
1561
  if (!e) return null;
1481
- const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), s = N(e.content) ?? N(e.body) ?? N(e.text);
1482
- return !n || s === null ? null : {
1562
+ const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), o = N(e.content) ?? N(e.body) ?? N(e.text);
1563
+ return !n || o === null ? null : {
1483
1564
  filePath: n,
1484
- content: s
1565
+ content: o
1485
1566
  };
1486
- }, _r = {
1567
+ }, Dr = {
1487
1568
  css: "css",
1488
1569
  html: "html",
1489
1570
  js: "js",
@@ -1495,88 +1576,88 @@ const Uo = {
1495
1576
  tsx: "tsx",
1496
1577
  yaml: "yaml",
1497
1578
  yml: "yaml"
1498
- }, Rr = (t) => {
1579
+ }, Br = (t) => {
1499
1580
  const e = t.split(".").pop()?.toLowerCase();
1500
- return e ? _r[e] ?? e : "text";
1501
- }, Ut = (t, e) => e.length === 0 ? [] : [{
1581
+ return e ? Dr[e] ?? e : "text";
1582
+ }, Kt = (t, e) => e.length === 0 ? [] : [{
1502
1583
  type: "text",
1503
1584
  text: t
1504
- }, ...e], vr = (t, e) => {
1585
+ }, ...e], Fr = (t, e) => {
1505
1586
  const n = [];
1506
- for (const s of t) {
1507
- const o = tt(s), r = N(o?.type);
1587
+ for (const o of t) {
1588
+ const s = rt(o), r = N(s?.type);
1508
1589
  if (r === "image") {
1509
- const i = _n(s, e);
1590
+ const i = Rn(o, e);
1510
1591
  i && n.push(i);
1511
1592
  continue;
1512
1593
  }
1513
1594
  if (r === "text") {
1514
- const i = N(o?.text);
1595
+ const i = N(s?.text);
1515
1596
  i && n.push({
1516
1597
  type: "text",
1517
1598
  text: i
1518
1599
  });
1519
1600
  continue;
1520
1601
  }
1521
- n.push(...wt(s, e));
1602
+ n.push(...Ct(o, e));
1522
1603
  }
1523
1604
  return n;
1524
- }, Mr = (t) => {
1525
- const e = Rn(t);
1605
+ }, Lr = (t) => {
1606
+ const e = Pn(t);
1526
1607
  return e ? [{
1527
1608
  type: "code",
1528
- language: Rr(e.filePath),
1609
+ language: Br(e.filePath),
1529
1610
  code: e.content
1530
1611
  }] : null;
1531
- }, Pr = (t) => {
1532
- const e = tt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), s = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
1533
- return !n && !s ? null : [{
1612
+ }, $r = (t) => {
1613
+ const e = rt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), o = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
1614
+ return !n && !o ? null : [{
1534
1615
  type: "text",
1535
- text: n ?? `Attachment ${s}`
1616
+ text: n ?? `Attachment ${o}`
1536
1617
  }];
1537
- }, wt = (t, e) => {
1538
- if (St(t)) return [];
1539
- const n = _n(t, e);
1618
+ }, Ct = (t, e) => {
1619
+ if (At(t)) return [];
1620
+ const n = Rn(t, e);
1540
1621
  if (n) return [n];
1541
- if (Array.isArray(t)) return vr(t, e);
1542
- const s = Mr(t);
1543
- if (s) return s;
1544
- const o = Pr(t);
1622
+ if (Array.isArray(t)) return Fr(t, e);
1623
+ const o = Lr(t);
1545
1624
  if (o) return o;
1546
- const r = kr(t);
1625
+ const s = $r(t);
1626
+ if (s) return s;
1627
+ const r = Rr(t);
1547
1628
  return r?.trim() ? [{
1548
1629
  type: "code",
1549
1630
  language: typeof t == "string" ? "text" : "json",
1550
1631
  code: r
1551
1632
  }] : [];
1552
- }, Er = (t) => {
1553
- const e = [], n = Cn(t.tool);
1554
- return In(t.state?.status) && t.state?.errorText && e.push({
1633
+ }, Or = (t) => {
1634
+ const e = [], n = vn(t.tool);
1635
+ return Mn(t.state?.status) && t.state?.errorText && e.push({
1555
1636
  type: "comment",
1556
1637
  text: t.state.errorText
1557
- }), e.push(...Ut("Input", wt(t.state?.input, `${n} input`))), e.push(...Ut("Output", wt(t.state?.output, `${n} output`))), e;
1558
- }, Dr = (t) => {
1638
+ }), e.push(...Kt("Input", Ct(t.state?.input, `${n} input`))), e.push(...Kt("Output", Ct(t.state?.output, `${n} output`))), e;
1639
+ }, zr = (t) => {
1559
1640
  const e = [{
1560
1641
  kind: "text",
1561
- text: Cn(t.tool),
1642
+ text: vn(t.tool),
1562
1643
  bold: !0
1563
- }], n = Rn(t.state?.output);
1644
+ }], n = Pn(t.state?.output);
1564
1645
  n && e.push({
1565
1646
  kind: "link",
1566
1647
  text: n.filePath,
1567
1648
  filePath: n.filePath
1568
1649
  });
1569
- const s = Ar(t.state?.status);
1570
- return s && e.push({
1650
+ const o = Mr(t.state?.status);
1651
+ return o && e.push({
1571
1652
  kind: "text",
1572
- text: s,
1653
+ text: o,
1573
1654
  muted: !0
1574
1655
  }), {
1575
- indicator: Tr(t),
1656
+ indicator: vr(t),
1576
1657
  title: e,
1577
- blocks: Er(t)
1658
+ blocks: Or(t)
1578
1659
  };
1579
- }, Br = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, Fr = (t) => {
1660
+ }, Qr = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, qr = (t) => {
1580
1661
  switch (t.type) {
1581
1662
  case "comment":
1582
1663
  case "code":
@@ -1596,355 +1677,355 @@ const Uo = {
1596
1677
  case "component":
1597
1678
  return !0;
1598
1679
  }
1599
- }, Lr = (t) => {
1600
- const e = t.title.some(Br), n = (t.blocks ?? []).some(Fr);
1680
+ }, Wr = (t) => {
1681
+ const e = t.title.some(Qr), n = (t.blocks ?? []).some(qr);
1601
1682
  return e || n;
1602
- }, $r = (t) => t ? {
1603
- ...Ht(),
1683
+ }, Hr = (t) => t ? {
1684
+ ...Vt(),
1604
1685
  ...t
1605
- } : Ht(), Or = (t, e) => {
1686
+ } : Vt(), Nr = (t, e) => {
1606
1687
  const n = t.tool ?? "tool";
1607
- for (const s of vo(n)) {
1608
- const o = e[s];
1609
- if (o) return o;
1688
+ for (const o of Fo(n)) {
1689
+ const s = e[o];
1690
+ if (s) return s;
1610
1691
  }
1611
- }, zr = (t, e, n) => {
1612
- const s = Or(t, e);
1613
- if (s) {
1614
- const o = s(t, n);
1615
- if (o) return o;
1692
+ }, Vr = (t, e, n) => {
1693
+ const o = Nr(t, e);
1694
+ if (o) {
1695
+ const s = o(t, n);
1696
+ if (s) return s;
1616
1697
  }
1617
- return Dr(t);
1618
- }, Qr = (t, e) => {
1619
- const n = $r(e?.toolRenderers);
1698
+ return zr(t);
1699
+ }, Ur = (t, e) => {
1700
+ const n = Hr(e?.toolRenderers);
1620
1701
  return {
1621
- items: t.map((o) => zr(o, n, e)).filter(Lr)
1702
+ items: t.map((s) => Vr(s, n, e)).filter(Wr)
1622
1703
  };
1623
- }, vn = (t, e, n, s = !1) => {
1624
- s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1704
+ }, En = (t, e, n, o = !1) => {
1705
+ o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1625
1706
  };
1626
- function qr(t) {
1627
- const e = A(6), {
1707
+ function jr(t) {
1708
+ const e = C(6), {
1628
1709
  seg: n
1629
1710
  } = t;
1630
- let s;
1631
- e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
1632
1711
  let o;
1633
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
1712
+ e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ u(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
1713
+ let s;
1714
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ u(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = s) : s = e[3];
1634
1715
  let r;
1635
- return e[4] !== s ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
1636
- s,
1637
- o
1638
- ] }), e[4] = s, e[5] = r) : r = e[5], r;
1716
+ return e[4] !== o ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
1717
+ o,
1718
+ s
1719
+ ] }), e[4] = o, e[5] = r) : r = e[5], r;
1639
1720
  }
1640
- function Wr(t) {
1641
- const e = A(9), {
1721
+ function Kr(t) {
1722
+ const e = C(9), {
1642
1723
  seg: n,
1643
- onOpenFile: s
1644
- } = t, o = n.additions ?? 0, r = n.deletions ?? 0;
1724
+ onOpenFile: o
1725
+ } = t, s = n.additions ?? 0, r = n.deletions ?? 0;
1645
1726
  let i;
1646
- e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1727
+ e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1647
1728
  const a = n.filePath ?? n.fileName;
1648
- s?.(a);
1649
- }, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1729
+ o?.(a);
1730
+ }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1650
1731
  let l;
1651
- return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ c(Cs, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1732
+ return e[4] !== n.fileName || e[5] !== s || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ u(vs, { fileName: n.fileName, additions: s, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = s, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1652
1733
  }
1653
- function Hr(t) {
1654
- const e = A(13), {
1734
+ function Xr(t) {
1735
+ const e = C(13), {
1655
1736
  seg: n,
1656
- onOpenFile: s
1657
- } = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
1658
- let u;
1659
- e[0] !== s || e[1] !== n ? (u = (m) => vn(m, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
1737
+ onOpenFile: o
1738
+ } = t, s = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
1739
+ let c;
1740
+ e[0] !== o || e[1] !== n ? (c = (p) => En(p, n, o, !0), e[0] = o, e[1] = n, e[2] = c) : c = e[2];
1660
1741
  const d = n.muted ? "fg.muted" : "fg.blue-dark";
1661
1742
  let f;
1662
1743
  e[3] !== d ? (f = {
1663
1744
  textDecoration: "underline",
1664
1745
  color: d
1665
1746
  }, e[3] = d, e[4] = f) : f = e[4];
1666
- let p;
1667
- return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== u || e[11] !== f ? (p = /* @__PURE__ */ c(Jt, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: a, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = u, e[11] = f, e[12] = p) : p = e[12], p;
1747
+ let m;
1748
+ return e[5] !== s || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== c || e[11] !== f ? (m = /* @__PURE__ */ u(en, { href: i, fontWeight: s, color: l, textDecoration: "none", cursor: a, onClick: c, _hover: f, children: n.text }), e[5] = s, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = c, e[11] = f, e[12] = m) : m = e[12], m;
1668
1749
  }
1669
- function Vr(t) {
1670
- const e = A(12), {
1750
+ function Gr(t) {
1751
+ const e = C(12), {
1671
1752
  seg: n,
1672
- onOpenFile: s
1673
- } = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1753
+ onOpenFile: o
1754
+ } = t, s = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1674
1755
  let l;
1675
- e[0] !== s || e[1] !== n ? (l = (f) => vn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
1756
+ e[0] !== o || e[1] !== n ? (l = (f) => En(f, n, o), e[0] = o, e[1] = n, e[2] = l) : l = e[2];
1676
1757
  const a = n.muted ? "fg.muted" : "accent.primary";
1677
- let u;
1678
- e[3] !== a ? (u = {
1758
+ let c;
1759
+ e[3] !== a ? (c = {
1679
1760
  color: a,
1680
1761
  textDecoration: "underline"
1681
- }, e[3] = a, e[4] = u) : u = e[4];
1762
+ }, e[3] = a, e[4] = c) : c = e[4];
1682
1763
  let d;
1683
- return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ c(Jt, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
1764
+ return e[5] !== s || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== c ? (d = /* @__PURE__ */ u(en, { href: r, fontWeight: s, color: i, textDecoration: "underline", onClick: l, _hover: c, children: n.text }), e[5] = s, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = c, e[11] = d) : d = e[11], d;
1684
1765
  }
1685
- function Nr(t) {
1686
- const e = A(14), {
1766
+ function Yr(t) {
1767
+ const e = C(14), {
1687
1768
  seg: n,
1688
- isClickable: s
1689
- } = t, o = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, u = n.truncate ? "nowrap" : void 0, d = s && !n.muted ? "fg" : "fg.muted";
1769
+ isClickable: o
1770
+ } = t, s = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, c = n.truncate ? "nowrap" : void 0, d = o && !n.muted ? "fg" : "fg.muted";
1690
1771
  let f;
1691
1772
  e[0] !== d ? (f = {
1692
1773
  color: d
1693
1774
  }, e[0] = d, e[1] = f) : f = e[1];
1694
- let p;
1695
- e[2] !== n.text || e[3] !== o || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== f ? (p = /* @__PURE__ */ c($e, { fontWeight: o, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: u, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = o, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = u, e[9] = f, e[10] = p) : p = e[10];
1696
- const m = p;
1775
+ let m;
1776
+ e[2] !== n.text || e[3] !== s || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== c || e[9] !== f ? (m = /* @__PURE__ */ u(ze, { fontWeight: s, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: c, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = s, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = c, e[9] = f, e[10] = m) : m = e[10];
1777
+ const p = m;
1697
1778
  if (!n.truncate)
1698
- return m;
1779
+ return p;
1699
1780
  let h;
1700
- return e[11] !== n.text || e[12] !== m ? (h = /* @__PURE__ */ c(Ct, { content: n.text, children: m }), e[11] = n.text, e[12] = m, e[13] = h) : h = e[13], h;
1781
+ return e[11] !== n.text || e[12] !== p ? (h = /* @__PURE__ */ u(vt, { content: n.text, children: p }), e[11] = n.text, e[12] = p, e[13] = h) : h = e[13], h;
1701
1782
  }
1702
- function Ur(t) {
1703
- const e = A(11), {
1783
+ function Jr(t) {
1784
+ const e = C(11), {
1704
1785
  seg: n,
1705
- isClickable: s,
1706
- onOpenFile: o
1786
+ isClickable: o,
1787
+ onOpenFile: s
1707
1788
  } = t;
1708
1789
  switch (n.kind) {
1709
1790
  case "avatar": {
1710
1791
  let r;
1711
- return e[0] !== n ? (r = /* @__PURE__ */ c(qr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1792
+ return e[0] !== n ? (r = /* @__PURE__ */ u(jr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1712
1793
  }
1713
1794
  case "diff": {
1714
1795
  let r;
1715
- return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ c(Wr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
1796
+ return e[2] !== s || e[3] !== n ? (r = /* @__PURE__ */ u(Kr, { seg: n, onOpenFile: s }), e[2] = s, e[3] = n, e[4] = r) : r = e[4], r;
1716
1797
  }
1717
1798
  case "link": {
1718
1799
  let r;
1719
- return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ c(Hr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ c(Vr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
1800
+ return e[5] !== s || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ u(Xr, { seg: n, onOpenFile: s }) : /* @__PURE__ */ u(Gr, { seg: n, onOpenFile: s }), e[5] = s, e[6] = n, e[7] = r) : r = e[7], r;
1720
1801
  }
1721
1802
  case "text": {
1722
1803
  let r;
1723
- return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ c(Nr, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
1804
+ return e[8] !== o || e[9] !== n ? (r = /* @__PURE__ */ u(Yr, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = r) : r = e[10], r;
1724
1805
  }
1725
1806
  default:
1726
1807
  return null;
1727
1808
  }
1728
1809
  }
1729
- const he = Nn;
1730
- function jr(t) {
1731
- const e = A(10), {
1810
+ const ge = Kn;
1811
+ function Zr(t) {
1812
+ const e = C(10), {
1732
1813
  ind: n
1733
1814
  } = t;
1734
1815
  if (!n || n.type === "none")
1735
1816
  return null;
1736
1817
  if (n.type === "icon") {
1737
1818
  let i;
1738
- e[0] !== n.icon ? (i = Eo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1819
+ e[0] !== n.icon ? (i = Oo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1739
1820
  const l = i;
1740
1821
  let a;
1741
- return e[2] !== l ? (a = /* @__PURE__ */ c(he.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ c(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
1822
+ return e[2] !== l ? (a = /* @__PURE__ */ u(ge.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ u(ze, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ u(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
1742
1823
  }
1743
- let s;
1744
- e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
1745
1824
  let o;
1746
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
1825
+ e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ u(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1826
+ let s;
1827
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ u(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = s) : s = e[7];
1747
1828
  let r;
1748
- return e[8] !== s ? (r = /* @__PURE__ */ c(he.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
1749
- s,
1750
- o
1751
- ] }) }), e[8] = s, e[9] = r) : r = e[9], r;
1829
+ return e[8] !== o ? (r = /* @__PURE__ */ u(ge.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
1830
+ o,
1831
+ s
1832
+ ] }) }), e[8] = o, e[9] = r) : r = e[9], r;
1752
1833
  }
1753
- function Kr(t) {
1754
- const e = A(5), {
1834
+ function ei(t) {
1835
+ const e = C(5), {
1755
1836
  code: n,
1756
- language: s
1757
- } = t, o = s ? `${s} code block` : "code block";
1837
+ language: o
1838
+ } = t, s = o ? `${o} code block` : "code block";
1758
1839
  let r;
1759
- e[0] !== n ? (r = /* @__PURE__ */ c(P, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1840
+ e[0] !== n ? (r = /* @__PURE__ */ u(D, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1760
1841
  let i;
1761
- return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ c(Ye, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ c(P, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
1842
+ return e[2] !== s || e[3] !== r ? (i = /* @__PURE__ */ u(tt, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ u(D, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": s, children: r }) }), e[2] = s, e[3] = r, e[4] = i) : i = e[4], i;
1762
1843
  }
1763
- function Xr(t) {
1764
- const e = A(38), {
1844
+ function ti(t) {
1845
+ const e = C(38), {
1765
1846
  b: n,
1766
- onOpenFile: s
1847
+ onOpenFile: o
1767
1848
  } = t;
1768
1849
  switch (n.type) {
1769
1850
  case "comment": {
1770
- let o;
1771
- e[0] !== n.text ? (o = /* @__PURE__ */ c(Y.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1851
+ let s;
1852
+ e[0] !== n.text ? (s = /* @__PURE__ */ u(se.Body, { children: n.text }), e[0] = n.text, e[1] = s) : s = e[1];
1772
1853
  let r;
1773
- e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ c(Y.Footer, { children: /* @__PURE__ */ k(Oe, { children: [
1854
+ e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ u(se.Footer, { children: /* @__PURE__ */ k(Qe, { children: [
1774
1855
  "👏 ",
1775
1856
  n.reactions.clap
1776
1857
  ] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
1777
1858
  let i;
1778
- return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(Y.Root, { children: [
1779
- o,
1859
+ return e[4] !== s || e[5] !== r ? (i = /* @__PURE__ */ k(se.Root, { children: [
1860
+ s,
1780
1861
  r
1781
- ] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
1862
+ ] }), e[4] = s, e[5] = r, e[6] = i) : i = e[6], i;
1782
1863
  }
1783
1864
  case "code": {
1784
- let o;
1785
- return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(Kr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1865
+ let s;
1866
+ return e[7] !== n.code || e[8] !== n.language ? (s = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", children: /* @__PURE__ */ u(se.Body, { padding: "0", children: /* @__PURE__ */ u(ei, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = s) : s = e[9], s;
1786
1867
  }
1787
1868
  case "diff": {
1788
- const o = n.sideBySide ?? !1;
1869
+ const s = n.sideBySide ?? !1;
1789
1870
  let r;
1790
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(P, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ c(Is, { 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;
1871
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== s ? (r = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", children: /* @__PURE__ */ u(se.Body, { padding: "0", children: /* @__PURE__ */ u(D, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ u(Ms, { original: n.original, modified: n.modified, language: n.language, sideBySide: s, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = s, e[14] = r) : r = e[14], r;
1791
1872
  }
1792
1873
  case "text": {
1793
- let o;
1794
- return e[15] !== n.text ? (o = /* @__PURE__ */ c(Y.Root, { background: "transparent", children: /* @__PURE__ */ c(Y.Body, { padding: "sm", children: /* @__PURE__ */ c(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1874
+ let s;
1875
+ return e[15] !== n.text ? (s = /* @__PURE__ */ u(se.Root, { background: "transparent", children: /* @__PURE__ */ u(se.Body, { padding: "sm", children: /* @__PURE__ */ u(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = s) : s = e[16], s;
1795
1876
  }
1796
1877
  case "todo-list": {
1797
- let o;
1798
- return e[17] !== n.items ? (o = /* @__PURE__ */ c(Ys, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
1878
+ let s;
1879
+ return e[17] !== n.items ? (s = /* @__PURE__ */ u(eo, { items: n.items }), e[17] = n.items, e[18] = s) : s = e[18], s;
1799
1880
  }
1800
1881
  case "question-form": {
1801
- let o;
1802
- return e[19] !== n.questions ? (o = /* @__PURE__ */ c(un, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
1882
+ let s;
1883
+ return e[19] !== n.questions ? (s = /* @__PURE__ */ u(fn, { questions: n.questions }), e[19] = n.questions, e[20] = s) : s = e[20], s;
1803
1884
  }
1804
1885
  case "references": {
1805
- let o;
1806
- e[21] !== n.references ? (o = n.references.map(Gr), e[21] = n.references, e[22] = o) : o = e[22];
1886
+ let s;
1887
+ e[21] !== n.references ? (s = n.references.map(ni), e[21] = n.references, e[22] = s) : s = e[22];
1807
1888
  let r;
1808
- return e[23] !== o ? (r = /* @__PURE__ */ c(j, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
1889
+ return e[23] !== s ? (r = /* @__PURE__ */ u(X, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: s }), e[23] = s, e[24] = r) : r = e[24], r;
1809
1890
  }
1810
1891
  case "image": {
1811
1892
  if (!n.src.trim())
1812
1893
  return null;
1813
- let o;
1814
- e[25] !== n.alt || e[26] !== n.src ? (o = /* @__PURE__ */ c(Zt, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = o) : o = e[27];
1894
+ let s;
1895
+ e[25] !== n.alt || e[26] !== n.src ? (s = /* @__PURE__ */ u(tn, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = s) : s = e[27];
1815
1896
  let r;
1816
- e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ c(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
1897
+ e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ u(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
1817
1898
  let i;
1818
- return e[30] !== o || e[31] !== r ? (i = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(Y.Body, { padding: "0", children: [
1819
- o,
1899
+ return e[30] !== s || e[31] !== r ? (i = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(se.Body, { padding: "0", children: [
1900
+ s,
1820
1901
  r
1821
- ] }) }), e[30] = o, e[31] = r, e[32] = i) : i = e[32], i;
1902
+ ] }) }), e[30] = s, e[31] = r, e[32] = i) : i = e[32], i;
1822
1903
  }
1823
1904
  case "component": {
1824
- let o;
1825
- e[33] !== n || e[34] !== s ? (o = n.render({
1826
- onOpenFile: s
1827
- }), e[33] = n, e[34] = s, e[35] = o) : o = e[35];
1905
+ let s;
1906
+ e[33] !== n || e[34] !== o ? (s = n.render({
1907
+ onOpenFile: o
1908
+ }), e[33] = n, e[34] = o, e[35] = s) : s = e[35];
1828
1909
  let r;
1829
- return e[36] !== o ? (r = /* @__PURE__ */ c(At, { children: o }), e[36] = o, e[37] = r) : r = e[37], r;
1910
+ return e[36] !== s ? (r = /* @__PURE__ */ u(It, { children: s }), e[36] = s, e[37] = r) : r = e[37], r;
1830
1911
  }
1831
1912
  }
1832
1913
  }
1833
- function Gr(t) {
1834
- return /* @__PURE__ */ c(It, { fileName: t }, t);
1914
+ function ni(t) {
1915
+ return /* @__PURE__ */ u(Mt, { fileName: t }, t);
1835
1916
  }
1836
- function Yr(t) {
1837
- const e = A(23), {
1917
+ function si(t) {
1918
+ const e = C(23), {
1838
1919
  item: n,
1839
- itemKey: s,
1840
- isOpen: o,
1920
+ itemKey: o,
1921
+ isOpen: s,
1841
1922
  canExpand: r,
1842
1923
  hasBlocks: i,
1843
1924
  onToggle: l,
1844
1925
  onOpenFile: a
1845
1926
  } = t;
1846
- let u;
1847
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(he.Separator, {}), e[0] = u) : u = e[0];
1927
+ let c;
1928
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(ge.Separator, {}), e[0] = c) : c = e[0];
1848
1929
  let d;
1849
- e[1] !== n.indicator ? (d = /* @__PURE__ */ k(he.Connector, { children: [
1850
- u,
1851
- /* @__PURE__ */ c(jr, { ind: n.indicator })
1930
+ e[1] !== n.indicator ? (d = /* @__PURE__ */ k(ge.Connector, { children: [
1931
+ c,
1932
+ /* @__PURE__ */ u(Zr, { ind: n.indicator })
1852
1933
  ] }), e[1] = n.indicator, e[2] = d) : d = e[2];
1853
- const f = o ? "auto" : "20px";
1854
- let p;
1855
- e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== a || e[8] !== l ? (p = n.title.length > 0 && /* @__PURE__ */ c(he.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k($e, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
1856
- /* @__PURE__ */ c($e, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, x) => /* @__PURE__ */ c(Ur, { seg: b, isClickable: r, onOpenFile: a }, x)) }),
1857
- r ? /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
1858
- color: "fg"
1859
- }, children: /* @__PURE__ */ c(ps, { size: 12 }) }) : null
1860
- ] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = a, e[8] = l, e[9] = p) : p = e[9];
1934
+ const f = s ? "auto" : "20px";
1861
1935
  let m;
1862
- e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== a ? (m = i ? /* @__PURE__ */ c(P, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ c(P, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, x) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Xr, { b, onOpenFile: a }) }, x)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = a, e[14] = m) : m = e[14];
1936
+ e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ u(ge.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(o) : void 0, children: /* @__PURE__ */ k(ze, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
1937
+ /* @__PURE__ */ u(ze, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, y) => /* @__PURE__ */ u(Jr, { seg: b, isClickable: r, onOpenFile: a }, y)) }),
1938
+ r ? /* @__PURE__ */ u(ze, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
1939
+ color: "fg"
1940
+ }, children: /* @__PURE__ */ u(gs, { size: 12 }) }) : null
1941
+ ] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = a, e[8] = l, e[9] = m) : m = e[9];
1942
+ let p;
1943
+ e[10] !== i || e[11] !== s || e[12] !== n.blocks || e[13] !== a ? (p = i ? /* @__PURE__ */ u(D, { display: "grid", gridTemplateRows: s ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: s ? /* @__PURE__ */ u(D, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, y) => /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(ti, { b, onOpenFile: a }) }, y)) }) : null }) : null, e[10] = i, e[11] = s, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
1863
1944
  let h;
1864
- e[15] !== f || e[16] !== p || e[17] !== m ? (h = /* @__PURE__ */ k(he.Content, { h: f, children: [
1865
- p,
1866
- m
1867
- ] }), e[15] = f, e[16] = p, e[17] = m, e[18] = h) : h = e[18];
1945
+ e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(ge.Content, { h: f, children: [
1946
+ m,
1947
+ p
1948
+ ] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
1868
1949
  let g;
1869
- return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(he.Item, { gap: "xs", children: [
1950
+ return e[19] !== o || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(ge.Item, { gap: "xs", children: [
1870
1951
  d,
1871
1952
  h
1872
- ] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1953
+ ] }, o), e[19] = o, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1873
1954
  }
1874
- function Jr(t) {
1875
- const e = A(11), {
1955
+ function oi(t) {
1956
+ const e = C(11), {
1876
1957
  data: n,
1877
- onOpenFile: s
1958
+ onOpenFile: o
1878
1959
  } = t;
1879
- let o;
1880
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1881
- const [r, i] = V(o), l = Zr;
1960
+ let s;
1961
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {}, e[0] = s) : s = e[0];
1962
+ const [r, i] = W(s), l = ri;
1882
1963
  let a;
1883
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (p) => {
1884
- i((m) => ({
1885
- ...m,
1886
- [p]: !m[p]
1964
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (m) => {
1965
+ i((p) => ({
1966
+ ...p,
1967
+ [m]: !p[m]
1887
1968
  }));
1888
1969
  }, e[1] = a) : a = e[1];
1889
- const u = a;
1970
+ const c = a;
1890
1971
  let d;
1891
- if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
1892
- let p;
1893
- e[6] !== r || e[7] !== s ? (p = (m, h) => {
1894
- const g = l(m, h), b = (m.blocks?.length ?? 0) > 0, x = (m.expandable ?? !0) && b, y = x ? r[g] ?? !1 : b;
1895
- return /* @__PURE__ */ c(Yr, { item: m, itemKey: g, isOpen: y, canExpand: x, hasBlocks: b, onToggle: u, onOpenFile: s }, g);
1896
- }, e[6] = r, e[7] = s, e[8] = p) : p = e[8], d = n.items.map(p), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
1972
+ if (e[2] !== n.items || e[3] !== r || e[4] !== o) {
1973
+ let m;
1974
+ e[6] !== r || e[7] !== o ? (m = (p, h) => {
1975
+ const g = l(p, h), b = (p.blocks?.length ?? 0) > 0, y = (p.expandable ?? !0) && b, x = y ? r[g] ?? !1 : b;
1976
+ return /* @__PURE__ */ u(si, { item: p, itemKey: g, isOpen: x, canExpand: y, hasBlocks: b, onToggle: c, onOpenFile: o }, g);
1977
+ }, e[6] = r, e[7] = o, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = o, e[5] = d;
1897
1978
  } else
1898
1979
  d = e[5];
1899
1980
  let f;
1900
- return e[9] !== d ? (f = /* @__PURE__ */ c(he.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1981
+ return e[9] !== d ? (f = /* @__PURE__ */ u(ge.Root, { variant: "tool", children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1901
1982
  }
1902
- function Zr(t, e) {
1983
+ function ri(t, e) {
1903
1984
  return t.id ? `id:${t.id}` : `idx:${e}`;
1904
1985
  }
1905
- const ei = (t) => Je(t.tool ?? "").replace(/_/g, "") === "question", ti = (t) => {
1986
+ const ii = (t) => nt(t.tool ?? "").replace(/_/g, "") === "question", li = (t) => {
1906
1987
  const e = t.state?.output;
1907
1988
  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;
1908
1989
  };
1909
- function ni(t) {
1910
- const e = A(8), {
1990
+ function ai(t) {
1991
+ const e = C(8), {
1911
1992
  invocations: n,
1912
- labeledBlocks: s,
1913
- hideQuestionForms: o,
1993
+ labeledBlocks: o,
1994
+ hideQuestionForms: s,
1914
1995
  onOpenFile: r
1915
- } = t, i = o === void 0 ? !1 : o;
1996
+ } = t, i = s === void 0 ? !1 : s;
1916
1997
  let l, a;
1917
- if (e[0] !== i || e[1] !== n || e[2] !== s) {
1998
+ if (e[0] !== i || e[1] !== n || e[2] !== o) {
1918
1999
  a = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1919
2000
  e: {
1920
- const f = i ? n.filter(si) : n;
2001
+ const f = i ? n.filter(ci) : n;
1921
2002
  if (f.length === 0) {
1922
2003
  a = null;
1923
2004
  break e;
1924
2005
  }
1925
- l = Qr(f, {
1926
- labeledBlocks: s
2006
+ l = Ur(f, {
2007
+ labeledBlocks: o
1927
2008
  });
1928
2009
  }
1929
- e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = a;
2010
+ e[0] = i, e[1] = n, e[2] = o, e[3] = l, e[4] = a;
1930
2011
  } else
1931
2012
  l = e[3], a = e[4];
1932
2013
  if (a !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1933
2014
  return a;
1934
- const u = l;
2015
+ const c = l;
1935
2016
  let d;
1936
- return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ c(Jr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
2017
+ return e[5] !== c || e[6] !== r ? (d = /* @__PURE__ */ u(oi, { data: c, onOpenFile: r }), e[5] = c, e[6] = r, e[7] = d) : d = e[7], d;
1937
2018
  }
1938
- function si(t) {
1939
- return !ei(t) || ti(t);
2019
+ function ci(t) {
2020
+ return !ii(t) || li(t);
1940
2021
  }
1941
- const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", ri = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, ii = (t) => t.mediaType?.startsWith("image/") || ri.test(Et(t)), li = (t) => ii(t) ? /* @__PURE__ */ c(Zt, { src: t.url, alt: `${Et(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, ai = (t, e) => {
2022
+ const ui = (t) => t.type === "tool", Ft = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", di = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, fi = (t) => t.mediaType?.startsWith("image/") || di.test(Ft(t)), pi = (t) => fi(t) ? /* @__PURE__ */ u(tn, { src: t.url, alt: `${Ft(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, mi = (t, e) => {
1942
2023
  if (e) {
1943
2024
  e(t.url);
1944
2025
  return;
1945
2026
  }
1946
2027
  typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
1947
- }, ci = (t) => {
2028
+ }, hi = (t) => {
1948
2029
  if (t.message && t.message.trim().length > 0)
1949
2030
  return t.message;
1950
2031
  const {
@@ -1960,737 +2041,743 @@ const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").
1960
2041
  default:
1961
2042
  return "An error occurred.";
1962
2043
  }
1963
- }, ui = {
2044
+ }, gi = {
1964
2045
  info: "blue",
1965
2046
  warning: "orange",
1966
2047
  error: "red",
1967
2048
  success: "green",
1968
2049
  loading: "blue"
1969
- }, di = (t, e) => {
2050
+ }, bi = (t, e) => {
1970
2051
  const n = [];
1971
- let s = e;
1972
- for (; s < t.length; ) {
1973
- const o = t[s];
1974
- if (!oi(o)) break;
1975
- n.push(o), s += 1;
2052
+ let o = e;
2053
+ for (; o < t.length; ) {
2054
+ const s = t[o];
2055
+ if (!ui(s)) break;
2056
+ n.push(s), o += 1;
1976
2057
  }
1977
2058
  return {
1978
2059
  invocations: n,
1979
- nextIndex: s - 1
2060
+ nextIndex: o - 1
1980
2061
  };
1981
2062
  };
1982
- function Mn(t) {
1983
- const e = A(8), {
2063
+ function Dn(t) {
2064
+ const e = C(8), {
1984
2065
  message: n,
1985
- hideQuestionForms: s,
1986
- onOpenFile: o,
2066
+ hideQuestionForms: o,
2067
+ onOpenFile: s,
1987
2068
  toolInvocationTimeline: r
1988
- } = t, i = s === void 0 ? !1 : s, l = r ?? ni;
2069
+ } = t, i = o === void 0 ? !1 : o, l = r ?? ai;
1989
2070
  let a;
1990
2071
  e[0] !== n.parts ? (a = n.parts ?? [], e[0] = n.parts, e[1] = a) : a = e[1];
1991
- const u = a;
2072
+ const c = a;
1992
2073
  let d;
1993
- if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
2074
+ if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== s || e[6] !== c) {
1994
2075
  const f = [];
1995
- for (let p = 0; p < u.length; p = p + 1, p) {
1996
- const m = u[p], h = `${n.id}-${p}`;
1997
- e: switch (m.type) {
2076
+ for (let m = 0; m < c.length; m = m + 1, m) {
2077
+ const p = c[m], h = `${n.id}-${m}`;
2078
+ e: switch (p.type) {
1998
2079
  case "text": {
1999
- f.push(/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(Ro, { children: m.text }) }, h));
2080
+ f.push(/* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(Bo, { children: p.text }) }, h));
2000
2081
  break e;
2001
2082
  }
2002
2083
  case "reasoning": {
2003
- f.push(/* @__PURE__ */ c(P, { padding: "0", css: {
2084
+ f.push(/* @__PURE__ */ u(D, { padding: "0", css: {
2004
2085
  "& .rich-text, & .rich-text *": {
2005
2086
  color: "fg.subtle !important",
2006
2087
  fontSize: ".75rem !important",
2007
2088
  fontWeight: "normal !important"
2008
2089
  }
2009
- }, children: /* @__PURE__ */ c(rn, { defaultState: m.text, fullWidth: !0 }) }, h));
2090
+ }, children: /* @__PURE__ */ u(an, { defaultState: p.text, fullWidth: !0 }) }, h));
2010
2091
  break e;
2011
2092
  }
2012
2093
  case "tool": {
2013
2094
  const {
2014
2095
  invocations: g,
2015
2096
  nextIndex: b
2016
- } = di(u, p);
2017
- p = b, f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
2097
+ } = bi(c, m);
2098
+ m = b, f.push(/* @__PURE__ */ u(D, { width: "full", children: /* @__PURE__ */ u(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: s }) }, h));
2018
2099
  break e;
2019
2100
  }
2020
2101
  case "file": {
2021
- f.push(/* @__PURE__ */ c(P, { width: "fit-content", children: /* @__PURE__ */ c(It, { fileName: Et(m), size: "sm", tone: "neutral", icon: li(m), onSelect: () => ai(m, o) }) }, h));
2102
+ f.push(/* @__PURE__ */ u(D, { width: "fit-content", children: /* @__PURE__ */ u(Mt, { fileName: Ft(p), size: "sm", tone: "neutral", icon: pi(p), onSelect: () => mi(p, s) }) }, h));
2022
2103
  break e;
2023
2104
  }
2024
2105
  case "error": {
2025
- f.push(/* @__PURE__ */ c(P, { py: "2", width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: "error", colorPalette: "red", title: ci(m), size: "sm" }) }, h));
2106
+ f.push(/* @__PURE__ */ u(D, { py: "2", width: "full", children: /* @__PURE__ */ u($t, { borderRadius: "xs", status: "error", colorPalette: "red", title: hi(p), size: "sm" }) }, h));
2026
2107
  break e;
2027
2108
  }
2028
2109
  case "token_usage":
2029
2110
  break e;
2030
2111
  case "alert": {
2031
- f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: m.status === "loading" ? "info" : m.status, colorPalette: ui[m.status], title: m.title, icon: m.status === "loading" ? /* @__PURE__ */ c(kt, { size: "sm" }) : void 0, size: "sm", children: m.message }) }, h));
2112
+ f.push(/* @__PURE__ */ u(D, { width: "full", children: /* @__PURE__ */ u($t, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: gi[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ u(_t, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
2032
2113
  break e;
2033
2114
  }
2034
2115
  default:
2035
2116
  f.push(null);
2036
2117
  }
2037
2118
  }
2038
- d = /* @__PURE__ */ c(At, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
2119
+ d = /* @__PURE__ */ u(It, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = s, e[6] = c, e[7] = d;
2039
2120
  } else
2040
2121
  d = e[7];
2041
2122
  return d;
2042
2123
  }
2043
- const fi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Pn = (t) => t.text.trim().length > 0, pi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), mi = (t) => {
2124
+ const yi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Bn = (t) => t.text.trim().length > 0, xi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), Si = (t) => {
2044
2125
  switch (t.type) {
2045
2126
  case "text":
2046
2127
  case "reasoning":
2047
- return Pn(t);
2128
+ return Bn(t);
2048
2129
  case "tool":
2049
2130
  case "file":
2050
2131
  case "error":
2051
2132
  return !0;
2052
2133
  case "alert":
2053
- return pi(t);
2134
+ return xi(t);
2054
2135
  default:
2055
2136
  return !1;
2056
2137
  }
2057
- }, hi = (t) => t.type === "reasoning" || t.type === "tool", gi = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(hi), bi = (t) => {
2138
+ }, wi = (t) => t.type === "reasoning" || t.type === "tool", Ti = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(wi), Ai = (t) => {
2058
2139
  if (t.length === 0) return null;
2059
2140
  const [e, ...n] = t;
2060
2141
  return e ? {
2061
2142
  ...e,
2062
2143
  role: "assistant",
2063
- parts: t.flatMap((s) => s.parts),
2144
+ parts: t.flatMap((o) => o.parts),
2064
2145
  modelId: n.at(-1)?.modelId ?? e.modelId,
2065
2146
  providerId: n.at(-1)?.providerId ?? e.providerId
2066
2147
  } : null;
2067
- }, yi = (t, e = {}) => {
2148
+ }, Ci = (t, e = {}) => {
2068
2149
  const n = [];
2069
- let s = [];
2070
- const o = () => {
2071
- s = [];
2150
+ let o = [];
2151
+ const s = () => {
2152
+ o = [];
2072
2153
  };
2073
2154
  for (const r of t) {
2074
- const i = (r.parts ?? []).filter(mi);
2155
+ const i = (r.parts ?? []).filter(Si);
2075
2156
  if (i.length === 0) continue;
2076
2157
  const l = {
2077
2158
  ...r,
2078
2159
  parts: i
2079
2160
  };
2080
2161
  if (l.role === "user") {
2081
- o(), n.push(l);
2162
+ s(), n.push(l);
2082
2163
  continue;
2083
2164
  }
2084
- if (gi(l)) {
2085
- s.push(l);
2165
+ if (Ti(l)) {
2166
+ o.push(l);
2086
2167
  continue;
2087
2168
  }
2088
- if (s.length > 0) {
2169
+ if (o.length > 0) {
2089
2170
  n.push({
2090
2171
  ...l,
2091
- parts: [...s.flatMap((a) => a.parts), ...l.parts]
2092
- }), o();
2172
+ parts: [...o.flatMap((a) => a.parts), ...l.parts]
2173
+ }), s();
2093
2174
  continue;
2094
2175
  }
2095
2176
  n.push(l);
2096
2177
  }
2097
- if (e.streaming && s.length > 0) {
2098
- const r = bi(s);
2178
+ if (e.streaming && o.length > 0) {
2179
+ const r = Ai(o);
2099
2180
  r && n.push(r);
2100
2181
  }
2101
2182
  return n;
2102
- }, En = (t) => {
2183
+ }, Fn = (t) => {
2103
2184
  const e = t.at(-1);
2104
- return e?.role !== "assistant" ? null : e.parts.some((s) => s.type === "text" && Pn(s)) ? e.id : null;
2105
- }, xi = (t) => {
2185
+ return e?.role !== "assistant" ? null : e.parts.some((o) => o.type === "text" && Bn(o)) ? e.id : null;
2186
+ }, ki = (t) => {
2106
2187
  const e = [], n = [];
2107
- for (const s of t)
2108
- s.role === "user" ? e.push({
2109
- userMessage: s,
2188
+ for (const o of t)
2189
+ o.role === "user" ? e.push({
2190
+ userMessage: o,
2110
2191
  responses: []
2111
- }) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
2192
+ }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
2112
2193
  return {
2113
2194
  groups: e,
2114
2195
  leadingResponses: n
2115
2196
  };
2116
- }, Dn = (t) => {
2117
- const e = A(18), {
2197
+ }, Ln = (t) => {
2198
+ const e = C(18), {
2118
2199
  message: n,
2119
- streaming: s,
2120
- hideQuestionForms: o,
2200
+ streaming: o,
2201
+ hideQuestionForms: s,
2121
2202
  animate: r,
2122
2203
  showAssistantActions: i
2123
- } = t, l = o === void 0 ? !1 : o, a = r === void 0 ? !1 : r;
2124
- let u;
2125
- e[0] !== n.role ? (u = fi(n.role), e[0] = n.role, e[1] = u) : u = e[1];
2126
- const d = u, f = d === "user" || d === "assistant" && i, p = a ? fn : void 0;
2127
- let m;
2128
- e[2] !== l || e[3] !== n || e[4] !== s ? (m = /* @__PURE__ */ c(Mn, { message: n, streaming: s, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = s, e[5] = m) : m = e[5];
2204
+ } = t, l = s === void 0 ? !1 : s, a = r === void 0 ? !1 : r;
2205
+ let c;
2206
+ e[0] !== n.role ? (c = yi(n.role), e[0] = n.role, e[1] = c) : c = e[1];
2207
+ const d = c, f = d === "user" || d === "assistant" && i, m = a ? hn : void 0;
2208
+ let p;
2209
+ e[2] !== l || e[3] !== n || e[4] !== o ? (p = /* @__PURE__ */ u(Dn, { message: n, streaming: o, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = o, e[5] = p) : p = e[5];
2129
2210
  let h;
2130
- e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ c(xt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
2211
+ e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ u(Tt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
2131
2212
  let g;
2132
- e[10] !== d || e[11] !== m || e[12] !== h ? (g = /* @__PURE__ */ k(ge.Content, { from: d, children: [
2133
- m,
2213
+ e[10] !== d || e[11] !== p || e[12] !== h ? (g = /* @__PURE__ */ k(be.Content, { from: d, children: [
2214
+ p,
2134
2215
  h
2135
- ] }), e[10] = d, e[11] = m, e[12] = h, e[13] = g) : g = e[13];
2216
+ ] }), e[10] = d, e[11] = p, e[12] = h, e[13] = g) : g = e[13];
2136
2217
  let b;
2137
- return e[14] !== d || e[15] !== p || e[16] !== g ? (b = /* @__PURE__ */ c(ge.Root, { from: d, ...p, children: g }), e[14] = d, e[15] = p, e[16] = g, e[17] = b) : b = e[17], b;
2138
- }, Si = (t) => {
2139
- const e = A(7), {
2218
+ return e[14] !== d || e[15] !== m || e[16] !== g ? (b = /* @__PURE__ */ u(be.Root, { from: d, ...m, children: g }), e[14] = d, e[15] = m, e[16] = g, e[17] = b) : b = e[17], b;
2219
+ }, Ii = (t) => {
2220
+ const e = C(7), {
2140
2221
  label: n,
2141
- onClick: s,
2142
- actionPanel: o
2143
- } = t, r = o ? "space-between" : "flex-end";
2222
+ onClick: o,
2223
+ actionPanel: s
2224
+ } = t, r = s ? "space-between" : "flex-end";
2144
2225
  let i;
2145
- e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ c(Oe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
2226
+ e[0] !== n || e[1] !== o ? (i = /* @__PURE__ */ u(Qe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: o, children: n }), e[0] = n, e[1] = o, e[2] = i) : i = e[2];
2146
2227
  let l;
2147
- return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(be, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
2148
- o,
2228
+ return e[3] !== s || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(ye, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
2229
+ s,
2149
2230
  i
2150
- ] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2151
- }, wi = 360, Ti = 4, Ai = "min(10vh, 4rem)", Bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", gt = 1, ki = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
2231
+ ] }), e[3] = s, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2232
+ }, _i = 360, vi = 4, Mi = "min(10vh, 4rem)", $n = "min(70dvh, calc(100dvh - 12rem), 22rem)", xt = 1, Ri = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
2152
2233
  lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
2153
2234
  textLength: e.textLength + n.text.length
2154
2235
  }, {
2155
2236
  lineCount: 0,
2156
2237
  textLength: 0
2157
- }), Ci = (t) => {
2238
+ }), Pi = (t) => {
2158
2239
  if (t.role !== "user") return !1;
2159
2240
  const {
2160
2241
  lineCount: e,
2161
2242
  textLength: n
2162
- } = ki(t);
2163
- return n > wi || e > Ti;
2164
- }, Ii = (t, e) => {
2243
+ } = Ri(t);
2244
+ return n > _i || e > vi;
2245
+ }, Ei = (t, e) => {
2165
2246
  const n = Math.max(0, t.scrollHeight - t.clientHeight);
2166
- return e === 0 || n <= gt ? !1 : e < 0 ? t.scrollTop > gt : t.scrollTop < n - gt;
2167
- }, Fn = 720, _i = 1, Ri = 3, vi = 20, jt = 1, Mi = 4, Ln = 8, Pi = (t, e) => {
2168
- const n = En(t);
2169
- return [...t.map((s) => ({
2247
+ return e === 0 || n <= xt ? !1 : e < 0 ? t.scrollTop > xt : t.scrollTop < n - xt;
2248
+ }, On = 720, Di = 1, Bi = 3, Fi = 20, Xt = 1, Li = 4, zn = 8, $i = (t, e) => {
2249
+ const n = Fn(t);
2250
+ return [...t.map((o) => ({
2170
2251
  type: "leading-response",
2171
- key: s.id,
2172
- message: s,
2173
- showAssistantActions: s.id === n
2174
- })), ...e.map((s, o) => ({
2252
+ key: o.id,
2253
+ message: o,
2254
+ showAssistantActions: o.id === n
2255
+ })), ...e.map((o, s) => ({
2175
2256
  type: "group",
2176
- key: s.userMessage.id,
2177
- group: s,
2178
- groupIndex: o
2257
+ key: o.userMessage.id,
2258
+ group: o,
2259
+ groupIndex: s
2179
2260
  }))];
2180
- }, Ei = (t, e) => {
2261
+ }, Oi = (t, e) => {
2181
2262
  if (t === 0) return 0;
2182
- const n = t * Fn + (t - 1) * Ln;
2263
+ const n = t * On + (t - 1) * zn;
2183
2264
  return Math.max(n - e, 0);
2184
- }, Di = (t) => t?.clientHeight || _i, Bi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= jt && Math.abs(t.totalSize - e.totalSize) <= jt, Fi = (t, e) => ({
2265
+ }, zi = (t) => t?.clientHeight || Di, Qi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= Xt && Math.abs(t.totalSize - e.totalSize) <= Xt, qi = (t, e) => ({
2185
2266
  scrollTop: t?.scrollTop ?? 0,
2186
2267
  totalSize: e
2187
- }), Li = (t) => {
2188
- const e = A(8), {
2268
+ }), Wi = (t) => {
2269
+ const e = C(8), {
2189
2270
  itemCount: n,
2190
- onReady: s,
2191
- scrollRef: o,
2271
+ onReady: o,
2272
+ scrollRef: s,
2192
2273
  totalSize: r
2193
- } = t, i = ie(s);
2274
+ } = t, i = J(o);
2194
2275
  let l, a;
2195
- e[0] !== s ? (l = () => {
2196
- i.current = s;
2197
- }, a = [s], e[0] = s, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), J(l, a);
2198
- let u, d;
2199
- e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
2276
+ e[0] !== o ? (l = () => {
2277
+ i.current = o;
2278
+ }, a = [o], e[0] = o, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), Z(l, a);
2279
+ let c, d;
2280
+ e[3] !== n || e[4] !== s || e[5] !== r ? (c = () => {
2200
2281
  if (n === 0 || typeof requestAnimationFrame > "u") {
2201
2282
  i.current?.();
2202
2283
  return;
2203
2284
  }
2204
- let f = 0, p = 0, m = 0, h = null;
2285
+ let f = 0, m = 0, p = 0, h = null;
2205
2286
  const g = () => {
2206
- p = p + 1;
2207
- const b = Fi(o.current, r);
2208
- if (m = h && Bi(b, h) ? m + 1 : 0, h = b, m >= Ri || p >= vi) {
2287
+ m = m + 1;
2288
+ const b = qi(s.current, r);
2289
+ if (p = h && Qi(b, h) ? p + 1 : 0, h = b, p >= Bi || m >= Fi) {
2209
2290
  i.current?.();
2210
2291
  return;
2211
2292
  }
2212
2293
  f = requestAnimationFrame(g);
2213
2294
  };
2214
2295
  return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
2215
- }, d = [n, o, r], e[3] = n, e[4] = o, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), J(u, d);
2216
- }, $i = (t) => {
2217
- Ii(t.currentTarget, t.deltaY) && t.stopPropagation();
2218
- }, Oi = (t, e) => {
2296
+ }, d = [n, s, r], e[3] = n, e[4] = s, e[5] = r, e[6] = c, e[7] = d) : (c = e[6], d = e[7]), Z(c, d);
2297
+ }, Hi = (t) => {
2298
+ Ei(t.currentTarget, t.deltaY) && t.stopPropagation();
2299
+ }, Ni = (t, e) => {
2219
2300
  if (t)
2220
- return e ? Bn : Ai;
2221
- }, zi = (t) => {
2301
+ return e ? $n : Mi;
2302
+ }, Vi = (t) => {
2222
2303
  if (t)
2223
- return Bn;
2224
- }, Qi = (t) => {
2225
- const e = A(50), {
2304
+ return $n;
2305
+ }, Ui = (t) => {
2306
+ const e = C(50), {
2226
2307
  group: n,
2227
- streaming: s,
2228
- hideQuestionForms: o,
2308
+ streaming: o,
2309
+ hideQuestionForms: s,
2229
2310
  isExpanded: r,
2230
2311
  animate: i,
2231
2312
  onToggleStickyMessage: l
2232
2313
  } = t;
2233
- let a, u, d;
2234
- e[0] !== n.userMessage || e[1] !== r ? (a = Ci(n.userMessage), u = a && r, d = Oi(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = u, e[4] = d) : (a = e[2], u = e[3], d = e[4]);
2314
+ let a, c, d;
2315
+ e[0] !== n.userMessage || e[1] !== r ? (a = Pi(n.userMessage), c = a && r, d = Ni(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = c, e[4] = d) : (a = e[2], c = e[3], d = e[4]);
2235
2316
  const f = d;
2236
- let p;
2237
- e[5] !== n.userMessage.id || e[6] !== l ? (p = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = p) : p = e[7];
2238
- const m = p;
2317
+ let m;
2318
+ e[5] !== n.userMessage.id || e[6] !== l ? (m = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = m) : m = e[7];
2319
+ const p = m;
2239
2320
  let h;
2240
- e[8] !== n.responses ? (h = En(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
2241
- const g = h, b = i ? fn : void 0, x = a ? "0" : void 0, y = a ? "relative" : void 0, T = a ? r ? "expanded" : "collapsed" : void 0;
2242
- let S;
2243
- e[10] !== u ? (S = zi(u), e[10] = u, e[11] = S) : S = e[11];
2244
- const w = u ? "auto" : "visible", C = a ? "xs" : void 0, _ = a ? "xs" : void 0, R = u ? "3rem" : void 0, L = u ? $i : void 0;
2245
- let E;
2246
- e[12] !== n.userMessage || e[13] !== s ? (E = /* @__PURE__ */ c(Mn, { message: n.userMessage, streaming: s }), e[12] = n.userMessage, e[13] = s, e[14] = E) : E = e[14];
2247
- let Q;
2248
- e[15] !== _ || e[16] !== R || e[17] !== L || e[18] !== E || e[19] !== T || e[20] !== S || e[21] !== w || e[22] !== C ? (Q = /* @__PURE__ */ c(P, { "data-sticky-user-message-content": T, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: w, px: C, py: _, pb: R, onWheel: L, children: E }), e[15] = _, e[16] = R, e[17] = L, e[18] = E, e[19] = T, e[20] = S, e[21] = w, e[22] = C, e[23] = Q) : Q = e[23];
2321
+ e[8] !== n.responses ? (h = Fn(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
2322
+ const g = h, b = i ? hn : void 0, y = a ? "0" : void 0, x = a ? "relative" : void 0, S = a ? r ? "expanded" : "collapsed" : void 0;
2323
+ let A;
2324
+ e[10] !== c ? (A = Vi(c), e[10] = c, e[11] = A) : A = e[11];
2325
+ const T = c ? "auto" : "visible", w = a ? "xs" : void 0, I = a ? "xs" : void 0, _ = c ? "3rem" : void 0, P = c ? Hi : void 0;
2249
2326
  let M;
2250
- e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== m ? (M = a ? /* @__PURE__ */ c(Si, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = m, e[28] = M) : M = e[28];
2251
- let D;
2252
- e[29] !== f || e[30] !== Q || e[31] !== M || e[32] !== x || e[33] !== y ? (D = /* @__PURE__ */ k(ge.Content, { from: "user", maxH: f, overflow: "hidden", p: x, position: y, children: [
2253
- Q,
2254
- M
2255
- ] }), e[29] = f, e[30] = Q, e[31] = M, e[32] = x, e[33] = y, e[34] = D) : D = e[34];
2327
+ e[12] !== n.userMessage || e[13] !== o ? (M = /* @__PURE__ */ u(Dn, { message: n.userMessage, streaming: o }), e[12] = n.userMessage, e[13] = o, e[14] = M) : M = e[14];
2328
+ let z;
2329
+ e[15] !== I || e[16] !== _ || e[17] !== P || e[18] !== M || e[19] !== S || e[20] !== A || e[21] !== T || e[22] !== w ? (z = /* @__PURE__ */ u(D, { "data-sticky-user-message-content": S, display: "flex", flexDirection: "column", gap: "sm", maxH: A, minH: "0", overflowY: T, px: w, py: I, pb: _, onWheel: P, children: M }), e[15] = I, e[16] = _, e[17] = P, e[18] = M, e[19] = S, e[20] = A, e[21] = T, e[22] = w, e[23] = z) : z = e[23];
2256
2330
  let B;
2257
- e[35] !== D || e[36] !== b ? (B = /* @__PURE__ */ c(P, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ c(ge.Root, { from: "user", ...b, children: D }) }), e[35] = D, e[36] = b, e[37] = B) : B = e[37];
2258
- let $;
2259
- if (e[38] !== g || e[39] !== n.responses || e[40] !== o || e[41] !== s) {
2260
- let F;
2261
- e[43] !== g || e[44] !== o || e[45] !== s ? (F = (z) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Dn, { message: z, streaming: s, hideQuestionForms: o, showAssistantActions: z.id === g }) }, z.id), e[43] = g, e[44] = o, e[45] = s, e[46] = F) : F = e[46], $ = n.responses.map(F), e[38] = g, e[39] = n.responses, e[40] = o, e[41] = s, e[42] = $;
2331
+ e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== p ? (B = a ? /* @__PURE__ */ u(Ii, { label: r ? "Show less" : "Show more", onClick: p, actionPanel: /* @__PURE__ */ u(Tt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ u(Tt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = p, e[28] = B) : B = e[28];
2332
+ let E;
2333
+ e[29] !== f || e[30] !== z || e[31] !== B || e[32] !== y || e[33] !== x ? (E = /* @__PURE__ */ k(be.Content, { from: "user", maxH: f, overflow: "hidden", p: y, position: x, children: [
2334
+ z,
2335
+ B
2336
+ ] }), e[29] = f, e[30] = z, e[31] = B, e[32] = y, e[33] = x, e[34] = E) : E = e[34];
2337
+ let F;
2338
+ e[35] !== E || e[36] !== b ? (F = /* @__PURE__ */ u(D, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ u(be.Root, { from: "user", ...b, children: E }) }), e[35] = E, e[36] = b, e[37] = F) : F = e[37];
2339
+ let L;
2340
+ if (e[38] !== g || e[39] !== n.responses || e[40] !== s || e[41] !== o) {
2341
+ let O;
2342
+ e[43] !== g || e[44] !== s || e[45] !== o ? (O = (H) => /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(Ln, { message: H, streaming: o, hideQuestionForms: s, showAssistantActions: H.id === g }) }, H.id), e[43] = g, e[44] = s, e[45] = o, e[46] = O) : O = e[46], L = n.responses.map(O), e[38] = g, e[39] = n.responses, e[40] = s, e[41] = o, e[42] = L;
2262
2343
  } else
2263
- $ = e[42];
2264
- let O;
2265
- return e[47] !== B || e[48] !== $ ? (O = /* @__PURE__ */ k(P, { children: [
2266
- B,
2267
- $
2268
- ] }), e[47] = B, e[48] = $, e[49] = O) : O = e[49], O;
2269
- }, qi = (t, e) => {
2344
+ L = e[42];
2345
+ let $;
2346
+ return e[47] !== F || e[48] !== L ? ($ = /* @__PURE__ */ k(D, { children: [
2347
+ F,
2348
+ L
2349
+ ] }), e[47] = F, e[48] = L, e[49] = $) : $ = e[49], $;
2350
+ }, ji = (t, e) => {
2270
2351
  const {
2271
2352
  groups: n,
2272
- streaming: s,
2273
- hideActiveQuestionForms: o,
2353
+ streaming: o,
2354
+ hideActiveQuestionForms: s,
2274
2355
  expandedStickyMessageIds: r,
2275
2356
  animatedItemKeys: i,
2276
2357
  onToggleStickyMessage: l
2277
2358
  } = e;
2278
- return t.type === "leading-response" ? /* @__PURE__ */ c(Dn, { message: t.message, streaming: s, hideQuestionForms: n.length > 0 || o, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ c(Qi, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
2279
- }, Wi = (t) => {
2359
+ return t.type === "leading-response" ? /* @__PURE__ */ u(Ln, { message: t.message, streaming: o, hideQuestionForms: n.length > 0 || s, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ u(Ui, { group: t.group, streaming: o, hideQuestionForms: t.groupIndex < n.length - 1 || s, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
2360
+ }, Ki = (t) => {
2280
2361
  const {
2281
2362
  leadingResponses: e,
2282
2363
  groups: n,
2283
- streaming: s,
2284
- hideActiveQuestionForms: o,
2364
+ streaming: o,
2365
+ hideActiveQuestionForms: s,
2285
2366
  expandedStickyMessageIds: r,
2286
2367
  onToggleStickyMessage: i,
2287
2368
  onReady: l
2288
2369
  } = t, {
2289
2370
  scrollRef: a
2290
- } = Ge(), u = Pi(e, n), d = Ao(u.map((h) => h.key)), f = Di(a.current), p = ks({
2291
- count: u.length,
2371
+ } = et(), c = $i(e, n), d = Mo(c.map((h) => h.key)), f = zi(a.current), m = _s({
2372
+ count: c.length,
2292
2373
  getScrollElement: () => a.current,
2293
- estimateSize: () => Fn,
2294
- getItemKey: (h) => u[h]?.key ?? h,
2295
- overscan: Mi,
2296
- gap: Ln,
2374
+ estimateSize: () => On,
2375
+ getItemKey: (h) => c[h]?.key ?? h,
2376
+ overscan: Li,
2377
+ gap: zn,
2297
2378
  initialRect: {
2298
2379
  width: 0,
2299
2380
  height: f
2300
2381
  },
2301
- initialOffset: () => Ei(u.length, f)
2302
- }), m = p.getTotalSize();
2303
- return Li({
2304
- itemCount: u.length,
2382
+ initialOffset: () => Oi(c.length, f)
2383
+ }), p = m.getTotalSize();
2384
+ return Wi({
2385
+ itemCount: c.length,
2305
2386
  onReady: l,
2306
2387
  scrollRef: a,
2307
- totalSize: m
2308
- }), /* @__PURE__ */ c(P, { px: "xs", children: /* @__PURE__ */ c(P, { position: "relative", width: "100%", style: {
2309
- height: m
2310
- }, children: p.getVirtualItems().map((h) => {
2311
- const g = u[h.index];
2312
- return g ? /* @__PURE__ */ c(P, { ref: p.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2388
+ totalSize: p
2389
+ }), /* @__PURE__ */ u(D, { px: "xs", children: /* @__PURE__ */ u(D, { position: "relative", width: "100%", style: {
2390
+ height: p
2391
+ }, children: m.getVirtualItems().map((h) => {
2392
+ const g = c[h.index];
2393
+ return g ? /* @__PURE__ */ u(D, { ref: m.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2313
2394
  top: h.start
2314
- }, children: qi(g, {
2395
+ }, children: ji(g, {
2315
2396
  groups: n,
2316
- streaming: s,
2317
- hideActiveQuestionForms: o,
2397
+ streaming: o,
2398
+ hideActiveQuestionForms: s,
2318
2399
  expandedStickyMessageIds: r,
2319
2400
  animatedItemKeys: d,
2320
2401
  onToggleStickyMessage: i
2321
2402
  }) }, h.key) : null;
2322
2403
  }) }) });
2323
- }, Hi = (t) => {
2324
- const e = A(48), {
2404
+ }, Xi = (t = "") => JSON.stringify(As(t)), Gi = (t) => {
2405
+ const e = C(48), {
2325
2406
  item: n,
2326
- index: s,
2327
- isFirst: o,
2407
+ index: o,
2408
+ isFirst: s,
2328
2409
  isLast: r,
2329
2410
  isEditing: i,
2330
2411
  isDragTarget: l,
2331
2412
  onEdit: a,
2332
- onRemove: u,
2413
+ onRemove: c,
2333
2414
  onDragStart: d,
2334
2415
  onDragEnd: f,
2335
- onDragOver: p,
2336
- onDrop: m
2337
- } = t, h = !!a, g = !!u, b = !o || !r, x = `Drag queued follow-up ${s + 1}`, y = o ? "0" : "1px", T = l ? "border.accent-light" : "border.subtle", S = o ? "0" : "2xs", w = i ? "bg.muted" : void 0;
2338
- let C;
2339
- e[0] !== n.id || e[1] !== p ? (C = (H) => p(H, n.id), e[0] = n.id, e[1] = p, e[2] = C) : C = e[2];
2340
- let _;
2341
- e[3] !== n.id || e[4] !== m ? (_ = (H) => m(H, n.id), e[3] = n.id, e[4] = m, e[5] = _) : _ = e[5];
2342
- const R = b ? "grab" : "default", L = !b;
2343
- let E;
2344
- e[6] !== n.id || e[7] !== d ? (E = (H) => {
2345
- H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
2346
- }, e[6] = n.id, e[7] = d, e[8] = E) : E = e[8];
2347
- let Q;
2348
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ c(dt, { as: ms, boxSize: "14px" }), e[9] = Q) : Q = e[9];
2416
+ onDragOver: m,
2417
+ onDrop: p
2418
+ } = t, h = !!a, g = !!c, b = !s || !r, y = `Drag queued follow-up ${o + 1}`, x = s ? "0" : "1px", S = l ? "border.accent-light" : "border.subtle", A = s ? "0" : "2xs", T = i ? "bg.muted" : void 0;
2419
+ let w;
2420
+ e[0] !== n.id || e[1] !== m ? (w = (V) => m(V, n.id), e[0] = n.id, e[1] = m, e[2] = w) : w = e[2];
2421
+ let I;
2422
+ e[3] !== n.id || e[4] !== p ? (I = (V) => p(V, n.id), e[3] = n.id, e[4] = p, e[5] = I) : I = e[5];
2423
+ const _ = b ? "grab" : "default", P = !b;
2349
2424
  let M;
2350
- e[10] !== b || e[11] !== x || e[12] !== f || e[13] !== R || e[14] !== L || e[15] !== E ? (M = /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": x, title: x, color: "fg.muted", cursor: R, disabled: L, onDragStart: E, onDragEnd: f, children: Q }), e[10] = b, e[11] = x, e[12] = f, e[13] = R, e[14] = L, e[15] = E, e[16] = M) : M = e[16];
2351
- let D;
2352
- e[17] !== n.prompt ? (D = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = D) : D = e[18];
2425
+ e[6] !== n.id || e[7] !== d ? (M = (V) => {
2426
+ V.dataTransfer.effectAllowed = "move", V.dataTransfer.setData("text/plain", n.id), d(n.id);
2427
+ }, e[6] = n.id, e[7] = d, e[8] = M) : M = e[8];
2428
+ let z;
2429
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ u(mt, { as: bs, boxSize: "14px" }), e[9] = z) : z = e[9];
2353
2430
  let B;
2354
- e[19] !== n.attachments ? (B = n.attachments?.length ? /* @__PURE__ */ k(Un, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
2431
+ e[10] !== b || e[11] !== y || e[12] !== f || e[13] !== _ || e[14] !== P || e[15] !== M ? (B = /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": y, title: y, color: "fg.muted", cursor: _, disabled: P, onDragStart: M, onDragEnd: f, children: z }), e[10] = b, e[11] = y, e[12] = f, e[13] = _, e[14] = P, e[15] = M, e[16] = B) : B = e[16];
2432
+ let E;
2433
+ e[17] !== n.prompt ? (E = /* @__PURE__ */ u(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = E) : E = e[18];
2434
+ let F;
2435
+ e[19] !== n.attachments ? (F = n.attachments?.length ? /* @__PURE__ */ k(Xn, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
2355
2436
  n.attachments.length,
2356
2437
  " attachments"
2357
- ] }) : null, e[19] = n.attachments, e[20] = B) : B = e[20];
2438
+ ] }) : null, e[19] = n.attachments, e[20] = F) : F = e[20];
2439
+ let L;
2440
+ e[21] !== E || e[22] !== F ? (L = /* @__PURE__ */ k(X, { gap: "2xs", flex: "1", minWidth: "0", children: [
2441
+ E,
2442
+ F
2443
+ ] }), e[21] = E, e[22] = F, e[23] = L) : L = e[23];
2358
2444
  let $;
2359
- e[21] !== D || e[22] !== B ? ($ = /* @__PURE__ */ k(j, { gap: "2xs", flex: "1", minWidth: "0", children: [
2360
- D,
2361
- B
2362
- ] }), e[21] = D, e[22] = B, e[23] = $) : $ = e[23];
2445
+ e[24] !== h || e[25] !== n || e[26] !== a ? ($ = h ? /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ u(mt, { as: ys, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = $) : $ = e[27];
2363
2446
  let O;
2364
- e[24] !== h || e[25] !== n || e[26] !== a ? (O = h ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ c(dt, { as: hs, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = O) : O = e[27];
2365
- let F;
2366
- e[28] !== g || e[29] !== n.id || e[30] !== u ? (F = g ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => u?.(n.id), children: /* @__PURE__ */ c(dt, { as: tn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = u, e[31] = F) : F = e[31];
2367
- let z;
2368
- e[32] !== O || e[33] !== F ? (z = /* @__PURE__ */ k(Z, { gap: "2xs", flexShrink: 0, children: [
2369
- O,
2370
- F
2371
- ] }), e[32] = O, e[33] = F, e[34] = z) : z = e[34];
2372
- let v;
2373
- e[35] !== M || e[36] !== $ || e[37] !== z ? (v = /* @__PURE__ */ k(Z, { gap: "xs", alignItems: "flex-start", children: [
2374
- M,
2447
+ e[28] !== g || e[29] !== n.id || e[30] !== c ? (O = g ? /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => c?.(n.id), children: /* @__PURE__ */ u(mt, { as: sn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = c, e[31] = O) : O = e[31];
2448
+ let H;
2449
+ e[32] !== $ || e[33] !== O ? (H = /* @__PURE__ */ k(oe, { gap: "2xs", flexShrink: 0, children: [
2375
2450
  $,
2376
- z
2377
- ] }), e[35] = M, e[36] = $, e[37] = z, e[38] = v) : v = e[38];
2378
- let W;
2379
- return e[39] !== n.id || e[40] !== y || e[41] !== T || e[42] !== v || e[43] !== S || e[44] !== w || e[45] !== C || e[46] !== _ ? (W = /* @__PURE__ */ c(P, { minWidth: "0", borderTopWidth: y, borderColor: T, paddingTop: S, paddingBottom: "2xs", bg: w, onDragOver: C, onDrop: _, "data-queued-follow-up-id": n.id, children: v }), e[39] = n.id, e[40] = y, e[41] = T, e[42] = v, e[43] = S, e[44] = w, e[45] = C, e[46] = _, e[47] = W) : W = e[47], W;
2380
- }, Vi = (t) => {
2381
- const e = A(24), {
2451
+ O
2452
+ ] }), e[32] = $, e[33] = O, e[34] = H) : H = e[34];
2453
+ let R;
2454
+ e[35] !== B || e[36] !== L || e[37] !== H ? (R = /* @__PURE__ */ k(oe, { gap: "xs", alignItems: "flex-start", children: [
2455
+ B,
2456
+ L,
2457
+ H
2458
+ ] }), e[35] = B, e[36] = L, e[37] = H, e[38] = R) : R = e[38];
2459
+ let q;
2460
+ return e[39] !== n.id || e[40] !== x || e[41] !== S || e[42] !== R || e[43] !== A || e[44] !== T || e[45] !== w || e[46] !== I ? (q = /* @__PURE__ */ u(D, { minWidth: "0", borderTopWidth: x, borderColor: S, paddingTop: A, paddingBottom: "2xs", bg: T, onDragOver: w, onDrop: I, "data-queued-follow-up-id": n.id, children: R }), e[39] = n.id, e[40] = x, e[41] = S, e[42] = R, e[43] = A, e[44] = T, e[45] = w, e[46] = I, e[47] = q) : q = e[47], q;
2461
+ }, Yi = (t) => {
2462
+ const e = C(24), {
2382
2463
  items: n,
2383
- editingItemId: s,
2384
- onEdit: o,
2464
+ editingItemId: o,
2465
+ onEdit: s,
2385
2466
  onRemove: r,
2386
2467
  onMove: i
2387
- } = t, [l, a] = V(null), [u, d] = V(null);
2468
+ } = t, [l, a] = W(null), [c, d] = W(null);
2388
2469
  if (n.length === 0)
2389
2470
  return null;
2390
2471
  let f;
2391
- e[0] !== l ? (f = (x, y) => {
2392
- !l || l === y || (x.preventDefault(), x.dataTransfer.dropEffect = "move", d(y));
2472
+ e[0] !== l ? (f = (y, x) => {
2473
+ !l || l === x || (y.preventDefault(), y.dataTransfer.dropEffect = "move", d(x));
2393
2474
  }, e[0] = l, e[1] = f) : f = e[1];
2394
- const p = f;
2395
- let m;
2396
- e[2] !== l || e[3] !== n || e[4] !== i ? (m = (x, y) => {
2397
- x.preventDefault();
2398
- const T = l ?? x.dataTransfer.getData("text/plain");
2399
- if (a(null), d(null), !T || T === y)
2475
+ const m = f;
2476
+ let p;
2477
+ e[2] !== l || e[3] !== n || e[4] !== i ? (p = (y, x) => {
2478
+ y.preventDefault();
2479
+ const S = l ?? y.dataTransfer.getData("text/plain");
2480
+ if (a(null), d(null), !S || S === x)
2400
2481
  return;
2401
- const S = n.findIndex((_) => _.id === T), w = n.findIndex((_) => _.id === y);
2402
- if (S === -1 || w === -1 || S === w)
2482
+ const A = n.findIndex((I) => I.id === S), T = n.findIndex((I) => I.id === x);
2483
+ if (A === -1 || T === -1 || A === T)
2403
2484
  return;
2404
- const C = w < S ? "up" : "down";
2405
- i?.(T, C, Math.abs(w - S));
2406
- }, e[2] = l, e[3] = n, e[4] = i, e[5] = m) : m = e[5];
2407
- const h = m;
2485
+ const w = T < A ? "up" : "down";
2486
+ i?.(S, w, Math.abs(T - A));
2487
+ }, e[2] = l, e[3] = n, e[4] = i, e[5] = p) : p = e[5];
2488
+ const h = p;
2408
2489
  let g;
2409
- if (e[6] !== u || e[7] !== s || e[8] !== p || e[9] !== h || e[10] !== n || e[11] !== o || e[12] !== r) {
2410
- let x;
2411
- e[14] !== u || e[15] !== s || e[16] !== p || e[17] !== h || e[18] !== n.length || e[19] !== o || e[20] !== r ? (x = (y, T) => /* @__PURE__ */ c(Hi, { item: y, index: T, isFirst: T === 0, isLast: T === n.length - 1, isEditing: s === y.id, isDragTarget: u === y.id, onEdit: o, onRemove: r, onDragStart: a, onDragEnd: () => {
2490
+ if (e[6] !== c || e[7] !== o || e[8] !== m || e[9] !== h || e[10] !== n || e[11] !== s || e[12] !== r) {
2491
+ let y;
2492
+ e[14] !== c || e[15] !== o || e[16] !== m || e[17] !== h || e[18] !== n.length || e[19] !== s || e[20] !== r ? (y = (x, S) => /* @__PURE__ */ u(Gi, { item: x, index: S, isFirst: S === 0, isLast: S === n.length - 1, isEditing: o === x.id, isDragTarget: c === x.id, onEdit: s, onRemove: r, onDragStart: a, onDragEnd: () => {
2412
2493
  a(null), d(null);
2413
- }, onDragOver: p, onDrop: h }, y.id), e[14] = u, e[15] = s, e[16] = p, e[17] = h, e[18] = n.length, e[19] = o, e[20] = r, e[21] = x) : x = e[21], g = n.map(x), e[6] = u, e[7] = s, e[8] = p, e[9] = h, e[10] = n, e[11] = o, e[12] = r, e[13] = g;
2494
+ }, onDragOver: m, onDrop: h }, x.id), e[14] = c, e[15] = o, e[16] = m, e[17] = h, e[18] = n.length, e[19] = s, e[20] = r, e[21] = y) : y = e[21], g = n.map(y), e[6] = c, e[7] = o, e[8] = m, e[9] = h, e[10] = n, e[11] = s, e[12] = r, e[13] = g;
2414
2495
  } else
2415
2496
  g = e[13];
2416
2497
  let b;
2417
- return e[22] !== g ? (b = /* @__PURE__ */ c(j, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
2418
- }, Ni = (t) => {
2419
- const e = Math.max(0, Math.floor(t));
2420
- if (e < 60) return `${e}s`;
2421
- const n = Math.floor(e / 60);
2422
- return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
2423
- }, Ui = (t) => {
2424
- const e = A(9), {
2425
- hidden: n
2426
- } = t, s = n === void 0 ? !1 : n, [o, r] = V(0);
2427
- let i;
2428
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
2429
- const l = ie(i);
2430
- let a, u;
2431
- if (e[1] !== s ? (a = () => {
2432
- if (s)
2433
- return;
2434
- const m = () => r((Date.now() - l.current) / 1e3);
2435
- m();
2436
- const h = setInterval(m, 1e3);
2437
- return () => clearInterval(h);
2438
- }, u = [s], e[1] = s, e[2] = a, e[3] = u) : (a = e[2], u = e[3]), J(a, u), s)
2439
- return null;
2440
- let d;
2441
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
2442
- let f;
2443
- e[5] !== o ? (f = Ni(o), e[5] = o, e[6] = f) : f = e[6];
2444
- let p;
2445
- return e[7] !== f ? (p = /* @__PURE__ */ k(Z, { gap: "2xs", px: "sm", py: "xs", children: [
2446
- d,
2447
- /* @__PURE__ */ c(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
2448
- ] }), e[7] = f, e[8] = p) : p = e[8], p;
2449
- }, ji = (t) => {
2450
- const e = A(19), {
2498
+ return e[22] !== g ? (b = /* @__PURE__ */ u(X, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
2499
+ }, Ji = (t) => {
2500
+ const e = C(19), {
2451
2501
  queuedFollowUps: n,
2452
- defaultValue: s,
2453
- onChange: o,
2502
+ defaultValue: o,
2503
+ onChange: s,
2454
2504
  onSubmit: r,
2455
2505
  onUpdate: i
2456
- } = t, [l, a] = V(null), [u, d] = V(""), [f, p] = V(0), m = l ? u : s;
2506
+ } = t, [l, a] = W(null), [c, d] = W(""), [f, m] = W(0), p = l ? c : o;
2457
2507
  let h, g;
2458
2508
  e[0] !== l || e[1] !== n ? (h = () => {
2459
- l && (n.some((R) => R.id === l) || (a(null), d("")));
2460
- }, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), J(h, g);
2509
+ l && (n.some((_) => _.id === l) || (a(null), d("")));
2510
+ }, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), Z(h, g);
2461
2511
  let b;
2462
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (R) => {
2463
- a(R.id), d(R.prompt), p(Xi);
2512
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (_) => {
2513
+ a(_.id), d(_.prompt), m(el);
2464
2514
  }, e[4] = b) : b = e[4];
2465
- const x = b;
2466
- let y;
2467
- e[5] !== l || e[6] !== o ? (y = (R) => {
2468
- l || o?.(R);
2469
- }, e[5] = l, e[6] = o, e[7] = y) : y = e[7];
2470
- const T = y;
2471
- let S;
2472
- e[8] !== l || e[9] !== r || e[10] !== i ? (S = (R, L, E) => {
2515
+ const y = b;
2516
+ let x;
2517
+ e[5] !== l || e[6] !== s ? (x = (_) => {
2518
+ l || s?.(_);
2519
+ }, e[5] = l, e[6] = s, e[7] = x) : x = e[7];
2520
+ const S = x;
2521
+ let A;
2522
+ e[8] !== l || e[9] !== r || e[10] !== i ? (A = (_, P, M) => {
2473
2523
  if (l) {
2474
- i?.(l, R), a(null), d("");
2524
+ i?.(l, _), a(null), d("");
2475
2525
  return;
2476
2526
  }
2477
- return r?.(R, L, E);
2478
- }, e[8] = l, e[9] = r, e[10] = i, e[11] = S) : S = e[11];
2479
- const w = S, C = !!l;
2480
- let _;
2481
- return e[12] !== T || e[13] !== l || e[14] !== f || e[15] !== m || e[16] !== w || e[17] !== C ? (_ = {
2482
- change: T,
2483
- edit: x,
2527
+ return r?.(_, P, M);
2528
+ }, e[8] = l, e[9] = r, e[10] = i, e[11] = A) : A = e[11];
2529
+ const T = A, w = !!l;
2530
+ let I;
2531
+ return e[12] !== S || e[13] !== l || e[14] !== f || e[15] !== p || e[16] !== T || e[17] !== w ? (I = {
2532
+ change: S,
2533
+ edit: y,
2484
2534
  editingItemId: l,
2485
2535
  focusSignal: f,
2486
- inputValue: m,
2487
- isEditing: C,
2488
- submit: w
2489
- }, e[12] = T, e[13] = l, e[14] = f, e[15] = m, e[16] = w, e[17] = C, e[18] = _) : _ = e[18], _;
2490
- }, Ki = (t) => {
2491
- const e = A(44), {
2492
- actions: n,
2493
- attachedResources: s,
2494
- attachmentList: o,
2495
- chatInputAutoFocus: r,
2496
- chatInputPlaceholder: i,
2497
- chatInputQuestionPrompt: l,
2498
- chatInputReferences: a,
2499
- hasWorkspaceHub: u,
2500
- inputDisabled: d,
2501
- submitDisabled: f,
2502
- onAttachFiles: p,
2503
- onAttachText: m,
2504
- onChatInputAddReference: h,
2505
- onClearAttachments: g,
2506
- onInterrupt: b,
2507
- onQueuedFollowUpMove: x,
2508
- onQueuedFollowUpRemove: y,
2536
+ inputValue: p,
2537
+ isEditing: w,
2538
+ submit: T
2539
+ }, e[12] = S, e[13] = l, e[14] = f, e[15] = p, e[16] = T, e[17] = w, e[18] = I) : I = e[18], I;
2540
+ }, Zi = (t) => {
2541
+ const e = C(46), {
2542
+ conversationKey: n,
2543
+ recentUserMessages: o,
2544
+ actions: s,
2545
+ attachedResources: r,
2546
+ attachmentList: i,
2547
+ chatInputAutoFocus: l,
2548
+ chatInputPlaceholder: a,
2549
+ chatInputQuestionPrompt: c,
2550
+ chatInputReferences: d,
2551
+ hasWorkspaceHub: f,
2552
+ inputDisabled: m,
2553
+ submitDisabled: p,
2554
+ onAttachFiles: h,
2555
+ onAttachText: g,
2556
+ onChatInputAddReference: b,
2557
+ onClearAttachments: y,
2558
+ onInterrupt: x,
2559
+ onQueuedFollowUpMove: S,
2560
+ onQueuedFollowUpRemove: A,
2509
2561
  onQueuedFollowUpUpdate: T,
2510
- queuedComposer: S,
2511
- queuedFollowUps: w,
2512
- streaming: C,
2513
- workspaceHub: _
2514
- } = t, R = w.length > 0, L = u ? "2xs" : "xs", E = u ? "2xs" : "0", Q = u ? "2xs" : void 0, M = u ? "1px" : void 0, D = u ? "border" : void 0, B = u ? "sm" : void 0, $ = u ? "bg.subtle" : void 0, O = T ? S.edit : void 0;
2515
- let F;
2516
- e[0] !== x || e[1] !== y || e[2] !== S.editingItemId || e[3] !== w || e[4] !== O ? (F = /* @__PURE__ */ c(Vi, { items: w, editingItemId: S.editingItemId, onEdit: O, onRemove: y, onMove: x }), e[0] = x, e[1] = y, e[2] = S.editingItemId, e[3] = w, e[4] = O, e[5] = F) : F = e[5];
2517
- let z;
2518
- e[6] !== S.inputValue ? (z = So(S.inputValue), e[6] = S.inputValue, e[7] = z) : z = e[7];
2519
- const v = S.isEditing ? "Save queued follow-up" : void 0;
2520
- let W;
2521
- e[8] !== n || e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== i || e[13] !== l || e[14] !== a || e[15] !== R || e[16] !== u || e[17] !== d || e[18] !== p || e[19] !== m || e[20] !== h || e[21] !== g || e[22] !== b || e[23] !== S.change || e[24] !== S.focusSignal || e[25] !== S.submit || e[26] !== C || e[27] !== f || e[28] !== v || e[29] !== z ? (W = /* @__PURE__ */ c(po, { placeholder: i, defaultState: z, streaming: C, onSubmit: S.submit, onInterrupt: b, onAttachFiles: p, onAttachText: m, onChange: S.change, actions: n, attachedResources: s, onClearAttachments: g, attachmentList: o, isDisabled: d, submitDisabled: f, attachedToTop: R, recessed: u, questionPrompt: l, autoFocus: r, focusSignal: S.focusSignal, submitTitle: v, references: a, onAddReference: h }), e[8] = n, e[9] = s, e[10] = o, e[11] = r, e[12] = i, e[13] = l, e[14] = a, e[15] = R, e[16] = u, e[17] = d, e[18] = p, e[19] = m, e[20] = h, e[21] = g, e[22] = b, e[23] = S.change, e[24] = S.focusSignal, e[25] = S.submit, e[26] = C, e[27] = f, e[28] = v, e[29] = z, e[30] = W) : W = e[30];
2522
- let H;
2523
- e[31] !== E || e[32] !== W || e[33] !== Q || e[34] !== M || e[35] !== D || e[36] !== B || e[37] !== $ || e[38] !== F || e[39] !== _ ? (H = /* @__PURE__ */ k(j, { gap: E, p: Q, borderWidth: M, borderColor: D, borderRadius: B, bg: $, children: [
2524
- _,
2525
- F,
2526
- W
2527
- ] }), e[31] = E, e[32] = W, e[33] = Q, e[34] = M, e[35] = D, e[36] = B, e[37] = $, e[38] = F, e[39] = _, e[40] = H) : H = e[40];
2562
+ queuedComposer: w,
2563
+ queuedFollowUps: I,
2564
+ streaming: _,
2565
+ workspaceHub: P
2566
+ } = t, M = I.length > 0, z = f ? "2xs" : "xs", B = f ? "2xs" : "0", E = f ? "2xs" : void 0, F = f ? "1px" : void 0, L = f ? "border" : void 0, $ = f ? "sm" : void 0, O = f ? "bg.subtle" : void 0, H = T ? w.edit : void 0;
2567
+ let R;
2568
+ e[0] !== S || e[1] !== A || e[2] !== w.editingItemId || e[3] !== I || e[4] !== H ? (R = /* @__PURE__ */ u(Yi, { items: I, editingItemId: w.editingItemId, onEdit: H, onRemove: A, onMove: S }), e[0] = S, e[1] = A, e[2] = w.editingItemId, e[3] = I, e[4] = H, e[5] = R) : R = e[5];
2569
+ let q;
2570
+ e[6] !== w.inputValue ? (q = Xi(w.inputValue), e[6] = w.inputValue, e[7] = q) : q = e[7];
2571
+ const V = w.isEditing ? "Save queued follow-up" : void 0;
2572
+ let j;
2573
+ e[8] !== s || e[9] !== r || e[10] !== i || e[11] !== l || e[12] !== a || e[13] !== c || e[14] !== d || e[15] !== n || e[16] !== M || e[17] !== f || e[18] !== m || e[19] !== h || e[20] !== g || e[21] !== b || e[22] !== y || e[23] !== x || e[24] !== w.change || e[25] !== w.focusSignal || e[26] !== w.submit || e[27] !== o || e[28] !== _ || e[29] !== p || e[30] !== V || e[31] !== q ? (j = /* @__PURE__ */ u(So, { recentUserMessages: o, placeholder: a, defaultState: q, streaming: _, onSubmit: w.submit, onInterrupt: x, onAttachFiles: h, onAttachText: g, onChange: w.change, actions: s, attachedResources: r, onClearAttachments: y, attachmentList: i, isDisabled: m, submitDisabled: p, attachedToTop: M, recessed: f, questionPrompt: c, autoFocus: l, focusSignal: w.focusSignal, submitTitle: V, references: d, onAddReference: b }, n), e[8] = s, e[9] = r, e[10] = i, e[11] = l, e[12] = a, e[13] = c, e[14] = d, e[15] = n, e[16] = M, e[17] = f, e[18] = m, e[19] = h, e[20] = g, e[21] = b, e[22] = y, e[23] = x, e[24] = w.change, e[25] = w.focusSignal, e[26] = w.submit, e[27] = o, e[28] = _, e[29] = p, e[30] = V, e[31] = q, e[32] = j) : j = e[32];
2528
2574
  let K;
2529
- return e[41] !== L || e[42] !== H ? (K = /* @__PURE__ */ c(j, { px: L, gap: "0", children: H }), e[41] = L, e[42] = H, e[43] = K) : K = e[43], K;
2530
- }, xl = (t) => {
2531
- const e = A(78), {
2575
+ e[33] !== B || e[34] !== j || e[35] !== E || e[36] !== F || e[37] !== L || e[38] !== $ || e[39] !== O || e[40] !== R || e[41] !== P ? (K = /* @__PURE__ */ k(X, { gap: B, p: E, borderWidth: F, borderColor: L, borderRadius: $, bg: O, children: [
2576
+ P,
2577
+ R,
2578
+ j
2579
+ ] }), e[33] = B, e[34] = j, e[35] = E, e[36] = F, e[37] = L, e[38] = $, e[39] = O, e[40] = R, e[41] = P, e[42] = K) : K = e[42];
2580
+ let G;
2581
+ return e[43] !== z || e[44] !== K ? (G = /* @__PURE__ */ u(X, { px: z, gap: "0", children: K }), e[43] = z, e[44] = K, e[45] = G) : G = e[45], G;
2582
+ };
2583
+ function el(t) {
2584
+ return t + 1;
2585
+ }
2586
+ const tl = (t) => {
2587
+ const e = Math.max(0, Math.floor(t));
2588
+ if (e < 60) return `${e}s`;
2589
+ const n = Math.floor(e / 60);
2590
+ return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
2591
+ }, nl = (t) => {
2592
+ const e = C(9), {
2593
+ hidden: n
2594
+ } = t, o = n === void 0 ? !1 : n, [s, r] = W(0);
2595
+ let i;
2596
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
2597
+ const l = J(i);
2598
+ let a, c;
2599
+ if (e[1] !== o ? (a = () => {
2600
+ if (o)
2601
+ return;
2602
+ const p = () => r((Date.now() - l.current) / 1e3);
2603
+ p();
2604
+ const h = setInterval(p, 1e3);
2605
+ return () => clearInterval(h);
2606
+ }, c = [o], e[1] = o, e[2] = a, e[3] = c) : (a = e[2], c = e[3]), Z(a, c), o)
2607
+ return null;
2608
+ let d;
2609
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ u(_t, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
2610
+ let f;
2611
+ e[5] !== s ? (f = tl(s), e[5] = s, e[6] = f) : f = e[6];
2612
+ let m;
2613
+ return e[7] !== f ? (m = /* @__PURE__ */ k(oe, { gap: "2xs", px: "sm", py: "xs", children: [
2614
+ d,
2615
+ /* @__PURE__ */ u(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
2616
+ ] }), e[7] = f, e[8] = m) : m = e[8], m;
2617
+ }, _l = (t) => {
2618
+ const e = C(82), {
2532
2619
  conversationKey: n,
2533
- messages: s,
2534
- loading: o,
2620
+ messages: o,
2621
+ loading: s,
2535
2622
  streaming: r,
2536
2623
  emptyStateTitle: i,
2537
2624
  emptyStateDescription: l,
2538
2625
  emptyStateContent: a,
2539
- loaderComponent: u,
2626
+ loaderComponent: c,
2540
2627
  chatInputPlaceholder: d,
2541
2628
  chatInputDefaultValue: f,
2542
- onSubmitMessage: p,
2543
- onInterrupt: m,
2629
+ onSubmitMessage: m,
2630
+ onInterrupt: p,
2544
2631
  onAttachFiles: h,
2545
2632
  onAttachText: g,
2546
2633
  onChatInputChange: b,
2547
- actions: x,
2548
- attachedResources: y,
2549
- onClearAttachments: T,
2550
- attachmentList: S,
2551
- approvalPrompt: w,
2552
- workspaceHub: C,
2553
- workspaceInitializing: _,
2554
- inputDisabled: R,
2555
- submitDisabled: L,
2556
- chatInputQuestionPrompt: E,
2557
- chatInputAutoFocus: Q,
2558
- queuedFollowUps: M,
2559
- onQueuedFollowUpUpdate: D,
2560
- onQueuedFollowUpRemove: B,
2561
- onQueuedFollowUpMove: $,
2562
- chatInputReferences: O,
2563
- onChatInputAddReference: F
2564
- } = t, z = o === void 0 ? !1 : o, v = r === void 0 ? !1 : r, W = f === void 0 ? "" : f, H = _ === void 0 ? !1 : _, K = R === void 0 ? !1 : R, oe = L === void 0 ? !1 : L, xe = Q === void 0 ? !1 : Q;
2634
+ actions: y,
2635
+ attachedResources: x,
2636
+ onClearAttachments: S,
2637
+ attachmentList: A,
2638
+ approvalPrompt: T,
2639
+ workspaceHub: w,
2640
+ workspaceInitializing: I,
2641
+ inputDisabled: _,
2642
+ submitDisabled: P,
2643
+ chatInputQuestionPrompt: M,
2644
+ chatInputAutoFocus: z,
2645
+ queuedFollowUps: B,
2646
+ onQueuedFollowUpUpdate: E,
2647
+ onQueuedFollowUpRemove: F,
2648
+ onQueuedFollowUpMove: L,
2649
+ chatInputReferences: $,
2650
+ onChatInputAddReference: O
2651
+ } = t, H = s === void 0 ? !1 : s, R = r === void 0 ? !1 : r, q = f === void 0 ? "" : f, V = I === void 0 ? !1 : I, j = _ === void 0 ? !1 : _, K = P === void 0 ? !1 : P, G = z === void 0 ? !1 : z;
2565
2652
  let Se;
2566
- e[0] !== M ? (Se = M === void 0 ? [] : M, e[0] = M, e[1] = Se) : Se = e[1];
2567
- const ee = Se;
2568
- let Te;
2569
- e[2] !== O ? (Te = O === void 0 ? [] : O, e[2] = O, e[3] = Te) : Te = e[3];
2570
- const Be = Te;
2571
- let X, G, de, te, fe;
2572
- if (e[4] !== n || e[5] !== s || e[6] !== v) {
2573
- const me = yi(s, {
2574
- streaming: v
2653
+ e[0] !== B ? (Se = B === void 0 ? [] : B, e[0] = B, e[1] = Se) : Se = e[1];
2654
+ const re = Se;
2655
+ let ie;
2656
+ e[2] !== $ ? (ie = $ === void 0 ? [] : $, e[2] = $, e[3] = ie) : ie = e[3];
2657
+ const ee = ie;
2658
+ let te, ne, le, Te, ae;
2659
+ if (e[4] !== n || e[5] !== o || e[6] !== R) {
2660
+ const he = Ci(o, {
2661
+ streaming: R
2575
2662
  });
2576
- X = me.length > 0, de = n ?? me[0]?.id, G = X ? de ?? "active-conversation" : null, fe = me.reduce(Gi, 0), te = xi(me), e[4] = n, e[5] = s, e[6] = v, e[7] = X, e[8] = G, e[9] = de, e[10] = te, e[11] = fe;
2663
+ te = he.length > 0, le = n ?? he[0]?.id, ne = te ? le ?? "active-conversation" : null, ae = he.reduce(sl, 0), Te = ki(he), e[4] = n, e[5] = o, e[6] = R, e[7] = te, e[8] = ne, e[9] = le, e[10] = Te, e[11] = ae;
2577
2664
  } else
2578
- X = e[7], G = e[8], de = e[9], te = e[10], fe = e[11];
2665
+ te = e[7], ne = e[8], le = e[9], Te = e[10], ae = e[11];
2579
2666
  const {
2580
- groups: Fe,
2581
- leadingResponses: Ae
2582
- } = te, [we, nt] = V(Yi), [st, q] = V(null), ne = !X && z;
2583
- let se;
2584
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ c(gs, { size: 48, strokeWidth: 1.5 }), e[12] = se) : se = e[12];
2585
- let pe;
2586
- e[13] !== l || e[14] !== i ? (pe = /* @__PURE__ */ c(As, { icon: se, title: i, description: l }), e[13] = l, e[14] = i, e[15] = pe) : pe = e[15];
2587
- const ot = ne ? u : a ?? pe, rt = !!C;
2588
- let We;
2589
- e[16] !== E || e[17] !== s ? (We = E ?? xo(s), e[16] = E, e[17] = s, e[18] = We) : We = e[18];
2590
- const Le = We, it = !!Le, lt = v && X && !H && !Le, He = !G || st === G;
2591
- let Ve;
2592
- e[19] !== W || e[20] !== b || e[21] !== D || e[22] !== p || e[23] !== ee ? (Ve = {
2593
- queuedFollowUps: ee,
2594
- defaultValue: W,
2667
+ groups: ce,
2668
+ leadingResponses: Be
2669
+ } = Te, [Fe, Ne] = W(ol), [Le, it] = W(null), lt = !te && H;
2670
+ let Q;
2671
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ u(xs, { size: 48, strokeWidth: 1.5 }), e[12] = Q) : Q = e[12];
2672
+ let Y;
2673
+ e[13] !== l || e[14] !== i ? (Y = /* @__PURE__ */ u(Is, { icon: Q, title: i, description: l }), e[13] = l, e[14] = i, e[15] = Y) : Y = e[15];
2674
+ const we = lt ? c : a ?? Y, $e = !!w;
2675
+ let Ue;
2676
+ e[16] !== M || e[17] !== o ? (Ue = M ?? Io(o), e[16] = M, e[17] = o, e[18] = Ue) : Ue = e[18];
2677
+ const Oe = Ue, at = !!Oe, ct = R && te && !V && !Oe, je = !ne || Le === ne;
2678
+ let Ke;
2679
+ e[19] !== q || e[20] !== b || e[21] !== E || e[22] !== m || e[23] !== re ? (Ke = {
2680
+ queuedFollowUps: re,
2681
+ defaultValue: q,
2595
2682
  onChange: b,
2596
- onSubmit: p,
2597
- onUpdate: D
2598
- }, e[19] = W, e[20] = b, e[21] = D, e[22] = p, e[23] = ee, e[24] = Ve) : Ve = e[24];
2599
- const at = ji(Ve);
2600
- let Ne;
2601
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ne = (me) => {
2602
- nt((On) => {
2603
- const je = new Set(On);
2604
- return je.has(me) ? je.delete(me) : je.add(me), je;
2683
+ onSubmit: m,
2684
+ onUpdate: E
2685
+ }, e[19] = q, e[20] = b, e[21] = E, e[22] = m, e[23] = re, e[24] = Ke) : Ke = e[24];
2686
+ const ut = Ji(Ke);
2687
+ let Xe;
2688
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Xe = (he) => {
2689
+ Ne((qn) => {
2690
+ const Ye = new Set(qn);
2691
+ return Ye.has(he) ? Ye.delete(he) : Ye.add(he), Ye;
2605
2692
  });
2606
- }, e[25] = Ne) : Ne = e[25];
2607
- const $n = Ne, ct = de ?? null;
2608
- let ke;
2609
- e[26] !== ct || e[27] !== fe ? (ke = /* @__PURE__ */ c(Hs, { conversationKey: ct, userMessageCount: fe }), e[26] = ct, e[27] = fe, e[28] = ke) : ke = e[28];
2610
- const ut = He ? "visible" : "hidden";
2693
+ }, e[25] = Xe) : Xe = e[25];
2694
+ const Qn = Xe, dt = le ?? null;
2695
+ let Ae;
2696
+ e[26] !== dt || e[27] !== ae ? (Ae = /* @__PURE__ */ u(Us, { conversationKey: dt, userMessageCount: ae }), e[26] = dt, e[27] = ae, e[28] = Ae) : Ae = e[28];
2697
+ const ft = je ? "visible" : "hidden";
2611
2698
  let Ce;
2612
- e[29] !== ot || e[30] !== we || e[31] !== Fe || e[32] !== X || e[33] !== it || e[34] !== Ae || e[35] !== G || e[36] !== v ? (Ce = X ? /* @__PURE__ */ c(Wi, { leadingResponses: Ae, groups: Fe, streaming: v, hideActiveQuestionForms: it, expandedStickyMessageIds: we, onToggleStickyMessage: $n, onReady: () => q(G) }, G) : ot, e[29] = ot, e[30] = we, e[31] = Fe, e[32] = X, e[33] = it, e[34] = Ae, e[35] = G, e[36] = v, e[37] = Ce) : Ce = e[37];
2699
+ e[29] !== we || e[30] !== Fe || e[31] !== ce || e[32] !== te || e[33] !== at || e[34] !== Be || e[35] !== ne || e[36] !== R ? (Ce = te ? /* @__PURE__ */ u(Ki, { leadingResponses: Be, groups: ce, streaming: R, hideActiveQuestionForms: at, expandedStickyMessageIds: Fe, onToggleStickyMessage: Qn, onReady: () => it(ne) }, ne) : we, e[29] = we, e[30] = Fe, e[31] = ce, e[32] = te, e[33] = at, e[34] = Be, e[35] = ne, e[36] = R, e[37] = Ce) : Ce = e[37];
2700
+ let ke;
2701
+ e[38] !== ft || e[39] !== Ce ? (ke = /* @__PURE__ */ u(gt.Viewport, { visibility: ft, children: Ce }), e[38] = ft, e[39] = Ce, e[40] = ke) : ke = e[40];
2613
2702
  let Ie;
2614
- e[38] !== ut || e[39] !== Ce ? (Ie = /* @__PURE__ */ c(pt.Viewport, { visibility: ut, children: Ce }), e[38] = ut, e[39] = Ce, e[40] = Ie) : Ie = e[40];
2703
+ e[41] !== je ? (Ie = je ? /* @__PURE__ */ u(gt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = je, e[42] = Ie) : Ie = e[42];
2615
2704
  let _e;
2616
- e[41] !== He ? (_e = He ? /* @__PURE__ */ c(pt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = He, e[42] = _e) : _e = e[42];
2617
- let Re;
2618
- e[43] !== ke || e[44] !== Ie || e[45] !== _e ? (Re = /* @__PURE__ */ k(pt.Root, { children: [
2705
+ e[43] !== Ae || e[44] !== ke || e[45] !== Ie ? (_e = /* @__PURE__ */ k(gt.Root, { children: [
2706
+ Ae,
2619
2707
  ke,
2620
- Ie,
2621
- _e
2622
- ] }), e[43] = ke, e[44] = Ie, e[45] = _e, e[46] = Re) : Re = e[46];
2708
+ Ie
2709
+ ] }), e[43] = Ae, e[44] = ke, e[45] = Ie, e[46] = _e) : _e = e[46];
2623
2710
  let ve;
2624
- e[47] !== lt || e[48] !== v ? (ve = v ? /* @__PURE__ */ c(Ui, { hidden: !lt }) : null, e[47] = lt, e[48] = v, e[49] = ve) : ve = e[49];
2711
+ e[47] !== ct || e[48] !== R ? (ve = R ? /* @__PURE__ */ u(nl, { hidden: !ct }) : null, e[47] = ct, e[48] = R, e[49] = ve) : ve = e[49];
2712
+ const pt = n ?? o[0]?.id;
2625
2713
  let Me;
2626
- e[50] !== x || e[51] !== Le || e[52] !== y || e[53] !== S || e[54] !== xe || e[55] !== d || e[56] !== Be || e[57] !== rt || e[58] !== K || e[59] !== h || e[60] !== g || e[61] !== F || e[62] !== T || e[63] !== m || e[64] !== $ || e[65] !== B || e[66] !== D || e[67] !== at || e[68] !== ee || e[69] !== v || e[70] !== oe || e[71] !== C ? (Me = /* @__PURE__ */ c(Ki, { actions: x, attachedResources: y, attachmentList: S, chatInputAutoFocus: xe, chatInputPlaceholder: d, chatInputQuestionPrompt: Le, chatInputReferences: Be, hasWorkspaceHub: rt, inputDisabled: K, submitDisabled: oe, onAttachFiles: h, onAttachText: g, onChatInputAddReference: F, onClearAttachments: T, onInterrupt: m, onQueuedFollowUpMove: $, onQueuedFollowUpRemove: B, onQueuedFollowUpUpdate: D, queuedComposer: at, queuedFollowUps: ee, streaming: v, workspaceHub: C }), e[50] = x, e[51] = Le, e[52] = y, e[53] = S, e[54] = xe, e[55] = d, e[56] = Be, e[57] = rt, e[58] = K, e[59] = h, e[60] = g, e[61] = F, e[62] = T, e[63] = m, e[64] = $, e[65] = B, e[66] = D, e[67] = at, e[68] = ee, e[69] = v, e[70] = oe, e[71] = C, e[72] = Me) : Me = e[72];
2627
- let Ue;
2628
- return e[73] !== w || e[74] !== Re || e[75] !== ve || e[76] !== Me ? (Ue = /* @__PURE__ */ k(be, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2629
- Re,
2630
- w,
2714
+ e[50] !== o ? (Me = ho(o), e[50] = o, e[51] = Me) : Me = e[51];
2715
+ let Re;
2716
+ e[52] !== y || e[53] !== Oe || e[54] !== x || e[55] !== A || e[56] !== G || e[57] !== d || e[58] !== ee || e[59] !== $e || e[60] !== j || e[61] !== h || e[62] !== g || e[63] !== O || e[64] !== S || e[65] !== p || e[66] !== L || e[67] !== F || e[68] !== E || e[69] !== ut || e[70] !== re || e[71] !== R || e[72] !== K || e[73] !== pt || e[74] !== Me || e[75] !== w ? (Re = /* @__PURE__ */ u(Zi, { conversationKey: pt, recentUserMessages: Me, actions: y, attachedResources: x, attachmentList: A, chatInputAutoFocus: G, chatInputPlaceholder: d, chatInputQuestionPrompt: Oe, chatInputReferences: ee, hasWorkspaceHub: $e, inputDisabled: j, submitDisabled: K, onAttachFiles: h, onAttachText: g, onChatInputAddReference: O, onClearAttachments: S, onInterrupt: p, onQueuedFollowUpMove: L, onQueuedFollowUpRemove: F, onQueuedFollowUpUpdate: E, queuedComposer: ut, queuedFollowUps: re, streaming: R, workspaceHub: w }), e[52] = y, e[53] = Oe, e[54] = x, e[55] = A, e[56] = G, e[57] = d, e[58] = ee, e[59] = $e, e[60] = j, e[61] = h, e[62] = g, e[63] = O, e[64] = S, e[65] = p, e[66] = L, e[67] = F, e[68] = E, e[69] = ut, e[70] = re, e[71] = R, e[72] = K, e[73] = pt, e[74] = Me, e[75] = w, e[76] = Re) : Re = e[76];
2717
+ let Ge;
2718
+ return e[77] !== T || e[78] !== _e || e[79] !== ve || e[80] !== Re ? (Ge = /* @__PURE__ */ k(ye, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2719
+ _e,
2720
+ T,
2631
2721
  ve,
2632
- Me
2633
- ] }), e[73] = w, e[74] = Re, e[75] = ve, e[76] = Me, e[77] = Ue) : Ue = e[77], Ue;
2722
+ Re
2723
+ ] }), e[77] = T, e[78] = _e, e[79] = ve, e[80] = Re, e[81] = Ge) : Ge = e[81], Ge;
2634
2724
  };
2635
- function Xi(t) {
2636
- return t + 1;
2637
- }
2638
- function Gi(t, e) {
2725
+ function sl(t, e) {
2639
2726
  return t + (e.role === "user" ? 1 : 0);
2640
2727
  }
2641
- function Yi() {
2728
+ function ol() {
2642
2729
  return /* @__PURE__ */ new Set();
2643
2730
  }
2644
- const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ c(jn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), Sl = () => {
2645
- const t = A(2);
2731
+ const Gt = (t) => /* @__PURE__ */ u(X, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ u(Gn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), vl = () => {
2732
+ const t = C(2);
2646
2733
  let e;
2647
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ c(ge.Root, { from: "user", children: /* @__PURE__ */ c(ge.Content, { from: "user", children: Kt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2734
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ u(be.Root, { from: "user", children: /* @__PURE__ */ u(be.Content, { from: "user", children: Gt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2648
2735
  let n;
2649
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(j, { minH: "full", py: "xs", gap: "0", children: [
2736
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(X, { minH: "full", py: "xs", gap: "0", children: [
2650
2737
  e,
2651
- /* @__PURE__ */ c(ge.Root, { from: "assistant", children: /* @__PURE__ */ c(ge.Content, { from: "assistant", children: Kt(["76%", "62%", "40%"]) }) })
2738
+ /* @__PURE__ */ u(be.Root, { from: "assistant", children: /* @__PURE__ */ u(be.Content, { from: "assistant", children: Gt(["76%", "62%", "40%"]) }) })
2652
2739
  ] }), t[1] = n) : n = t[1], n;
2653
- }, Ji = 3, Xt = 10, Zi = 26, Tt = 4, el = (t, e) => {
2740
+ }, rl = 3, Yt = 10, il = 26, kt = 4, ll = (t, e) => {
2654
2741
  if (e === null) return 0;
2655
2742
  const n = Math.abs(t - e);
2656
- return n >= Tt ? 0 : (1 + Math.cos(Math.PI * n / Tt)) / 2;
2657
- }, tl = (t, e) => {
2743
+ return n >= kt ? 0 : (1 + Math.cos(Math.PI * n / kt)) / 2;
2744
+ }, al = (t, e) => {
2658
2745
  if (e === null) return "fg.subtle";
2659
2746
  const n = Math.abs(t - e);
2660
- return n < 0.5 ? "fg" : n < Tt ? "fg.muted" : "fg.subtle";
2661
- }, nl = (t) => {
2662
- const e = A(11), {
2747
+ return n < 0.5 ? "fg" : n < kt ? "fg.muted" : "fg.subtle";
2748
+ }, cl = (t) => {
2749
+ const e = C(11), {
2663
2750
  item: n,
2664
- position: s
2665
- } = t, o = `${s.left}px`, r = `${s.top}px`;
2751
+ position: o
2752
+ } = t, s = `${o.left}px`, r = `${o.top}px`;
2666
2753
  let i;
2667
- e[0] !== n.message ? (i = /* @__PURE__ */ c(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
2754
+ e[0] !== n.message ? (i = /* @__PURE__ */ u(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
2668
2755
  let l;
2669
- e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
2756
+ e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
2670
2757
  let a;
2671
- e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(j, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
2758
+ e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(X, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
2672
2759
  i,
2673
2760
  l
2674
2761
  ] }), e[4] = i, e[5] = l, e[6] = a) : a = e[6];
2675
- let u;
2676
- return e[7] !== o || e[8] !== r || e[9] !== a ? (u = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(P, { position: "fixed", left: o, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = o, e[8] = r, e[9] = a, e[10] = u) : u = e[10], u;
2677
- }, wl = (t) => {
2678
- const e = A(22), {
2762
+ let c;
2763
+ return e[7] !== s || e[8] !== r || e[9] !== a ? (c = /* @__PURE__ */ u(Zt, { children: /* @__PURE__ */ u(D, { position: "fixed", left: s, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = s, e[8] = r, e[9] = a, e[10] = c) : c = e[10], c;
2764
+ }, Ml = (t) => {
2765
+ const e = C(22), {
2679
2766
  items: n,
2680
- onSelect: s,
2681
- floating: o
2682
- } = t, r = o === void 0 ? !1 : o, [i, l] = V(null), [a, u] = V(null);
2683
- if (n.length < Ji)
2767
+ onSelect: o,
2768
+ floating: s
2769
+ } = t, r = s === void 0 ? !1 : s, [i, l] = W(null), [a, c] = W(null);
2770
+ if (n.length < rl)
2684
2771
  return null;
2685
2772
  let d;
2686
- e[0] !== n.length ? (d = (S) => {
2687
- const w = S.currentTarget.getBoundingClientRect(), C = (S.clientY - w.top) / w.height, _ = Math.min(n.length - 1, Math.max(0, C * n.length - 0.5)), R = Math.round(_);
2688
- l(_), u({
2689
- left: w.right,
2690
- top: w.top + (R + 0.5) / n.length * w.height
2773
+ e[0] !== n.length ? (d = (A) => {
2774
+ const T = A.currentTarget.getBoundingClientRect(), w = (A.clientY - T.top) / T.height, I = Math.min(n.length - 1, Math.max(0, w * n.length - 0.5)), _ = Math.round(I);
2775
+ l(I), c({
2776
+ left: T.right,
2777
+ top: T.top + (_ + 0.5) / n.length * T.height
2691
2778
  });
2692
2779
  }, e[0] = n.length, e[1] = d) : d = e[1];
2693
- const f = d, p = i === null ? null : Math.round(i), m = p === null ? null : n[p];
2780
+ const f = d, m = i === null ? null : Math.round(i), p = m === null ? null : n[m];
2694
2781
  let h;
2695
2782
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => l(null), e[2] = h) : h = e[2];
2696
2783
  let g;
@@ -2702,100 +2789,100 @@ const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((
2702
2789
  bg: "bg"
2703
2790
  } : {}, e[3] = r, e[4] = g) : g = e[4];
2704
2791
  let b;
2705
- if (e[5] !== n || e[6] !== s || e[7] !== i) {
2706
- let S;
2707
- e[9] !== s || e[10] !== i ? (S = (w, C) => /* @__PURE__ */ c(Gt.button, { type: "button", h: "2px", w: `${Xt + (Zi - Xt) * el(C, i)}px`, bg: tl(C, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${C + 1}`, onClick: () => s?.(w.id) }, w.id), e[9] = s, e[10] = i, e[11] = S) : S = e[11], b = n.map(S), e[5] = n, e[6] = s, e[7] = i, e[8] = b;
2792
+ if (e[5] !== n || e[6] !== o || e[7] !== i) {
2793
+ let A;
2794
+ e[9] !== o || e[10] !== i ? (A = (T, w) => /* @__PURE__ */ u(Jt.button, { type: "button", h: "2px", w: `${Yt + (il - Yt) * ll(w, i)}px`, bg: al(w, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${w + 1}`, onClick: () => o?.(T.id) }, T.id), e[9] = o, e[10] = i, e[11] = A) : A = e[11], b = n.map(A), e[5] = n, e[6] = o, e[7] = i, e[8] = b;
2708
2795
  } else
2709
2796
  b = e[8];
2710
- let x;
2711
- e[12] !== f || e[13] !== g || e[14] !== b ? (x = /* @__PURE__ */ c(be, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = x) : x = e[15];
2712
2797
  let y;
2713
- e[16] !== m || e[17] !== a ? (y = m && a ? /* @__PURE__ */ c(nl, { item: m, position: a }) : null, e[16] = m, e[17] = a, e[18] = y) : y = e[18];
2714
- let T;
2715
- return e[19] !== x || e[20] !== y ? (T = /* @__PURE__ */ k(P, { position: "relative", w: "10", flexShrink: 0, children: [
2716
- x,
2717
- y
2718
- ] }), e[19] = x, e[20] = y, e[21] = T) : T = e[21], T;
2719
- }, sl = (t) => {
2720
- const e = A(13), {
2798
+ e[12] !== f || e[13] !== g || e[14] !== b ? (y = /* @__PURE__ */ u(ye, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = y) : y = e[15];
2799
+ let x;
2800
+ e[16] !== p || e[17] !== a ? (x = p && a ? /* @__PURE__ */ u(cl, { item: p, position: a }) : null, e[16] = p, e[17] = a, e[18] = x) : x = e[18];
2801
+ let S;
2802
+ return e[19] !== y || e[20] !== x ? (S = /* @__PURE__ */ k(D, { position: "relative", w: "10", flexShrink: 0, children: [
2803
+ y,
2804
+ x
2805
+ ] }), e[19] = y, e[20] = x, e[21] = S) : S = e[21], S;
2806
+ }, ul = (t) => {
2807
+ const e = C(13), {
2721
2808
  status: n,
2722
- statusLabel: s,
2723
- additions: o,
2809
+ statusLabel: o,
2810
+ additions: s,
2724
2811
  deletions: r
2725
2812
  } = t;
2726
2813
  if (n === "loading") {
2727
- let u;
2728
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[0] = u) : u = e[0];
2729
- const d = s ?? "Setting up workspace...";
2814
+ let c;
2815
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(_t, { size: "xs", color: "fg.muted" }), e[0] = c) : c = e[0];
2816
+ const d = o ?? "Setting up workspace...";
2730
2817
  let f;
2731
- return e[1] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
2732
- u,
2733
- /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
2818
+ return e[1] !== d ? (f = /* @__PURE__ */ k(oe, { gap: "2xs", minW: "0", children: [
2819
+ c,
2820
+ /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
2734
2821
  ] }), e[1] = d, e[2] = f) : f = e[2], f;
2735
2822
  }
2736
2823
  if (n === "error") {
2737
- let u;
2738
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(sn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = u) : u = e[3];
2739
- const d = s ?? "Workspace setup failed";
2824
+ let c;
2825
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(rn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = c) : c = e[3];
2826
+ const d = o ?? "Workspace setup failed";
2740
2827
  let f;
2741
- return e[4] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
2742
- u,
2743
- /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
2828
+ return e[4] !== d ? (f = /* @__PURE__ */ k(oe, { gap: "2xs", minW: "0", children: [
2829
+ c,
2830
+ /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
2744
2831
  ] }), e[4] = d, e[5] = f) : f = e[5], f;
2745
2832
  }
2746
- if (o <= 0 && r <= 0)
2833
+ if (s <= 0 && r <= 0)
2747
2834
  return null;
2748
2835
  let i;
2749
- e[6] !== o ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
2836
+ e[6] !== s ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
2750
2837
  "+",
2751
- o
2752
- ] }), e[6] = o, e[7] = i) : i = e[7];
2838
+ s
2839
+ ] }), e[6] = s, e[7] = i) : i = e[7];
2753
2840
  let l;
2754
2841
  e[8] !== r ? (l = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.error", children: [
2755
2842
  "−",
2756
2843
  r
2757
2844
  ] }), e[8] = r, e[9] = l) : l = e[9];
2758
2845
  let a;
2759
- return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(Z, { gap: "2xs", children: [
2846
+ return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(oe, { gap: "2xs", children: [
2760
2847
  i,
2761
2848
  l
2762
2849
  ] }), e[10] = i, e[11] = l, e[12] = a) : a = e[12], a;
2763
- }, Tl = (t) => {
2764
- const e = A(13), {
2850
+ }, Rl = (t) => {
2851
+ const e = C(13), {
2765
2852
  workspaceControl: n,
2766
- additions: s,
2767
- deletions: o,
2853
+ additions: o,
2854
+ deletions: s,
2768
2855
  action: r,
2769
2856
  status: i,
2770
2857
  statusLabel: l
2771
2858
  } = t, a = i === void 0 ? "ready" : i;
2772
- let u;
2773
- e[0] !== s || e[1] !== o || e[2] !== a || e[3] !== l ? (u = /* @__PURE__ */ c(sl, { status: a, statusLabel: l, additions: s, deletions: o }), e[0] = s, e[1] = o, e[2] = a, e[3] = l, e[4] = u) : u = e[4];
2859
+ let c;
2860
+ e[0] !== o || e[1] !== s || e[2] !== a || e[3] !== l ? (c = /* @__PURE__ */ u(ul, { status: a, statusLabel: l, additions: o, deletions: s }), e[0] = o, e[1] = s, e[2] = a, e[3] = l, e[4] = c) : c = e[4];
2774
2861
  let d;
2775
- e[5] !== u || e[6] !== n ? (d = /* @__PURE__ */ k(Z, { gap: "sm", minW: "0", children: [
2862
+ e[5] !== c || e[6] !== n ? (d = /* @__PURE__ */ k(oe, { gap: "sm", minW: "0", children: [
2776
2863
  n,
2777
- u
2778
- ] }), e[5] = u, e[6] = n, e[7] = d) : d = e[7];
2864
+ c
2865
+ ] }), e[5] = c, e[6] = n, e[7] = d) : d = e[7];
2779
2866
  let f;
2780
- e[8] !== r ? (f = r ? /* @__PURE__ */ c(be, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
2781
- let p;
2782
- return e[10] !== d || e[11] !== f ? (p = /* @__PURE__ */ k(be, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
2867
+ e[8] !== r ? (f = r ? /* @__PURE__ */ u(ye, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
2868
+ let m;
2869
+ return e[10] !== d || e[11] !== f ? (m = /* @__PURE__ */ k(ye, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
2783
2870
  d,
2784
2871
  f
2785
- ] }), e[10] = d, e[11] = f, e[12] = p) : p = e[12], p;
2872
+ ] }), e[10] = d, e[11] = f, e[12] = m) : m = e[12], m;
2786
2873
  };
2787
2874
  export {
2788
- bl as ApprovalPrompt,
2789
- yl as AttachmentList,
2790
- Hs as AutoScroll,
2791
- po as ChatInput,
2792
- ge as ChatMessage,
2793
- xl as ChatPanel,
2794
- pt as ChatPrimitives,
2795
- Sl as ChatSkeleton,
2796
- Tl as ChatWorkspaceHub,
2797
- wl as ConversationBrowse,
2798
- uo as SendButton,
2799
- So as createSerializedPromptState
2875
+ kl as ApprovalPrompt,
2876
+ Il as AttachmentList,
2877
+ Us as AutoScroll,
2878
+ So as ChatInput,
2879
+ be as ChatMessage,
2880
+ _l as ChatPanel,
2881
+ gt as ChatPrimitives,
2882
+ vl as ChatSkeleton,
2883
+ Rl as ChatWorkspaceHub,
2884
+ Ml as ConversationBrowse,
2885
+ mo as SendButton,
2886
+ Xi as createSerializedPromptState
2800
2887
  };
2801
2888
  //# sourceMappingURL=chat-ui.js.map