@marimo-team/islands 0.25.3-dev170 → 0.25.3-dev175

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 (196) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BbSXV-Xa.js → ConnectedDataExplorerComponent-Le_OBfmt.js} +9 -9
  2. package/dist/{ErrorBoundary-NE86qEWZ.js → ErrorBoundary-DNvcAIsP.js} +8 -8
  3. package/dist/{abnfDiagram-VCTEODGH-D7n07nXf.js → abnfDiagram-VCTEODGH-Tf1ghyQQ.js} +2 -2
  4. package/dist/{any-language-editor-3E24SnCV.js → any-language-editor-BVFHDDQ3.js} +4 -4
  5. package/dist/{architectureDiagram-5GKGNRK7-D6CjRib5.js → architectureDiagram-5GKGNRK7-xlnbTG0T.js} +1 -1
  6. package/dist/{chat-ui-CC7GekpG.js → chat-ui-X-cWrL9u.js} +1218 -1218
  7. package/dist/{check-SpOMoCLP.js → check-C9Mp9eCK.js} +1 -1
  8. package/dist/{chunk-IMKFNOWR-6dtPz7uS.js → chunk-IMKFNOWR-Cmd4a5jy.js} +1 -1
  9. package/dist/{chunk-SHT3W25Y-BwnFNKDA.js → chunk-SHT3W25Y-mSNp-WpO.js} +1 -1
  10. package/dist/{chunk-SVP7TREG-D2eV4vBJ.js → chunk-SVP7TREG-CWC49D8X.js} +1 -1
  11. package/dist/{chunk-TICWLB2K-BDs4-_-r.js → chunk-TICWLB2K-De9FINtG.js} +1 -1
  12. package/dist/{classDiagram-ZZMXUADV-DCJnf_8v.js → classDiagram-ZZMXUADV-DweTkYdp.js} +2 -2
  13. package/dist/{classDiagram-v2-VYDZK3BY-BOmSzPBD.js → classDiagram-v2-VYDZK3BY-A6MR2TiE.js} +2 -2
  14. package/dist/{code-visibility-Bzvc6ajl.js → code-visibility-CH1lmM1h.js} +5 -5
  15. package/dist/{common-Ciw4zkh2.js → common-DIrS1UR9.js} +1081 -1085
  16. package/dist/{copy-icon-C1trdvVt.js → copy-icon-De584pZ4.js} +2 -2
  17. package/dist/{cynefinDiagram-5FMLGOSQ-Bln_Soky.js → cynefinDiagram-5FMLGOSQ-BSvo5le-.js} +1 -1
  18. package/dist/{dagre-GXQ25YYZ-D-nf7WzW.js → dagre-GXQ25YYZ-tXRQslO6.js} +1 -1
  19. package/dist/{data-grid-overlay-editor-AQREmxI7.js → data-grid-overlay-editor-DFLZvFK0.js} +1 -1
  20. package/dist/{diagram-S7CK7UJ4-PsgSMkY2.js → diagram-S7CK7UJ4-r3t5VtwI.js} +1 -1
  21. package/dist/{diagram-UQ7AKVKN-DfwfUuSw.js → diagram-UQ7AKVKN-qgbC8YnT.js} +1 -1
  22. package/dist/{diagram-VX7I27RA-C9_e-oMc.js → diagram-VX7I27RA-CiHxEwtp.js} +1 -1
  23. package/dist/{diagram-Z3DM3KII-CWLa5tuY.js → diagram-Z3DM3KII-D95u15Ev.js} +1 -1
  24. package/dist/{dialog-DgeqyrEZ.js → dialog-DVRfQuhD.js} +24 -24
  25. package/dist/{dist-F8Ep36rk.js → dist-B1M0bGO3.js} +1 -1
  26. package/dist/{dist-D6d86eNJ.js → dist-BA13RJj5.js} +1 -1
  27. package/dist/{dist-Bvs24R_E.js → dist-BJtmSgcE.js} +48 -48
  28. package/dist/{dist-CN_BeG2I.js → dist-Ba2VIn1K.js} +53 -53
  29. package/dist/{dist-PXYI_yuP.js → dist-Bj4bmwUm.js} +12 -12
  30. package/dist/{dist-DoE4XJBC.js → dist-BmS-ZGjl.js} +8626 -8626
  31. package/dist/{dist-BorMD-uX.js → dist-Bzogh7CW.js} +87 -87
  32. package/dist/{dist-CN8zI-XC.js → dist-CThPVKaP.js} +1385 -1382
  33. package/dist/{dist-DiDibOYr.js → dist-CTi5FTiV.js} +87 -87
  34. package/dist/{dist-diIx5qJW.js → dist-Ck_C32ye.js} +2 -2
  35. package/dist/{dist-BLfKmR-l.js → dist-D1fnFp1J.js} +1 -1
  36. package/dist/{dist-OR1OnN-y.js → dist-D3x9__Fu.js} +46 -46
  37. package/dist/{dist-BMQf5zIS.js → dist-D7mrh5sO.js} +36 -36
  38. package/dist/{dist-CSJ0MDRw.js → dist-D9Q3xjiP.js} +1 -1
  39. package/dist/{dist-BuaRHxOc.js → dist-DP60Ubh8.js} +2 -2
  40. package/dist/{dist-CSbh1PNP.js → dist-DTv9KkpW.js} +12 -12
  41. package/dist/{dist-D-wwqlzJ.js → dist-DVVwOfrD.js} +109 -109
  42. package/dist/{dist-C8fAKSH1.js → dist-DYXM73-k.js} +36 -36
  43. package/dist/{dist-DBtSl3sf.js → dist-DjeybPOb.js} +1 -1
  44. package/dist/{dist-CrSP_H1M.js → dist-DtGn9N4h.js} +197 -197
  45. package/dist/{dist-CLdpGQVr.js → dist-KN80qWCP.js} +2 -2
  46. package/dist/{dist-Cg7gzw-a.js → dist-O0qFpEJh.js} +56 -56
  47. package/dist/{dist-CkTTIdBe.js → dist-OUle2RT7.js} +207 -207
  48. package/dist/{dist-BK4Oj99o.js → dist-T5rh6JvL.js} +1 -1
  49. package/dist/{dropdown-menu-B6ftyzOg.js → dropdown-menu-DCMbbQ35.js} +691 -691
  50. package/dist/{ebnfDiagram-PWID7BFC-B1QRM58v.js → ebnfDiagram-PWID7BFC-P7e4bryK.js} +2 -2
  51. package/dist/{erDiagram-RLTQ6QDP-DJK_FqvW.js → erDiagram-RLTQ6QDP-CUHZcmRj.js} +1 -1
  52. package/dist/{error-banner-D40pmfQQ.js → error-banner-DxJ3s8YO.js} +57 -57
  53. package/dist/{error-entries-DgK3wUJR.js → error-entries-mpoD5t79.js} +4985 -5006
  54. package/dist/{esm-D2gTsXEV.js → esm-Bbw_Njjx.js} +575 -575
  55. package/dist/{esm-AMFssoNp.js → esm-mDQNEFe_.js} +354 -354
  56. package/dist/{feedback-button-8a6SETmT.js → feedback-button-DL0DJ-LB.js} +30 -30
  57. package/dist/{flowDiagram-HODETNUW-Uxc25XSJ.js → flowDiagram-HODETNUW-BGZ95AzI.js} +2 -2
  58. package/dist/{formats-DQCyPd5Z.js → formats-DI7HEVv7.js} +1 -1
  59. package/dist/{glide-data-editor-B70oke_v.js → glide-data-editor-n4wnx19S.js} +10 -10
  60. package/dist/{glide-utils-Dz_F4pAY.js → glide-utils-D98laidb.js} +2 -2
  61. package/dist/{globals-Cxd5hNlI.js → globals-NCsYyjpB.js} +3 -3
  62. package/dist/{html-to-image-D4yG5Ru0.js → html-to-image-BoZthB4P.js} +467 -458
  63. package/dist/{infoDiagram-27XIBGKW-DmjxqwL0.js → infoDiagram-27XIBGKW-BF0YX70D.js} +1 -1
  64. package/dist/{ishikawaDiagram-5VMMS53U-NgCLHqQi.js → ishikawaDiagram-5VMMS53U-_itsAAn-.js} +1 -1
  65. package/dist/{kanban-definition-UXKFOSKX-CZaG-iam.js → kanban-definition-UXKFOSKX-VNW2Beqh.js} +1 -1
  66. package/dist/{label-D9_-zSg-.js → label-Qvw1E97W.js} +1 -1
  67. package/dist/main.js +8257 -6606
  68. package/dist/{mermaid-CSvw7c71.js → mermaid-CZ6FrClS.js} +35 -35
  69. package/dist/{mindmap-definition-YA3MSWOX-DJYQBDH_.js → mindmap-definition-YA3MSWOX-DR4ripvd.js} +1 -1
  70. package/dist/{number-overlay-editor-ChK-SKUk.js → number-overlay-editor-rlvo4mo3.js} +1 -1
  71. package/dist/{pegDiagram-XKGWAZYB-CHKO_dAe.js → pegDiagram-XKGWAZYB-CFr3XlGl.js} +2 -2
  72. package/dist/{pieDiagram-E7YTZNPT-DVevbMAo.js → pieDiagram-E7YTZNPT-j91XYSLY.js} +1 -1
  73. package/dist/{process-output-DxvBAeL3.js → process-output-DLS4Mqg_.js} +4 -4
  74. package/dist/{railroadDiagram-O6MQD6OU-Detj1kcB.js → railroadDiagram-O6MQD6OU-Cd47ZV9E.js} +2 -2
  75. package/dist/{requirementDiagram-BXWQKSXE-BLFD0T_Z.js → requirementDiagram-BXWQKSXE-eJH6gLtX.js} +1 -1
  76. package/dist/{reveal-component-CXMXeDZD.js → reveal-component-BJfmRUzb.js} +9 -9
  77. package/dist/{select-CkF_GBxO.js → select-2KOiReNY.js} +324 -324
  78. package/dist/{sequenceDiagram-WJ2MYXX4-BZBgatQV.js → sequenceDiagram-WJ2MYXX4-DdfFEIrm.js} +1 -1
  79. package/dist/{spec-Mnkn3XEr.js → spec-h69nC3SI.js} +4 -4
  80. package/dist/{stateDiagram-D77RDMKH-4BZW9-6_.js → stateDiagram-D77RDMKH-DkjDvip8.js} +2 -2
  81. package/dist/{stateDiagram-v2-MP3YSRHH-C4sKC8Iq.js → stateDiagram-v2-MP3YSRHH-DBHACnOo.js} +2 -2
  82. package/dist/{swimlanes-42K2YHIH-SL5yeGe2.js → swimlanes-42K2YHIH-ogImlOmp.js} +1 -1
  83. package/dist/{swimlanesDiagram-VR7AAH4N-DqPmAYUv.js → swimlanesDiagram-VR7AAH4N-D6x-zsci.js} +2 -2
  84. package/dist/{timeline-definition-24CTP7MA-BfXUMWkq.js → timeline-definition-24CTP7MA-DQpLtsHD.js} +1 -1
  85. package/dist/{toDate-TMubKIVL.js → toDate-CDzoofJo.js} +2 -2
  86. package/dist/{toast-Btbve3Lm.js → toast-B5t9o6s_.js} +47 -47
  87. package/dist/{tooltip-CJ4Rqasp.js → tooltip-s4zZxwKe.js} +67 -67
  88. package/dist/{use-restore-focus-CmGwRNId.js → use-restore-focus-BgDTd2tc.js} +1 -1
  89. package/dist/{useAsyncData-DjMGFzFy.js → useAsyncData-Bn8SxUqM.js} +1 -1
  90. package/dist/{useDateFormatter-eCL_SdeG.js → useDateFormatter-D3Tkfzej.js} +2 -2
  91. package/dist/{useDeepCompareMemoize-BQR5TJot.js → useDeepCompareMemoize-CC2tnPCk.js} +1 -1
  92. package/dist/{useLifecycle-C_GvKWbQ.js → useLifecycle-BJlxHqWa.js} +2 -2
  93. package/dist/{useTheme-Bns2gJZ6.js → useTheme-DMfQYmlG.js} +85 -85
  94. package/dist/{vega-component-BsVptuhz.js → vega-component-CovWHi60.js} +7 -7
  95. package/dist/{vennDiagram-4TSXK5OY-CH65znGa.js → vennDiagram-4TSXK5OY-BD-SL_vq.js} +1 -1
  96. package/dist/{wardleyDiagram-VM6X3IG4-z9pWKb2_.js → wardleyDiagram-VM6X3IG4-BDgJV4ah.js} +1 -1
  97. package/dist/{xychartDiagram-S5SC5T6Z-MxyaWjjq.js → xychartDiagram-S5SC5T6Z-1hIHN6Rl.js} +1 -1
  98. package/package.json +1 -1
  99. package/src/__mocks__/document.tsx +54 -0
  100. package/src/__mocks__/notebook.ts +2 -1
  101. package/src/__mocks__/requests.ts +0 -2
  102. package/src/components/chat/chat-panel.tsx +3 -3
  103. package/src/components/datasources/__tests__/column-preview.test.tsx +6 -8
  104. package/src/components/datasources/column-preview.tsx +4 -8
  105. package/src/components/datasources/datasources.tsx +4 -3
  106. package/src/components/dependency-graph/minimap-content.tsx +2 -6
  107. package/src/components/dependency-graph/panels.tsx +2 -1
  108. package/src/components/editor/__tests__/Output.test.tsx +50 -32
  109. package/src/components/editor/__tests__/data-attributes.test.tsx +22 -11
  110. package/src/components/editor/__tests__/output-persistence.test.tsx +6 -1
  111. package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +69 -0
  112. package/src/components/editor/actions/name-cell-input.tsx +4 -3
  113. package/src/components/editor/actions/useCellActionButton.tsx +20 -26
  114. package/src/components/editor/actions/useNotebookActions.tsx +13 -18
  115. package/src/components/editor/actions/useSetCodeVisibility.ts +10 -11
  116. package/src/components/editor/actions/useSetOutputsExpanded.ts +13 -18
  117. package/src/components/editor/cell/CreateCellButton.tsx +5 -9
  118. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +3 -1
  119. package/src/components/editor/cell/code/cell-editor.tsx +13 -20
  120. package/src/components/editor/cell/useAddCell.ts +4 -8
  121. package/src/components/editor/cell/useDeleteCell.tsx +10 -36
  122. package/src/components/editor/cell/useRunCells.ts +2 -5
  123. package/src/components/editor/cell/useSplitCell.tsx +2 -1
  124. package/src/components/editor/chrome/panels/logs-panel.tsx +2 -1
  125. package/src/components/editor/chrome/panels/snippets-panel.tsx +5 -11
  126. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +3 -1
  127. package/src/components/editor/columns/sortable-column.tsx +1 -1
  128. package/src/components/editor/connections/components.tsx +4 -9
  129. package/src/components/editor/controls/Controls.tsx +1 -1
  130. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +9 -3
  131. package/src/components/editor/documentation.css +34 -11
  132. package/src/components/editor/errors/auto-fix.tsx +4 -8
  133. package/src/components/editor/file-tree/file-explorer.tsx +3 -7
  134. package/src/components/editor/links/__tests__/cell-link.test.tsx +3 -1
  135. package/src/components/editor/links/cell-link.tsx +2 -1
  136. package/src/components/editor/navigation/__tests__/clipboard.test.ts +60 -38
  137. package/src/components/editor/navigation/__tests__/navigation.test.ts +73 -64
  138. package/src/components/editor/navigation/clipboard.ts +12 -11
  139. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +11 -20
  140. package/src/components/editor/navigation/navigation.ts +20 -28
  141. package/src/components/editor/notebook-cell.tsx +7 -10
  142. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +125 -69
  143. package/src/components/editor/renderers/cell-array.tsx +10 -17
  144. package/src/components/markdown/markdown-renderer.tsx +4 -8
  145. package/src/components/pages/edit-page.tsx +32 -17
  146. package/src/components/scratchpad/scratchpad.test.tsx +3 -1
  147. package/src/components/scratchpad/scratchpad.tsx +4 -7
  148. package/src/components/slides/__tests__/minimap-actions.test.tsx +9 -25
  149. package/src/components/slides/minimap.tsx +7 -3
  150. package/src/components/slides/slide-cell-view.tsx +3 -3
  151. package/src/components/sort/SortableCellsProvider.tsx +2 -1
  152. package/src/core/ai/__tests__/staged-cells.test.ts +18 -20
  153. package/src/core/ai/staged-cells.ts +8 -16
  154. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +2 -2
  155. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +2 -2
  156. package/src/core/ai/tools/base.ts +2 -2
  157. package/src/core/ai/tools/edit-notebook-tool.ts +13 -21
  158. package/src/core/cells/__tests__/actions.test.ts +474 -34
  159. package/src/core/cells/__tests__/add-missing-import.test.ts +7 -8
  160. package/src/core/cells/__tests__/cells.test.ts +251 -861
  161. package/src/core/cells/__tests__/document.test.ts +42 -38
  162. package/src/core/cells/__tests__/notebook-outline.test.ts +7 -1
  163. package/src/core/cells/__tests__/outputs.test.tsx +71 -53
  164. package/src/core/cells/actions.ts +391 -3
  165. package/src/core/cells/add-missing-import.ts +46 -42
  166. package/src/core/cells/cells.ts +73 -444
  167. package/src/core/cells/document.ts +38 -6
  168. package/src/core/cells/outputs.ts +12 -28
  169. package/src/core/codemirror/cells/extensions.ts +6 -6
  170. package/src/core/codemirror/cells/state.ts +1 -1
  171. package/src/core/codemirror/keymaps/vim.ts +2 -2
  172. package/src/core/edit-app.tsx +20 -25
  173. package/src/core/islands/__tests__/bootstrap.test.ts +56 -0
  174. package/src/core/islands/__tests__/bridge.test.ts +42 -0
  175. package/src/core/islands/bootstrap.ts +24 -1
  176. package/src/core/islands/bridge.ts +46 -5
  177. package/src/core/kernel/__tests__/handlers.test.ts +7 -153
  178. package/src/core/kernel/handlers.ts +18 -59
  179. package/src/core/network/__tests__/requests-lazy.test.ts +1 -3
  180. package/src/core/network/requests-lazy.ts +0 -2
  181. package/src/core/network/requests-network.ts +0 -16
  182. package/src/core/network/requests-static.ts +0 -2
  183. package/src/core/network/requests-toasting.tsx +0 -2
  184. package/src/core/network/types.ts +0 -7
  185. package/src/core/notebook/document/__tests__/codemirror.test.ts +5 -0
  186. package/src/core/notebook/document/__tests__/draft.test.ts +41 -0
  187. package/src/core/notebook/document/__tests__/state.test.ts +21 -0
  188. package/src/core/notebook/document/draft.ts +35 -5
  189. package/src/core/notebook/document/index.ts +1 -0
  190. package/src/core/notebook/document/state.ts +6 -2
  191. package/src/core/run-app.tsx +1 -7
  192. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +0 -6
  193. package/src/core/session/useNotebookSession.tsx +28 -35
  194. package/src/core/wasm/bridge.ts +0 -16
  195. package/src/css/globals.css +56 -22
  196. package/src/stories/runtime-story.tsx +22 -15
@@ -2,27 +2,27 @@ import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { c as n, g as r, h as i, t as a } from "./button-BQRdqQi1.js";
3
3
  import { t as o } from "./react-sHtZdjeP.js";
4
4
  import { t as s } from "./compiler-runtime-CldRdSsv.js";
5
- import { i as c, t as l } from "./copy-icon-C1trdvVt.js";
6
- import { F as u, H as d, U as f, V as p, X as m, Y as h, Z as g, _, a as v, c as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, p as D, r as O, t as k, v as A, x as ee, y as te, z as ne } from "./html-to-image-D4yG5Ru0.js";
7
- import { m as j, t as re } from "./tooltip-CJ4Rqasp.js";
8
- import { Ct as ie, Ft as ae, Ot as oe, Q as se, Tt as ce, Wt as le, at as ue, dn as de, gn as fe, gt as pe, h as me, i as he, lt as ge, nn as _e, nt as ve, pn as ye, r as be, t as xe, un as Se, ut as Ce, w as we, wt as Te, z as Ee, zt as De } from "./error-entries-DgK3wUJR.js";
9
- import { A as Oe, C as ke, M as Ae, b as je } from "./select-CkF_GBxO.js";
10
- import { _ as Me, f as Ne, h as Pe, i as Fe, n as Ie, t as Le } from "./dropdown-menu-B6ftyzOg.js";
11
- import { C as Re, d as ze } from "./toDate-TMubKIVL.js";
12
- import { d as Be, f as Ve, i as He, n as Ue, t as We, u as Ge } from "./process-output-DxvBAeL3.js";
13
- import { t as Ke } from "./jsx-runtime-3BD1kT0s.js";
14
- import { A as qe, C as Je, D as Ye, E as Xe, F as Ze, L as Qe, M as $e, O as et, P as tt, R as nt, S as rt, T as it, V as at, b as ot, j as st, v as ct, w as lt, x as ut, y as dt, z as ft } from "./use-restore-focus-CmGwRNId.js";
15
- import { n as pt } from "./error-banner-D40pmfQQ.js";
16
- import { t as mt } from "./label-D9_-zSg-.js";
17
- import { t as ht } from "./isEmpty-BSZ1LaUo.js";
18
- import { A as gt, E as _t, n as vt } from "./useTheme-Bns2gJZ6.js";
19
- import { $ as yt, Mt as bt, Pt as xt, Rt as St, Vt as Ct, Z as wt, ht as Tt, jt as Et, mt as Dt, nt as Ot, tt as kt, zt as At } from "./dist-DoE4XJBC.js";
20
- import { t as jt } from "./objects-DCmMvZtn.js";
21
- import { n as Mt, o as Nt, r as Pt } from "./dist-CkTTIdBe.js";
22
- import { n as Ft } from "./dist-CrSP_H1M.js";
23
- import { n as It, t as Lt } from "./esm-AMFssoNp.js";
24
- import { t as Rt } from "./useAsyncData-DjMGFzFy.js";
25
- var zt = j("ban", [["circle", {
5
+ import { i as c, t as l } from "./copy-icon-De584pZ4.js";
6
+ import { B as u, H as d, I as f, Q as p, S as m, U as h, W as g, X as _, Z as v, _ as y, a as b, b as x, f as S, g as C, h as w, l as T, m as E, n as D, p as O, r as k, t as A, u as ee, v as j, y as te } from "./html-to-image-BoZthB4P.js";
7
+ import { m as M, t as ne } from "./tooltip-s4zZxwKe.js";
8
+ import { Ct as re, Ft as ie, Ot as ae, Q as oe, R as se, Tt as ce, Wt as le, at as ue, dn as de, gn as fe, gt as pe, i as me, lt as he, m as ge, nn as _e, nt as ve, pn as ye, r as be, t as xe, un as Se, ut as Ce, wt as we, x as Te, zt as Ee } from "./error-entries-mpoD5t79.js";
9
+ import { A as De, C as Oe, M as ke, b as Ae } from "./select-2KOiReNY.js";
10
+ import { _ as je, f as Me, h as Ne, i as Pe, n as Fe, t as Ie } from "./dropdown-menu-DCMbbQ35.js";
11
+ import { C as Le, d as Re } from "./toDate-CDzoofJo.js";
12
+ import { d as ze, f as Be, i as Ve, n as He, t as Ue, u as We } from "./process-output-DLS4Mqg_.js";
13
+ import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
14
+ import { A as Ke, B as qe, C as Je, E as Ye, I as Xe, L as Ze, M as Qe, N as $e, O as et, P as tt, S as nt, T as rt, U as it, V as at, b as ot, k as st, w as ct, x as lt, y as ut, z as dt } from "./use-restore-focus-BgDTd2tc.js";
15
+ import { n as ft } from "./error-banner-DxJ3s8YO.js";
16
+ import { t as pt } from "./label-Qvw1E97W.js";
17
+ import { t as mt } from "./isEmpty-BSZ1LaUo.js";
18
+ import { A as ht, E as gt, n as _t } from "./useTheme-DMfQYmlG.js";
19
+ import { t as vt } from "./objects-DCmMvZtn.js";
20
+ import { At as yt, Ct as bt, Et as xt, G as St, J as Ct, Nt as wt, U as Tt, jt as Et, ot as Dt, q as Ot, st as kt, wt as At } from "./dist-BmS-ZGjl.js";
21
+ import { n as jt, o as Mt, r as Nt } from "./dist-OUle2RT7.js";
22
+ import { n as Pt } from "./dist-DtGn9N4h.js";
23
+ import { n as Ft, t as It } from "./esm-mDQNEFe_.js";
24
+ import { t as Lt } from "./useAsyncData-Bn8SxUqM.js";
25
+ var Rt = M("ban", [["circle", {
26
26
  cx: "12",
27
27
  cy: "12",
28
28
  r: "10",
@@ -30,7 +30,7 @@ var zt = j("ban", [["circle", {
30
30
  }], ["path", {
31
31
  d: "M4.929 4.929 19.07 19.071",
32
32
  key: "196cmz"
33
- }]]), Bt = j("bot-message-square", [
33
+ }]]), zt = M("bot-message-square", [
34
34
  ["path", {
35
35
  d: "M12 6V2H8",
36
36
  key: "1155em"
@@ -55,13 +55,13 @@ var zt = j("ban", [["circle", {
55
55
  d: "M9 11v2",
56
56
  key: "1ueba0"
57
57
  }]
58
- ]), Vt = j("circle-check-big", [["path", {
58
+ ]), Bt = M("circle-check-big", [["path", {
59
59
  d: "M21.801 10A10 10 0 1 1 17 3.335",
60
60
  key: "yps3ct"
61
61
  }], ["path", {
62
62
  d: "m9 11 3 3L22 4",
63
63
  key: "1pflzl"
64
- }]]), Ht = j("circle-slash", [["circle", {
64
+ }]]), Vt = M("circle-slash", [["circle", {
65
65
  cx: "12",
66
66
  cy: "12",
67
67
  r: "10",
@@ -72,22 +72,22 @@ var zt = j("ban", [["circle", {
72
72
  y1: "15",
73
73
  y2: "9",
74
74
  key: "1dfufj"
75
- }]]), Ut = j("paperclip", [["path", {
75
+ }]]), Ht = M("paperclip", [["path", {
76
76
  d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
77
77
  key: "1miecu"
78
- }]]), Wt = j("rotate-cw", [["path", {
78
+ }]]), Ut = M("rotate-cw", [["path", {
79
79
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
80
80
  key: "1p45f6"
81
81
  }], ["path", {
82
82
  d: "M21 3v5h-5",
83
83
  key: "1q7to0"
84
- }]]), Gt = j("send-horizontal", [["path", {
84
+ }]]), Wt = M("send-horizontal", [["path", {
85
85
  d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
86
86
  key: "117uat"
87
87
  }], ["path", {
88
88
  d: "M6 12h16",
89
89
  key: "s4cdu5"
90
- }]]), Kt = j("settings", [["path", {
90
+ }]]), Gt = M("settings", [["path", {
91
91
  d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
92
92
  key: "1i5ecw"
93
93
  }], ["circle", {
@@ -95,7 +95,7 @@ var zt = j("ban", [["circle", {
95
95
  cy: "12",
96
96
  r: "3",
97
97
  key: "1v7zrd"
98
- }]]), qt = j("shield-question-mark", [
98
+ }]]), Kt = M("shield-question-mark", [
99
99
  ["path", {
100
100
  d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
101
101
  key: "oel41y"
@@ -108,66 +108,66 @@ var zt = j("ban", [["circle", {
108
108
  d: "M12 17h.01",
109
109
  key: "p32p05"
110
110
  }]
111
- ]), M = s(), Jt = "vercel.ai.error", Yt = Symbol.for(Jt), Xt, Zt, N = class e extends (Zt = Error, Xt = Yt, Zt) {
111
+ ]), N = s(), qt = "vercel.ai.error", Jt = Symbol.for(qt), Yt, Xt, P = class e extends (Xt = Error, Yt = Jt, Xt) {
112
112
  constructor({ name: e, message: t, cause: n }) {
113
- super(t), this[Xt] = !0, this.name = e, this.cause = n;
113
+ super(t), this[Yt] = !0, this.name = e, this.cause = n;
114
114
  }
115
115
  static isInstance(t) {
116
- return e.hasMarker(t, Jt);
116
+ return e.hasMarker(t, qt);
117
117
  }
118
118
  static hasMarker(e, t) {
119
119
  let n = Symbol.for(t);
120
120
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
121
121
  }
122
- }, Qt = "AI_APICallError", $t = `vercel.ai.error.${Qt}`, en = Symbol.for($t), tn, nn, rn = class extends (nn = N, tn = en, nn) {
122
+ }, Zt = "AI_APICallError", Qt = `vercel.ai.error.${Zt}`, $t = Symbol.for(Qt), en, tn, nn = class extends (tn = P, en = $t, tn) {
123
123
  constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
124
124
  super({
125
- name: Qt,
125
+ name: Zt,
126
126
  message: e,
127
127
  cause: o
128
- }), this[tn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
128
+ }), this[en] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
129
129
  }
130
130
  static isInstance(e) {
131
- return N.hasMarker(e, $t);
131
+ return P.hasMarker(e, Qt);
132
132
  }
133
- }, an = "AI_EmptyResponseBodyError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = N, cn = sn, ln) {
133
+ }, rn = "AI_EmptyResponseBodyError", an = `vercel.ai.error.${rn}`, on = Symbol.for(an), sn, cn, ln = class extends (cn = P, sn = on, cn) {
134
134
  constructor({ message: e = "Empty response body" } = {}) {
135
135
  super({
136
- name: an,
136
+ name: rn,
137
137
  message: e
138
- }), this[cn] = !0;
138
+ }), this[sn] = !0;
139
139
  }
140
140
  static isInstance(e) {
141
- return N.hasMarker(e, on);
141
+ return P.hasMarker(e, an);
142
142
  }
143
143
  };
144
- function dn(e) {
144
+ function un(e) {
145
145
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
146
146
  }
147
- var fn = "AI_InvalidArgumentError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn, gn, _n = class extends (gn = N, hn = mn, gn) {
147
+ var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, gn = class extends (hn = P, mn = pn, hn) {
148
148
  constructor({ message: e, cause: t, argument: n }) {
149
149
  super({
150
- name: fn,
150
+ name: dn,
151
151
  message: e,
152
152
  cause: t
153
- }), this[hn] = !0, this.argument = n;
153
+ }), this[mn] = !0, this.argument = n;
154
154
  }
155
155
  static isInstance(e) {
156
- return N.hasMarker(e, pn);
156
+ return P.hasMarker(e, fn);
157
157
  }
158
- }, vn = "AI_JSONParseError", yn = `vercel.ai.error.${vn}`, bn = Symbol.for(yn), xn, Sn, Cn = class extends (Sn = N, xn = bn, Sn) {
158
+ }, _n = "AI_JSONParseError", vn = `vercel.ai.error.${_n}`, yn = Symbol.for(vn), bn, xn, Sn = class extends (xn = P, bn = yn, xn) {
159
159
  constructor({ text: e, cause: t }) {
160
160
  super({
161
- name: vn,
161
+ name: _n,
162
162
  message: `JSON parsing failed: Text: ${e}.
163
- Error message: ${dn(t)}`,
163
+ Error message: ${un(t)}`,
164
164
  cause: t
165
- }), this[xn] = !0, this.text = e;
165
+ }), this[bn] = !0, this.text = e;
166
166
  }
167
167
  static isInstance(e) {
168
- return N.hasMarker(e, yn);
168
+ return P.hasMarker(e, vn);
169
169
  }
170
- }, wn = "AI_TypeValidationError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn, On, P = class e extends (On = N, Dn = En, On) {
170
+ }, Cn = "AI_TypeValidationError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En, Dn, F = class e extends (Dn = P, En = Tn, Dn) {
171
171
  constructor({ value: e, cause: t, context: n }) {
172
172
  let r = "Type validation failed";
173
173
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -176,14 +176,14 @@ Error message: ${dn(t)}`,
176
176
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
177
177
  }
178
178
  super({
179
- name: wn,
179
+ name: Cn,
180
180
  message: `${r}: Value: ${JSON.stringify(e)}.
181
- Error message: ${dn(t)}`,
181
+ Error message: ${un(t)}`,
182
182
  cause: t
183
- }), this[Dn] = !0, this.value = e, this.context = n;
183
+ }), this[En] = !0, this.value = e, this.context = n;
184
184
  }
185
185
  static isInstance(e) {
186
- return N.hasMarker(e, Tn);
186
+ return P.hasMarker(e, wn);
187
187
  }
188
188
  static wrap({ value: t, cause: n, context: r }) {
189
189
  return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
@@ -192,25 +192,25 @@ Error message: ${dn(t)}`,
192
192
  context: r
193
193
  });
194
194
  }
195
- }, kn = "AI_UnsupportedFunctionalityError", An = `vercel.ai.error.${kn}`, jn = Symbol.for(An), Mn, Nn, Pn = class extends (Nn = N, Mn = jn, Nn) {
195
+ }, On = "AI_UnsupportedFunctionalityError", kn = `vercel.ai.error.${On}`, An = Symbol.for(kn), jn, Mn, Nn = class extends (Mn = P, jn = An, Mn) {
196
196
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
197
197
  super({
198
- name: kn,
198
+ name: On,
199
199
  message: t
200
- }), this[Mn] = !0, this.functionality = e;
200
+ }), this[jn] = !0, this.functionality = e;
201
201
  }
202
202
  static isInstance(e) {
203
- return N.hasMarker(e, An);
203
+ return P.hasMarker(e, kn);
204
204
  }
205
- }, Fn = class extends Error {
205
+ }, Pn = class extends Error {
206
206
  constructor(e, t) {
207
207
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
208
208
  }
209
- }, In = 10, Ln = 13, Rn = 32;
210
- function zn(e) {}
211
- function Bn(e) {
209
+ }, Fn = 10, In = 13, Ln = 32;
210
+ function Rn(e) {}
211
+ function zn(e) {
212
212
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
213
- let { onEvent: t = zn, onError: n = zn, onRetry: r = zn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
213
+ let { onEvent: t = Rn, onError: n = Rn, onRetry: r = Rn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
214
214
  function m(e) {
215
215
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
216
216
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -229,7 +229,7 @@ function Bn(e) {
229
229
  n !== "" && (o.push(n), s = n.length), h();
230
230
  }
231
231
  function h() {
232
- a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Fn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
232
+ a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Pn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
233
233
  }
234
234
  function g(e) {
235
235
  let n = 0;
@@ -245,9 +245,9 @@ function Bn(e) {
245
245
  continue;
246
246
  }
247
247
  let i = e.charCodeAt(n);
248
- if (Vn(e, n, i)) {
249
- let i = e.charCodeAt(n + 5) === Rn ? n + 6 : n + 5, a = e.slice(i, r);
250
- if (d === 0 && e.charCodeAt(r + 1) === In) {
248
+ if (Bn(e, n, i)) {
249
+ let i = e.charCodeAt(n + 5) === Ln ? n + 6 : n + 5, a = e.slice(i, r);
250
+ if (d === 0 && e.charCodeAt(r + 1) === Fn) {
251
251
  t({
252
252
  id: l,
253
253
  event: f,
@@ -257,7 +257,7 @@ function Bn(e) {
257
257
  }
258
258
  u = d === 0 ? a : `${u}
259
259
  ${a}`, d++;
260
- } else Hn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Rn ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
260
+ } else Vn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Ln ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
261
261
  n = r + 1, r = e.indexOf("\n", n);
262
262
  }
263
263
  return e.slice(n);
@@ -265,7 +265,7 @@ ${a}`, d++;
265
265
  for (; n < e.length;) {
266
266
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
267
267
  if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
268
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Ln && e.charCodeAt(n) === In && n++;
268
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === In && e.charCodeAt(n) === Fn && n++;
269
269
  }
270
270
  return e.slice(n);
271
271
  }
@@ -275,25 +275,25 @@ ${a}`, d++;
275
275
  return;
276
276
  }
277
277
  let r = e.charCodeAt(t);
278
- if (Vn(e, t, r)) {
279
- let r = e.charCodeAt(t + 5) === Rn ? t + 6 : t + 5, i = e.slice(r, n);
278
+ if (Bn(e, t, r)) {
279
+ let r = e.charCodeAt(t + 5) === Ln ? t + 6 : t + 5, i = e.slice(r, n);
280
280
  u = d === 0 ? i : `${u}
281
281
  ${i}`, d++;
282
282
  return;
283
283
  }
284
- if (Hn(e, t, r)) {
285
- f = e.slice(e.charCodeAt(t + 6) === Rn ? t + 7 : t + 6, n) || void 0;
284
+ if (Vn(e, t, r)) {
285
+ f = e.slice(e.charCodeAt(t + 6) === Ln ? t + 7 : t + 6, n) || void 0;
286
286
  return;
287
287
  }
288
288
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
289
- let r = e.slice(e.charCodeAt(t + 3) === Rn ? t + 4 : t + 3, n);
289
+ let r = e.slice(e.charCodeAt(t + 3) === Ln ? t + 4 : t + 3, n);
290
290
  l = r.includes("\0") ? void 0 : r;
291
291
  return;
292
292
  }
293
293
  if (r === 58) {
294
294
  if (i) {
295
295
  let r = e.slice(t, n);
296
- i(r.slice(e.charCodeAt(t + 1) === Rn ? 2 : 1));
296
+ i(r.slice(e.charCodeAt(t + 1) === Ln ? 2 : 1));
297
297
  }
298
298
  return;
299
299
  }
@@ -302,7 +302,7 @@ ${i}`, d++;
302
302
  v(a, "", a);
303
303
  return;
304
304
  }
305
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Rn ? 2 : 1;
305
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Ln ? 2 : 1;
306
306
  v(s, a.slice(o + c), a);
307
307
  }
308
308
  function v(e, t, i) {
@@ -318,13 +318,13 @@ ${t}`, d++;
318
318
  l = t.includes("\0") ? void 0 : t;
319
319
  break;
320
320
  case "retry":
321
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Fn(`Invalid \`retry\` value: "${t}"`, {
321
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Pn(`Invalid \`retry\` value: "${t}"`, {
322
322
  type: "invalid-retry",
323
323
  value: t,
324
324
  line: i
325
325
  }));
326
326
  break;
327
- default: n(new Fn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
327
+ default: n(new Pn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
328
328
  type: "unknown-field",
329
329
  field: e,
330
330
  value: t,
@@ -351,20 +351,20 @@ ${t}`, d++;
351
351
  reset: b
352
352
  };
353
353
  }
354
- function Vn(e, t, n) {
354
+ function Bn(e, t, n) {
355
355
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
356
356
  }
357
- function Hn(e, t, n) {
357
+ function Vn(e, t, n) {
358
358
  return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
359
359
  }
360
360
  //#endregion
361
361
  //#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
362
- var Un = class extends TransformStream {
362
+ var Hn = class extends TransformStream {
363
363
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
364
364
  let i;
365
365
  super({
366
366
  start(a) {
367
- i = Bn({
367
+ i = zn({
368
368
  onEvent: (e) => {
369
369
  a.enqueue(e);
370
370
  },
@@ -383,8 +383,8 @@ var Un = class extends TransformStream {
383
383
  }
384
384
  };
385
385
  new TextDecoder();
386
- var { btoa: Wn, atob: Gn } = globalThis;
387
- function Kn(e) {
386
+ var { btoa: Un, atob: Wn } = globalThis;
387
+ function Gn(e) {
388
388
  if (e == null) return {};
389
389
  let t = {};
390
390
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -396,28 +396,28 @@ function Kn(e) {
396
396
  }
397
397
  return t;
398
398
  }
399
- var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
399
+ var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
400
400
  let i = () => {
401
401
  let e = n.length, r = Array(t);
402
402
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
403
403
  return r.join("");
404
404
  };
405
405
  if (e == null) return i;
406
- if (n.includes(r)) throw new _n({
406
+ if (n.includes(r)) throw new gn({
407
407
  argument: "separator",
408
408
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
409
409
  });
410
410
  return () => `${e}${r}${i()}`;
411
- }, qn = F();
412
- function Jn(e) {
411
+ }, Kn = I();
412
+ function qn(e) {
413
413
  return globalThis.Buffer?.isBuffer(e) ?? !1;
414
414
  }
415
- var Yn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Xn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
416
- function Zn(e) {
415
+ var Jn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Yn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
416
+ function Xn(e) {
417
417
  let t = JSON.parse(e);
418
- return typeof t != "object" || !t || Yn.test(e) === !1 && Xn.test(e) === !1 ? t : Qn(t);
418
+ return typeof t != "object" || !t || Jn.test(e) === !1 && Yn.test(e) === !1 ? t : Zn(t);
419
419
  }
420
- function Qn(e) {
420
+ function Zn(e) {
421
421
  let t = [e];
422
422
  for (; t.length;) {
423
423
  let e = t;
@@ -432,35 +432,35 @@ function Qn(e) {
432
432
  }
433
433
  return e;
434
434
  }
435
- function $n(e) {
435
+ function Qn(e) {
436
436
  let { stackTraceLimit: t } = Error;
437
437
  try {
438
438
  Error.stackTraceLimit = 0;
439
439
  } catch {
440
- return Zn(e);
440
+ return Xn(e);
441
441
  }
442
442
  try {
443
- return Zn(e);
443
+ return Xn(e);
444
444
  } finally {
445
445
  Error.stackTraceLimit = t;
446
446
  }
447
447
  }
448
- function er(e) {
448
+ function $n(e) {
449
449
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
450
450
  let { additionalProperties: t } = e;
451
- e.additionalProperties = t != null && typeof t != "boolean" && tr(t);
451
+ e.additionalProperties = t != null && typeof t != "boolean" && L(t);
452
452
  let { properties: n } = e;
453
- if (n != null) for (let e of Object.keys(n)) n[e] = tr(n[e]);
453
+ if (n != null) for (let e of Object.keys(n)) n[e] = L(n[e]);
454
454
  }
455
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(tr) : tr(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(tr)), e.allOf != null && (e.allOf = e.allOf.map(tr)), e.oneOf != null && (e.oneOf = e.oneOf.map(tr));
455
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(L) : L(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(L)), e.allOf != null && (e.allOf = e.allOf.map(L)), e.oneOf != null && (e.oneOf = e.oneOf.map(L));
456
456
  let { definitions: t } = e;
457
- if (t != null) for (let e of Object.keys(t)) t[e] = tr(t[e]);
457
+ if (t != null) for (let e of Object.keys(t)) t[e] = L(t[e]);
458
458
  return e;
459
459
  }
460
- function tr(e) {
461
- return typeof e == "boolean" ? e : er(e);
460
+ function L(e) {
461
+ return typeof e == "boolean" ? e : $n(e);
462
462
  }
463
- var nr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), rr = {
463
+ var er = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), tr = {
464
464
  name: void 0,
465
465
  $refStrategy: "root",
466
466
  basePath: ["#"],
@@ -480,24 +480,24 @@ var nr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
480
480
  emailStrategy: "format:email",
481
481
  base64Strategy: "contentEncoding:base64",
482
482
  nameStrategy: "ref"
483
- }, ir = (e) => typeof e == "string" ? {
484
- ...rr,
483
+ }, nr = (e) => typeof e == "string" ? {
484
+ ...tr,
485
485
  name: e
486
486
  } : {
487
- ...rr,
487
+ ...tr,
488
488
  ...e
489
489
  };
490
- function I() {
490
+ function R() {
491
491
  return {};
492
492
  }
493
- function ar(e, t) {
493
+ function rr(e, t) {
494
494
  let n = { type: "array" };
495
- return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = B(e.type._def, {
495
+ return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = H(e.type._def, {
496
496
  ...t,
497
497
  currentPath: [...t.currentPath, "items"]
498
498
  })), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
499
499
  }
500
- function or(e) {
500
+ function ir(e) {
501
501
  let t = {
502
502
  type: "integer",
503
503
  format: "int64"
@@ -514,16 +514,16 @@ function or(e) {
514
514
  }
515
515
  return t;
516
516
  }
517
- function sr() {
517
+ function ar() {
518
518
  return { type: "boolean" };
519
519
  }
520
- function cr(e, t) {
521
- return B(e.type._def, t);
520
+ function or(e, t) {
521
+ return H(e.type._def, t);
522
522
  }
523
- var lr = (e, t) => B(e.innerType._def, t);
524
- function ur(e, t, n) {
523
+ var sr = (e, t) => H(e.innerType._def, t);
524
+ function cr(e, t, n) {
525
525
  let r = n ?? t.dateStrategy;
526
- if (Array.isArray(r)) return { anyOf: r.map((n) => ur(e, t, n)) };
526
+ if (Array.isArray(r)) return { anyOf: r.map((n) => cr(e, t, n)) };
527
527
  switch (r) {
528
528
  case "string":
529
529
  case "format:date-time": return {
@@ -534,10 +534,10 @@ function ur(e, t, n) {
534
534
  type: "string",
535
535
  format: "date"
536
536
  };
537
- case "integer": return dr(e);
537
+ case "integer": return lr(e);
538
538
  }
539
539
  }
540
- var dr = (e) => {
540
+ var lr = (e) => {
541
541
  let t = {
542
542
  type: "integer",
543
543
  format: "unix-time"
@@ -550,31 +550,31 @@ var dr = (e) => {
550
550
  }
551
551
  return t;
552
552
  };
553
- function fr(e, t) {
553
+ function ur(e, t) {
554
554
  return {
555
- ...B(e.innerType._def, t),
555
+ ...H(e.innerType._def, t),
556
556
  default: e.defaultValue()
557
557
  };
558
558
  }
559
- function pr(e, t) {
560
- return t.effectStrategy === "input" ? B(e.schema._def, t) : I();
559
+ function dr(e, t) {
560
+ return t.effectStrategy === "input" ? H(e.schema._def, t) : R();
561
561
  }
562
- function mr(e) {
562
+ function fr(e) {
563
563
  return {
564
564
  type: "string",
565
565
  enum: Array.from(e.values)
566
566
  };
567
567
  }
568
- var hr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
- function gr(e, t) {
570
- let n = [B(e.left._def, {
568
+ var pr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
+ function mr(e, t) {
570
+ let n = [H(e.left._def, {
571
571
  ...t,
572
572
  currentPath: [
573
573
  ...t.currentPath,
574
574
  "allOf",
575
575
  "0"
576
576
  ]
577
- }), B(e.right._def, {
577
+ }), H(e.right._def, {
578
578
  ...t,
579
579
  currentPath: [
580
580
  ...t.currentPath,
@@ -583,7 +583,7 @@ function gr(e, t) {
583
583
  ]
584
584
  })].filter((e) => !!e), r = [];
585
585
  return n.forEach((e) => {
586
- if (hr(e)) r.push(...e.allOf);
586
+ if (pr(e)) r.push(...e.allOf);
587
587
  else {
588
588
  let t = e;
589
589
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -594,19 +594,19 @@ function gr(e, t) {
594
594
  }
595
595
  }), r.length ? { allOf: r } : void 0;
596
596
  }
597
- function _r(e) {
597
+ function hr(e) {
598
598
  let t = typeof e.value;
599
599
  return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
600
600
  type: t === "bigint" ? "integer" : t,
601
601
  const: e.value
602
602
  };
603
603
  }
604
- var vr = void 0, L = {
604
+ var gr = void 0, z = {
605
605
  cuid: /^[cC][^\s-]{8,}$/,
606
606
  cuid2: /^[0-9a-z]+$/,
607
607
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
608
608
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
609
- emoji: () => (vr === void 0 && (vr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), vr),
609
+ emoji: () => (gr === void 0 && (gr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), gr),
610
610
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
611
611
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
612
612
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
@@ -617,7 +617,7 @@ var vr = void 0, L = {
617
617
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
618
618
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
619
619
  };
620
- function yr(e, t) {
620
+ function _r(e, t) {
621
621
  let n = { type: "string" };
622
622
  if (e.checks) for (let r of e.checks) switch (r.kind) {
623
623
  case "min":
@@ -629,108 +629,108 @@ function yr(e, t) {
629
629
  case "email":
630
630
  switch (t.emailStrategy) {
631
631
  case "format:email":
632
- R(n, "email", r.message, t);
632
+ B(n, "email", r.message, t);
633
633
  break;
634
634
  case "format:idn-email":
635
- R(n, "idn-email", r.message, t);
635
+ B(n, "idn-email", r.message, t);
636
636
  break;
637
- case "pattern:zod": z(n, L.email, r.message, t);
637
+ case "pattern:zod": V(n, z.email, r.message, t);
638
638
  }
639
639
  break;
640
640
  case "url":
641
- R(n, "uri", r.message, t);
641
+ B(n, "uri", r.message, t);
642
642
  break;
643
643
  case "uuid":
644
- R(n, "uuid", r.message, t);
644
+ B(n, "uuid", r.message, t);
645
645
  break;
646
646
  case "regex":
647
- z(n, r.regex, r.message, t);
647
+ V(n, r.regex, r.message, t);
648
648
  break;
649
649
  case "cuid":
650
- z(n, L.cuid, r.message, t);
650
+ V(n, z.cuid, r.message, t);
651
651
  break;
652
652
  case "cuid2":
653
- z(n, L.cuid2, r.message, t);
653
+ V(n, z.cuid2, r.message, t);
654
654
  break;
655
655
  case "startsWith":
656
- z(n, RegExp(`^${br(r.value, t)}`), r.message, t);
656
+ V(n, RegExp(`^${vr(r.value, t)}`), r.message, t);
657
657
  break;
658
658
  case "endsWith":
659
- z(n, RegExp(`${br(r.value, t)}$`), r.message, t);
659
+ V(n, RegExp(`${vr(r.value, t)}$`), r.message, t);
660
660
  break;
661
661
  case "datetime":
662
- R(n, "date-time", r.message, t);
662
+ B(n, "date-time", r.message, t);
663
663
  break;
664
664
  case "date":
665
- R(n, "date", r.message, t);
665
+ B(n, "date", r.message, t);
666
666
  break;
667
667
  case "time":
668
- R(n, "time", r.message, t);
668
+ B(n, "time", r.message, t);
669
669
  break;
670
670
  case "duration":
671
- R(n, "duration", r.message, t);
671
+ B(n, "duration", r.message, t);
672
672
  break;
673
673
  case "length":
674
674
  n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
675
675
  break;
676
676
  case "includes":
677
- z(n, RegExp(br(r.value, t)), r.message, t);
677
+ V(n, RegExp(vr(r.value, t)), r.message, t);
678
678
  break;
679
679
  case "ip":
680
- r.version !== "v6" && R(n, "ipv4", r.message, t), r.version !== "v4" && R(n, "ipv6", r.message, t);
680
+ r.version !== "v6" && B(n, "ipv4", r.message, t), r.version !== "v4" && B(n, "ipv6", r.message, t);
681
681
  break;
682
682
  case "base64url":
683
- z(n, L.base64url, r.message, t);
683
+ V(n, z.base64url, r.message, t);
684
684
  break;
685
685
  case "jwt":
686
- z(n, L.jwt, r.message, t);
686
+ V(n, z.jwt, r.message, t);
687
687
  break;
688
688
  case "cidr":
689
- r.version !== "v6" && z(n, L.ipv4Cidr, r.message, t), r.version !== "v4" && z(n, L.ipv6Cidr, r.message, t);
689
+ r.version !== "v6" && V(n, z.ipv4Cidr, r.message, t), r.version !== "v4" && V(n, z.ipv6Cidr, r.message, t);
690
690
  break;
691
691
  case "emoji":
692
- z(n, L.emoji(), r.message, t);
692
+ V(n, z.emoji(), r.message, t);
693
693
  break;
694
694
  case "ulid":
695
- z(n, L.ulid, r.message, t);
695
+ V(n, z.ulid, r.message, t);
696
696
  break;
697
697
  case "base64":
698
698
  switch (t.base64Strategy) {
699
699
  case "format:binary":
700
- R(n, "binary", r.message, t);
700
+ B(n, "binary", r.message, t);
701
701
  break;
702
702
  case "contentEncoding:base64":
703
703
  n.contentEncoding = "base64";
704
704
  break;
705
- case "pattern:zod": z(n, L.base64, r.message, t);
705
+ case "pattern:zod": V(n, z.base64, r.message, t);
706
706
  }
707
707
  break;
708
- case "nanoid": z(n, L.nanoid, r.message, t);
708
+ case "nanoid": V(n, z.nanoid, r.message, t);
709
709
  }
710
710
  return n;
711
711
  }
712
- function br(e, t) {
713
- return t.patternStrategy === "escape" ? Sr(e) : e;
712
+ function vr(e, t) {
713
+ return t.patternStrategy === "escape" ? br(e) : e;
714
714
  }
715
- var xr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
- function Sr(e) {
715
+ var yr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
+ function br(e) {
717
717
  let t = "";
718
- for (let n = 0; n < e.length; n++) xr.has(e[n]) || (t += "\\"), t += e[n];
718
+ for (let n = 0; n < e.length; n++) yr.has(e[n]) || (t += "\\"), t += e[n];
719
719
  return t;
720
720
  }
721
- function R(e, t, n, r) {
721
+ function B(e, t, n, r) {
722
722
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
723
723
  format: t,
724
724
  ...n && r.errorMessages && { errorMessage: { format: n } }
725
725
  })) : e.format = t;
726
726
  }
727
- function z(e, t, n, r) {
727
+ function V(e, t, n, r) {
728
728
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
729
- pattern: Cr(t, r),
729
+ pattern: xr(t, r),
730
730
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
731
- })) : e.pattern = Cr(t, r);
731
+ })) : e.pattern = xr(t, r);
732
732
  }
733
- function Cr(e, t) {
733
+ function xr(e, t) {
734
734
  if (!t.applyRegexFlags || !e.flags) return e.source;
735
735
  let n = {
736
736
  i: e.flags.includes("i"),
@@ -778,16 +778,16 @@ function Cr(e, t) {
778
778
  }
779
779
  return i;
780
780
  }
781
- function wr(e, t) {
781
+ function Sr(e, t) {
782
782
  let n = {
783
783
  type: "object",
784
- additionalProperties: B(e.valueType._def, {
784
+ additionalProperties: H(e.valueType._def, {
785
785
  ...t,
786
786
  currentPath: [...t.currentPath, "additionalProperties"]
787
787
  }) ?? t.allowedAdditionalProperties
788
788
  };
789
789
  if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
790
- let { type: r, ...i } = yr(e.keyType._def, t);
790
+ let { type: r, ...i } = _r(e.keyType._def, t);
791
791
  return {
792
792
  ...n,
793
793
  propertyNames: i
@@ -798,7 +798,7 @@ function wr(e, t) {
798
798
  propertyNames: { enum: e.keyType._def.values }
799
799
  };
800
800
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
801
- let { type: r, ...i } = cr(e.keyType._def, t);
801
+ let { type: r, ...i } = or(e.keyType._def, t);
802
802
  return {
803
803
  ...n,
804
804
  propertyNames: i
@@ -806,13 +806,13 @@ function wr(e, t) {
806
806
  }
807
807
  return n;
808
808
  }
809
- function Tr(e, t) {
810
- return t.mapStrategy === "record" ? wr(e, t) : {
809
+ function Cr(e, t) {
810
+ return t.mapStrategy === "record" ? Sr(e, t) : {
811
811
  type: "array",
812
812
  maxItems: 125,
813
813
  items: {
814
814
  type: "array",
815
- items: [B(e.keyType._def, {
815
+ items: [H(e.keyType._def, {
816
816
  ...t,
817
817
  currentPath: [
818
818
  ...t.currentPath,
@@ -820,7 +820,7 @@ function Tr(e, t) {
820
820
  "items",
821
821
  "0"
822
822
  ]
823
- }) || I(), B(e.valueType._def, {
823
+ }) || R(), H(e.valueType._def, {
824
824
  ...t,
825
825
  currentPath: [
826
826
  ...t.currentPath,
@@ -828,37 +828,37 @@ function Tr(e, t) {
828
828
  "items",
829
829
  "1"
830
830
  ]
831
- }) || I()],
831
+ }) || R()],
832
832
  minItems: 2,
833
833
  maxItems: 2
834
834
  }
835
835
  };
836
836
  }
837
- function Er(e) {
837
+ function wr(e) {
838
838
  let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
839
839
  return {
840
840
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
841
841
  enum: n
842
842
  };
843
843
  }
844
- function Dr() {
845
- return { not: I() };
844
+ function Tr() {
845
+ return { not: R() };
846
846
  }
847
- function Or() {
847
+ function Er() {
848
848
  return { type: "null" };
849
849
  }
850
- var kr = {
850
+ var Dr = {
851
851
  ZodString: "string",
852
852
  ZodNumber: "number",
853
853
  ZodBigInt: "integer",
854
854
  ZodBoolean: "boolean",
855
855
  ZodNull: "null"
856
856
  };
857
- function Ar(e, t) {
857
+ function Or(e, t) {
858
858
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
859
- if (n.every((e) => e._def.typeName in kr && (!e._def.checks || !e._def.checks.length))) {
859
+ if (n.every((e) => e._def.typeName in Dr && (!e._def.checks || !e._def.checks.length))) {
860
860
  let e = n.reduce((e, t) => {
861
- let n = kr[t._def.typeName];
861
+ let n = Dr[t._def.typeName];
862
862
  return n && !e.includes(n) ? [...e, n] : e;
863
863
  }, []);
864
864
  return { type: e.length > 1 ? e : e[0] };
@@ -886,10 +886,10 @@ function Ar(e, t) {
886
886
  type: "string",
887
887
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
888
888
  };
889
- return jr(e, t);
889
+ return kr(e, t);
890
890
  }
891
- var jr = (e, t) => {
892
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => B(e._def, {
891
+ var kr = (e, t) => {
892
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => H(e._def, {
893
893
  ...t,
894
894
  currentPath: [
895
895
  ...t.currentPath,
@@ -899,15 +899,15 @@ var jr = (e, t) => {
899
899
  })).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
900
900
  return n.length ? { anyOf: n } : void 0;
901
901
  };
902
- function Mr(e, t) {
902
+ function Ar(e, t) {
903
903
  if ([
904
904
  "ZodString",
905
905
  "ZodNumber",
906
906
  "ZodBigInt",
907
907
  "ZodBoolean",
908
908
  "ZodNull"
909
- ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [kr[e.innerType._def.typeName], "null"] };
910
- let n = B(e.innerType._def, {
909
+ ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Dr[e.innerType._def.typeName], "null"] };
910
+ let n = H(e.innerType._def, {
911
911
  ...t,
912
912
  currentPath: [
913
913
  ...t.currentPath,
@@ -917,7 +917,7 @@ function Mr(e, t) {
917
917
  });
918
918
  return n && { anyOf: [n, { type: "null" }] };
919
919
  }
920
- function Nr(e) {
920
+ function jr(e) {
921
921
  let t = { type: "number" };
922
922
  if (!e.checks) return t;
923
923
  for (let n of e.checks) switch (n.kind) {
@@ -934,7 +934,7 @@ function Nr(e) {
934
934
  }
935
935
  return t;
936
936
  }
937
- function Pr(e, t) {
937
+ function Mr(e, t) {
938
938
  let n = {
939
939
  type: "object",
940
940
  properties: {}
@@ -942,7 +942,7 @@ function Pr(e, t) {
942
942
  for (let e in i) {
943
943
  let a = i[e];
944
944
  if (a === void 0 || a._def === void 0) continue;
945
- let o = Ir(a), s = B(a._def, {
945
+ let o = Pr(a), s = H(a._def, {
946
946
  ...t,
947
947
  currentPath: [
948
948
  ...t.currentPath,
@@ -958,11 +958,11 @@ function Pr(e, t) {
958
958
  s !== void 0 && (n.properties[e] = s, o || r.push(e));
959
959
  }
960
960
  r.length && (n.required = r);
961
- let a = Fr(e, t);
961
+ let a = Nr(e, t);
962
962
  return a !== void 0 && (n.additionalProperties = a), n;
963
963
  }
964
- function Fr(e, t) {
965
- if (e.catchall._def.typeName !== "ZodNever") return B(e.catchall._def, {
964
+ function Nr(e, t) {
965
+ if (e.catchall._def.typeName !== "ZodNever") return H(e.catchall._def, {
966
966
  ...t,
967
967
  currentPath: [...t.currentPath, "additionalProperties"]
968
968
  });
@@ -972,16 +972,16 @@ function Fr(e, t) {
972
972
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
973
973
  }
974
974
  }
975
- function Ir(e) {
975
+ function Pr(e) {
976
976
  try {
977
977
  return e.isOptional();
978
978
  } catch {
979
979
  return !0;
980
980
  }
981
981
  }
982
- var Lr = (e, t) => {
983
- if (t.currentPath.toString() === t.propertyPath?.toString()) return B(e.innerType._def, t);
984
- let n = B(e.innerType._def, {
982
+ var Fr = (e, t) => {
983
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return H(e.innerType._def, t);
984
+ let n = H(e.innerType._def, {
985
985
  ...t,
986
986
  currentPath: [
987
987
  ...t.currentPath,
@@ -989,11 +989,11 @@ var Lr = (e, t) => {
989
989
  "1"
990
990
  ]
991
991
  });
992
- return n ? { anyOf: [{ not: I() }, n] } : I();
993
- }, Rr = (e, t) => {
994
- if (t.pipeStrategy === "input") return B(e.in._def, t);
995
- if (t.pipeStrategy === "output") return B(e.out._def, t);
996
- let n = B(e.in._def, {
992
+ return n ? { anyOf: [{ not: R() }, n] } : R();
993
+ }, Ir = (e, t) => {
994
+ if (t.pipeStrategy === "input") return H(e.in._def, t);
995
+ if (t.pipeStrategy === "output") return H(e.out._def, t);
996
+ let n = H(e.in._def, {
997
997
  ...t,
998
998
  currentPath: [
999
999
  ...t.currentPath,
@@ -1001,7 +1001,7 @@ var Lr = (e, t) => {
1001
1001
  "0"
1002
1002
  ]
1003
1003
  });
1004
- return { allOf: [n, B(e.out._def, {
1004
+ return { allOf: [n, H(e.out._def, {
1005
1005
  ...t,
1006
1006
  currentPath: [
1007
1007
  ...t.currentPath,
@@ -1010,25 +1010,25 @@ var Lr = (e, t) => {
1010
1010
  ]
1011
1011
  })].filter((e) => e !== void 0) };
1012
1012
  };
1013
- function zr(e, t) {
1014
- return B(e.type._def, t);
1013
+ function Lr(e, t) {
1014
+ return H(e.type._def, t);
1015
1015
  }
1016
- function Br(e, t) {
1016
+ function Rr(e, t) {
1017
1017
  let n = {
1018
1018
  type: "array",
1019
1019
  uniqueItems: !0,
1020
- items: B(e.valueType._def, {
1020
+ items: H(e.valueType._def, {
1021
1021
  ...t,
1022
1022
  currentPath: [...t.currentPath, "items"]
1023
1023
  })
1024
1024
  };
1025
1025
  return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
1026
1026
  }
1027
- function Vr(e, t) {
1027
+ function zr(e, t) {
1028
1028
  return e.rest ? {
1029
1029
  type: "array",
1030
1030
  minItems: e.items.length,
1031
- items: e.items.map((e, n) => B(e._def, {
1031
+ items: e.items.map((e, n) => H(e._def, {
1032
1032
  ...t,
1033
1033
  currentPath: [
1034
1034
  ...t.currentPath,
@@ -1036,7 +1036,7 @@ function Vr(e, t) {
1036
1036
  `${n}`
1037
1037
  ]
1038
1038
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
1039
- additionalItems: B(e.rest._def, {
1039
+ additionalItems: H(e.rest._def, {
1040
1040
  ...t,
1041
1041
  currentPath: [...t.currentPath, "additionalItems"]
1042
1042
  })
@@ -1044,7 +1044,7 @@ function Vr(e, t) {
1044
1044
  type: "array",
1045
1045
  minItems: e.items.length,
1046
1046
  maxItems: e.items.length,
1047
- items: e.items.map((e, n) => B(e._def, {
1047
+ items: e.items.map((e, n) => H(e._def, {
1048
1048
  ...t,
1049
1049
  currentPath: [
1050
1050
  ...t.currentPath,
@@ -1054,65 +1054,65 @@ function Vr(e, t) {
1054
1054
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
1055
1055
  };
1056
1056
  }
1057
- function Hr() {
1058
- return { not: I() };
1057
+ function Br() {
1058
+ return { not: R() };
1059
1059
  }
1060
- function Ur() {
1061
- return I();
1060
+ function Vr() {
1061
+ return R();
1062
1062
  }
1063
- var Wr = (e, t) => B(e.innerType._def, t), Gr = (e, t, n) => {
1063
+ var Hr = (e, t) => H(e.innerType._def, t), Ur = (e, t, n) => {
1064
1064
  switch (t) {
1065
- case "ZodString": return yr(e, n);
1066
- case "ZodNumber": return Nr(e);
1067
- case "ZodObject": return Pr(e, n);
1068
- case "ZodBigInt": return or(e);
1069
- case "ZodBoolean": return sr();
1070
- case "ZodDate": return ur(e, n);
1071
- case "ZodUndefined": return Hr();
1072
- case "ZodNull": return Or();
1073
- case "ZodArray": return ar(e, n);
1065
+ case "ZodString": return _r(e, n);
1066
+ case "ZodNumber": return jr(e);
1067
+ case "ZodObject": return Mr(e, n);
1068
+ case "ZodBigInt": return ir(e);
1069
+ case "ZodBoolean": return ar();
1070
+ case "ZodDate": return cr(e, n);
1071
+ case "ZodUndefined": return Br();
1072
+ case "ZodNull": return Er();
1073
+ case "ZodArray": return rr(e, n);
1074
1074
  case "ZodUnion":
1075
- case "ZodDiscriminatedUnion": return Ar(e, n);
1076
- case "ZodIntersection": return gr(e, n);
1077
- case "ZodTuple": return Vr(e, n);
1078
- case "ZodRecord": return wr(e, n);
1079
- case "ZodLiteral": return _r(e);
1080
- case "ZodEnum": return mr(e);
1081
- case "ZodNativeEnum": return Er(e);
1082
- case "ZodNullable": return Mr(e, n);
1083
- case "ZodOptional": return Lr(e, n);
1084
- case "ZodMap": return Tr(e, n);
1085
- case "ZodSet": return Br(e, n);
1075
+ case "ZodDiscriminatedUnion": return Or(e, n);
1076
+ case "ZodIntersection": return mr(e, n);
1077
+ case "ZodTuple": return zr(e, n);
1078
+ case "ZodRecord": return Sr(e, n);
1079
+ case "ZodLiteral": return hr(e);
1080
+ case "ZodEnum": return fr(e);
1081
+ case "ZodNativeEnum": return wr(e);
1082
+ case "ZodNullable": return Ar(e, n);
1083
+ case "ZodOptional": return Fr(e, n);
1084
+ case "ZodMap": return Cr(e, n);
1085
+ case "ZodSet": return Rr(e, n);
1086
1086
  case "ZodLazy": return () => e.getter()._def;
1087
- case "ZodPromise": return zr(e, n);
1087
+ case "ZodPromise": return Lr(e, n);
1088
1088
  case "ZodNaN":
1089
- case "ZodNever": return Dr();
1090
- case "ZodEffects": return pr(e, n);
1091
- case "ZodAny": return I();
1092
- case "ZodUnknown": return Ur();
1093
- case "ZodDefault": return fr(e, n);
1094
- case "ZodBranded": return cr(e, n);
1095
- case "ZodReadonly": return Wr(e, n);
1096
- case "ZodCatch": return lr(e, n);
1097
- case "ZodPipeline": return Rr(e, n);
1089
+ case "ZodNever": return Tr();
1090
+ case "ZodEffects": return dr(e, n);
1091
+ case "ZodAny": return R();
1092
+ case "ZodUnknown": return Vr();
1093
+ case "ZodDefault": return ur(e, n);
1094
+ case "ZodBranded": return or(e, n);
1095
+ case "ZodReadonly": return Hr(e, n);
1096
+ case "ZodCatch": return sr(e, n);
1097
+ case "ZodPipeline": return Ir(e, n);
1098
1098
  case "ZodFunction":
1099
1099
  case "ZodVoid":
1100
1100
  case "ZodSymbol": return;
1101
1101
  default: return /* @__PURE__ */ ((e) => void 0)(t);
1102
1102
  }
1103
- }, Kr = (e, t) => {
1103
+ }, Wr = (e, t) => {
1104
1104
  let n = 0;
1105
1105
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
1106
1106
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
1107
1107
  };
1108
- function B(e, t, n = !1) {
1108
+ function H(e, t, n = !1) {
1109
1109
  let r = t.seen.get(e);
1110
1110
  if (t.override) {
1111
1111
  let i = t.override?.call(t, e, t, r, n);
1112
- if (i !== nr) return i;
1112
+ if (i !== er) return i;
1113
1113
  }
1114
1114
  if (r && !n) {
1115
- let e = qr(r, t);
1115
+ let e = Gr(r, t);
1116
1116
  if (e !== void 0) return e;
1117
1117
  }
1118
1118
  let i = {
@@ -1121,22 +1121,22 @@ function B(e, t, n = !1) {
1121
1121
  jsonSchema: void 0
1122
1122
  };
1123
1123
  t.seen.set(e, i);
1124
- let a = Gr(e, e.typeName, t), o = typeof a == "function" ? B(a(), t) : a;
1125
- if (o && Jr(e, t, o), t.postProcess) {
1124
+ let a = Ur(e, e.typeName, t), o = typeof a == "function" ? H(a(), t) : a;
1125
+ if (o && Kr(e, t, o), t.postProcess) {
1126
1126
  let n = t.postProcess(o, e, t);
1127
1127
  return i.jsonSchema = o, n;
1128
1128
  }
1129
1129
  return i.jsonSchema = o, o;
1130
1130
  }
1131
- var qr = (e, t) => {
1131
+ var Gr = (e, t) => {
1132
1132
  switch (t.$refStrategy) {
1133
1133
  case "root": return { $ref: e.path.join("/") };
1134
- case "relative": return { $ref: Kr(t.currentPath, e.path) };
1134
+ case "relative": return { $ref: Wr(t.currentPath, e.path) };
1135
1135
  case "none":
1136
- case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), I()) : t.$refStrategy === "seen" ? I() : void 0;
1136
+ case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), R()) : t.$refStrategy === "seen" ? R() : void 0;
1137
1137
  }
1138
- }, Jr = (e, t, n) => (e.description && (n.description = e.description), n), Yr = (e) => {
1139
- let t = ir(e), n = t.name === void 0 ? t.basePath : [
1138
+ }, Kr = (e, t, n) => (e.description && (n.description = e.description), n), qr = (e) => {
1139
+ let t = nr(e), n = t.name === void 0 ? t.basePath : [
1140
1140
  ...t.basePath,
1141
1141
  t.definitionPath,
1142
1142
  t.name
@@ -1155,25 +1155,25 @@ var qr = (e, t) => {
1155
1155
  jsonSchema: void 0
1156
1156
  }]))
1157
1157
  };
1158
- }, Xr = (e, t) => {
1159
- let n = Yr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1158
+ }, Jr = (e, t) => {
1159
+ let n = qr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1160
1160
  ...e,
1161
- [t]: B(r._def, {
1161
+ [t]: H(r._def, {
1162
1162
  ...n,
1163
1163
  currentPath: [
1164
1164
  ...n.basePath,
1165
1165
  n.definitionPath,
1166
1166
  t
1167
1167
  ]
1168
- }, !0) ?? I()
1169
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = B(e._def, i === void 0 ? n : {
1168
+ }, !0) ?? R()
1169
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = H(e._def, i === void 0 ? n : {
1170
1170
  ...n,
1171
1171
  currentPath: [
1172
1172
  ...n.basePath,
1173
1173
  n.definitionPath,
1174
1174
  i
1175
1175
  ]
1176
- }, !1) ?? I(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1176
+ }, !1) ?? R(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1177
1177
  o !== void 0 && (a.title = o);
1178
1178
  let s = i === void 0 ? r ? {
1179
1179
  ...a,
@@ -1190,14 +1190,14 @@ var qr = (e, t) => {
1190
1190
  }
1191
1191
  };
1192
1192
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1193
- }, Zr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
- function Qr(e) {
1193
+ }, Yr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
+ function Xr(e) {
1195
1195
  let t;
1196
1196
  return () => (t ??= e(), t);
1197
1197
  }
1198
- function $r(e, { validate: t } = {}) {
1198
+ function Zr(e, { validate: t } = {}) {
1199
1199
  return {
1200
- [Zr]: !0,
1200
+ [Yr]: !0,
1201
1201
  _type: void 0,
1202
1202
  get jsonSchema() {
1203
1203
  return typeof e == "function" && (e = e()), e;
@@ -1205,20 +1205,20 @@ function $r(e, { validate: t } = {}) {
1205
1205
  validate: t
1206
1206
  };
1207
1207
  }
1208
- function ei(e) {
1209
- return typeof e == "object" && !!e && Zr in e && e[Zr] === !0 && "jsonSchema" in e && "validate" in e;
1208
+ function Qr(e) {
1209
+ return typeof e == "object" && !!e && Yr in e && e[Yr] === !0 && "jsonSchema" in e && "validate" in e;
1210
1210
  }
1211
- function ti(e) {
1212
- return e == null ? $r({
1211
+ function $r(e) {
1212
+ return e == null ? Zr({
1213
1213
  type: "object",
1214
1214
  properties: {},
1215
1215
  additionalProperties: !1
1216
- }) : ei(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? si(e) : ni(e) : e();
1216
+ }) : Qr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? ai(e) : ei(e) : e();
1217
1217
  }
1218
- function ni(e) {
1219
- return $r(() => {
1220
- if (!ri(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1221
- return er(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1218
+ function ei(e) {
1219
+ return Zr(() => {
1220
+ if (!ti(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1221
+ return $n(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1222
1222
  }, { validate: async (t) => {
1223
1223
  let n = await e["~standard"].validate(t);
1224
1224
  return "value" in n ? {
@@ -1226,19 +1226,19 @@ function ni(e) {
1226
1226
  value: n.value
1227
1227
  } : {
1228
1228
  success: !1,
1229
- error: new P({
1229
+ error: new F({
1230
1230
  value: t,
1231
1231
  cause: n.issues
1232
1232
  })
1233
1233
  };
1234
1234
  } });
1235
1235
  }
1236
- function ri(e) {
1236
+ function ti(e) {
1237
1237
  return e["~standard"].jsonSchema != null;
1238
1238
  }
1239
- function ii(e, t) {
1239
+ function ni(e, t) {
1240
1240
  let n = t?.useReferences ?? !1;
1241
- return $r(() => Xr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1241
+ return Zr(() => Jr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1242
1242
  let n = await e.safeParseAsync(t);
1243
1243
  return n.success ? {
1244
1244
  success: !0,
@@ -1249,14 +1249,14 @@ function ii(e, t) {
1249
1249
  };
1250
1250
  } });
1251
1251
  }
1252
- function ai(e, t) {
1252
+ function ri(e, t) {
1253
1253
  let n = t?.useReferences ?? !1;
1254
- return $r(() => er(at(e, {
1254
+ return Zr(() => $n(it(e, {
1255
1255
  target: "draft-7",
1256
1256
  io: "input",
1257
1257
  reused: n ? "ref" : "inline"
1258
1258
  })), { validate: async (t) => {
1259
- let n = await ft(e, t);
1259
+ let n = await at(e, t);
1260
1260
  return n.success ? {
1261
1261
  success: !0,
1262
1262
  value: n.data
@@ -1266,27 +1266,27 @@ function ai(e, t) {
1266
1266
  };
1267
1267
  } });
1268
1268
  }
1269
- function oi(e) {
1269
+ function ii(e) {
1270
1270
  return "_zod" in e;
1271
1271
  }
1272
- function si(e, t) {
1273
- return oi(e) ? ai(e, t) : ii(e, t);
1272
+ function ai(e, t) {
1273
+ return ii(e) ? ri(e, t) : ni(e, t);
1274
1274
  }
1275
- async function ci({ value: e, schema: t, context: n }) {
1276
- let r = await li({
1275
+ async function oi({ value: e, schema: t, context: n }) {
1276
+ let r = await si({
1277
1277
  value: e,
1278
1278
  schema: t,
1279
1279
  context: n
1280
1280
  });
1281
- if (!r.success) throw P.wrap({
1281
+ if (!r.success) throw F.wrap({
1282
1282
  value: e,
1283
1283
  cause: r.error,
1284
1284
  context: n
1285
1285
  });
1286
1286
  return r.value;
1287
1287
  }
1288
- async function li({ value: e, schema: t, context: n }) {
1289
- let r = ti(t);
1288
+ async function si({ value: e, schema: t, context: n }) {
1289
+ let r = $r(t);
1290
1290
  try {
1291
1291
  if (r.validate == null) return {
1292
1292
  success: !0,
@@ -1300,7 +1300,7 @@ async function li({ value: e, schema: t, context: n }) {
1300
1300
  rawValue: e
1301
1301
  } : {
1302
1302
  success: !1,
1303
- error: P.wrap({
1303
+ error: F.wrap({
1304
1304
  value: e,
1305
1305
  cause: t.error,
1306
1306
  context: n
@@ -1310,7 +1310,7 @@ async function li({ value: e, schema: t, context: n }) {
1310
1310
  } catch (t) {
1311
1311
  return {
1312
1312
  success: !1,
1313
- error: P.wrap({
1313
+ error: F.wrap({
1314
1314
  value: e,
1315
1315
  cause: t,
1316
1316
  context: n
@@ -1319,21 +1319,21 @@ async function li({ value: e, schema: t, context: n }) {
1319
1319
  };
1320
1320
  }
1321
1321
  }
1322
- async function ui({ text: e, schema: t }) {
1322
+ async function ci({ text: e, schema: t }) {
1323
1323
  try {
1324
- let n = $n(e);
1324
+ let n = Qn(e);
1325
1325
  return t == null ? {
1326
1326
  success: !0,
1327
1327
  value: n,
1328
1328
  rawValue: n
1329
- } : await li({
1329
+ } : await si({
1330
1330
  value: n,
1331
1331
  schema: t
1332
1332
  });
1333
1333
  } catch (t) {
1334
1334
  return {
1335
1335
  success: !1,
1336
- error: Cn.isInstance(t) ? t : new Cn({
1336
+ error: Sn.isInstance(t) ? t : new Sn({
1337
1337
  text: e,
1338
1338
  cause: t
1339
1339
  }),
@@ -1341,56 +1341,56 @@ async function ui({ text: e, schema: t }) {
1341
1341
  };
1342
1342
  }
1343
1343
  }
1344
- function di({ stream: e, schema: t }) {
1345
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Un()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1346
- e !== "[DONE]" && n.enqueue(await ui({
1344
+ function li({ stream: e, schema: t }) {
1345
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Hn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1346
+ e !== "[DONE]" && n.enqueue(await ci({
1347
1347
  text: e,
1348
1348
  schema: t
1349
1349
  }));
1350
1350
  } }));
1351
1351
  }
1352
- async function V(e) {
1352
+ async function ui(e) {
1353
1353
  return typeof e == "function" && (e = e()), Promise.resolve(e);
1354
1354
  }
1355
1355
  new TextDecoder();
1356
- var fi = Object.defineProperty, pi = (e, t) => {
1357
- for (var n in t) fi(e, n, {
1356
+ var di = Object.defineProperty, fi = (e, t) => {
1357
+ for (var n in t) di(e, n, {
1358
1358
  get: t[n],
1359
1359
  enumerable: !0
1360
1360
  });
1361
- }, mi = "AI_InvalidArgumentError", hi = `vercel.ai.error.${mi}`, gi = Symbol.for(hi), _i, vi, yi = class extends (vi = N, _i = gi, vi) {
1361
+ }, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i = P, gi = hi, _i) {
1362
1362
  constructor({ parameter: e, value: t, message: n }) {
1363
1363
  super({
1364
- name: mi,
1364
+ name: pi,
1365
1365
  message: `Invalid argument for parameter ${e}: ${n}`
1366
- }), this[_i] = !0, this.parameter = e, this.value = t;
1366
+ }), this[gi] = !0, this.parameter = e, this.value = t;
1367
1367
  }
1368
1368
  static isInstance(e) {
1369
- return N.hasMarker(e, hi);
1369
+ return P.hasMarker(e, mi);
1370
1370
  }
1371
- }, bi = "AI_NoObjectGeneratedError", xi = `vercel.ai.error.${bi}`, Si = Symbol.for(xi), Ci, wi, H = class extends (wi = N, Ci = Si, wi) {
1371
+ }, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci = P, Si = xi, Ci) {
1372
1372
  constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
1373
1373
  super({
1374
- name: bi,
1374
+ name: yi,
1375
1375
  message: e,
1376
1376
  cause: t
1377
- }), this[Ci] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1377
+ }), this[Si] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1378
1378
  }
1379
1379
  static isInstance(e) {
1380
- return N.hasMarker(e, xi);
1380
+ return P.hasMarker(e, bi);
1381
1381
  }
1382
- }, Ti = "AI_UIMessageStreamError", Ei = `vercel.ai.error.${Ti}`, Di = Symbol.for(Ei), Oi, ki, Ai = class extends (ki = N, Oi = Di, ki) {
1382
+ }, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi = P, Di = Ei, Oi) {
1383
1383
  constructor({ chunkType: e, chunkId: t, message: n }) {
1384
1384
  super({
1385
- name: Ti,
1385
+ name: wi,
1386
1386
  message: n
1387
- }), this[Oi] = !0, this.chunkType = e, this.chunkId = t;
1387
+ }), this[Di] = !0, this.chunkType = e, this.chunkId = t;
1388
1388
  }
1389
1389
  static isInstance(e) {
1390
- return N.hasMarker(e, Ei);
1390
+ return P.hasMarker(e, Ti);
1391
1391
  }
1392
1392
  };
1393
- function ji({ warning: e, provider: t, model: n }) {
1393
+ function Ai({ warning: e, provider: t, model: n }) {
1394
1394
  let r = `AI SDK Warning${t != null && n != null ? ` (${t} / ${n})` : ""}:`;
1395
1395
  switch (e.type) {
1396
1396
  case "unsupported": {
@@ -1406,11 +1406,11 @@ function ji({ warning: e, provider: t, model: n }) {
1406
1406
  default: return `${r} ${JSON.stringify(e, null, 2)}`;
1407
1407
  }
1408
1408
  }
1409
- var Mi = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Ni = !1;
1410
- function Pi({ message: e, type: t }) {
1409
+ var ji = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Mi = !1;
1410
+ function Ni({ message: e, type: t }) {
1411
1411
  typeof process < "u" && typeof process.emitWarning == "function" ? process.emitWarning(e, { type: t }) : console.warn(e);
1412
1412
  }
1413
- var Fi = (e) => {
1413
+ var Pi = (e) => {
1414
1414
  if (e.warnings.length === 0) return;
1415
1415
  let t = globalThis.AI_SDK_LOG_WARNINGS;
1416
1416
  if (t !== !1) {
@@ -1418,12 +1418,12 @@ var Fi = (e) => {
1418
1418
  t(e);
1419
1419
  return;
1420
1420
  }
1421
- Ni || (Ni = !0, Pi({
1422
- message: Mi,
1421
+ Mi || (Mi = !0, Ni({
1422
+ message: ji,
1423
1423
  type: "Warning"
1424
1424
  }));
1425
- for (let t of e.warnings) Pi({
1426
- message: ji({
1425
+ for (let t of e.warnings) Ni({
1426
+ message: Ai({
1427
1427
  warning: t,
1428
1428
  provider: e.provider,
1429
1429
  model: e.model
@@ -1432,7 +1432,7 @@ var Fi = (e) => {
1432
1432
  });
1433
1433
  }
1434
1434
  };
1435
- function Ii(e, t) {
1435
+ function Fi(e, t) {
1436
1436
  if (e === void 0 && t === void 0) return;
1437
1437
  if (e === void 0) return t;
1438
1438
  if (t === void 0) return e;
@@ -1441,261 +1441,261 @@ function Ii(e, t) {
1441
1441
  let i = t[r];
1442
1442
  if (i === void 0) continue;
1443
1443
  let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
1444
- n[r] = o && s ? Ii(a, i) : i;
1444
+ n[r] = o && s ? Fi(a, i) : i;
1445
1445
  }
1446
1446
  return n;
1447
1447
  }
1448
- var U = {
1449
- array: rt,
1450
- boolean: Je,
1451
- custom: lt,
1452
- discriminatedUnion: it,
1453
- enum: ct,
1454
- instanceof: dt,
1455
- lazy: Xe,
1456
- literal: Ye,
1457
- looseObject: et,
1458
- never: qe,
1459
- null: ot,
1460
- number: st,
1461
- object: $e,
1462
- record: tt,
1448
+ var W = {
1449
+ array: Je,
1450
+ boolean: ct,
1451
+ custom: rt,
1452
+ discriminatedUnion: Ye,
1453
+ enum: ut,
1454
+ instanceof: ot,
1455
+ lazy: et,
1456
+ literal: st,
1457
+ looseObject: Ke,
1458
+ never: Qe,
1459
+ null: lt,
1460
+ number: $e,
1461
+ object: tt,
1462
+ record: Xe,
1463
1463
  string: Ze,
1464
- union: Qe,
1465
- unknown: nt
1466
- }, Li = U.lazy(() => U.union([
1467
- U.null(),
1468
- U.string(),
1469
- U.number(),
1470
- U.boolean(),
1471
- U.record(U.string(), Li.optional()),
1472
- U.array(Li)
1473
- ])), W = U.record(U.string(), U.record(U.string(), Li.optional())), Ri = U.union([
1474
- U.string(),
1475
- U.instanceof(Uint8Array),
1476
- U.instanceof(ArrayBuffer),
1477
- U.custom(Jn, { message: "Must be a Buffer" })
1478
- ]), zi = U.record(U.string(), U.string()), Bi = U.object({
1479
- type: U.literal("text"),
1480
- text: U.string(),
1481
- providerOptions: W.optional()
1482
- }), Vi = U.object({
1483
- type: U.literal("image"),
1484
- image: U.union([
1485
- Ri,
1486
- U.instanceof(URL),
1487
- zi
1464
+ union: dt,
1465
+ unknown: qe
1466
+ }, Ii = W.lazy(() => W.union([
1467
+ W.null(),
1468
+ W.string(),
1469
+ W.number(),
1470
+ W.boolean(),
1471
+ W.record(W.string(), Ii.optional()),
1472
+ W.array(Ii)
1473
+ ])), G = W.record(W.string(), W.record(W.string(), Ii.optional())), Li = W.union([
1474
+ W.string(),
1475
+ W.instanceof(Uint8Array),
1476
+ W.instanceof(ArrayBuffer),
1477
+ W.custom(qn, { message: "Must be a Buffer" })
1478
+ ]), Ri = W.record(W.string(), W.string()), zi = W.object({
1479
+ type: W.literal("text"),
1480
+ text: W.string(),
1481
+ providerOptions: G.optional()
1482
+ }), Bi = W.object({
1483
+ type: W.literal("image"),
1484
+ image: W.union([
1485
+ Li,
1486
+ W.instanceof(URL),
1487
+ Ri
1488
1488
  ]),
1489
- mediaType: U.string().optional(),
1490
- providerOptions: W.optional()
1491
- }), Hi = U.discriminatedUnion("type", [
1492
- U.object({
1493
- type: U.literal("data"),
1494
- data: Ri
1489
+ mediaType: W.string().optional(),
1490
+ providerOptions: G.optional()
1491
+ }), Vi = W.discriminatedUnion("type", [
1492
+ W.object({
1493
+ type: W.literal("data"),
1494
+ data: Li
1495
1495
  }),
1496
- U.object({
1497
- type: U.literal("url"),
1498
- url: U.instanceof(URL)
1496
+ W.object({
1497
+ type: W.literal("url"),
1498
+ url: W.instanceof(URL)
1499
1499
  }),
1500
- U.object({
1501
- type: U.literal("reference"),
1502
- reference: zi
1500
+ W.object({
1501
+ type: W.literal("reference"),
1502
+ reference: Ri
1503
1503
  }),
1504
- U.object({
1505
- type: U.literal("text"),
1506
- text: U.string()
1504
+ W.object({
1505
+ type: W.literal("text"),
1506
+ text: W.string()
1507
1507
  })
1508
- ]), Ui = U.discriminatedUnion("type", [U.object({
1509
- type: U.literal("data"),
1510
- data: Ri
1511
- }), U.object({
1512
- type: U.literal("url"),
1513
- url: U.instanceof(URL)
1514
- })]), Wi = U.object({
1515
- type: U.literal("file"),
1516
- data: U.union([
1517
- Hi,
1518
- Ri,
1519
- U.instanceof(URL),
1520
- zi
1508
+ ]), Hi = W.discriminatedUnion("type", [W.object({
1509
+ type: W.literal("data"),
1510
+ data: Li
1511
+ }), W.object({
1512
+ type: W.literal("url"),
1513
+ url: W.instanceof(URL)
1514
+ })]), Ui = W.object({
1515
+ type: W.literal("file"),
1516
+ data: W.union([
1517
+ Vi,
1518
+ Li,
1519
+ W.instanceof(URL),
1520
+ Ri
1521
1521
  ]),
1522
- filename: U.string().optional(),
1523
- mediaType: U.string(),
1524
- providerOptions: W.optional()
1525
- }), Gi = U.object({
1526
- type: U.literal("reasoning"),
1527
- text: U.string(),
1528
- providerOptions: W.optional()
1529
- }), Ki = U.object({
1530
- type: U.literal("custom"),
1531
- kind: U.string().transform((e) => e),
1532
- providerOptions: W.optional()
1533
- }), qi = U.object({
1534
- type: U.literal("reasoning-file"),
1535
- data: U.union([
1536
- Ui,
1537
- Ri,
1538
- U.instanceof(URL)
1522
+ filename: W.string().optional(),
1523
+ mediaType: W.string(),
1524
+ providerOptions: G.optional()
1525
+ }), Wi = W.object({
1526
+ type: W.literal("reasoning"),
1527
+ text: W.string(),
1528
+ providerOptions: G.optional()
1529
+ }), Gi = W.object({
1530
+ type: W.literal("custom"),
1531
+ kind: W.string().transform((e) => e),
1532
+ providerOptions: G.optional()
1533
+ }), Ki = W.object({
1534
+ type: W.literal("reasoning-file"),
1535
+ data: W.union([
1536
+ Hi,
1537
+ Li,
1538
+ W.instanceof(URL)
1539
1539
  ]),
1540
- mediaType: U.string(),
1541
- providerOptions: W.optional()
1542
- }), Ji = U.object({
1543
- type: U.literal("tool-call"),
1544
- toolCallId: U.string(),
1545
- toolName: U.string(),
1546
- input: U.unknown(),
1547
- providerOptions: W.optional(),
1548
- providerExecuted: U.boolean().optional()
1549
- }), Yi = U.discriminatedUnion("type", [
1550
- U.object({
1551
- type: U.literal("text"),
1552
- value: U.string(),
1553
- providerOptions: W.optional()
1540
+ mediaType: W.string(),
1541
+ providerOptions: G.optional()
1542
+ }), qi = W.object({
1543
+ type: W.literal("tool-call"),
1544
+ toolCallId: W.string(),
1545
+ toolName: W.string(),
1546
+ input: W.unknown(),
1547
+ providerOptions: G.optional(),
1548
+ providerExecuted: W.boolean().optional()
1549
+ }), Ji = W.discriminatedUnion("type", [
1550
+ W.object({
1551
+ type: W.literal("text"),
1552
+ value: W.string(),
1553
+ providerOptions: G.optional()
1554
1554
  }),
1555
- U.object({
1556
- type: U.literal("json"),
1557
- value: Li,
1558
- providerOptions: W.optional()
1555
+ W.object({
1556
+ type: W.literal("json"),
1557
+ value: Ii,
1558
+ providerOptions: G.optional()
1559
1559
  }),
1560
- U.object({
1561
- type: U.literal("execution-denied"),
1562
- reason: U.string().optional(),
1563
- providerOptions: W.optional()
1560
+ W.object({
1561
+ type: W.literal("execution-denied"),
1562
+ reason: W.string().optional(),
1563
+ providerOptions: G.optional()
1564
1564
  }),
1565
- U.object({
1566
- type: U.literal("error-text"),
1567
- value: U.string(),
1568
- providerOptions: W.optional()
1565
+ W.object({
1566
+ type: W.literal("error-text"),
1567
+ value: W.string(),
1568
+ providerOptions: G.optional()
1569
1569
  }),
1570
- U.object({
1571
- type: U.literal("error-json"),
1572
- value: Li,
1573
- providerOptions: W.optional()
1570
+ W.object({
1571
+ type: W.literal("error-json"),
1572
+ value: Ii,
1573
+ providerOptions: G.optional()
1574
1574
  }),
1575
- U.object({
1576
- type: U.literal("content"),
1577
- value: U.array(U.union([
1578
- U.object({
1579
- type: U.literal("text"),
1580
- text: U.string(),
1581
- providerOptions: W.optional()
1575
+ W.object({
1576
+ type: W.literal("content"),
1577
+ value: W.array(W.union([
1578
+ W.object({
1579
+ type: W.literal("text"),
1580
+ text: W.string(),
1581
+ providerOptions: G.optional()
1582
1582
  }),
1583
- U.object({
1584
- type: U.literal("file"),
1585
- data: Hi,
1586
- mediaType: U.string(),
1587
- filename: U.string().optional(),
1588
- providerOptions: W.optional()
1583
+ W.object({
1584
+ type: W.literal("file"),
1585
+ data: Vi,
1586
+ mediaType: W.string(),
1587
+ filename: W.string().optional(),
1588
+ providerOptions: G.optional()
1589
1589
  }),
1590
- U.object({
1591
- type: U.literal("file-data"),
1592
- data: U.string(),
1593
- mediaType: U.string(),
1594
- filename: U.string().optional(),
1595
- providerOptions: W.optional()
1590
+ W.object({
1591
+ type: W.literal("file-data"),
1592
+ data: W.string(),
1593
+ mediaType: W.string(),
1594
+ filename: W.string().optional(),
1595
+ providerOptions: G.optional()
1596
1596
  }),
1597
- U.object({
1598
- type: U.literal("file-url"),
1599
- url: U.string(),
1600
- mediaType: U.string().optional(),
1601
- providerOptions: W.optional()
1597
+ W.object({
1598
+ type: W.literal("file-url"),
1599
+ url: W.string(),
1600
+ mediaType: W.string().optional(),
1601
+ providerOptions: G.optional()
1602
1602
  }),
1603
- U.object({
1604
- type: U.literal("file-id"),
1605
- fileId: U.union([U.string(), U.record(U.string(), U.string())]),
1606
- providerOptions: W.optional()
1603
+ W.object({
1604
+ type: W.literal("file-id"),
1605
+ fileId: W.union([W.string(), W.record(W.string(), W.string())]),
1606
+ providerOptions: G.optional()
1607
1607
  }),
1608
- U.object({
1609
- type: U.literal("file-reference"),
1610
- providerReference: U.record(U.string(), U.string()),
1611
- providerOptions: W.optional()
1608
+ W.object({
1609
+ type: W.literal("file-reference"),
1610
+ providerReference: W.record(W.string(), W.string()),
1611
+ providerOptions: G.optional()
1612
1612
  }),
1613
- U.object({
1614
- type: U.literal("image-data"),
1615
- data: U.string(),
1616
- mediaType: U.string(),
1617
- providerOptions: W.optional()
1613
+ W.object({
1614
+ type: W.literal("image-data"),
1615
+ data: W.string(),
1616
+ mediaType: W.string(),
1617
+ providerOptions: G.optional()
1618
1618
  }),
1619
- U.object({
1620
- type: U.literal("image-url"),
1621
- url: U.string(),
1622
- providerOptions: W.optional()
1619
+ W.object({
1620
+ type: W.literal("image-url"),
1621
+ url: W.string(),
1622
+ providerOptions: G.optional()
1623
1623
  }),
1624
- U.object({
1625
- type: U.literal("image-file-id"),
1626
- fileId: U.union([U.string(), U.record(U.string(), U.string())]),
1627
- providerOptions: W.optional()
1624
+ W.object({
1625
+ type: W.literal("image-file-id"),
1626
+ fileId: W.union([W.string(), W.record(W.string(), W.string())]),
1627
+ providerOptions: G.optional()
1628
1628
  }),
1629
- U.object({
1630
- type: U.literal("image-file-reference"),
1631
- providerReference: U.record(U.string(), U.string()),
1632
- providerOptions: W.optional()
1629
+ W.object({
1630
+ type: W.literal("image-file-reference"),
1631
+ providerReference: W.record(W.string(), W.string()),
1632
+ providerOptions: G.optional()
1633
1633
  }),
1634
- U.object({
1635
- type: U.literal("custom"),
1636
- providerOptions: W.optional()
1634
+ W.object({
1635
+ type: W.literal("custom"),
1636
+ providerOptions: G.optional()
1637
1637
  })
1638
1638
  ]))
1639
1639
  })
1640
- ]), Xi = U.object({
1641
- type: U.literal("tool-result"),
1642
- toolCallId: U.string(),
1643
- toolName: U.string(),
1644
- output: Yi,
1645
- providerOptions: W.optional()
1646
- }), Zi = U.object({
1647
- type: U.literal("tool-approval-request"),
1648
- approvalId: U.string(),
1649
- toolCallId: U.string(),
1650
- reason: U.string().optional()
1651
- }), Qi = U.object({
1652
- type: U.literal("tool-approval-response"),
1653
- approvalId: U.string(),
1654
- approved: U.boolean(),
1655
- reason: U.string().optional()
1656
- }), $i = U.object({
1657
- role: U.literal("system"),
1658
- content: U.string(),
1659
- providerOptions: W.optional()
1660
- }), ea = U.object({
1661
- role: U.literal("user"),
1662
- content: U.union([U.string(), U.array(U.union([
1640
+ ]), Yi = W.object({
1641
+ type: W.literal("tool-result"),
1642
+ toolCallId: W.string(),
1643
+ toolName: W.string(),
1644
+ output: Ji,
1645
+ providerOptions: G.optional()
1646
+ }), Xi = W.object({
1647
+ type: W.literal("tool-approval-request"),
1648
+ approvalId: W.string(),
1649
+ toolCallId: W.string(),
1650
+ reason: W.string().optional()
1651
+ }), Zi = W.object({
1652
+ type: W.literal("tool-approval-response"),
1653
+ approvalId: W.string(),
1654
+ approved: W.boolean(),
1655
+ reason: W.string().optional()
1656
+ }), Qi = W.object({
1657
+ role: W.literal("system"),
1658
+ content: W.string(),
1659
+ providerOptions: G.optional()
1660
+ }), $i = W.object({
1661
+ role: W.literal("user"),
1662
+ content: W.union([W.string(), W.array(W.union([
1663
+ zi,
1663
1664
  Bi,
1664
- Vi,
1665
- Wi
1665
+ Ui
1666
1666
  ]))]),
1667
- providerOptions: W.optional()
1668
- }), ta = U.object({
1669
- role: U.literal("assistant"),
1670
- content: U.union([U.string(), U.array(U.union([
1671
- Bi,
1672
- Ki,
1673
- Wi,
1667
+ providerOptions: G.optional()
1668
+ }), ea = W.object({
1669
+ role: W.literal("assistant"),
1670
+ content: W.union([W.string(), W.array(W.union([
1671
+ zi,
1674
1672
  Gi,
1673
+ Ui,
1674
+ Wi,
1675
+ Ki,
1675
1676
  qi,
1676
- Ji,
1677
- Xi,
1678
- Zi
1677
+ Yi,
1678
+ Xi
1679
1679
  ]))]),
1680
- providerOptions: W.optional()
1681
- }), na = U.object({
1682
- role: U.literal("tool"),
1683
- content: U.array(U.union([Xi, Qi])),
1684
- providerOptions: W.optional()
1680
+ providerOptions: G.optional()
1681
+ }), ta = W.object({
1682
+ role: W.literal("tool"),
1683
+ content: W.array(W.union([Yi, Zi])),
1684
+ providerOptions: G.optional()
1685
1685
  });
1686
- U.union([
1686
+ W.union([
1687
+ Qi,
1687
1688
  $i,
1688
1689
  ea,
1689
- ta,
1690
- na
1691
- ]), pi({}, {
1692
- array: () => sa,
1693
- choice: () => ua,
1694
- json: () => da,
1695
- object: () => oa,
1696
- text: () => aa
1690
+ ta
1691
+ ]), fi({}, {
1692
+ array: () => oa,
1693
+ choice: () => la,
1694
+ json: () => ua,
1695
+ object: () => aa,
1696
+ text: () => ia
1697
1697
  });
1698
- function ra(e) {
1698
+ function na(e) {
1699
1699
  let t = ["ROOT"], n = -1, r = null, i = 0;
1700
1700
  function a(e) {
1701
1701
  return e >= "0" && e <= "9" || e >= "A" && e <= "F" || e >= "a" && e <= "f";
@@ -1877,16 +1877,16 @@ function ra(e) {
1877
1877
  }
1878
1878
  return l;
1879
1879
  }
1880
- async function ia(e) {
1880
+ async function ra(e) {
1881
1881
  if (e === void 0) return {
1882
1882
  value: void 0,
1883
1883
  state: "undefined-input"
1884
1884
  };
1885
- let t = await ui({ text: e });
1885
+ let t = await ci({ text: e });
1886
1886
  return t.success ? {
1887
1887
  value: t.value,
1888
1888
  state: "successful-parse"
1889
- } : (t = await ui({ text: ra(e) }), t.success ? {
1889
+ } : (t = await ci({ text: na(e) }), t.success ? {
1890
1890
  value: t.value,
1891
1891
  state: "repaired-parse"
1892
1892
  } : {
@@ -1894,7 +1894,7 @@ async function ia(e) {
1894
1894
  state: "failed-parse"
1895
1895
  });
1896
1896
  }
1897
- var aa = () => ({
1897
+ var ia = () => ({
1898
1898
  name: "text",
1899
1899
  responseFormat: Promise.resolve({ type: "text" }),
1900
1900
  async parseCompleteOutput({ text: e }) {
@@ -1904,19 +1904,19 @@ var aa = () => ({
1904
1904
  return { partial: e };
1905
1905
  },
1906
1906
  createElementStreamTransform() {}
1907
- }), oa = ({ schema: e, name: t, description: n }) => {
1908
- let r = ti(e);
1907
+ }), aa = ({ schema: e, name: t, description: n }) => {
1908
+ let r = $r(e);
1909
1909
  return {
1910
1910
  name: "object",
1911
- responseFormat: V(r.jsonSchema).then((e) => ({
1911
+ responseFormat: ui(r.jsonSchema).then((e) => ({
1912
1912
  type: "json",
1913
1913
  schema: e,
1914
1914
  ...t != null && { name: t },
1915
1915
  ...n != null && { description: n }
1916
1916
  })),
1917
1917
  async parseCompleteOutput({ text: e }, t) {
1918
- let n = await ui({ text: e });
1919
- if (!n.success) throw new H({
1918
+ let n = await ci({ text: e });
1919
+ if (!n.success) throw new U({
1920
1920
  message: "No object generated: could not parse the response.",
1921
1921
  cause: n.error,
1922
1922
  text: e,
@@ -1924,11 +1924,11 @@ var aa = () => ({
1924
1924
  usage: t.usage,
1925
1925
  finishReason: t.finishReason
1926
1926
  });
1927
- let i = await li({
1927
+ let i = await si({
1928
1928
  value: n.value,
1929
1929
  schema: r
1930
1930
  });
1931
- if (!i.success) throw new H({
1931
+ if (!i.success) throw new U({
1932
1932
  message: "No object generated: response did not match schema.",
1933
1933
  cause: i.error,
1934
1934
  text: e,
@@ -1939,7 +1939,7 @@ var aa = () => ({
1939
1939
  return i.value;
1940
1940
  },
1941
1941
  async parsePartialOutput({ text: e }) {
1942
- let t = await ia(e);
1942
+ let t = await ra(e);
1943
1943
  switch (t.state) {
1944
1944
  case "failed-parse":
1945
1945
  case "undefined-input": return;
@@ -1949,22 +1949,22 @@ var aa = () => ({
1949
1949
  },
1950
1950
  createElementStreamTransform() {}
1951
1951
  };
1952
- }, sa = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1953
- if (ca({
1952
+ }, oa = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1953
+ if (sa({
1954
1954
  name: "minItems",
1955
1955
  value: t
1956
- }), ca({
1956
+ }), sa({
1957
1957
  name: "maxItems",
1958
1958
  value: n
1959
- }), t != null && n != null && t > n) throw new yi({
1959
+ }), t != null && n != null && t > n) throw new vi({
1960
1960
  parameter: "minItems",
1961
1961
  value: t,
1962
1962
  message: "minItems must be less than or equal to maxItems"
1963
1963
  });
1964
- let a = ti(e);
1964
+ let a = $r(e);
1965
1965
  return {
1966
1966
  name: "array",
1967
- responseFormat: V(a.jsonSchema).then((e) => {
1967
+ responseFormat: ui(a.jsonSchema).then((e) => {
1968
1968
  let { $schema: a, definitions: o, $defs: s, ...c } = e;
1969
1969
  return {
1970
1970
  type: "json",
@@ -1987,8 +1987,8 @@ var aa = () => ({
1987
1987
  };
1988
1988
  }),
1989
1989
  async parseCompleteOutput({ text: e }, r) {
1990
- let i = await ui({ text: e });
1991
- if (!i.success) throw new H({
1990
+ let i = await ci({ text: e });
1991
+ if (!i.success) throw new U({
1992
1992
  message: "No object generated: could not parse the response.",
1993
1993
  cause: i.error,
1994
1994
  text: e,
@@ -1997,9 +1997,9 @@ var aa = () => ({
1997
1997
  finishReason: r.finishReason
1998
1998
  });
1999
1999
  let o = i.value;
2000
- if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new H({
2000
+ if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
2001
2001
  message: "No object generated: response did not match schema.",
2002
- cause: new P({
2002
+ cause: new F({
2003
2003
  value: o,
2004
2004
  cause: "response must be an object with an elements array"
2005
2005
  }),
@@ -2008,12 +2008,12 @@ var aa = () => ({
2008
2008
  usage: r.usage,
2009
2009
  finishReason: r.finishReason
2010
2010
  });
2011
- let s = la({
2011
+ let s = ca({
2012
2012
  value: o.elements,
2013
2013
  minItems: t,
2014
2014
  maxItems: n
2015
2015
  });
2016
- if (s != null) throw new H({
2016
+ if (s != null) throw new U({
2017
2017
  message: "No object generated: response did not match schema.",
2018
2018
  cause: s,
2019
2019
  text: e,
@@ -2023,11 +2023,11 @@ var aa = () => ({
2023
2023
  });
2024
2024
  let c = [];
2025
2025
  for (let t of o.elements) {
2026
- let n = await li({
2026
+ let n = await si({
2027
2027
  value: t,
2028
2028
  schema: a
2029
2029
  });
2030
- if (!n.success) throw new H({
2030
+ if (!n.success) throw new U({
2031
2031
  message: "No object generated: response did not match schema.",
2032
2032
  cause: n.error,
2033
2033
  text: e,
@@ -2040,7 +2040,7 @@ var aa = () => ({
2040
2040
  return c;
2041
2041
  },
2042
2042
  async parsePartialOutput({ text: e }) {
2043
- let t = await ia(e);
2043
+ let t = await ra(e);
2044
2044
  switch (t.state) {
2045
2045
  case "failed-parse":
2046
2046
  case "undefined-input": return;
@@ -2050,7 +2050,7 @@ var aa = () => ({
2050
2050
  if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
2051
2051
  let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, r = [];
2052
2052
  for (let e of n) {
2053
- let t = await li({
2053
+ let t = await si({
2054
2054
  value: e,
2055
2055
  schema: a
2056
2056
  });
@@ -2065,7 +2065,7 @@ var aa = () => ({
2065
2065
  return new TransformStream({ transform({ partialOutput: t }, r) {
2066
2066
  if (t != null) for (; e < t.length; e++) {
2067
2067
  if (n != null && e >= n) {
2068
- r.error(la({
2068
+ r.error(ca({
2069
2069
  value: t,
2070
2070
  maxItems: n
2071
2071
  }));
@@ -2077,31 +2077,31 @@ var aa = () => ({
2077
2077
  }
2078
2078
  };
2079
2079
  };
2080
- function ca({ name: e, value: t }) {
2080
+ function sa({ name: e, value: t }) {
2081
2081
  if (t != null) {
2082
- if (!Number.isInteger(t)) throw new yi({
2082
+ if (!Number.isInteger(t)) throw new vi({
2083
2083
  parameter: e,
2084
2084
  value: t,
2085
2085
  message: `${e} must be an integer`
2086
2086
  });
2087
- if (t < 0) throw new yi({
2087
+ if (t < 0) throw new vi({
2088
2088
  parameter: e,
2089
2089
  value: t,
2090
2090
  message: `${e} must be greater than or equal to 0`
2091
2091
  });
2092
2092
  }
2093
2093
  }
2094
- function la({ value: e, minItems: t, maxItems: n }) {
2095
- if (t != null && e.length < t) return new P({
2094
+ function ca({ value: e, minItems: t, maxItems: n }) {
2095
+ if (t != null && e.length < t) return new F({
2096
2096
  value: e,
2097
2097
  cause: `elements array must contain at least ${t} items`
2098
2098
  });
2099
- if (n != null && e.length > n) return new P({
2099
+ if (n != null && e.length > n) return new F({
2100
2100
  value: e,
2101
2101
  cause: `elements array must contain at most ${n} items`
2102
2102
  });
2103
2103
  }
2104
- var ua = ({ options: e, name: t, description: n }) => ({
2104
+ var la = ({ options: e, name: t, description: n }) => ({
2105
2105
  name: "choice",
2106
2106
  responseFormat: Promise.resolve({
2107
2107
  type: "json",
@@ -2119,8 +2119,8 @@ var ua = ({ options: e, name: t, description: n }) => ({
2119
2119
  ...n != null && { description: n }
2120
2120
  }),
2121
2121
  async parseCompleteOutput({ text: t }, n) {
2122
- let r = await ui({ text: t });
2123
- if (!r.success) throw new H({
2122
+ let r = await ci({ text: t });
2123
+ if (!r.success) throw new U({
2124
2124
  message: "No object generated: could not parse the response.",
2125
2125
  cause: r.error,
2126
2126
  text: t,
@@ -2129,9 +2129,9 @@ var ua = ({ options: e, name: t, description: n }) => ({
2129
2129
  finishReason: n.finishReason
2130
2130
  });
2131
2131
  let i = r.value;
2132
- if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new H({
2132
+ if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
2133
2133
  message: "No object generated: response did not match schema.",
2134
- cause: new P({
2134
+ cause: new F({
2135
2135
  value: i,
2136
2136
  cause: "response must be an object that contains a choice value."
2137
2137
  }),
@@ -2143,7 +2143,7 @@ var ua = ({ options: e, name: t, description: n }) => ({
2143
2143
  return i.result;
2144
2144
  },
2145
2145
  async parsePartialOutput({ text: t }) {
2146
- let n = await ia(t);
2146
+ let n = await ra(t);
2147
2147
  switch (n.state) {
2148
2148
  case "failed-parse":
2149
2149
  case "undefined-input": return;
@@ -2157,7 +2157,7 @@ var ua = ({ options: e, name: t, description: n }) => ({
2157
2157
  }
2158
2158
  },
2159
2159
  createElementStreamTransform() {}
2160
- }), da = ({ name: e, description: t } = {}) => ({
2160
+ }), ua = ({ name: e, description: t } = {}) => ({
2161
2161
  name: "json",
2162
2162
  responseFormat: Promise.resolve({
2163
2163
  type: "json",
@@ -2165,8 +2165,8 @@ var ua = ({ options: e, name: t, description: n }) => ({
2165
2165
  ...t != null && { description: t }
2166
2166
  }),
2167
2167
  async parseCompleteOutput({ text: e }, t) {
2168
- let n = await ui({ text: e });
2169
- if (!n.success) throw new H({
2168
+ let n = await ci({ text: e });
2169
+ if (!n.success) throw new U({
2170
2170
  message: "No object generated: could not parse the response.",
2171
2171
  cause: n.error,
2172
2172
  text: e,
@@ -2177,7 +2177,7 @@ var ua = ({ options: e, name: t, description: n }) => ({
2177
2177
  return n.value;
2178
2178
  },
2179
2179
  async parsePartialOutput({ text: e }) {
2180
- let t = await ia(e);
2180
+ let t = await ra(e);
2181
2181
  switch (t.state) {
2182
2182
  case "failed-parse":
2183
2183
  case "undefined-input": return;
@@ -2187,19 +2187,19 @@ var ua = ({ options: e, name: t, description: n }) => ({
2187
2187
  },
2188
2188
  createElementStreamTransform() {}
2189
2189
  });
2190
- new TextEncoder(), new TextEncoder(), F({
2190
+ new TextEncoder(), new TextEncoder(), I({
2191
2191
  prefix: "aitxt",
2192
2192
  size: 24
2193
- }), F({
2193
+ }), I({
2194
2194
  prefix: "call",
2195
2195
  size: 24
2196
2196
  });
2197
- function fa(e, t) {
2197
+ function da(e, t) {
2198
2198
  let n = new Headers(e ?? {});
2199
2199
  for (let [e, r] of Object.entries(t)) n.has(e) || n.set(e, r);
2200
2200
  return n;
2201
2201
  }
2202
- var pa = class extends TransformStream {
2202
+ var fa = class extends TransformStream {
2203
2203
  constructor() {
2204
2204
  super({
2205
2205
  transform(e, t) {
@@ -2212,15 +2212,15 @@ var pa = class extends TransformStream {
2212
2212
  }
2213
2213
  });
2214
2214
  }
2215
- }, ma = {
2215
+ }, pa = {
2216
2216
  "content-type": "text/event-stream",
2217
2217
  "cache-control": "no-cache",
2218
2218
  connection: "keep-alive",
2219
2219
  "x-vercel-ai-ui-message-stream": "v1",
2220
2220
  "x-accel-buffering": "no"
2221
2221
  };
2222
- function ha({ status: e, statusText: t, headers: n, stream: r, consumeSseStream: i }) {
2223
- let a = r.pipeThrough(new pa());
2222
+ function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream: i }) {
2223
+ let a = r.pipeThrough(new fa());
2224
2224
  if (i) {
2225
2225
  let [e, t] = a.tee();
2226
2226
  a = e, i({ stream: t });
@@ -2228,173 +2228,173 @@ function ha({ status: e, statusText: t, headers: n, stream: r, consumeSseStream:
2228
2228
  return new Response(a.pipeThrough(new TextEncoderStream()), {
2229
2229
  status: e,
2230
2230
  statusText: t,
2231
- headers: fa(n, ma)
2231
+ headers: da(n, pa)
2232
2232
  });
2233
2233
  }
2234
- var ga = U.record(U.string(), Li.optional()), _a = Qr(() => si(U.union([
2235
- U.looseObject({
2236
- type: U.literal("text-start"),
2237
- id: U.string(),
2238
- providerMetadata: W.optional()
2234
+ var ha = W.record(W.string(), Ii.optional()), ga = Xr(() => ai(W.union([
2235
+ W.looseObject({
2236
+ type: W.literal("text-start"),
2237
+ id: W.string(),
2238
+ providerMetadata: G.optional()
2239
2239
  }),
2240
- U.looseObject({
2241
- type: U.literal("text-delta"),
2242
- id: U.string(),
2243
- delta: U.string(),
2244
- providerMetadata: W.optional()
2240
+ W.looseObject({
2241
+ type: W.literal("text-delta"),
2242
+ id: W.string(),
2243
+ delta: W.string(),
2244
+ providerMetadata: G.optional()
2245
2245
  }),
2246
- U.looseObject({
2247
- type: U.literal("text-end"),
2248
- id: U.string(),
2249
- providerMetadata: W.optional()
2246
+ W.looseObject({
2247
+ type: W.literal("text-end"),
2248
+ id: W.string(),
2249
+ providerMetadata: G.optional()
2250
2250
  }),
2251
- U.looseObject({
2252
- type: U.literal("error"),
2253
- errorText: U.string()
2251
+ W.looseObject({
2252
+ type: W.literal("error"),
2253
+ errorText: W.string()
2254
2254
  }),
2255
- U.looseObject({
2256
- type: U.literal("tool-input-start"),
2257
- toolCallId: U.string(),
2258
- toolName: U.string(),
2259
- providerExecuted: U.boolean().optional(),
2260
- providerMetadata: W.optional(),
2261
- toolMetadata: ga.optional(),
2262
- dynamic: U.boolean().optional(),
2263
- title: U.string().optional()
2255
+ W.looseObject({
2256
+ type: W.literal("tool-input-start"),
2257
+ toolCallId: W.string(),
2258
+ toolName: W.string(),
2259
+ providerExecuted: W.boolean().optional(),
2260
+ providerMetadata: G.optional(),
2261
+ toolMetadata: ha.optional(),
2262
+ dynamic: W.boolean().optional(),
2263
+ title: W.string().optional()
2264
2264
  }),
2265
- U.looseObject({
2266
- type: U.literal("tool-input-delta"),
2267
- toolCallId: U.string(),
2268
- inputTextDelta: U.string()
2265
+ W.looseObject({
2266
+ type: W.literal("tool-input-delta"),
2267
+ toolCallId: W.string(),
2268
+ inputTextDelta: W.string()
2269
2269
  }),
2270
- U.looseObject({
2271
- type: U.literal("tool-input-available"),
2272
- toolCallId: U.string(),
2273
- toolName: U.string(),
2274
- input: U.unknown(),
2275
- providerExecuted: U.boolean().optional(),
2276
- providerMetadata: W.optional(),
2277
- toolMetadata: ga.optional(),
2278
- dynamic: U.boolean().optional(),
2279
- title: U.string().optional()
2270
+ W.looseObject({
2271
+ type: W.literal("tool-input-available"),
2272
+ toolCallId: W.string(),
2273
+ toolName: W.string(),
2274
+ input: W.unknown(),
2275
+ providerExecuted: W.boolean().optional(),
2276
+ providerMetadata: G.optional(),
2277
+ toolMetadata: ha.optional(),
2278
+ dynamic: W.boolean().optional(),
2279
+ title: W.string().optional()
2280
2280
  }),
2281
- U.looseObject({
2282
- type: U.literal("tool-input-error"),
2283
- toolCallId: U.string(),
2284
- toolName: U.string(),
2285
- input: U.unknown(),
2286
- providerExecuted: U.boolean().optional(),
2287
- providerMetadata: W.optional(),
2288
- toolMetadata: ga.optional(),
2289
- dynamic: U.boolean().optional(),
2290
- errorText: U.string(),
2291
- title: U.string().optional()
2281
+ W.looseObject({
2282
+ type: W.literal("tool-input-error"),
2283
+ toolCallId: W.string(),
2284
+ toolName: W.string(),
2285
+ input: W.unknown(),
2286
+ providerExecuted: W.boolean().optional(),
2287
+ providerMetadata: G.optional(),
2288
+ toolMetadata: ha.optional(),
2289
+ dynamic: W.boolean().optional(),
2290
+ errorText: W.string(),
2291
+ title: W.string().optional()
2292
2292
  }),
2293
- U.looseObject({
2294
- type: U.literal("tool-approval-request"),
2295
- approvalId: U.string(),
2296
- toolCallId: U.string(),
2297
- approvalDescriptor: U.unknown().optional(),
2298
- reason: U.string().optional(),
2299
- isAutomatic: U.boolean().optional(),
2300
- signature: U.string().optional()
2293
+ W.looseObject({
2294
+ type: W.literal("tool-approval-request"),
2295
+ approvalId: W.string(),
2296
+ toolCallId: W.string(),
2297
+ approvalDescriptor: W.unknown().optional(),
2298
+ reason: W.string().optional(),
2299
+ isAutomatic: W.boolean().optional(),
2300
+ signature: W.string().optional()
2301
2301
  }),
2302
- U.looseObject({
2303
- type: U.literal("tool-approval-response"),
2304
- approvalId: U.string(),
2305
- approved: U.boolean(),
2306
- reason: U.string().optional(),
2307
- providerExecuted: U.boolean().optional(),
2308
- providerMetadata: W.optional()
2302
+ W.looseObject({
2303
+ type: W.literal("tool-approval-response"),
2304
+ approvalId: W.string(),
2305
+ approved: W.boolean(),
2306
+ reason: W.string().optional(),
2307
+ providerExecuted: W.boolean().optional(),
2308
+ providerMetadata: G.optional()
2309
2309
  }),
2310
- U.looseObject({
2311
- type: U.literal("tool-output-available"),
2312
- toolCallId: U.string(),
2313
- output: U.unknown(),
2314
- providerExecuted: U.boolean().optional(),
2315
- providerMetadata: W.optional(),
2316
- toolMetadata: ga.optional(),
2317
- dynamic: U.boolean().optional(),
2318
- preliminary: U.boolean().optional()
2310
+ W.looseObject({
2311
+ type: W.literal("tool-output-available"),
2312
+ toolCallId: W.string(),
2313
+ output: W.unknown(),
2314
+ providerExecuted: W.boolean().optional(),
2315
+ providerMetadata: G.optional(),
2316
+ toolMetadata: ha.optional(),
2317
+ dynamic: W.boolean().optional(),
2318
+ preliminary: W.boolean().optional()
2319
2319
  }),
2320
- U.looseObject({
2321
- type: U.literal("tool-output-error"),
2322
- toolCallId: U.string(),
2323
- errorText: U.string(),
2324
- providerExecuted: U.boolean().optional(),
2325
- providerMetadata: W.optional(),
2326
- toolMetadata: ga.optional(),
2327
- dynamic: U.boolean().optional()
2320
+ W.looseObject({
2321
+ type: W.literal("tool-output-error"),
2322
+ toolCallId: W.string(),
2323
+ errorText: W.string(),
2324
+ providerExecuted: W.boolean().optional(),
2325
+ providerMetadata: G.optional(),
2326
+ toolMetadata: ha.optional(),
2327
+ dynamic: W.boolean().optional()
2328
2328
  }),
2329
- U.looseObject({
2330
- type: U.literal("tool-output-denied"),
2331
- toolCallId: U.string()
2329
+ W.looseObject({
2330
+ type: W.literal("tool-output-denied"),
2331
+ toolCallId: W.string()
2332
2332
  }),
2333
- U.looseObject({
2334
- type: U.literal("reasoning-start"),
2335
- id: U.string(),
2336
- providerMetadata: W.optional()
2333
+ W.looseObject({
2334
+ type: W.literal("reasoning-start"),
2335
+ id: W.string(),
2336
+ providerMetadata: G.optional()
2337
2337
  }),
2338
- U.looseObject({
2339
- type: U.literal("reasoning-delta"),
2340
- id: U.string(),
2341
- delta: U.string(),
2342
- providerMetadata: W.optional()
2338
+ W.looseObject({
2339
+ type: W.literal("reasoning-delta"),
2340
+ id: W.string(),
2341
+ delta: W.string(),
2342
+ providerMetadata: G.optional()
2343
2343
  }),
2344
- U.looseObject({
2345
- type: U.literal("reasoning-end"),
2346
- id: U.string(),
2347
- providerMetadata: W.optional()
2344
+ W.looseObject({
2345
+ type: W.literal("reasoning-end"),
2346
+ id: W.string(),
2347
+ providerMetadata: G.optional()
2348
2348
  }),
2349
- U.looseObject({
2350
- type: U.literal("custom"),
2351
- kind: U.string().transform((e) => e),
2352
- providerMetadata: W.optional()
2349
+ W.looseObject({
2350
+ type: W.literal("custom"),
2351
+ kind: W.string().transform((e) => e),
2352
+ providerMetadata: G.optional()
2353
2353
  }),
2354
- U.looseObject({
2355
- type: U.literal("source-url"),
2356
- sourceId: U.string(),
2357
- url: U.string(),
2358
- title: U.string().optional(),
2359
- providerMetadata: W.optional()
2354
+ W.looseObject({
2355
+ type: W.literal("source-url"),
2356
+ sourceId: W.string(),
2357
+ url: W.string(),
2358
+ title: W.string().optional(),
2359
+ providerMetadata: G.optional()
2360
2360
  }),
2361
- U.looseObject({
2362
- type: U.literal("source-document"),
2363
- sourceId: U.string(),
2364
- mediaType: U.string(),
2365
- title: U.string(),
2366
- filename: U.string().optional(),
2367
- providerMetadata: W.optional()
2361
+ W.looseObject({
2362
+ type: W.literal("source-document"),
2363
+ sourceId: W.string(),
2364
+ mediaType: W.string(),
2365
+ title: W.string(),
2366
+ filename: W.string().optional(),
2367
+ providerMetadata: G.optional()
2368
2368
  }),
2369
- U.looseObject({
2370
- type: U.literal("file"),
2371
- url: U.string(),
2372
- mediaType: U.string(),
2373
- providerMetadata: W.optional()
2369
+ W.looseObject({
2370
+ type: W.literal("file"),
2371
+ url: W.string(),
2372
+ mediaType: W.string(),
2373
+ providerMetadata: G.optional()
2374
2374
  }),
2375
- U.looseObject({
2376
- type: U.literal("reasoning-file"),
2377
- url: U.string(),
2378
- mediaType: U.string(),
2379
- providerMetadata: W.optional()
2375
+ W.looseObject({
2376
+ type: W.literal("reasoning-file"),
2377
+ url: W.string(),
2378
+ mediaType: W.string(),
2379
+ providerMetadata: G.optional()
2380
2380
  }),
2381
- U.looseObject({
2382
- type: U.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2383
- id: U.string().optional(),
2384
- data: U.unknown(),
2385
- transient: U.boolean().optional()
2381
+ W.looseObject({
2382
+ type: W.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2383
+ id: W.string().optional(),
2384
+ data: W.unknown(),
2385
+ transient: W.boolean().optional()
2386
2386
  }),
2387
- U.looseObject({ type: U.literal("start-step") }),
2388
- U.looseObject({ type: U.literal("finish-step") }),
2389
- U.looseObject({ type: U.literal("reset-step") }),
2390
- U.looseObject({
2391
- type: U.literal("start"),
2392
- messageId: U.string().optional(),
2393
- messageMetadata: U.unknown().optional()
2387
+ W.looseObject({ type: W.literal("start-step") }),
2388
+ W.looseObject({ type: W.literal("finish-step") }),
2389
+ W.looseObject({ type: W.literal("reset-step") }),
2390
+ W.looseObject({
2391
+ type: W.literal("start"),
2392
+ messageId: W.string().optional(),
2393
+ messageMetadata: W.unknown().optional()
2394
2394
  }),
2395
- U.looseObject({
2396
- type: U.literal("finish"),
2397
- finishReason: U.enum([
2395
+ W.looseObject({
2396
+ type: W.literal("finish"),
2397
+ finishReason: W.enum([
2398
2398
  "stop",
2399
2399
  "length",
2400
2400
  "content-filter",
@@ -2402,44 +2402,44 @@ var ga = U.record(U.string(), Li.optional()), _a = Qr(() => si(U.union([
2402
2402
  "error",
2403
2403
  "other"
2404
2404
  ]).optional(),
2405
- messageMetadata: U.unknown().optional()
2405
+ messageMetadata: W.unknown().optional()
2406
2406
  }),
2407
- U.looseObject({
2408
- type: U.literal("abort"),
2409
- reason: U.string().optional()
2407
+ W.looseObject({
2408
+ type: W.literal("abort"),
2409
+ reason: W.string().optional()
2410
2410
  }),
2411
- U.looseObject({
2412
- type: U.literal("message-metadata"),
2413
- messageMetadata: U.unknown()
2411
+ W.looseObject({
2412
+ type: W.literal("message-metadata"),
2413
+ messageMetadata: W.unknown()
2414
2414
  })
2415
2415
  ])));
2416
- function va(e) {
2416
+ function _a(e) {
2417
2417
  return e.type.startsWith("data-");
2418
2418
  }
2419
- function ya() {
2419
+ function va() {
2420
2420
  return /* @__PURE__ */ Object.create(null);
2421
2421
  }
2422
- function ba(e) {
2422
+ function ya(e) {
2423
2423
  return e.type.startsWith("tool-");
2424
2424
  }
2425
- function xa(e) {
2425
+ function ba(e) {
2426
2426
  return e.type === "dynamic-tool";
2427
2427
  }
2428
- function G(e) {
2429
- return ba(e) || xa(e);
2428
+ function K(e) {
2429
+ return ya(e) || ba(e);
2430
2430
  }
2431
- function Sa(e) {
2431
+ function xa(e) {
2432
2432
  return e.type.split("-").slice(1).join("-");
2433
2433
  }
2434
- var Ca = {
2434
+ var Sa = {
2435
2435
  type: "deprecated",
2436
2436
  setting: "rawInput in output-error UI message parts",
2437
2437
  message: "Use the \"input\" field instead. The \"rawInput\" field will be removed in the next major version."
2438
2438
  };
2439
- function wa(e) {
2440
- e.some((e) => e.parts.some((e) => typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && (e.type === "dynamic-tool" || e.type.startsWith("tool-")) && "state" in e && e.state === "output-error" && Object.prototype.hasOwnProperty.call(e, "rawInput") && "rawInput" in e && e.rawInput !== void 0)) && Fi({ warnings: [Ca] });
2439
+ function Ca(e) {
2440
+ e.some((e) => e.parts.some((e) => typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && (e.type === "dynamic-tool" || e.type.startsWith("tool-")) && "state" in e && e.state === "output-error" && Object.prototype.hasOwnProperty.call(e, "rawInput") && "rawInput" in e && e.rawInput !== void 0)) && Pi({ warnings: [Sa] });
2441
2441
  }
2442
- function Ta({ lastMessage: e, messageId: t }) {
2442
+ function wa({ lastMessage: e, messageId: t }) {
2443
2443
  return {
2444
2444
  message: e?.role === "assistant" ? e : {
2445
2445
  id: t,
@@ -2447,12 +2447,12 @@ function Ta({ lastMessage: e, messageId: t }) {
2447
2447
  role: "assistant",
2448
2448
  parts: []
2449
2449
  },
2450
- activeTextParts: ya(),
2451
- activeReasoningParts: ya(),
2452
- partialToolCalls: ya()
2450
+ activeTextParts: va(),
2451
+ activeReasoningParts: va(),
2452
+ partialToolCalls: va()
2453
2453
  };
2454
2454
  }
2455
- function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2455
+ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2456
2456
  return e.pipeThrough(new TransformStream({ async transform(e, s) {
2457
2457
  await r(async ({ state: r, write: c }) => {
2458
2458
  function l() {
@@ -2461,7 +2461,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2461
2461
  return e.slice(t + 1);
2462
2462
  }
2463
2463
  function u() {
2464
- return l().filter(G);
2464
+ return l().filter(K);
2465
2465
  }
2466
2466
  function d(e) {
2467
2467
  let t = u().find((t) => t.toolCallId === e);
@@ -2469,13 +2469,13 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2469
2469
  let n = r.message.parts;
2470
2470
  for (let r = n.length - 1; r >= 0; r--) {
2471
2471
  let i = n[r];
2472
- if (G(i) && i.toolCallId === e) {
2472
+ if (K(i) && i.toolCallId === e) {
2473
2473
  t = i;
2474
2474
  break;
2475
2475
  }
2476
2476
  }
2477
2477
  }
2478
- if (t == null) throw new Ai({
2478
+ if (t == null) throw new ki({
2479
2479
  chunkType: "tool-invocation",
2480
2480
  chunkId: e,
2481
2481
  message: `No tool invocation found for tool call ID "${e}".`
@@ -2483,8 +2483,8 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2483
2483
  return t;
2484
2484
  }
2485
2485
  function f(e) {
2486
- let t = r.message.parts.filter(G).find((t) => t.approval?.id === e);
2487
- if (t == null) throw new Ai({
2486
+ let t = r.message.parts.filter(K).find((t) => t.approval?.id === e);
2487
+ if (t == null) throw new ki({
2488
2488
  chunkType: "tool-approval-response",
2489
2489
  chunkId: e,
2490
2490
  message: `No tool invocation found for approval ID "${e}".`
@@ -2492,7 +2492,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2492
2492
  return t;
2493
2493
  }
2494
2494
  function p(e, t) {
2495
- let n = t ?? l().find((t) => ba(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2495
+ let n = t ?? l().find((t) => ya(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2496
2496
  if (n != null) {
2497
2497
  n.state = e.state, a.input = i.input, a.output = i.output, a.errorText = i.errorText, a.rawInput = i.rawInput, a.preliminary = i.preliminary, e.title !== void 0 && (a.title = e.title), e.toolMetadata !== void 0 && (a.toolMetadata = e.toolMetadata), a.providerExecuted = i.providerExecuted ?? n.providerExecuted;
2498
2498
  let t = i.providerMetadata;
@@ -2547,8 +2547,8 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2547
2547
  }
2548
2548
  async function h(e) {
2549
2549
  if (e != null) {
2550
- let n = r.message.metadata == null ? e : Ii(r.message.metadata, e);
2551
- t != null && await ci({
2550
+ let n = r.message.metadata == null ? e : Fi(r.message.metadata, e);
2551
+ t != null && await oi({
2552
2552
  value: n,
2553
2553
  schema: t,
2554
2554
  context: {
@@ -2571,7 +2571,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2571
2571
  }
2572
2572
  case "text-delta": {
2573
2573
  let t = r.activeTextParts[e.id];
2574
- if (t == null) throw new Ai({
2574
+ if (t == null) throw new ki({
2575
2575
  chunkType: "text-delta",
2576
2576
  chunkId: e.id,
2577
2577
  message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
@@ -2581,7 +2581,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2581
2581
  }
2582
2582
  case "text-end": {
2583
2583
  let t = r.activeTextParts[e.id];
2584
- if (t == null) throw new Ai({
2584
+ if (t == null) throw new ki({
2585
2585
  chunkType: "text-end",
2586
2586
  chunkId: e.id,
2587
2587
  message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
@@ -2611,7 +2611,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2611
2611
  }
2612
2612
  case "reasoning-delta": {
2613
2613
  let t = r.activeReasoningParts[e.id];
2614
- if (t == null) throw new Ai({
2614
+ if (t == null) throw new ki({
2615
2615
  chunkType: "reasoning-delta",
2616
2616
  chunkId: e.id,
2617
2617
  message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
@@ -2621,7 +2621,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2621
2621
  }
2622
2622
  case "reasoning-end": {
2623
2623
  let t = r.activeReasoningParts[e.id];
2624
- if (t == null) throw new Ai({
2624
+ if (t == null) throw new ki({
2625
2625
  chunkType: "reasoning-end",
2626
2626
  chunkId: e.id,
2627
2627
  message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
@@ -2658,7 +2658,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2658
2658
  }), c();
2659
2659
  break;
2660
2660
  case "tool-input-start": {
2661
- let t = l().filter(ba);
2661
+ let t = l().filter(ya);
2662
2662
  r.partialToolCalls[e.toolCallId] = {
2663
2663
  text: "",
2664
2664
  toolName: e.toolName,
@@ -2689,13 +2689,13 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2689
2689
  }
2690
2690
  case "tool-input-delta": {
2691
2691
  let t = r.partialToolCalls[e.toolCallId];
2692
- if (t == null) throw new Ai({
2692
+ if (t == null) throw new ki({
2693
2693
  chunkType: "tool-input-delta",
2694
2694
  chunkId: e.toolCallId,
2695
2695
  message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
2696
2696
  });
2697
2697
  t.text += e.inputTextDelta;
2698
- let { value: n } = await ia(t.text);
2698
+ let { value: n } = await ra(t.text);
2699
2699
  t.dynamic ? m({
2700
2700
  toolCallId: e.toolCallId,
2701
2701
  toolName: t.toolName,
@@ -2735,7 +2735,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2735
2735
  }), c(), a && !e.providerExecuted && await a({ toolCall: e });
2736
2736
  break;
2737
2737
  case "tool-input-error": {
2738
- let t = l().filter(G).find((t) => t.toolCallId === e.toolCallId);
2738
+ let t = l().filter(K).find((t) => t.toolCallId === e.toolCallId);
2739
2739
  (t == null ? e.dynamic : t.type === "dynamic-tool") ? m({
2740
2740
  toolCallId: e.toolCallId,
2741
2741
  toolName: e.toolName,
@@ -2755,7 +2755,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2755
2755
  providerExecuted: e.providerExecuted,
2756
2756
  providerMetadata: e.providerMetadata,
2757
2757
  toolMetadata: e.toolMetadata
2758
- }), wa([r.message])), c();
2758
+ }), Ca([r.message])), c();
2759
2759
  break;
2760
2760
  }
2761
2761
  case "tool-approval-request": {
@@ -2799,7 +2799,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2799
2799
  toolMetadata: t.toolMetadata
2800
2800
  }, t) : p({
2801
2801
  toolCallId: e.toolCallId,
2802
- toolName: Sa(t),
2802
+ toolName: xa(t),
2803
2803
  state: "output-available",
2804
2804
  input: t.input,
2805
2805
  output: e.output,
@@ -2825,7 +2825,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2825
2825
  toolMetadata: t.toolMetadata
2826
2826
  }, t) : p({
2827
2827
  toolCallId: e.toolCallId,
2828
- toolName: Sa(t),
2828
+ toolName: xa(t),
2829
2829
  state: "output-error",
2830
2830
  input: t.input,
2831
2831
  rawInput: t.rawInput,
@@ -2843,7 +2843,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2843
2843
  case "finish-step": break;
2844
2844
  case "reset-step": {
2845
2845
  let e = l();
2846
- r.activeTextParts = ya(), r.activeReasoningParts = ya(), r.partialToolCalls = ya(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2846
+ r.activeTextParts = va(), r.activeReasoningParts = va(), r.partialToolCalls = va(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2847
2847
  break;
2848
2848
  }
2849
2849
  case "start":
@@ -2858,10 +2858,10 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2858
2858
  case "error":
2859
2859
  i?.(Error(e.errorText));
2860
2860
  break;
2861
- default: if (va(e)) {
2861
+ default: if (_a(e)) {
2862
2862
  if (n?.[e.type] != null) {
2863
2863
  let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
2864
- await ci({
2864
+ await oi({
2865
2865
  value: e.data,
2866
2866
  schema: n[e.type],
2867
2867
  context: {
@@ -2884,7 +2884,7 @@ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2884
2884
  });
2885
2885
  } }));
2886
2886
  }
2887
- async function Da({ stream: e, onError: t, abortSignal: n }) {
2887
+ async function Ea({ stream: e, onError: t, abortSignal: n }) {
2888
2888
  let r = e.getReader(), i = () => {
2889
2889
  r.cancel().catch(() => {});
2890
2890
  };
@@ -2900,29 +2900,29 @@ async function Da({ stream: e, onError: t, abortSignal: n }) {
2900
2900
  n?.removeEventListener("abort", i), r.releaseLock();
2901
2901
  }
2902
2902
  }
2903
- F({
2903
+ I({
2904
2904
  prefix: "aitxt",
2905
2905
  size: 24
2906
- }), F({
2906
+ }), I({
2907
2907
  prefix: "call",
2908
2908
  size: 24
2909
- }), F({
2909
+ }), I({
2910
2910
  prefix: "aitxt",
2911
2911
  size: 24
2912
- }), F({
2912
+ }), I({
2913
2913
  prefix: "call",
2914
2914
  size: 24
2915
- }), U.record(U.string(), Li.optional()), U.record(U.string(), U.string()), F({
2915
+ }), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()), I({
2916
2916
  prefix: "call",
2917
2917
  size: 24
2918
- }), F({
2918
+ }), I({
2919
2919
  prefix: "call",
2920
2920
  size: 24
2921
- }), new TextEncoder(), F({
2921
+ }), new TextEncoder(), I({
2922
2922
  prefix: "aiobj",
2923
2923
  size: 24
2924
2924
  });
2925
- var { atob: Oa } = globalThis, ka = class {
2925
+ var { atob: Da } = globalThis, Oa = class {
2926
2926
  constructor() {
2927
2927
  this.queue = [], this.isProcessing = !1;
2928
2928
  }
@@ -2944,12 +2944,12 @@ var { atob: Oa } = globalThis, ka = class {
2944
2944
  });
2945
2945
  }
2946
2946
  };
2947
- F({
2947
+ I({
2948
2948
  prefix: "aiobj",
2949
2949
  size: 24
2950
- }), U.object({
2951
- token: U.string().refine((e) => e.trim().length > 0),
2952
- url: U.string().refine((e) => {
2950
+ }), W.object({
2951
+ token: W.string().refine((e) => e.trim().length > 0),
2952
+ url: W.string().refine((e) => {
2953
2953
  try {
2954
2954
  let t = new URL(e);
2955
2955
  return (t.protocol === "ws:" || t.protocol === "wss:") && t.hostname !== "";
@@ -2957,20 +2957,20 @@ F({
2957
2957
  return !1;
2958
2958
  }
2959
2959
  }),
2960
- expiresAt: U.number().positive().max(2 ** 53 - 1).optional(),
2961
- tools: U.array(U.object({
2962
- type: U.literal("function"),
2963
- name: U.string().min(1),
2964
- description: U.string().optional(),
2965
- parameters: U.record(U.string(), U.unknown())
2960
+ expiresAt: W.number().positive().max(2 ** 53 - 1).optional(),
2961
+ tools: W.array(W.object({
2962
+ type: W.literal("function"),
2963
+ name: W.string().min(1),
2964
+ description: W.string().optional(),
2965
+ parameters: W.record(W.string(), W.unknown())
2966
2966
  })).optional()
2967
- }), F({
2967
+ }), I({
2968
2968
  prefix: "call",
2969
2969
  size: 24
2970
2970
  });
2971
- async function Aa({ response: e, url: t, fallbackMessage: n }) {
2971
+ async function ka({ response: e, url: t, fallbackMessage: n }) {
2972
2972
  let r = await e.text();
2973
- return new rn({
2973
+ return new nn({
2974
2974
  message: r || n,
2975
2975
  url: t,
2976
2976
  requestBodyValues: void 0,
@@ -2978,9 +2978,9 @@ async function Aa({ response: e, url: t, fallbackMessage: n }) {
2978
2978
  responseBody: r
2979
2979
  });
2980
2980
  }
2981
- async function ja(e) {
2981
+ async function Aa(e) {
2982
2982
  if (e == null) return [];
2983
- if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Pn({
2983
+ if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Nn({
2984
2984
  functionality: "FileList",
2985
2985
  message: "FileList is not supported in the current environment"
2986
2986
  });
@@ -2999,18 +2999,18 @@ async function ja(e) {
2999
2999
  };
3000
3000
  }));
3001
3001
  }
3002
- function Ma(e, t) {
3002
+ function ja(e, t) {
3003
3003
  let n = e.search(/[?#]/);
3004
3004
  return n === -1 ? `${e}${t}` : `${e.slice(0, n)}${t}${e.slice(n)}`;
3005
3005
  }
3006
- var Na = class {
3006
+ var Ma = class {
3007
3007
  constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
3008
3008
  this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
3009
3009
  }
3010
3010
  async sendMessages({ abortSignal: e, ...t }) {
3011
- let n = await V(this.body), r = await V(this.headers), i = await V(this.credentials), a = {
3012
- ...Kn(r),
3013
- ...Kn(t.headers)
3011
+ let n = await ui(this.body), r = await ui(this.headers), i = await ui(this.credentials), a = {
3012
+ ...Gn(r),
3013
+ ...Gn(t.headers)
3014
3014
  }, o = await this.prepareSendMessagesRequest?.call(this, {
3015
3015
  api: this.api,
3016
3016
  id: t.chatId,
@@ -3024,7 +3024,7 @@ var Na = class {
3024
3024
  requestMetadata: t.metadata,
3025
3025
  trigger: t.trigger,
3026
3026
  messageId: t.messageId
3027
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Kn(o.headers), l = o?.body === void 0 ? {
3027
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Gn(o.headers), l = o?.body === void 0 ? {
3028
3028
  ...n,
3029
3029
  ...t.body,
3030
3030
  id: t.chatId,
@@ -3041,18 +3041,18 @@ var Na = class {
3041
3041
  credentials: u,
3042
3042
  signal: e
3043
3043
  });
3044
- if (!d.ok) throw await Aa({
3044
+ if (!d.ok) throw await ka({
3045
3045
  response: d,
3046
3046
  url: s,
3047
3047
  fallbackMessage: "Failed to fetch the chat response."
3048
3048
  });
3049
- if (!d.body) throw new un({ message: "The response body is empty." });
3049
+ if (!d.body) throw new ln({ message: "The response body is empty." });
3050
3050
  return this.processResponseStream(d.body);
3051
3051
  }
3052
3052
  async reconnectToStream(e) {
3053
- let t = await V(this.body), n = await V(this.headers), r = await V(this.credentials), i = {
3054
- ...Kn(n),
3055
- ...Kn(e.headers)
3053
+ let t = await ui(this.body), n = await ui(this.headers), r = await ui(this.credentials), i = {
3054
+ ...Gn(n),
3055
+ ...Gn(e.headers)
3056
3056
  }, a = await this.prepareReconnectToStreamRequest?.call(this, {
3057
3057
  api: this.api,
3058
3058
  id: e.chatId,
@@ -3063,37 +3063,37 @@ var Na = class {
3063
3063
  headers: i,
3064
3064
  credentials: r,
3065
3065
  requestMetadata: e.metadata
3066
- }), o = a?.api ?? Ma(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Kn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3066
+ }), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Gn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3067
3067
  method: "GET",
3068
3068
  headers: s,
3069
3069
  credentials: c,
3070
3070
  signal: e.abortSignal
3071
3071
  });
3072
3072
  if (l.status === 204) return null;
3073
- if (!l.ok) throw await Aa({
3073
+ if (!l.ok) throw await ka({
3074
3074
  response: l,
3075
3075
  url: o,
3076
3076
  fallbackMessage: "Failed to fetch the chat response."
3077
3077
  });
3078
- if (!l.body) throw new un({ message: "The response body is empty." });
3078
+ if (!l.body) throw new ln({ message: "The response body is empty." });
3079
3079
  return this.processResponseStream(l.body);
3080
3080
  }
3081
- }, Pa = class extends Na {
3081
+ }, Na = class extends Ma {
3082
3082
  constructor(e = {}) {
3083
3083
  super(e);
3084
3084
  }
3085
3085
  processResponseStream(e) {
3086
- return di({
3086
+ return li({
3087
3087
  stream: e,
3088
- schema: _a
3088
+ schema: ga
3089
3089
  }).pipeThrough(new TransformStream({ async transform(e, t) {
3090
3090
  if (!e.success) throw e.error;
3091
3091
  t.enqueue(e.value);
3092
3092
  } }));
3093
3093
  }
3094
- }, Fa = class {
3095
- constructor({ generateId: e = qn, id: t = e(), transport: n = new Pa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3096
- this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new ka(), this.sendMessage = async (e, t) => {
3094
+ }, Pa = class {
3095
+ constructor({ generateId: e = Kn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3096
+ this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Oa(), this.sendMessage = async (e, t) => {
3097
3097
  if (e == null) {
3098
3098
  await this.makeRequest({
3099
3099
  trigger: "submit-message",
@@ -3108,7 +3108,7 @@ var Na = class {
3108
3108
  this.pendingMessagePreparations.add(t);
3109
3109
  let r;
3110
3110
  try {
3111
- r = Array.isArray(e.files) ? e.files : await ja(e.files);
3111
+ r = Array.isArray(e.files) ? e.files : await Aa(e.files);
3112
3112
  } finally {
3113
3113
  this.pendingMessagePreparations.delete(t);
3114
3114
  }
@@ -3120,12 +3120,12 @@ var Na = class {
3120
3120
  } else n = e;
3121
3121
  if (e.messageId != null) {
3122
3122
  let t = this.state.messages.findIndex((t) => t.id === e.messageId);
3123
- if (t === -1) throw new yi({
3123
+ if (t === -1) throw new vi({
3124
3124
  parameter: "message.messageId",
3125
3125
  value: e.messageId,
3126
3126
  message: `message with id ${e.messageId} not found`
3127
3127
  });
3128
- if (this.state.messages[t].role !== "user") throw new yi({
3128
+ if (this.state.messages[t].role !== "user") throw new vi({
3129
3129
  parameter: "message.messageId",
3130
3130
  value: e.messageId,
3131
3131
  message: `message with id ${e.messageId} is not a user message`
@@ -3149,7 +3149,7 @@ var Na = class {
3149
3149
  });
3150
3150
  }, this.regenerate = async ({ messageId: e, ...t } = {}) => {
3151
3151
  let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
3152
- if (n === -1) throw new yi({
3152
+ if (n === -1) throw new vi({
3153
3153
  parameter: "messageId",
3154
3154
  value: e,
3155
3155
  message: `message ${e} not found`
@@ -3167,7 +3167,7 @@ var Na = class {
3167
3167
  }, this.clearError = () => {
3168
3168
  this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
3169
3169
  }, this.addToolApprovalResponse = async ({ id: e, approved: t, reason: n, options: r }) => this.jobExecutor.run(async () => {
3170
- let i = this.state.messages, a = i[i.length - 1], o = (r) => G(r) && r.state === "approval-requested" && r.approval.id === e ? {
3170
+ let i = this.state.messages, a = i[i.length - 1], o = (r) => K(r) && r.state === "approval-requested" && r.approval.id === e ? {
3171
3171
  ...r,
3172
3172
  state: "approval-responded",
3173
3173
  approval: {
@@ -3188,7 +3188,7 @@ var Na = class {
3188
3188
  });
3189
3189
  });
3190
3190
  }), this.addToolOutput = async ({ state: e = "output-available", toolCallId: t, output: n, errorText: r, options: i }) => this.jobExecutor.run(async () => {
3191
- let a = this.state.messages, o = a[a.length - 1], s = (i) => G(i) && i.toolCallId === t ? {
3191
+ let a = this.state.messages, o = a[a.length - 1], s = (i) => K(i) && i.toolCallId === t ? {
3192
3192
  ...i,
3193
3193
  state: e,
3194
3194
  output: n,
@@ -3276,7 +3276,7 @@ var Na = class {
3276
3276
  let f = this.lastMessage, p = !1, m = !1, h = !1, g;
3277
3277
  try {
3278
3278
  let a = {
3279
- state: Ta({
3279
+ state: wa({
3280
3280
  lastMessage: e === "resume-stream" || e === "regenerate-message" ? void 0 : this.state.snapshot(f),
3281
3281
  messageId: this.generateId()
3282
3282
  }),
@@ -3295,8 +3295,8 @@ var Na = class {
3295
3295
  body: r,
3296
3296
  trigger: e,
3297
3297
  messageId: i
3298
- }), await Da({
3299
- stream: Ea({
3298
+ }), await Ea({
3299
+ stream: Ta({
3300
3300
  stream: o,
3301
3301
  onToolCall: this.onToolCall,
3302
3302
  onData: this.onData,
@@ -3348,21 +3348,21 @@ var Na = class {
3348
3348
  });
3349
3349
  }
3350
3350
  };
3351
- function Ia({ messages: e }) {
3351
+ function Fa({ messages: e }) {
3352
3352
  let t = e[e.length - 1];
3353
3353
  if (!t || t.role !== "assistant") return !1;
3354
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(G);
3354
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(K);
3355
3355
  return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
3356
3356
  }
3357
- function La({ messages: e }) {
3357
+ function Ia({ messages: e }) {
3358
3358
  let t = e[e.length - 1];
3359
3359
  if (!t || t.role !== "assistant") return !1;
3360
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(G).filter((e) => !e.providerExecuted);
3360
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(K).filter((e) => !e.providerExecuted);
3361
3361
  return r.length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error");
3362
3362
  }
3363
3363
  //#endregion
3364
3364
  //#region ../node_modules/.pnpm/throttleit@2.1.0/node_modules/throttleit/index.js
3365
- var Ra = /* @__PURE__ */ t(((e, t) => {
3365
+ var La = /* @__PURE__ */ t(((e, t) => {
3366
3366
  function n(e, t) {
3367
3367
  if (typeof e != "function") throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);
3368
3368
  let n, r = 0;
@@ -3375,30 +3375,30 @@ var Ra = /* @__PURE__ */ t(((e, t) => {
3375
3375
  };
3376
3376
  }
3377
3377
  t.exports = n;
3378
- })), K = /* @__PURE__ */ e(o(), 1), za = /* @__PURE__ */ e(Ra(), 1), q = Ke(), Ba = (e, t, n) => {
3378
+ })), q = /* @__PURE__ */ e(o(), 1), Ra = /* @__PURE__ */ e(La(), 1), J = Ge(), za = (e, t, n) => {
3379
3379
  if (!t.has(e)) throw TypeError("Cannot " + n);
3380
- }, J = (e, t, n) => (Ba(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Y = (e, t, n) => {
3380
+ }, Y = (e, t, n) => (za(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
3381
3381
  if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
3382
3382
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
3383
- }, X = (e, t, n, r) => (Ba(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
3383
+ }, Ba = (e, t, n, r) => (za(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
3384
3384
  function Va(e, t) {
3385
- return t == null ? e : (0, za.default)(e, t);
3385
+ return t == null ? e : (0, Ra.default)(e, t);
3386
3386
  }
3387
3387
  function Ha(e) {
3388
3388
  return Array.isArray(e) ? [...e] : typeof e == "object" && e && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
3389
3389
  }
3390
3390
  var Z, Ua, Wa, Ga, Ka, qa, Ja, Ya, Xa, Za = class {
3391
3391
  constructor(e = []) {
3392
- Y(this, Z, void 0), Y(this, Ua, "ready"), Y(this, Wa, void 0), Y(this, Ga, /* @__PURE__ */ new Set()), Y(this, Ka, /* @__PURE__ */ new Set()), Y(this, qa, /* @__PURE__ */ new Set()), this.pushMessage = (e) => {
3393
- X(this, Z, J(this, Z).concat(e)), J(this, Ja).call(this);
3392
+ X(this, Z, void 0), X(this, Ua, "ready"), X(this, Wa, void 0), X(this, Ga, /* @__PURE__ */ new Set()), X(this, Ka, /* @__PURE__ */ new Set()), X(this, qa, /* @__PURE__ */ new Set()), this.pushMessage = (e) => {
3393
+ Ba(this, Z, Y(this, Z).concat(e)), Y(this, Ja).call(this);
3394
3394
  }, this.popMessage = () => {
3395
- X(this, Z, J(this, Z).slice(0, -1)), J(this, Ja).call(this);
3395
+ Ba(this, Z, Y(this, Z).slice(0, -1)), Y(this, Ja).call(this);
3396
3396
  }, this.replaceMessage = (e, t) => {
3397
- X(this, Z, [
3398
- ...J(this, Z).slice(0, e),
3397
+ Ba(this, Z, [
3398
+ ...Y(this, Z).slice(0, e),
3399
3399
  this.snapshot(t),
3400
- ...J(this, Z).slice(e + 1)
3401
- ]), J(this, Ja).call(this);
3400
+ ...Y(this, Z).slice(e + 1)
3401
+ ]), Y(this, Ja).call(this);
3402
3402
  }, this.snapshot = (e) => {
3403
3403
  if (typeof e != "object" || !e || !("parts" in e) || !Array.isArray(e.parts)) return e;
3404
3404
  let t = e, n = {
@@ -3408,53 +3408,53 @@ var Z, Ua, Wa, Ga, Ka, qa, Ja, Ya, Xa, Za = class {
3408
3408
  return "metadata" in t && (n.metadata = Ha(t.metadata)), n;
3409
3409
  }, this["~registerMessagesCallback"] = (e, t) => {
3410
3410
  let n = t ? Va(e, t) : e;
3411
- return J(this, Ga).add(n), () => {
3412
- J(this, Ga).delete(n);
3411
+ return Y(this, Ga).add(n), () => {
3412
+ Y(this, Ga).delete(n);
3413
3413
  };
3414
- }, this["~registerStatusCallback"] = (e) => (J(this, Ka).add(e), () => {
3415
- J(this, Ka).delete(e);
3416
- }), this["~registerErrorCallback"] = (e) => (J(this, qa).add(e), () => {
3417
- J(this, qa).delete(e);
3418
- }), Y(this, Ja, () => {
3419
- J(this, Ga).forEach((e) => e());
3420
- }), Y(this, Ya, () => {
3421
- J(this, Ka).forEach((e) => e());
3422
- }), Y(this, Xa, () => {
3423
- J(this, qa).forEach((e) => e());
3424
- }), X(this, Z, e);
3414
+ }, this["~registerStatusCallback"] = (e) => (Y(this, Ka).add(e), () => {
3415
+ Y(this, Ka).delete(e);
3416
+ }), this["~registerErrorCallback"] = (e) => (Y(this, qa).add(e), () => {
3417
+ Y(this, qa).delete(e);
3418
+ }), X(this, Ja, () => {
3419
+ Y(this, Ga).forEach((e) => e());
3420
+ }), X(this, Ya, () => {
3421
+ Y(this, Ka).forEach((e) => e());
3422
+ }), X(this, Xa, () => {
3423
+ Y(this, qa).forEach((e) => e());
3424
+ }), Ba(this, Z, e);
3425
3425
  }
3426
3426
  get status() {
3427
- return J(this, Ua);
3427
+ return Y(this, Ua);
3428
3428
  }
3429
3429
  set status(e) {
3430
- X(this, Ua, e), J(this, Ya).call(this);
3430
+ Ba(this, Ua, e), Y(this, Ya).call(this);
3431
3431
  }
3432
3432
  get error() {
3433
- return J(this, Wa);
3433
+ return Y(this, Wa);
3434
3434
  }
3435
3435
  set error(e) {
3436
- X(this, Wa, e), J(this, Xa).call(this);
3436
+ Ba(this, Wa, e), Y(this, Xa).call(this);
3437
3437
  }
3438
3438
  get messages() {
3439
- return J(this, Z);
3439
+ return Y(this, Z);
3440
3440
  }
3441
3441
  set messages(e) {
3442
- X(this, Z, [...e]), J(this, Ja).call(this);
3442
+ Ba(this, Z, [...e]), Y(this, Ja).call(this);
3443
3443
  }
3444
3444
  };
3445
3445
  Z = /* @__PURE__ */ new WeakMap(), Ua = /* @__PURE__ */ new WeakMap(), Wa = /* @__PURE__ */ new WeakMap(), Ga = /* @__PURE__ */ new WeakMap(), Ka = /* @__PURE__ */ new WeakMap(), qa = /* @__PURE__ */ new WeakMap(), Ja = /* @__PURE__ */ new WeakMap(), Ya = /* @__PURE__ */ new WeakMap(), Xa = /* @__PURE__ */ new WeakMap();
3446
- var Qa, $a = class extends Fa {
3446
+ var Qa, $a = class extends Pa {
3447
3447
  constructor({ messages: e, ...t }) {
3448
3448
  let n = new Za(e);
3449
3449
  super({
3450
3450
  ...t,
3451
3451
  state: n
3452
- }), Y(this, Qa, void 0), this["~registerMessagesCallback"] = (e, t) => J(this, Qa)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = (e) => J(this, Qa)["~registerStatusCallback"](e), this["~registerErrorCallback"] = (e) => J(this, Qa)["~registerErrorCallback"](e), X(this, Qa, n);
3452
+ }), X(this, Qa, void 0), this["~registerMessagesCallback"] = (e, t) => Y(this, Qa)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = (e) => Y(this, Qa)["~registerStatusCallback"](e), this["~registerErrorCallback"] = (e) => Y(this, Qa)["~registerErrorCallback"](e), Ba(this, Qa, n);
3453
3453
  }
3454
3454
  };
3455
3455
  Qa = /* @__PURE__ */ new WeakMap();
3456
3456
  function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}) {
3457
- let i = e ?? t, a = (0, K.useRef)({});
3457
+ let i = e ?? t, a = (0, q.useRef)({});
3458
3458
  "chat" in r || (a.current = {
3459
3459
  onToolCall: r.onToolCall,
3460
3460
  onData: r.onData,
@@ -3463,7 +3463,7 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3463
3463
  sendAutomaticallyWhen: r.sendAutomaticallyWhen,
3464
3464
  transport: r.transport
3465
3465
  });
3466
- let o, s = () => a.current.transport ?? (o ??= new Pa()), c = {
3466
+ let o, s = () => a.current.transport ?? (o ??= new Na()), c = {
3467
3467
  ...r,
3468
3468
  transport: {
3469
3469
  sendMessages: (e) => s().sendMessages(e),
@@ -3489,16 +3489,16 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3489
3489
  var t;
3490
3490
  return (t = a.current).sendAutomaticallyWhen?.call(t, e) ?? !1;
3491
3491
  }
3492
- }, l = "chat" in r ? r.chat : r.id, { chat: u, isExternallyManaged: d } = (0, K.useMemo)(() => ({
3492
+ }, l = "chat" in r ? r.chat : r.id, { chat: u, isExternallyManaged: d } = (0, q.useMemo)(() => ({
3493
3493
  chat: "chat" in r ? r.chat : new $a(c),
3494
3494
  isExternallyManaged: "chat" in r
3495
3495
  }), [l]);
3496
- (0, K.useEffect)(() => {
3496
+ (0, q.useEffect)(() => {
3497
3497
  if (!d) return () => {
3498
3498
  u.stop();
3499
3499
  };
3500
3500
  }, [u, d]);
3501
- let f = (0, K.useMemo)(() => ({ messages: u.messages }), [u]), p = (0, K.useCallback)((e) => {
3501
+ let f = (0, q.useMemo)(() => ({ messages: u.messages }), [u]), p = (0, q.useCallback)((e) => {
3502
3502
  let t = !0, n = u["~registerMessagesCallback"](() => {
3503
3503
  t && (f.messages = u.messages, e());
3504
3504
  }, i);
@@ -3509,12 +3509,12 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3509
3509
  u,
3510
3510
  f,
3511
3511
  i
3512
- ]), m = (0, K.useCallback)(() => f.messages, [f]), h = (0, K.useSyncExternalStore)(p, m, m), g = (0, K.useCallback)((e) => u["~registerStatusCallback"](() => {
3512
+ ]), m = (0, q.useCallback)(() => f.messages, [f]), h = (0, q.useSyncExternalStore)(p, m, m), g = (0, q.useCallback)((e) => u["~registerStatusCallback"](() => {
3513
3513
  (u.status === "ready" || u.status === "error") && (f.messages = u.messages), e();
3514
- }), [u, f]), _ = (0, K.useCallback)(() => u.status, [u]), v = (0, K.useSyncExternalStore)(g, _, _), y = (0, K.useSyncExternalStore)(u["~registerErrorCallback"], () => u.error, () => u.error), b = (0, K.useCallback)((e) => {
3514
+ }), [u, f]), _ = (0, q.useCallback)(() => u.status, [u]), v = (0, q.useSyncExternalStore)(g, _, _), y = (0, q.useSyncExternalStore)(u["~registerErrorCallback"], () => u.error, () => u.error), b = (0, q.useCallback)((e) => {
3515
3515
  typeof e == "function" && (e = e(u.messages)), u.messages = e;
3516
3516
  }, [u]);
3517
- return (0, K.useEffect)(() => {
3517
+ return (0, q.useEffect)(() => {
3518
3518
  n && u.resumeStream();
3519
3519
  }, [n, u]), {
3520
3520
  id: u.id,
@@ -3566,7 +3566,7 @@ function ao(e, t) {
3566
3566
  "<marimo-ui-element"
3567
3567
  ].some((e) => t.includes(e))) : !1;
3568
3568
  }
3569
- var oo = class extends T {
3569
+ var oo = class extends w {
3570
3570
  title = "Cell Outputs";
3571
3571
  mentionPrefix = "@";
3572
3572
  contextType = "cell-output";
@@ -3575,7 +3575,7 @@ var oo = class extends T {
3575
3575
  super(), this.store = e;
3576
3576
  }
3577
3577
  getItems() {
3578
- let e = this.store.get(me), t = [];
3578
+ let e = this.store.get(ge), t = [];
3579
3579
  for (let n of e.cellIds.inOrderIds) {
3580
3580
  let r = lo(n, e), i = r.cellOutput;
3581
3581
  if (!i) continue;
@@ -3599,9 +3599,9 @@ var oo = class extends T {
3599
3599
  label: `@${n}`,
3600
3600
  displayLabel: n,
3601
3601
  detail: `${t.outputType} output`,
3602
- boost: t.outputType === "media" ? b.HIGH : b.MEDIUM,
3602
+ boost: t.outputType === "media" ? S.HIGH : S.MEDIUM,
3603
3603
  type: this.contextType,
3604
- section: x.CELL_OUTPUT,
3604
+ section: O.CELL_OUTPUT,
3605
3605
  apply: `@${n}`,
3606
3606
  info: () => {
3607
3607
  let e = document.createElement("div");
@@ -3638,7 +3638,7 @@ var oo = class extends T {
3638
3638
  outputType: t.outputType,
3639
3639
  mimetype: t.output.mimetype
3640
3640
  }, o = `Cell Code:\n${i}\n\n`;
3641
- return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), D({
3641
+ return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), E({
3642
3642
  type: this.contextType,
3643
3643
  data: a,
3644
3644
  details: o
@@ -3666,15 +3666,15 @@ async function so(e, t, n) {
3666
3666
  type: "file",
3667
3667
  filename: `${n}-output-screenshot`,
3668
3668
  mediaType: "image/png",
3669
- url: await k(e.element)
3669
+ url: await A(e.element)
3670
3670
  })));
3671
3671
  } catch (e) {
3672
3672
  return r.error("Error downloading cell output images:", e), [];
3673
3673
  }
3674
3674
  }
3675
3675
  function co(e) {
3676
- if (v(e)) return null;
3677
- let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = We(e), i, a = !1;
3676
+ if (b(e)) return null;
3677
+ let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = Ue(e), i, a = !1;
3678
3678
  return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
3679
3679
  processedContent: r,
3680
3680
  imageUrl: i,
@@ -3684,10 +3684,10 @@ function co(e) {
3684
3684
  };
3685
3685
  }
3686
3686
  function lo(e, t, n) {
3687
- let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = Ee(a.name, o), c;
3687
+ let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = se(a.name, o), c;
3688
3688
  r && (c = i.consoleOutputs.map((e) => co(e)).filter((e) => e !== null));
3689
3689
  let l, u = i.output;
3690
- return u && !v(u) && (l = co(u) ?? void 0), {
3690
+ return u && !b(u) && (l = co(u) ?? void 0), {
3691
3691
  cellId: e,
3692
3692
  cellName: s,
3693
3693
  cellCode: a.code,
@@ -3699,14 +3699,14 @@ function lo(e, t, n) {
3699
3699
  //#region src/core/ai/context/providers/error.ts
3700
3700
  function uo(e, t) {
3701
3701
  let n = [`Code:\n${e.cellCode}`];
3702
- if (e.tracebackHtml && n.push(`Traceback:\n${we(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => be(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3703
- let r = w(e.cellId, t);
3702
+ if (e.tracebackHtml && n.push(`Traceback:\n${Te(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => be(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3703
+ let r = ee(e.cellId, t);
3704
3704
  r && n.push(`Database schema:\n${r}`);
3705
3705
  }
3706
3706
  return n.join("\n\n");
3707
3707
  }
3708
3708
  function fo(e, t) {
3709
- return D({
3709
+ return E({
3710
3710
  type: "error",
3711
3711
  data: {
3712
3712
  name: e.cellName || `Cell ${e.cellId}`,
@@ -3716,12 +3716,12 @@ function fo(e, t) {
3716
3716
  });
3717
3717
  }
3718
3718
  function po(e) {
3719
- return e.errorData.length === 1 ? xe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? we(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3719
+ return e.errorData.length === 1 ? xe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Te(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3720
3720
  }
3721
3721
  function mo(e) {
3722
3722
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
3723
3723
  }
3724
- var ho = new pe("error", "errors"), go = class extends T {
3724
+ var ho = new pe("error", "errors"), go = class extends w {
3725
3725
  title = "Errors";
3726
3726
  mentionPrefix = "@";
3727
3727
  contextType = "error";
@@ -3730,7 +3730,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3730
3730
  super(), this.store = e;
3731
3731
  }
3732
3732
  getItems() {
3733
- let e = he(this.store);
3733
+ let e = me(this.store);
3734
3734
  if (e.length === 0) return [];
3735
3735
  let t = [{
3736
3736
  uri: this.asURI("all"),
@@ -3763,7 +3763,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3763
3763
  detail: `${t} ${ho.pluralize(t)}`,
3764
3764
  type: "error",
3765
3765
  apply: "@error://all",
3766
- section: x.ERROR,
3766
+ section: O.ERROR,
3767
3767
  info: () => {
3768
3768
  let e = document.createElement("div");
3769
3769
  e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
@@ -3783,24 +3783,24 @@ var ho = new pe("error", "errors"), go = class extends T {
3783
3783
  detail: po(t),
3784
3784
  type: "error"
3785
3785
  }),
3786
- section: x.ERROR
3786
+ section: O.ERROR
3787
3787
  };
3788
3788
  }
3789
3789
  return {
3790
3790
  label: "Error",
3791
3791
  displayLabel: "Error",
3792
- section: x.ERROR
3792
+ section: O.ERROR
3793
3793
  };
3794
3794
  }
3795
3795
  formatContext(e) {
3796
3796
  return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => fo(e, this.store)).join("\n\n");
3797
3797
  }
3798
- }, _o = ae(), vo = {
3798
+ }, _o = ie(), vo = {
3799
3799
  maxDepth: 3,
3800
3800
  maxResults: 20,
3801
3801
  defaultResultsLimit: 5,
3802
3802
  includeDirectories: !1
3803
- }, yo = class extends T {
3803
+ }, yo = class extends w {
3804
3804
  title = "Files";
3805
3805
  mentionPrefix = "#";
3806
3806
  contextType = "file";
@@ -3902,8 +3902,8 @@ var ho = new pe("error", "errors"), go = class extends T {
3902
3902
  return {
3903
3903
  ...this.createBasicCompletion(e),
3904
3904
  type: "file",
3905
- section: x.FILE,
3906
- boost: t.isDirectory ? b.MEDIUM : b.LOW,
3905
+ section: O.FILE,
3906
+ boost: t.isDirectory ? S.MEDIUM : S.LOW,
3907
3907
  detail: t.path,
3908
3908
  displayLabel: `${i} ${n}`,
3909
3909
  apply: async (e, i, a, o) => {
@@ -3917,7 +3917,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3917
3917
  description: e.message
3918
3918
  }), null));
3919
3919
  if (!l) return;
3920
- let u = l.mimeType || "text/plain", d = Ge({
3920
+ let u = l.mimeType || "text/plain", d = We({
3921
3921
  contents: l.contents ?? "",
3922
3922
  mimeType: u,
3923
3923
  isBase64: l.isBase64 ?? !1
@@ -3926,7 +3926,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3926
3926
  from: a,
3927
3927
  to: o,
3928
3928
  insert: ""
3929
- } }), Nt(e);
3929
+ } }), Mt(e);
3930
3930
  },
3931
3931
  info: () => {
3932
3932
  let e = document.createElement("div");
@@ -3940,7 +3940,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3940
3940
  }
3941
3941
  formatContext(e) {
3942
3942
  let { data: t, name: n } = e;
3943
- return D({
3943
+ return E({
3944
3944
  type: this.contextType,
3945
3945
  data: {
3946
3946
  name: n,
@@ -3950,7 +3950,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3950
3950
  details: t.isDirectory ? "Directory containing files and subdirectories" : "File"
3951
3951
  });
3952
3952
  }
3953
- }, bo = class extends T {
3953
+ }, bo = class extends w {
3954
3954
  title = "Tables";
3955
3955
  mentionPrefix = "@";
3956
3956
  contextType = "data";
@@ -3980,7 +3980,7 @@ var ho = new pe("error", "errors"), go = class extends T {
3980
3980
  l += `${t}\n`;
3981
3981
  }
3982
3982
  }
3983
- return D({
3983
+ return E({
3984
3984
  type: this.contextType,
3985
3985
  data: {
3986
3986
  name: o,
@@ -3995,12 +3995,12 @@ var ho = new pe("error", "errors"), go = class extends T {
3995
3995
  label: `@${t}`,
3996
3996
  displayLabel: t,
3997
3997
  detail: n.source === "memory" ? "in-memory" : n.source,
3998
- boost: n.source_type === "local" ? b.LOCAL_TABLE : b.REMOTE_TABLE,
3998
+ boost: n.source_type === "local" ? S.LOCAL_TABLE : S.REMOTE_TABLE,
3999
3999
  type: ce(n),
4000
4000
  apply: `@${t}`,
4001
4001
  section: {
4002
4002
  name: ce(n) === "dataframe" ? "Dataframe" : "Table",
4003
- rank: x.TABLE.rank
4003
+ rank: O.TABLE.rank
4004
4004
  },
4005
4005
  info: () => this.createTableInfoElement(t, n)
4006
4006
  };
@@ -4058,7 +4058,7 @@ var ho = new pe("error", "errors"), go = class extends T {
4058
4058
  return e.classList.add("text-xs", "px-1.5", "py-0.5", "rounded-full", "font-medium", ...t.split(" ")), e;
4059
4059
  }
4060
4060
  }
4061
- }, xo = class extends T {
4061
+ }, xo = class extends w {
4062
4062
  title = "Variables";
4063
4063
  mentionPrefix = "@";
4064
4064
  contextType = "variable";
@@ -4085,13 +4085,13 @@ var ho = new pe("error", "errors"), go = class extends T {
4085
4085
  displayLabel: n.name,
4086
4086
  detail: n.dataType ?? "",
4087
4087
  type: this.contextType,
4088
- section: x.VARIABLE,
4089
- info: () => se(n)
4088
+ section: O.VARIABLE,
4089
+ info: () => oe(n)
4090
4090
  };
4091
4091
  }
4092
4092
  formatContext(e) {
4093
4093
  let { data: t } = e, { variable: n } = t;
4094
- return D({
4094
+ return E({
4095
4095
  type: this.contextType,
4096
4096
  data: {
4097
4097
  name: n.name,
@@ -4104,11 +4104,11 @@ var ho = new pe("error", "errors"), go = class extends T {
4104
4104
  //#endregion
4105
4105
  //#region src/core/ai/context/context.ts
4106
4106
  function So(e) {
4107
- let t = e.get(Te), n = e.get(ie), r = e.get(Ce);
4108
- return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new y(t.connectionsMap, n));
4107
+ let t = e.get(we), n = e.get(re), r = e.get(Ce);
4108
+ return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new T(t.connectionsMap, n));
4109
4109
  }
4110
4110
  function Co() {
4111
- return new yo(oe());
4111
+ return new yo(ae());
4112
4112
  }
4113
4113
  //#endregion
4114
4114
  //#region src/components/editor/ai/completion-utils.ts
@@ -4128,42 +4128,42 @@ async function To(e) {
4128
4128
  type: "file",
4129
4129
  mediaType: e.type,
4130
4130
  filename: e.name,
4131
- url: await Ue(e, "dataUrl")
4131
+ url: await He(e, "dataUrl")
4132
4132
  })));
4133
4133
  }
4134
4134
  function Eo(e) {
4135
4135
  let t = e.at(-1);
4136
4136
  if (!t || t.role !== "assistant") return !1;
4137
4137
  let n = t.parts.at(-1);
4138
- return !n || !G(n) ? !1 : La({ messages: e }) || Ia({ messages: e }) || n.state === "output-denied" && !n.providerExecuted;
4138
+ return !n || !K(n) ? !1 : Ia({ messages: e }) || Fa({ messages: e }) || n.state === "output-denied" && !n.providerExecuted;
4139
4139
  }
4140
4140
  //#endregion
4141
4141
  //#region src/components/chat/chat-components.tsx
4142
4142
  var Do = (e) => {
4143
- let t = (0, M.c)(6), { attachment: n } = e;
4143
+ let t = (0, N.c)(6), { attachment: n } = e;
4144
4144
  if (n.mediaType?.startsWith("image/")) {
4145
4145
  let e = n.filename || "Attachment", r;
4146
- return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, q.jsx)("img", {
4146
+ return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
4147
4147
  src: n.url,
4148
4148
  alt: e,
4149
4149
  className: "max-h-[100px] max-w-[100px] object-contain mb-1.5"
4150
4150
  }), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
4151
4151
  }
4152
4152
  let r;
4153
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, q.jsx)(Ve, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4153
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(Be, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4154
4154
  let i = n.filename || "Attachment", a;
4155
- return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4155
+ return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4156
4156
  className: "flex flex-row gap-1 items-center text-xs",
4157
4157
  children: [r, i]
4158
4158
  }), t[4] = i, t[5] = a), a;
4159
4159
  }, Oo = (e) => {
4160
- let t = (0, M.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4161
- t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, q.jsx)("span", {
4160
+ let t = (0, N.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4161
+ t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
4162
4162
  className: "truncate font-medium",
4163
4163
  children: r
4164
4164
  }), t[0] = r, t[1] = o);
4165
4165
  let s;
4166
- t[2] === i ? s = t[3] : (s = i && /* @__PURE__ */ (0, q.jsxs)("span", {
4166
+ t[2] === i ? s = t[3] : (s = i && /* @__PURE__ */ (0, J.jsxs)("span", {
4167
4167
  className: "truncate opacity-70",
4168
4168
  children: [
4169
4169
  "(",
@@ -4172,15 +4172,15 @@ var Do = (e) => {
4172
4172
  ]
4173
4173
  }), t[2] = i, t[3] = s);
4174
4174
  let c;
4175
- t[4] !== n || t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
4175
+ t[4] !== n || t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [
4176
4176
  n,
4177
4177
  o,
4178
4178
  s
4179
4179
  ] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
4180
4180
  let l = c;
4181
- if (a && ze(a)) {
4181
+ if (a && Re(a)) {
4182
4182
  let e = i ?? r, n;
4183
- return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, q.jsx)("a", {
4183
+ return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
4184
4184
  href: a,
4185
4185
  target: "_blank",
4186
4186
  rel: "noopener noreferrer",
@@ -4190,20 +4190,20 @@ var Do = (e) => {
4190
4190
  }), t[8] = l, t[9] = a, t[10] = e, t[11] = n) : n = t[11], n;
4191
4191
  }
4192
4192
  let u = i ?? r, d;
4193
- return t[12] !== l || t[13] !== u ? (d = /* @__PURE__ */ (0, q.jsx)("div", {
4193
+ return t[12] !== l || t[13] !== u ? (d = /* @__PURE__ */ (0, J.jsx)("div", {
4194
4194
  className: "inline-flex max-w-full items-center gap-1.5 rounded-md border bg-muted/50 px-2 py-1 my-1 text-xs text-muted-foreground",
4195
4195
  title: u,
4196
4196
  children: l
4197
4197
  }), t[12] = l, t[13] = u, t[14] = d) : d = t[14], d;
4198
4198
  }, ko = (e) => {
4199
- let t = (0, M.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = K.useState("");
4199
+ let t = (0, N.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = q.useState("");
4200
4200
  if (!n && !o) return null;
4201
4201
  let l = o ? "reasoning" : s, u;
4202
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4202
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4203
4203
  let d = o ? "Thinking" : "View reasoning", f = n.length > 0 && ` (${n.length} chars)`, p;
4204
- t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, q.jsx)(te, {
4204
+ t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(x, {
4205
4205
  className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
4206
- children: /* @__PURE__ */ (0, q.jsxs)("span", {
4206
+ children: /* @__PURE__ */ (0, J.jsxs)("span", {
4207
4207
  className: "flex items-center gap-2",
4208
4208
  children: [
4209
4209
  u,
@@ -4213,24 +4213,24 @@ var Do = (e) => {
4213
4213
  })
4214
4214
  }), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
4215
4215
  let m;
4216
- t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, q.jsx)(_, {
4216
+ t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(j, {
4217
4217
  className: "pb-2 px-2",
4218
- children: /* @__PURE__ */ (0, q.jsx)("div", {
4218
+ children: /* @__PURE__ */ (0, J.jsx)("div", {
4219
4219
  className: "bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",
4220
- children: /* @__PURE__ */ (0, q.jsx)("div", {
4220
+ children: /* @__PURE__ */ (0, J.jsx)("div", {
4221
4221
  className: "pr-6",
4222
- children: /* @__PURE__ */ (0, q.jsx)(O, { content: n })
4222
+ children: /* @__PURE__ */ (0, J.jsx)(k, { content: n })
4223
4223
  })
4224
4224
  })
4225
4225
  }), t[4] = n, t[5] = m);
4226
4226
  let h;
4227
- t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, q.jsxs)(A, {
4227
+ t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(te, {
4228
4228
  value: "reasoning",
4229
4229
  className: "border-0",
4230
4230
  children: [p, m]
4231
4231
  }), t[6] = p, t[7] = m, t[8] = h) : h = t[8];
4232
4232
  let g;
4233
- return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, q.jsx)(S, {
4233
+ return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(y, {
4234
4234
  type: "single",
4235
4235
  collapsible: !0,
4236
4236
  className: "w-full mb-2",
@@ -4247,48 +4247,48 @@ function Ao(e) {
4247
4247
  //#endregion
4248
4248
  //#region src/components/chat/tool-call/tool-args.tsx
4249
4249
  var jo = (e) => {
4250
- let t = (0, M.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4250
+ let t = (0, N.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4251
4251
  if (n == null) return null;
4252
4252
  let a;
4253
- t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, q.jsx)("h3", {
4253
+ t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
4254
4254
  className: "text-xs font-semibold text-muted-foreground",
4255
4255
  children: i
4256
4256
  }), t[0] = i, t[1] = a);
4257
4257
  let o;
4258
4258
  t[2] === n ? o = t[3] : (o = JSON.stringify(n, null, 2), t[2] = n, t[3] = o);
4259
4259
  let s;
4260
- t[4] === o ? s = t[5] : (s = /* @__PURE__ */ (0, q.jsx)("pre", {
4260
+ t[4] === o ? s = t[5] : (s = /* @__PURE__ */ (0, J.jsx)("pre", {
4261
4261
  className: "bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64",
4262
4262
  children: o
4263
4263
  }), t[4] = o, t[5] = s);
4264
4264
  let c;
4265
- return t[6] !== a || t[7] !== s ? (c = /* @__PURE__ */ (0, q.jsxs)("div", {
4265
+ return t[6] !== a || t[7] !== s ? (c = /* @__PURE__ */ (0, J.jsxs)("div", {
4266
4266
  className: "space-y-2",
4267
4267
  children: [a, s]
4268
4268
  }), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
4269
4269
  }, Mo = (e) => {
4270
- let t = (0, M.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4270
+ let t = (0, N.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4271
4271
  t[0] === c ? l = t[1] : (l = i("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
4272
4272
  let u;
4273
4273
  t[2] === n ? u = t[3] : (u = Ao(n), t[2] = n, t[3] = u);
4274
4274
  let d = `Approval required for ${u}`, f;
4275
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(qt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4275
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(Kt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4276
4276
  let p;
4277
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, q.jsx)("span", {
4277
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
4278
4278
  className: "font-semibold",
4279
4279
  children: "Approval required:"
4280
4280
  }), t[5] = p) : p = t[5];
4281
4281
  let m;
4282
4282
  t[6] === n ? m = t[7] : (m = Ao(n), t[6] = n, t[7] = m);
4283
4283
  let h;
4284
- t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, q.jsxs)("div", {
4284
+ t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, J.jsxs)("div", {
4285
4285
  className: "flex items-start gap-2",
4286
- children: [f, /* @__PURE__ */ (0, q.jsxs)("div", {
4286
+ children: [f, /* @__PURE__ */ (0, J.jsxs)("div", {
4287
4287
  className: "text-xs text-(--amber-11) leading-relaxed",
4288
4288
  children: [
4289
4289
  p,
4290
4290
  " ",
4291
- /* @__PURE__ */ (0, q.jsx)("code", {
4291
+ /* @__PURE__ */ (0, J.jsx)("code", {
4292
4292
  className: "font-mono",
4293
4293
  children: m
4294
4294
  })
@@ -4296,9 +4296,9 @@ var jo = (e) => {
4296
4296
  })]
4297
4297
  }), t[8] = m, t[9] = h);
4298
4298
  let g;
4299
- t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4299
+ t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4300
4300
  let _;
4301
- t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, q.jsx)(a, {
4301
+ t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, J.jsx)(a, {
4302
4302
  size: "xs",
4303
4303
  variant: "outline",
4304
4304
  onClick: () => s({
@@ -4308,7 +4308,7 @@ var jo = (e) => {
4308
4308
  children: "Deny"
4309
4309
  }), t[12] = o.id, t[13] = s, t[14] = _) : _ = t[14];
4310
4310
  let v;
4311
- t[15] !== o.id || t[16] !== s ? (v = /* @__PURE__ */ (0, q.jsx)(a, {
4311
+ t[15] !== o.id || t[16] !== s ? (v = /* @__PURE__ */ (0, J.jsx)(a, {
4312
4312
  size: "xs",
4313
4313
  onClick: () => s({
4314
4314
  id: o.id,
@@ -4317,12 +4317,12 @@ var jo = (e) => {
4317
4317
  children: "Approve"
4318
4318
  }), t[15] = o.id, t[16] = s, t[17] = v) : v = t[17];
4319
4319
  let y;
4320
- t[18] !== v || t[19] !== _ ? (y = /* @__PURE__ */ (0, q.jsxs)("div", {
4320
+ t[18] !== v || t[19] !== _ ? (y = /* @__PURE__ */ (0, J.jsxs)("div", {
4321
4321
  className: "flex items-center justify-end gap-2",
4322
4322
  children: [_, v]
4323
4323
  }), t[18] = v, t[19] = _, t[20] = y) : y = t[20];
4324
4324
  let b;
4325
- return t[21] !== l || t[22] !== y || t[23] !== d || t[24] !== h || t[25] !== g ? (b = /* @__PURE__ */ (0, q.jsxs)("div", {
4325
+ return t[21] !== l || t[22] !== y || t[23] !== d || t[24] !== h || t[25] !== g ? (b = /* @__PURE__ */ (0, J.jsxs)("div", {
4326
4326
  className: l,
4327
4327
  role: "alertdialog",
4328
4328
  "aria-label": d,
@@ -4333,30 +4333,30 @@ var jo = (e) => {
4333
4333
  ]
4334
4334
  }), t[21] = l, t[22] = y, t[23] = d, t[24] = h, t[25] = g, t[26] = b) : b = t[26], b;
4335
4335
  }, No = (e) => {
4336
- let t = (0, M.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = K.useState(o), u = K.useRef(o), d, f;
4336
+ let t = (0, N.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = q.useState(o), u = q.useRef(o), d, f;
4337
4337
  t[0] === o ? (d = t[1], f = t[2]) : (d = () => {
4338
4338
  u.current && !o && l(!1), u.current = o;
4339
- }, f = [o], t[0] = o, t[1] = d, t[2] = f), K.useEffect(d, f);
4339
+ }, f = [o], t[0] = o, t[1] = d, t[2] = f), q.useEffect(d, f);
4340
4340
  let p;
4341
4341
  t[3] === s ? p = t[4] : (p = i("rounded-md border border-(--red-6) bg-(--red-2)", s), t[3] = s, t[4] = p);
4342
4342
  let m;
4343
4343
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(Po), t[5] = m) : m = t[5];
4344
4344
  let h;
4345
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, q.jsx)(fe, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4345
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(fe, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4346
4346
  let g;
4347
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, q.jsx)("span", {
4347
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
4348
4348
  className: "font-semibold",
4349
4349
  children: "Failed:"
4350
4350
  }), t[7] = g) : g = t[7];
4351
4351
  let _;
4352
4352
  t[8] === n ? _ = t[9] : (_ = Ao(n), t[8] = n, t[9] = _);
4353
4353
  let v;
4354
- t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, q.jsxs)("span", {
4354
+ t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, J.jsxs)("span", {
4355
4355
  className: "flex-1 text-left",
4356
4356
  children: [
4357
4357
  g,
4358
4358
  " ",
4359
- /* @__PURE__ */ (0, q.jsx)("code", {
4359
+ /* @__PURE__ */ (0, J.jsx)("code", {
4360
4360
  className: "font-mono",
4361
4361
  children: _
4362
4362
  })
@@ -4365,9 +4365,9 @@ var jo = (e) => {
4365
4365
  let y = c && "rotate-180", b;
4366
4366
  t[12] === y ? b = t[13] : (b = i("h-3.5 w-3.5 shrink-0 transition-transform", y), t[12] = y, t[13] = b);
4367
4367
  let x;
4368
- t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, q.jsx)(Ae, { className: b }), t[14] = b, t[15] = x);
4368
+ t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, J.jsx)(ke, { className: b }), t[14] = b, t[15] = x);
4369
4369
  let S;
4370
- t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, q.jsxs)("button", {
4370
+ t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, J.jsxs)("button", {
4371
4371
  type: "button",
4372
4372
  onClick: m,
4373
4373
  className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors",
@@ -4379,18 +4379,18 @@ var jo = (e) => {
4379
4379
  ]
4380
4380
  }), t[16] = c, t[17] = x, t[18] = v, t[19] = S) : S = t[19];
4381
4381
  let C;
4382
- t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4382
+ t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, J.jsxs)("div", {
4383
4383
  className: "px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3",
4384
- children: [/* @__PURE__ */ (0, q.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, q.jsxs)("div", { children: [/* @__PURE__ */ (0, q.jsx)("h3", {
4384
+ children: [/* @__PURE__ */ (0, J.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, J.jsxs)("div", { children: [/* @__PURE__ */ (0, J.jsx)("h3", {
4385
4385
  className: "text-xs font-semibold text-(--red-11) mb-1",
4386
4386
  children: "Error"
4387
- }), /* @__PURE__ */ (0, q.jsx)("pre", {
4387
+ }), /* @__PURE__ */ (0, J.jsx)("pre", {
4388
4388
  className: "bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap",
4389
4389
  children: a
4390
4390
  })] })]
4391
4391
  }), t[20] = a, t[21] = r, t[22] = c, t[23] = C) : C = t[23];
4392
4392
  let w;
4393
- return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, q.jsxs)("div", {
4393
+ return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, J.jsxs)("div", {
4394
4394
  className: p,
4395
4395
  children: [S, C]
4396
4396
  }), t[24] = S, t[25] = C, t[26] = p, t[27] = w) : w = t[27], w;
@@ -4401,54 +4401,54 @@ function Po(e) {
4401
4401
  //#endregion
4402
4402
  //#region src/components/chat/tool-call/tool-result.tsx
4403
4403
  function Fo(e) {
4404
- return e == null || typeof e == "object" && ht(e);
4404
+ return e == null || typeof e == "object" && mt(e);
4405
4405
  }
4406
- var Io = et({
4406
+ var Io = Ke({
4407
4407
  status: Ze().default("success"),
4408
- auth_required: Je().default(!1),
4409
- action_url: ut().optional(),
4410
- next_steps: ut().optional(),
4411
- meta: ut().optional(),
4408
+ auth_required: ct().default(!1),
4409
+ action_url: nt().optional(),
4410
+ next_steps: nt().optional(),
4411
+ meta: nt().optional(),
4412
4412
  message: Ze().nullish()
4413
4413
  }), Lo = (e) => {
4414
- let t = (0, M.c)(12), { data: n } = e, r;
4414
+ let t = (0, N.c)(12), { data: n } = e, r;
4415
4415
  if (t[0] !== n) {
4416
4416
  let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
4417
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)("h3", {
4417
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
4418
4418
  className: "text-xs font-semibold text-muted-foreground",
4419
4419
  children: "Tool Result"
4420
4420
  }), t[2] = u) : u = t[2];
4421
4421
  let d;
4422
- t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, q.jsx)("span", {
4422
+ t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, J.jsx)("span", {
4423
4423
  className: "text-xs px-2 py-0.5 bg-(--grass-2) text-(--grass-11) rounded-full font-medium capitalize",
4424
4424
  children: e
4425
4425
  }), t[3] = e, t[4] = d);
4426
4426
  let f;
4427
- t[5] === i ? f = t[6] : (f = i && /* @__PURE__ */ (0, q.jsx)("span", {
4427
+ t[5] === i ? f = t[6] : (f = i && /* @__PURE__ */ (0, J.jsx)("span", {
4428
4428
  className: "text-xs px-2 py-0.5 bg-(--amber-2) text-(--amber-11) rounded-full",
4429
4429
  children: "Auth Required"
4430
4430
  }), t[5] = i, t[6] = f);
4431
4431
  let p;
4432
- t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, q.jsxs)("div", {
4432
+ t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, J.jsxs)("div", {
4433
4433
  className: "flex items-center justify-between",
4434
- children: [u, /* @__PURE__ */ (0, q.jsxs)("div", {
4434
+ children: [u, /* @__PURE__ */ (0, J.jsxs)("div", {
4435
4435
  className: "flex items-center gap-2",
4436
4436
  children: [d, f]
4437
4437
  })]
4438
4438
  }), t[7] = d, t[8] = f, t[9] = p) : p = t[9];
4439
4439
  let m;
4440
- t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4440
+ t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.jsxs)("div", {
4441
4441
  className: "flex items-start gap-2",
4442
- children: [/* @__PURE__ */ (0, q.jsx)(Se, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, q.jsx)("div", {
4442
+ children: [/* @__PURE__ */ (0, J.jsx)(Se, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
4443
4443
  className: "text-xs text-foreground",
4444
4444
  children: c
4445
4445
  })]
4446
- }), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, q.jsxs)("div", {
4446
+ }), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, J.jsxs)("div", {
4447
4447
  className: "flex flex-col gap-1.5",
4448
4448
  children: [
4449
4449
  p,
4450
4450
  m,
4451
- l && /* @__PURE__ */ (0, q.jsx)("div", {
4451
+ l && /* @__PURE__ */ (0, J.jsx)("div", {
4452
4452
  className: "space-y-3",
4453
4453
  children: Object.entries(l).map(zo)
4454
4454
  })
@@ -4457,29 +4457,29 @@ var Io = et({
4457
4457
  } else r = t[1];
4458
4458
  return r;
4459
4459
  }, Ro = (e) => {
4460
- let t = (0, M.c)(8), { result: n } = e, r;
4460
+ let t = (0, N.c)(8), { result: n } = e, r;
4461
4461
  t[0] === n ? r = t[1] : (r = Io.safeParse(n), t[0] = n, t[1] = r);
4462
4462
  let i = r;
4463
4463
  if (i.success) {
4464
4464
  let e;
4465
- return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4465
+ return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, J.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4466
4466
  }
4467
4467
  let a;
4468
4468
  t[4] === n ? a = t[5] : (a = typeof n == "string" ? n : JSON.stringify(n, null, 2), t[4] = n, t[5] = a);
4469
4469
  let o;
4470
- return t[6] === a ? o = t[7] : (o = /* @__PURE__ */ (0, q.jsx)("div", {
4470
+ return t[6] === a ? o = t[7] : (o = /* @__PURE__ */ (0, J.jsx)("div", {
4471
4471
  className: "text-xs font-medium text-muted-foreground mb-1 max-h-64 overflow-y-auto scrollbar-thin",
4472
4472
  children: a
4473
4473
  }), t[6] = a, t[7] = o), o;
4474
4474
  };
4475
4475
  function zo(e) {
4476
4476
  let [t, n] = e;
4477
- return Fo(n) ? null : /* @__PURE__ */ (0, q.jsxs)("div", {
4477
+ return Fo(n) ? null : /* @__PURE__ */ (0, J.jsxs)("div", {
4478
4478
  className: "space-y-1.5",
4479
- children: [/* @__PURE__ */ (0, q.jsx)("span", {
4479
+ children: [/* @__PURE__ */ (0, J.jsx)("span", {
4480
4480
  className: "text-xs text-muted-foreground",
4481
4481
  children: t
4482
- }), /* @__PURE__ */ (0, q.jsx)("pre", {
4482
+ }), /* @__PURE__ */ (0, J.jsx)("pre", {
4483
4483
  className: "bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64",
4484
4484
  children: JSON.stringify(n, null, 2)
4485
4485
  })]
@@ -4498,30 +4498,30 @@ var Bo = {
4498
4498
  "input-available",
4499
4499
  "approval-responded"
4500
4500
  ]), Ho = (e) => {
4501
- let t = (0, M.c)(5), { state: n, interrupted: r } = e;
4501
+ let t = (0, N.c)(5), { state: n, interrupted: r } = e;
4502
4502
  if (r) {
4503
4503
  let e;
4504
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Ht, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4504
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Vt, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4505
4505
  }
4506
4506
  switch (n) {
4507
4507
  case "input-streaming":
4508
4508
  case "input-available":
4509
4509
  case "approval-responded": {
4510
4510
  let e;
4511
- return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(g, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4511
+ return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(p, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4512
4512
  }
4513
4513
  case "output-available": {
4514
4514
  let e;
4515
- return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Vt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4515
+ return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Bt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4516
4516
  }
4517
4517
  case "output-denied": {
4518
4518
  let e;
4519
- return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(zt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4519
+ return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Rt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4520
4520
  }
4521
4521
  default: {
4522
- ke(n);
4522
+ Oe(n);
4523
4523
  let e;
4524
- return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(h, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4524
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(_, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4525
4525
  }
4526
4526
  }
4527
4527
  };
@@ -4532,47 +4532,47 @@ function Uo(e) {
4532
4532
  case "input-streaming":
4533
4533
  case "input-available":
4534
4534
  case "approval-responded": return "";
4535
- default: return ke(e), "";
4535
+ default: return Oe(e), "";
4536
4536
  }
4537
4537
  }
4538
4538
  var Wo = (e) => {
4539
- let t = (0, M.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4539
+ let t = (0, N.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4540
4540
  t[0] !== f || t[1] !== r ? (p = !f && Vo.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
4541
4541
  let m = p, h = `tool-${d}`, g;
4542
4542
  t[3] === l ? g = t[4] : (g = i("w-full", l), t[3] = l, t[4] = g);
4543
+ let _;
4544
+ t[5] !== m || t[6] !== r ? (_ = i("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", m ? "text-muted-foreground" : Uo(r)), t[5] = m, t[6] = r, t[7] = _) : _ = t[7];
4543
4545
  let v;
4544
- t[5] !== m || t[6] !== r ? (v = i("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", m ? "text-muted-foreground" : Uo(r)), t[5] = m, t[6] = r, t[7] = v) : v = t[7];
4545
- let y;
4546
- t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, q.jsx)(Ho, {
4546
+ t[8] !== m || t[9] !== r ? (v = /* @__PURE__ */ (0, J.jsx)(Ho, {
4547
4547
  state: r,
4548
4548
  interrupted: m
4549
- }), t[8] = m, t[9] = r, t[10] = y) : y = t[10];
4550
- let b = m ? "Interrupted" : Bo[r], x;
4551
- t[11] === n ? x = t[12] : (x = Ao(n), t[11] = n, t[12] = x);
4549
+ }), t[8] = m, t[9] = r, t[10] = v) : v = t[10];
4550
+ let b = m ? "Interrupted" : Bo[r], S;
4551
+ t[11] === n ? S = t[12] : (S = Ao(n), t[11] = n, t[12] = S);
4552
4552
  let C;
4553
- t[13] === x ? C = t[14] : (C = /* @__PURE__ */ (0, q.jsx)("code", {
4553
+ t[13] === S ? C = t[14] : (C = /* @__PURE__ */ (0, J.jsx)("code", {
4554
4554
  className: "font-mono text-xs",
4555
- children: x
4556
- }), t[13] = x, t[14] = C);
4555
+ children: S
4556
+ }), t[13] = S, t[14] = C);
4557
4557
  let w;
4558
- t[15] !== C || t[16] !== y || t[17] !== b ? (w = /* @__PURE__ */ (0, q.jsxs)("span", {
4558
+ t[15] !== C || t[16] !== v || t[17] !== b ? (w = /* @__PURE__ */ (0, J.jsxs)("span", {
4559
4559
  className: "flex items-center gap-1",
4560
4560
  children: [
4561
- y,
4561
+ v,
4562
4562
  b,
4563
4563
  ":",
4564
4564
  C
4565
4565
  ]
4566
- }), t[15] = C, t[16] = y, t[17] = b, t[18] = w) : w = t[18];
4566
+ }), t[15] = C, t[16] = v, t[17] = b, t[18] = w) : w = t[18];
4567
4567
  let T;
4568
- t[19] !== w || t[20] !== v ? (T = /* @__PURE__ */ (0, q.jsx)(te, {
4569
- className: v,
4568
+ t[19] !== w || t[20] !== _ ? (T = /* @__PURE__ */ (0, J.jsx)(x, {
4569
+ className: _,
4570
4570
  children: w
4571
- }), t[19] = w, t[20] = v, t[21] = T) : T = t[21];
4571
+ }), t[19] = w, t[20] = _, t[21] = T) : T = t[21];
4572
4572
  let E;
4573
- t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, q.jsx)(_, {
4573
+ t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(j, {
4574
4574
  className: "py-2 px-2",
4575
- children: /* @__PURE__ */ (0, q.jsx)(Go, {
4575
+ children: /* @__PURE__ */ (0, J.jsx)(Go, {
4576
4576
  state: r,
4577
4577
  input: a,
4578
4578
  result: o,
@@ -4580,61 +4580,61 @@ var Wo = (e) => {
4580
4580
  })
4581
4581
  }), t[22] = s, t[23] = a, t[24] = o, t[25] = r, t[26] = E) : E = t[26];
4582
4582
  let D;
4583
- t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, q.jsxs)(A, {
4583
+ t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(te, {
4584
4584
  value: "tool-call",
4585
4585
  className: "border-0",
4586
4586
  children: [T, E]
4587
4587
  }), t[27] = T, t[28] = E, t[29] = D) : D = t[29];
4588
4588
  let O;
4589
- return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, q.jsx)(S, {
4589
+ return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(y, {
4590
4590
  type: "single",
4591
4591
  collapsible: !0,
4592
4592
  className: g,
4593
4593
  children: D
4594
4594
  }, h), t[30] = D, t[31] = h, t[32] = g, t[33] = O) : O = t[33], O;
4595
4595
  }, Go = (e) => {
4596
- let t = (0, M.c)(16), { state: n, input: r, result: i, approval: a } = e;
4596
+ let t = (0, N.c)(16), { state: n, input: r, result: i, approval: a } = e;
4597
4597
  switch (n) {
4598
4598
  case "input-streaming":
4599
4599
  case "input-available":
4600
4600
  case "approval-responded": {
4601
4601
  let e;
4602
- return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4602
+ return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4603
4603
  }
4604
4604
  case "output-available": {
4605
4605
  let e;
4606
- t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4606
+ t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4607
4607
  let n;
4608
- t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, q.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4608
+ t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, J.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4609
4609
  let a;
4610
- return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4610
+ return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4611
4611
  className: "space-y-3",
4612
4612
  children: [e, n]
4613
4613
  }), t[6] = e, t[7] = n, t[8] = a) : a = t[8], a;
4614
4614
  }
4615
4615
  case "output-denied": {
4616
4616
  let e;
4617
- t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4617
+ t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4618
4618
  let n = a?.reason ? `: ${a.reason}` : ".", i;
4619
- t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, q.jsxs)("div", {
4619
+ t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, J.jsxs)("div", {
4620
4620
  className: "bg-muted/40 border border-border rounded-md p-3 text-xs text-muted-foreground leading-relaxed",
4621
4621
  children: ["Tool execution was denied", n]
4622
4622
  }), t[11] = n, t[12] = i);
4623
4623
  let o;
4624
- return t[13] !== e || t[14] !== i ? (o = /* @__PURE__ */ (0, q.jsxs)("div", {
4624
+ return t[13] !== e || t[14] !== i ? (o = /* @__PURE__ */ (0, J.jsxs)("div", {
4625
4625
  className: "space-y-3",
4626
4626
  children: [e, i]
4627
4627
  }), t[13] = e, t[14] = i, t[15] = o) : o = t[15], o;
4628
4628
  }
4629
- default: return ke(n), null;
4629
+ default: return Oe(n), null;
4630
4630
  }
4631
4631
  }, Ko = (e) => {
4632
- let t = (0, M.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4632
+ let t = (0, N.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4633
4633
  switch (r) {
4634
4634
  case "approval-requested": {
4635
4635
  if (s != null && c != null) {
4636
4636
  let e;
4637
- return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Mo, {
4637
+ return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Mo, {
4638
4638
  toolName: n,
4639
4639
  input: o,
4640
4640
  approval: s,
@@ -4643,7 +4643,7 @@ var Wo = (e) => {
4643
4643
  }), t[0] = s, t[1] = u, t[2] = o, t[3] = c, t[4] = n, t[5] = e) : e = t[5], e;
4644
4644
  }
4645
4645
  let e;
4646
- return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4646
+ return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Wo, {
4647
4647
  toolName: n,
4648
4648
  state: "input-available",
4649
4649
  input: o,
@@ -4654,7 +4654,7 @@ var Wo = (e) => {
4654
4654
  }
4655
4655
  case "output-error": {
4656
4656
  let e;
4657
- return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(No, {
4657
+ return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(No, {
4658
4658
  toolName: n,
4659
4659
  input: o,
4660
4660
  errorText: a,
@@ -4668,7 +4668,7 @@ var Wo = (e) => {
4668
4668
  case "output-available":
4669
4669
  case "output-denied": {
4670
4670
  let e;
4671
- return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4671
+ return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Wo, {
4672
4672
  toolName: n,
4673
4673
  state: r,
4674
4674
  input: o,
@@ -4679,12 +4679,12 @@ var Wo = (e) => {
4679
4679
  isActive: m
4680
4680
  }), t[18] = s, t[19] = u, t[20] = l, t[21] = o, t[22] = m, t[23] = i, t[24] = r, t[25] = n, t[26] = e) : e = t[26], e;
4681
4681
  }
4682
- default: return ke(r), null;
4682
+ default: return Oe(r), null;
4683
4683
  }
4684
4684
  }, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
4685
- return /* @__PURE__ */ (0, q.jsx)(q.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4685
+ return /* @__PURE__ */ (0, J.jsx)(J.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4686
4686
  function o(o, s) {
4687
- if (Jo(o)) return /* @__PURE__ */ (0, q.jsx)(Ko, {
4687
+ if (Jo(o)) return /* @__PURE__ */ (0, J.jsx)(Ko, {
4688
4688
  index: s,
4689
4689
  toolName: o.type,
4690
4690
  result: o.output,
@@ -4699,19 +4699,19 @@ var Wo = (e) => {
4699
4699
  }, s);
4700
4700
  if (Yo(o)) return r.debug("Found data part", o), null;
4701
4701
  switch (o.type) {
4702
- case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, q.jsx)(K.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, q.jsx)(O, { content: o.text }, s);
4703
- case "reasoning": return /* @__PURE__ */ (0, q.jsx)(ko, {
4702
+ case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: f({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(k, { content: o.text }, s);
4703
+ case "reasoning": return /* @__PURE__ */ (0, J.jsx)(ko, {
4704
4704
  reasoning: o.text,
4705
4705
  index: s,
4706
4706
  isStreaming: t && n && s === (e.parts.length || 0) - 1
4707
4707
  }, s);
4708
- case "file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: o }, s);
4709
- case "reasoning-file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: {
4708
+ case "file": return /* @__PURE__ */ (0, J.jsx)(Do, { attachment: o }, s);
4709
+ case "reasoning-file": return /* @__PURE__ */ (0, J.jsx)(Do, { attachment: {
4710
4710
  type: "file",
4711
4711
  mediaType: o.mediaType,
4712
4712
  url: o.url
4713
4713
  } }, s);
4714
- case "dynamic-tool": return /* @__PURE__ */ (0, q.jsx)(Ko, {
4714
+ case "dynamic-tool": return /* @__PURE__ */ (0, J.jsx)(Ko, {
4715
4715
  toolName: o.toolName,
4716
4716
  result: o.output,
4717
4717
  errorText: o.state === "output-error" ? o.errorText : void 0,
@@ -4722,23 +4722,23 @@ var Wo = (e) => {
4722
4722
  isLive: n,
4723
4723
  isActive: i
4724
4724
  }, s);
4725
- case "source-document": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4726
- icon: /* @__PURE__ */ (0, q.jsx)(de, { className: "h-3 w-3 shrink-0" }),
4725
+ case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4726
+ icon: /* @__PURE__ */ (0, J.jsx)(de, { className: "h-3 w-3 shrink-0" }),
4727
4727
  title: o.title,
4728
4728
  subtitle: o.filename
4729
4729
  }, s);
4730
- case "source-url": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4731
- icon: /* @__PURE__ */ (0, q.jsx)(ye, { className: "h-3 w-3 shrink-0" }),
4730
+ case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4731
+ icon: /* @__PURE__ */ (0, J.jsx)(ye, { className: "h-3 w-3 shrink-0" }),
4732
4732
  title: o.title ?? o.url,
4733
4733
  subtitle: o.title ? o.url : void 0,
4734
4734
  href: o.url
4735
4735
  }, s);
4736
- case "custom": return /* @__PURE__ */ (0, q.jsx)("div", {
4736
+ case "custom": return /* @__PURE__ */ (0, J.jsx)("div", {
4737
4737
  className: "text-sm text-muted-foreground",
4738
4738
  children: o.kind
4739
4739
  }, s);
4740
4740
  case "step-start": return null;
4741
- default: return ke(o), null;
4741
+ default: return Oe(o), null;
4742
4742
  }
4743
4743
  }
4744
4744
  };
@@ -4751,11 +4751,11 @@ function Yo(e) {
4751
4751
  //#endregion
4752
4752
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
4753
4753
  function Xo(e) {
4754
- return bt.define({ combine: (t) => t[0] ?? e });
4754
+ return At.define({ combine: (t) => t[0] ?? e });
4755
4755
  }
4756
4756
  //#endregion
4757
4757
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
4758
- var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4758
+ var Zo = Xo({}), Qo = yt.define(), $o = yt.define(), es = 50, ts = Et.define({
4759
4759
  create() {
4760
4760
  return {
4761
4761
  prompts: [],
@@ -4814,7 +4814,7 @@ function is(e = {}) {
4814
4814
  navigationIndex: -1,
4815
4815
  originalText: ""
4816
4816
  })), Zo.of(t ?? {})];
4817
- return n && r.push(Tt.of([{
4817
+ return n && r.push(kt.of([{
4818
4818
  key: "ArrowUp",
4819
4819
  run: ns
4820
4820
  }, {
@@ -4824,7 +4824,7 @@ function is(e = {}) {
4824
4824
  }
4825
4825
  //#endregion
4826
4826
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4827
- var as = St.define(), Q = At.define({
4827
+ var as = yt.define(), Q = Et.define({
4828
4828
  create() {
4829
4829
  return /* @__PURE__ */ new Map();
4830
4830
  },
@@ -4836,7 +4836,7 @@ var as = St.define(), Q = At.define({
4836
4836
  }
4837
4837
  return r;
4838
4838
  }
4839
- }), os = At.define({
4839
+ }), os = Et.define({
4840
4840
  create() {
4841
4841
  return {
4842
4842
  onResourceClick: void 0,
@@ -4848,8 +4848,8 @@ var as = St.define(), Q = At.define({
4848
4848
  update(e) {
4849
4849
  return e;
4850
4850
  }
4851
- }), ss = St.define();
4852
- At.define({
4851
+ }), ss = yt.define();
4852
+ Et.define({
4853
4853
  create() {
4854
4854
  return /* @__PURE__ */ new Map();
4855
4855
  },
@@ -4897,7 +4897,7 @@ function $(e) {
4897
4897
  }
4898
4898
  //#endregion
4899
4899
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4900
- var us = class extends Ot {
4900
+ var us = class extends Ct {
4901
4901
  resource;
4902
4902
  view;
4903
4903
  constructor(e, t) {
@@ -4918,7 +4918,7 @@ var us = class extends Ot {
4918
4918
  e.preventDefault(), e.stopPropagation(), i(this.resource);
4919
4919
  }), e;
4920
4920
  }
4921
- }, ds = class extends Ot {
4921
+ }, ds = class extends Ct {
4922
4922
  uri;
4923
4923
  view;
4924
4924
  constructor(e, t) {
@@ -4938,12 +4938,12 @@ function fs(e) {
4938
4938
  let a = e.state.doc.sliceString(r, i);
4939
4939
  for (let i of $(a)) {
4940
4940
  let a = r + i.index, o = i[0].slice(1), s = t.get(o);
4941
- s ? n.push(wt.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(wt.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4941
+ s ? n.push(Tt.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(Tt.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4942
4942
  }
4943
4943
  }
4944
- return wt.set(n);
4944
+ return Tt.set(n);
4945
4945
  }
4946
- var ps = kt.fromClass(class {
4946
+ var ps = Ot.fromClass(class {
4947
4947
  decorations;
4948
4948
  constructor(e) {
4949
4949
  this.decorations = fs(e);
@@ -5053,8 +5053,8 @@ function xs(e, t) {
5053
5053
  }
5054
5054
  return null;
5055
5055
  }
5056
- var Ss = Et.transactionFilter.of((e) => {
5057
- let t = e.annotation(Ct.userEvent);
5056
+ var Ss = bt.transactionFilter.of((e) => {
5057
+ let t = e.annotation(wt.userEvent);
5058
5058
  if (!t) return e;
5059
5059
  let n = e.startState.selection.main;
5060
5060
  if (!n.empty) return e;
@@ -5236,11 +5236,11 @@ function Os(e, t) {
5236
5236
  };
5237
5237
  }
5238
5238
  function ks(e, t = {}) {
5239
- return kt.fromClass(Os(e, t));
5239
+ return Ot.fromClass(Os(e, t));
5240
5240
  }
5241
5241
  //#endregion
5242
5242
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5243
- var As = yt.baseTheme({
5243
+ var As = St.baseTheme({
5244
5244
  ".cm-resource-widget": {
5245
5245
  background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
5246
5246
  borderRadius: "4px",
@@ -5273,10 +5273,10 @@ function Fs(e) {
5273
5273
  let { language: t, store: n, onAddFiles: i } = e, a = () => Ps(n);
5274
5274
  return [
5275
5275
  t.data.of({ autocomplete: cs(async () => a(), (e) => e.type === js ? Ns : So(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
5276
- xt.high(Tt.of([{
5276
+ xt.high(kt.of([{
5277
5277
  key: "Tab",
5278
5278
  preventDefault: !0,
5279
- run: (e) => Mt(e)
5279
+ run: (e) => jt(e)
5280
5280
  }])),
5281
5281
  _o.of({ addAttachment: (e) => i?.([e]) }),
5282
5282
  ...i ? [t.data.of({ autocomplete: Co().createCompletionSource() })] : [],
@@ -5303,14 +5303,14 @@ function Is(e) {
5303
5303
  let t = document.createElement("div");
5304
5304
  return t.textContent = e, { dom: t };
5305
5305
  }
5306
- _e("marimo:ai-language", "python", ge);
5307
- var Ls = "marimo:ai-prompt-history", Rs = new De(rt(Ze()), () => []), zs = (e) => {
5308
- let t = (0, M.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = _t(), { theme: _ } = vt(), v;
5306
+ _e("marimo:ai-language", "python", he);
5307
+ var Ls = "marimo:ai-prompt-history", Rs = new Ee(Je(Ze()), () => []), zs = (e) => {
5308
+ let t = (0, N.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = gt(), { theme: _ } = _t(), v;
5309
5309
  t[0] === f ? v = t[1] : (v = (e) => f ? wo([f.triggerCompletionRegex], f.completions)(e) : null, t[0] = f, t[1] = v);
5310
- let y = gt(v), b, x, S, C;
5310
+ let y = ht(v), b, x, S, C;
5311
5311
  if (t[2] !== y || t[3] !== d || t[4] !== g) {
5312
- let e = Ft();
5313
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Pt({}), t[9] = b) : b = t[9], x = e, S = Fs({
5312
+ let e = Pt();
5313
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Nt({}), t[9] = b) : b = t[9], x = e, S = Fs({
5314
5314
  language: e.language,
5315
5315
  store: g,
5316
5316
  onAddFiles: d
@@ -5322,9 +5322,9 @@ var Ls = "marimo:ai-prompt-history", Rs = new De(rt(Ze()), () => []), zs = (e) =
5322
5322
  save: Vs
5323
5323
  } }), t[10] = w) : w = t[10];
5324
5324
  let T;
5325
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = It(), t[11] = T) : T = t[11];
5325
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = Ft(), t[11] = T) : T = t[11];
5326
5326
  let E;
5327
- t[12] === m ? E = t[13] : (E = xt.highest(Tt.of([{
5327
+ t[12] === m ? E = t[13] : (E = xt.highest(kt.of([{
5328
5328
  preventDefault: !0,
5329
5329
  stopPropagation: !0,
5330
5330
  any: (e, t) => {
@@ -5348,7 +5348,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new De(rt(Ze()), () => []), zs = (e) =
5348
5348
  }
5349
5349
  }])), t[12] = m, t[13] = E);
5350
5350
  let D;
5351
- t[14] === h ? D = t[15] : (D = Tt.of([{
5351
+ t[14] === h ? D = t[15] : (D = kt.of([{
5352
5352
  key: "Escape",
5353
5353
  preventDefault: !0,
5354
5354
  stopPropagation: !0,
@@ -5361,15 +5361,15 @@ var Ls = "marimo:ai-prompt-history", Rs = new De(rt(Ze()), () => []), zs = (e) =
5361
5361
  S,
5362
5362
  C,
5363
5363
  w,
5364
- yt.lineWrapping,
5364
+ St.lineWrapping,
5365
5365
  T,
5366
5366
  E,
5367
5367
  D
5368
5368
  ], t[16] = b, t[17] = x, t[18] = S, t[19] = C, t[20] = E, t[21] = D, t[22] = O) : O = t[22];
5369
5369
  let k = O, A;
5370
5370
  t[23] === o ? A = t[24] : (A = i("flex-1 font-sans overflow-auto my-1", o), t[23] = o, t[24] = A);
5371
- let ee = _ === "dark" ? "dark" : "light", te = r || "Generate with AI, @ to include context", ne;
5372
- return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== te || t[33] !== n ? (ne = /* @__PURE__ */ (0, q.jsx)(Lt, {
5371
+ let ee = _ === "dark" ? "dark" : "light", j = r || "Generate with AI, @ to include context", te;
5372
+ return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== j || t[33] !== n ? (te = /* @__PURE__ */ (0, J.jsx)(It, {
5373
5373
  ref: a,
5374
5374
  className: A,
5375
5375
  width: "100%",
@@ -5380,8 +5380,8 @@ var Ls = "marimo:ai-prompt-history", Rs = new De(rt(Ze()), () => []), zs = (e) =
5380
5380
  onChange: s,
5381
5381
  onKeyDown: l,
5382
5382
  theme: ee,
5383
- placeholder: te
5384
- }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = te, t[33] = n, t[34] = ne) : ne = t[34], ne;
5383
+ placeholder: j
5384
+ }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = j, t[33] = n, t[34] = te) : te = t[34], te;
5385
5385
  };
5386
5386
  function Bs() {
5387
5387
  return Rs.get(Ls);
@@ -5391,11 +5391,11 @@ function Vs(e) {
5391
5391
  }
5392
5392
  //#endregion
5393
5393
  //#region src/plugins/impl/chat/chat-ui.tsx
5394
- var Hs = f, Us = $e({
5395
- type: Ye("stream_chunk"),
5394
+ var Hs = g, Us = tt({
5395
+ type: st("stream_chunk"),
5396
5396
  message_id: Ze(),
5397
- content: ut().nullable().transform((e) => e),
5398
- is_final: Je().optional()
5397
+ content: nt().nullable().transform((e) => e),
5398
+ is_final: ct().optional()
5399
5399
  });
5400
5400
  function Ws(e, t) {
5401
5401
  let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
@@ -5407,17 +5407,17 @@ function Ws(e, t) {
5407
5407
  }), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), n.current = null, i.current = null, "closed") : "enqueued");
5408
5408
  }
5409
5409
  var Gs = (e) => {
5410
- let [t, o] = (0, K.useState)(""), [s, c] = (0, K.useState)(e.config), [u, d] = (0, K.useState)(e.config), [f, p] = (0, K.useState)(void 0), h = (0, K.useRef)(null), g = (0, K.useRef)(null), _ = (0, K.useRef)(null), v = (0, K.useRef)(null);
5410
+ let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), m = (0, q.useRef)(null), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null);
5411
5411
  Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
5412
- let y = (0, K.useRef)(s);
5413
- (0, K.useLayoutEffect)(() => {
5412
+ let y = (0, q.useRef)(s);
5413
+ (0, q.useLayoutEffect)(() => {
5414
5414
  y.current = s;
5415
5415
  }, [s]);
5416
- let b = (0, K.useRef)(null), x = (0, K.useRef)(null), S = (0, K.useRef)(null), [C, w] = (0, K.useState)(null), T = () => {
5416
+ let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
5417
5417
  S.current = null, w(null);
5418
- }, { data: D } = Rt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: te, stop: ne, error: j, regenerate: ie, clearError: ae, addToolApprovalResponse: oe } = eo({
5418
+ }, { data: E } = Lt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : E, { messages: k, sendMessage: A, setMessages: ee, status: j, stop: te, error: M, regenerate: re, clearError: ie, addToolApprovalResponse: ae } = eo({
5419
5419
  sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
5420
- transport: new Pa({ fetch: async (t, n) => {
5420
+ transport: new Na({ fetch: async (t, n) => {
5421
5421
  if (n === void 0) return fetch(t);
5422
5422
  let i = JSON.parse(n.body), a = n.signal, o = {
5423
5423
  max_tokens: y.current.max_tokens,
@@ -5460,7 +5460,7 @@ var Gs = (e) => {
5460
5460
  config: o
5461
5461
  }).catch((e) => {
5462
5462
  b.current?.error(e), b.current = null, x.current = null;
5463
- }), ha({ stream: s });
5463
+ }), ma({ stream: s });
5464
5464
  } catch (e) {
5465
5465
  if (e instanceof Error && e.name === "AbortError") return new Response("Aborted", { status: 499 });
5466
5466
  let t = e.message?.split("failed with exception ").pop();
@@ -5469,7 +5469,7 @@ var Gs = (e) => {
5469
5469
  } }),
5470
5470
  messages: O,
5471
5471
  onFinish: ({ messages: t, isAbort: n, finishReason: i }) => {
5472
- if (p(void 0), h.current && (h.current.value = ""), r.debug("Finished streaming message:", {
5472
+ if (p(void 0), m.current && (m.current.value = ""), r.debug("Finished streaming message:", {
5473
5473
  finishReason: i,
5474
5474
  isAbort: n
5475
5475
  }), n) {
@@ -5491,7 +5491,7 @@ var Gs = (e) => {
5491
5491
  r.error("An error occurred:", e);
5492
5492
  }
5493
5493
  });
5494
- n(e.host, He.TYPE, (e) => {
5494
+ n(e.host, Ve.TYPE, (e) => {
5495
5495
  let t = Us.safeParse(e.detail.message);
5496
5496
  if (t.success) {
5497
5497
  if (t.data.content && t.data.message_id === x.current) {
@@ -5504,28 +5504,28 @@ var Gs = (e) => {
5504
5504
  });
5505
5505
  }
5506
5506
  });
5507
- let se = te === "submitted" || te === "streaming", ce = (t) => {
5507
+ let oe = j === "submitted" || j === "streaming", se = (t) => {
5508
5508
  let n = k.findIndex((e) => e.id === t);
5509
5509
  if (n !== -1) {
5510
5510
  let r = k.filter((e) => e.id !== t);
5511
5511
  e.delete_chat_message({ index: n }), ee(r), e.setValue(r), r.length === 0 && T();
5512
5512
  }
5513
- }, le = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, de = {
5513
+ }, ce = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, le = {
5514
5514
  triggerCompletionRegex: /^\/(\w+)?/,
5515
5515
  completions: e.prompts.map((e) => ({
5516
5516
  label: `/${e}`,
5517
5517
  displayLabel: e,
5518
5518
  apply: e
5519
5519
  }))
5520
- }, fe = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5521
- (0, K.useEffect)(() => {
5522
- v.current?.scrollTo({
5523
- top: v.current.scrollHeight,
5520
+ }, de = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5521
+ (0, q.useEffect)(() => {
5522
+ _.current?.scrollTo({
5523
+ top: _.current.scrollHeight,
5524
5524
  behavior: "smooth"
5525
5525
  });
5526
- }, [k.length, v]);
5527
- let pe = () => {
5528
- let e = _.current?.view;
5526
+ }, [k.length, _]);
5527
+ let fe = () => {
5528
+ let e = g.current?.view;
5529
5529
  if (e) {
5530
5530
  let t = e.state.doc.length;
5531
5531
  e.dispatch({ changes: {
@@ -5536,36 +5536,36 @@ var Gs = (e) => {
5536
5536
  }
5537
5537
  o("");
5538
5538
  };
5539
- return /* @__PURE__ */ (0, q.jsxs)("div", {
5539
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
5540
5540
  className: "flex flex-col h-full bg-(--slate-1) rounded-lg shadow border border-(--slate-6) overflow-hidden relative",
5541
5541
  style: { maxHeight: e.maxHeight },
5542
5542
  children: [
5543
- /* @__PURE__ */ (0, q.jsx)("div", {
5543
+ /* @__PURE__ */ (0, J.jsx)("div", {
5544
5544
  className: "absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg",
5545
- children: /* @__PURE__ */ (0, q.jsx)(a, {
5545
+ children: /* @__PURE__ */ (0, J.jsx)(a, {
5546
5546
  "aria-label": "Reset chat",
5547
5547
  variant: "text",
5548
5548
  size: "icon",
5549
5549
  disabled: k.length === 0,
5550
5550
  onClick: () => {
5551
- ee([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
5551
+ ee([]), e.setValue([]), e.delete_chat_history({}), ie(), T();
5552
5552
  },
5553
- children: /* @__PURE__ */ (0, q.jsx)(Wt, { className: "h-3 w-3" })
5553
+ children: /* @__PURE__ */ (0, J.jsx)(Ut, { className: "h-3 w-3" })
5554
5554
  })
5555
5555
  }),
5556
- /* @__PURE__ */ (0, q.jsxs)("div", {
5556
+ /* @__PURE__ */ (0, J.jsxs)("div", {
5557
5557
  className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
5558
- ref: v,
5558
+ ref: _,
5559
5559
  children: [
5560
- k.length === 0 && /* @__PURE__ */ (0, q.jsxs)("div", {
5560
+ k.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
5561
5561
  className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
5562
5562
  children: [
5563
- /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-12 w-12 mb-4" }),
5564
- /* @__PURE__ */ (0, q.jsx)("h3", {
5563
+ /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-12 w-12 mb-4" }),
5564
+ /* @__PURE__ */ (0, J.jsx)("h3", {
5565
5565
  className: "text-lg font-semibold mb-2",
5566
5566
  children: "No messages yet"
5567
5567
  }),
5568
- /* @__PURE__ */ (0, q.jsx)("p", {
5568
+ /* @__PURE__ */ (0, J.jsx)("p", {
5569
5569
  className: "text-sm",
5570
5570
  children: "Start a conversation by typing a message below."
5571
5571
  })
@@ -5573,56 +5573,56 @@ var Gs = (e) => {
5573
5573
  }),
5574
5574
  k.map((e, t) => {
5575
5575
  let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t === k.length - 1;
5576
- return /* @__PURE__ */ (0, q.jsxs)("div", {
5576
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
5577
5577
  className: i("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
5578
- children: [/* @__PURE__ */ (0, q.jsx)("div", {
5578
+ children: [/* @__PURE__ */ (0, J.jsx)("div", {
5579
5579
  className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12)"}`,
5580
5580
  children: qo({
5581
5581
  message: e,
5582
- isStreamingReasoning: te === "streaming",
5582
+ isStreamingReasoning: j === "streaming",
5583
5583
  isLast: r,
5584
- isActive: se,
5585
- addToolApprovalResponse: r ? oe : void 0
5584
+ isActive: oe,
5585
+ addToolApprovalResponse: r ? ae : void 0
5586
5586
  })
5587
- }), /* @__PURE__ */ (0, q.jsxs)("div", {
5587
+ }), /* @__PURE__ */ (0, J.jsxs)("div", {
5588
5588
  className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
5589
- children: [/* @__PURE__ */ (0, q.jsx)(l, {
5589
+ children: [/* @__PURE__ */ (0, J.jsx)(l, {
5590
5590
  value: n,
5591
5591
  className: "h-3 w-3",
5592
5592
  buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
5593
- }), /* @__PURE__ */ (0, q.jsx)("button", {
5593
+ }), /* @__PURE__ */ (0, J.jsx)("button", {
5594
5594
  type: "button",
5595
5595
  "aria-label": "Delete message",
5596
- onClick: () => ce(e.id),
5596
+ onClick: () => se(e.id),
5597
5597
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5598
- children: /* @__PURE__ */ (0, q.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5598
+ children: /* @__PURE__ */ (0, J.jsx)(v, { className: "h-3 w-3 text-(--red-9)" })
5599
5599
  })]
5600
5600
  })]
5601
5601
  }, e.id);
5602
5602
  }),
5603
- se && /* @__PURE__ */ (0, q.jsx)("div", {
5603
+ oe && /* @__PURE__ */ (0, J.jsx)("div", {
5604
5604
  className: "flex items-center justify-center mb-4",
5605
- children: /* @__PURE__ */ (0, q.jsx)(E, { size: "small" })
5605
+ children: /* @__PURE__ */ (0, J.jsx)(D, { size: "small" })
5606
5606
  }),
5607
- j && /* @__PURE__ */ (0, q.jsxs)("div", {
5607
+ M && /* @__PURE__ */ (0, J.jsxs)("div", {
5608
5608
  className: "flex items-center justify-center space-x-2 mb-4",
5609
- children: [/* @__PURE__ */ (0, q.jsx)(pt, { error: j }), /* @__PURE__ */ (0, q.jsx)(a, {
5609
+ children: [/* @__PURE__ */ (0, J.jsx)(ft, { error: M }), /* @__PURE__ */ (0, J.jsx)(a, {
5610
5610
  variant: "outline",
5611
5611
  size: "sm",
5612
- onClick: () => ie(),
5612
+ onClick: () => re(),
5613
5613
  children: "Retry"
5614
5614
  })]
5615
5615
  }),
5616
- C && !se && !j && /* @__PURE__ */ (0, q.jsx)("div", {
5616
+ C && !oe && !M && /* @__PURE__ */ (0, J.jsx)("div", {
5617
5617
  className: "flex justify-center py-2",
5618
- children: /* @__PURE__ */ (0, q.jsx)("span", {
5618
+ children: /* @__PURE__ */ (0, J.jsx)("span", {
5619
5619
  className: "text-xs text-muted-foreground",
5620
5620
  children: C
5621
5621
  })
5622
5622
  })
5623
5623
  ]
5624
5624
  }),
5625
- /* @__PURE__ */ (0, q.jsxs)("form", {
5625
+ /* @__PURE__ */ (0, J.jsxs)("form", {
5626
5626
  onSubmit: async (n) => {
5627
5627
  if (n.preventDefault(), e.disabled) return;
5628
5628
  let r = f ? await To(f) : void 0;
@@ -5632,66 +5632,66 @@ var Gs = (e) => {
5632
5632
  type: "text",
5633
5633
  text: t
5634
5634
  }, ...r ?? []]
5635
- }), pe();
5635
+ }), fe();
5636
5636
  },
5637
- ref: g,
5637
+ ref: h,
5638
5638
  inert: e.disabled || void 0,
5639
5639
  className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
5640
5640
  children: [
5641
- e.showConfigurationControls && /* @__PURE__ */ (0, q.jsx)(qs, {
5641
+ e.showConfigurationControls && /* @__PURE__ */ (0, J.jsx)(qs, {
5642
5642
  config: s,
5643
5643
  onChange: c
5644
5644
  }),
5645
- e.prompts.length > 0 && /* @__PURE__ */ (0, q.jsx)(Js, {
5645
+ e.prompts.length > 0 && /* @__PURE__ */ (0, J.jsx)(Js, {
5646
5646
  prompts: e.prompts,
5647
5647
  onSelect: (e) => {
5648
5648
  o(e), requestAnimationFrame(() => {
5649
- let e = _.current?.view;
5649
+ let e = g.current?.view;
5650
5650
  e?.focus(), ve(e);
5651
5651
  });
5652
5652
  }
5653
5653
  }),
5654
- /* @__PURE__ */ (0, q.jsx)(zs, {
5654
+ /* @__PURE__ */ (0, J.jsx)(zs, {
5655
5655
  className: "rounded-sm mr-2",
5656
- placeholder: fe,
5656
+ placeholder: de,
5657
5657
  value: t,
5658
- inputRef: _,
5658
+ inputRef: g,
5659
5659
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
5660
5660
  onChange: o,
5661
5661
  onSubmit: (e, t) => {
5662
- t.trim() && g.current?.requestSubmit();
5662
+ t.trim() && h.current?.requestSubmit();
5663
5663
  },
5664
5664
  onClose: () => {},
5665
- additionalCompletions: de
5665
+ additionalCompletions: le
5666
5666
  }),
5667
- f && f.length === 1 && /* @__PURE__ */ (0, q.jsx)("span", {
5667
+ f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
5668
5668
  title: f[0].name,
5669
5669
  className: "text-sm text-(--slate-11) truncate shrink-0 w-fit max-w-24",
5670
5670
  children: f[0].name
5671
5671
  }),
5672
- f && f.length > 1 && /* @__PURE__ */ (0, q.jsxs)("span", {
5672
+ f && f.length > 1 && /* @__PURE__ */ (0, J.jsxs)("span", {
5673
5673
  title: [...f].map((e) => e.name).join("\n"),
5674
5674
  className: "text-sm text-(--slate-11) truncate shrink-0",
5675
5675
  children: [f.length, " files"]
5676
5676
  }),
5677
- f && f.length > 0 && /* @__PURE__ */ (0, q.jsx)(a, {
5677
+ f && f.length > 0 && /* @__PURE__ */ (0, J.jsx)(a, {
5678
5678
  type: "button",
5679
5679
  variant: "text",
5680
5680
  size: "sm",
5681
5681
  onClick: () => {
5682
- p(void 0), h.current && (h.current.value = "");
5682
+ p(void 0), m.current && (m.current.value = "");
5683
5683
  },
5684
- children: /* @__PURE__ */ (0, q.jsx)(Oe, { className: "size-3" })
5684
+ children: /* @__PURE__ */ (0, J.jsx)(De, { className: "size-3" })
5685
5685
  }),
5686
- le && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(a, {
5686
+ ce && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
5687
5687
  type: "button",
5688
5688
  variant: "text",
5689
5689
  size: "sm",
5690
- onClick: () => h.current?.click(),
5691
- children: /* @__PURE__ */ (0, q.jsx)(Ut, { className: "h-4" })
5692
- }), /* @__PURE__ */ (0, q.jsx)("input", {
5690
+ onClick: () => m.current?.click(),
5691
+ children: /* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-4" })
5692
+ }), /* @__PURE__ */ (0, J.jsx)("input", {
5693
5693
  type: "file",
5694
- ref: h,
5694
+ ref: m,
5695
5695
  className: "hidden",
5696
5696
  multiple: !0,
5697
5697
  accept: Array.isArray(e.allowAttachments) ? e.allowAttachments.join(",") : void 0,
@@ -5699,24 +5699,24 @@ var Gs = (e) => {
5699
5699
  e.target.files && p([...e.target.files]);
5700
5700
  }
5701
5701
  })] }),
5702
- se ? /* @__PURE__ */ (0, q.jsx)(re, {
5702
+ oe ? /* @__PURE__ */ (0, J.jsx)(ne, {
5703
5703
  content: "Stop generating",
5704
- children: /* @__PURE__ */ (0, q.jsx)(a, {
5704
+ children: /* @__PURE__ */ (0, J.jsx)(a, {
5705
5705
  type: "button",
5706
5706
  variant: "link",
5707
5707
  size: "xs",
5708
- onClick: () => ne(),
5708
+ onClick: () => te(),
5709
5709
  className: "text-(--red-9) hover:text-(--red-11)",
5710
- children: /* @__PURE__ */ (0, q.jsx)(Be, { className: "h-4 w-4 fill-current" })
5710
+ children: /* @__PURE__ */ (0, J.jsx)(ze, { className: "h-4 w-4 fill-current" })
5711
5711
  })
5712
- }) : /* @__PURE__ */ (0, q.jsx)(a, {
5712
+ }) : /* @__PURE__ */ (0, J.jsx)(a, {
5713
5713
  type: "submit",
5714
5714
  disabled: !t,
5715
5715
  variant: "outline",
5716
5716
  size: "xs",
5717
5717
  className: "text-(--slate-11)",
5718
5718
  "aria-label": "Send message",
5719
- children: /* @__PURE__ */ (0, q.jsx)(Gt, { className: "h-4 w-4" })
5719
+ children: /* @__PURE__ */ (0, J.jsx)(Wt, { className: "h-4 w-4" })
5720
5720
  })
5721
5721
  ]
5722
5722
  })
@@ -5756,7 +5756,7 @@ var Gs = (e) => {
5756
5756
  description: "Penalizes new tokens (-2: favor, 2: avoid)"
5757
5757
  }
5758
5758
  }, qs = (e) => {
5759
- let t = (0, M.c)(16), { config: n, onChange: r } = e, [i, o] = (0, K.useState)(!1), s;
5759
+ let t = (0, N.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
5760
5760
  t[0] !== n || t[1] !== r ? (s = (e, t) => {
5761
5761
  let i = t === null || Number.isNaN(t) ? null : t;
5762
5762
  if (i !== null) {
@@ -5773,44 +5773,44 @@ var Gs = (e) => {
5773
5773
  t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (e) => {
5774
5774
  e.key === "Enter" && (e.preventDefault(), o(!1));
5775
5775
  }, t[3] = l) : l = t[3];
5776
- let u = l, f;
5777
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(re, {
5776
+ let f = l, p;
5777
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)(ne, {
5778
5778
  content: "Configuration",
5779
- children: /* @__PURE__ */ (0, q.jsx)(d, {
5779
+ children: /* @__PURE__ */ (0, J.jsx)(h, {
5780
5780
  asChild: !0,
5781
- children: /* @__PURE__ */ (0, q.jsx)(a, {
5781
+ children: /* @__PURE__ */ (0, J.jsx)(a, {
5782
5782
  variant: "outline",
5783
5783
  size: "sm",
5784
5784
  className: "border-none shadow-none hover:bg-transparent",
5785
- children: /* @__PURE__ */ (0, q.jsx)(Kt, { className: "h-3 w-3" })
5785
+ children: /* @__PURE__ */ (0, J.jsx)(Gt, { className: "h-3 w-3" })
5786
5786
  })
5787
5787
  })
5788
- }), t[4] = f) : f = t[4];
5788
+ }), t[4] = p) : p = t[4];
5789
5789
  let m;
5790
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, q.jsx)("h4", {
5790
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, J.jsx)("h4", {
5791
5791
  className: "font-bold leading-none",
5792
5792
  children: "Configuration"
5793
5793
  }), t[5] = m) : m = t[5];
5794
- let h;
5794
+ let g;
5795
5795
  if (t[6] !== n || t[7] !== c) {
5796
5796
  let e;
5797
5797
  t[9] === c ? e = t[10] : (e = (e) => {
5798
5798
  let [t, n] = e;
5799
- return /* @__PURE__ */ (0, q.jsxs)("div", {
5799
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
5800
5800
  className: "grid grid-cols-3 items-center gap-1",
5801
- children: [/* @__PURE__ */ (0, q.jsxs)(mt, {
5801
+ children: [/* @__PURE__ */ (0, J.jsxs)(pt, {
5802
5802
  htmlFor: t,
5803
5803
  className: "flex w-full justify-between col-span-3 align-end",
5804
- children: [je.startCase(t), /* @__PURE__ */ (0, q.jsx)(re, {
5804
+ children: [Ae.startCase(t), /* @__PURE__ */ (0, J.jsx)(ne, {
5805
5805
  delayDuration: 200,
5806
5806
  side: "top",
5807
- content: /* @__PURE__ */ (0, q.jsx)("div", {
5807
+ content: /* @__PURE__ */ (0, J.jsx)("div", {
5808
5808
  className: "text-xs flex flex-col",
5809
5809
  children: Ks[t].description
5810
5810
  }),
5811
- children: /* @__PURE__ */ (0, q.jsx)(Re, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5811
+ children: /* @__PURE__ */ (0, J.jsx)(Le, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5812
5812
  })]
5813
- }), /* @__PURE__ */ (0, q.jsx)(Me, {
5813
+ }), /* @__PURE__ */ (0, J.jsx)(je, {
5814
5814
  id: t,
5815
5815
  "aria-label": t,
5816
5816
  value: n ?? NaN,
@@ -5819,84 +5819,84 @@ var Gs = (e) => {
5819
5819
  maxValue: Ks[t].max,
5820
5820
  step: Ks[t].step ?? 1,
5821
5821
  onChange: (e) => c(t, e),
5822
- onKeyDown: u,
5822
+ onKeyDown: f,
5823
5823
  className: "col-span-3"
5824
5824
  })]
5825
5825
  }, t);
5826
- }, t[9] = c, t[10] = e), h = jt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5827
- } else h = t[8];
5828
- let g;
5829
- t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, q.jsx)(p, {
5826
+ }, t[9] = c, t[10] = e), g = vt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = g;
5827
+ } else g = t[8];
5828
+ let _;
5829
+ t[11] === g ? _ = t[12] : (_ = /* @__PURE__ */ (0, J.jsx)(d, {
5830
5830
  className: "w-70 border",
5831
- children: /* @__PURE__ */ (0, q.jsxs)("div", {
5831
+ children: /* @__PURE__ */ (0, J.jsxs)("div", {
5832
5832
  className: "grid gap-3",
5833
- children: [m, h]
5833
+ children: [m, g]
5834
5834
  })
5835
- }), t[11] = h, t[12] = g);
5836
- let _;
5837
- return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5835
+ }), t[11] = g, t[12] = _);
5836
+ let v;
5837
+ return t[13] !== i || t[14] !== _ ? (v = /* @__PURE__ */ (0, J.jsxs)(u, {
5838
5838
  open: i,
5839
5839
  onOpenChange: o,
5840
- children: [f, g]
5841
- }), t[13] = i, t[14] = g, t[15] = _) : _ = t[15], _;
5840
+ children: [p, _]
5841
+ }), t[13] = i, t[14] = _, t[15] = v) : v = t[15], v;
5842
5842
  }, Js = (e) => {
5843
- let t = (0, M.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, K.useState)(!1), [s, c] = (0, K.useState)(""), l;
5843
+ let t = (0, N.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
5844
5844
  t[0] === r ? l = t[1] : (l = (e) => {
5845
5845
  [...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
5846
5846
  }, t[0] = r, t[1] = l);
5847
- let u = l, d;
5848
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, q.jsx)(re, {
5847
+ let f = l, p;
5848
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)(ne, {
5849
5849
  content: "Select a prompt",
5850
- children: /* @__PURE__ */ (0, q.jsx)(Ne, {
5850
+ children: /* @__PURE__ */ (0, J.jsx)(Me, {
5851
5851
  asChild: !0,
5852
- children: /* @__PURE__ */ (0, q.jsx)(a, {
5852
+ children: /* @__PURE__ */ (0, J.jsx)(a, {
5853
5853
  variant: "outline",
5854
5854
  size: "sm",
5855
5855
  className: "border-none shadow-none hover:bg-transparent",
5856
- children: /* @__PURE__ */ (0, q.jsx)(ee, { className: "h-3 w-3" })
5856
+ children: /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3" })
5857
5857
  })
5858
5858
  })
5859
- }), t[2] = d) : d = t[2];
5860
- let f;
5861
- if (t[3] !== u || t[4] !== n) {
5859
+ }), t[2] = p) : p = t[2];
5860
+ let h;
5861
+ if (t[3] !== f || t[4] !== n) {
5862
5862
  let e;
5863
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, q.jsx)(Fe, {
5864
- onSelect: () => u(e),
5863
+ t[6] === f ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(Pe, {
5864
+ onSelect: () => f(e),
5865
5865
  className: "whitespace-normal text-left",
5866
5866
  children: e
5867
- }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
5868
- } else f = t[5];
5869
- let m;
5870
- t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, q.jsx)(Hs, { children: /* @__PURE__ */ (0, q.jsxs)(Le, { children: [d, /* @__PURE__ */ (0, q.jsx)(Ie, {
5867
+ }, t), t[6] = f, t[7] = e), h = n.map(e), t[3] = f, t[4] = n, t[5] = h;
5868
+ } else h = t[5];
5869
+ let g;
5870
+ t[8] === h ? g = t[9] : (g = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Ie, { children: [p, /* @__PURE__ */ (0, J.jsx)(Fe, {
5871
5871
  side: "right",
5872
5872
  align: "end",
5873
5873
  onCloseAutoFocus: Xs,
5874
5874
  className: "w-64 max-h-96 overflow-y-auto",
5875
- children: f
5876
- })] }) }), t[8] = f, t[9] = m);
5877
- let h;
5878
- t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
5879
- let g;
5880
- t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, q.jsx)(p, {
5875
+ children: h
5876
+ })] }) }), t[8] = h, t[9] = g);
5877
+ let _;
5878
+ t[10] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => o(!1), t[10] = _) : _ = t[10];
5879
+ let v;
5880
+ t[11] !== r || t[12] !== s ? (v = /* @__PURE__ */ (0, J.jsx)(d, {
5881
5881
  side: "right",
5882
5882
  align: "end",
5883
5883
  className: "min-w-80 px-2",
5884
- children: /* @__PURE__ */ (0, q.jsx)(Ys, {
5884
+ children: /* @__PURE__ */ (0, J.jsx)(Ys, {
5885
5885
  prompt: s,
5886
- onClose: h,
5886
+ onClose: _,
5887
5887
  onSelect: r
5888
5888
  }, s)
5889
- }), t[11] = r, t[12] = s, t[13] = g) : g = t[13];
5890
- let _;
5891
- return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5889
+ }), t[11] = r, t[12] = s, t[13] = v) : v = t[13];
5890
+ let y;
5891
+ return t[14] !== i || t[15] !== g || t[16] !== v ? (y = /* @__PURE__ */ (0, J.jsxs)(u, {
5892
5892
  open: i,
5893
5893
  onOpenChange: o,
5894
- children: [m, g]
5895
- }), t[14] = i, t[15] = m, t[16] = g, t[17] = _) : _ = t[17], _;
5894
+ children: [g, v]
5895
+ }), t[14] = i, t[15] = g, t[16] = v, t[17] = y) : y = t[17], y;
5896
5896
  }, Ys = (e) => {
5897
- let t = (0, M.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
5897
+ let t = (0, N.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
5898
5898
  t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {}), t[0] = n, t[1] = o);
5899
- let [s, c] = (0, K.useState)(o), l;
5899
+ let [s, c] = (0, q.useState)(o), l;
5900
5900
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
5901
5901
  c((n) => ({
5902
5902
  ...n,
@@ -5921,13 +5921,13 @@ var Gs = (e) => {
5921
5921
  let v;
5922
5922
  t[17] !== g || t[18] !== m || t[19] !== _ ? (v = _.map((e, t) => {
5923
5923
  let [n, r] = e;
5924
- return /* @__PURE__ */ (0, q.jsxs)("div", {
5924
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
5925
5925
  className: "grid grid-cols-4 items-center gap-2",
5926
- children: [/* @__PURE__ */ (0, q.jsx)(mt, {
5926
+ children: [/* @__PURE__ */ (0, J.jsx)(pt, {
5927
5927
  htmlFor: n,
5928
5928
  className: "font-semibold text-base",
5929
5929
  children: n
5930
- }), /* @__PURE__ */ (0, q.jsx)(Pe, {
5930
+ }), /* @__PURE__ */ (0, J.jsx)(Ne, {
5931
5931
  id: n,
5932
5932
  value: r,
5933
5933
  onChange: (e) => u(n, e.target.value),
@@ -5942,22 +5942,22 @@ var Gs = (e) => {
5942
5942
  }, n);
5943
5943
  }), t[17] = g, t[18] = m, t[19] = _, t[20] = v) : v = t[20];
5944
5944
  let y;
5945
- t[21] === f ? y = t[22] : (y = /* @__PURE__ */ (0, q.jsx)("div", {
5945
+ t[21] === f ? y = t[22] : (y = /* @__PURE__ */ (0, J.jsx)("div", {
5946
5946
  className: "grid gap-2 prose dark:prose-invert",
5947
- children: /* @__PURE__ */ (0, q.jsx)("blockquote", {
5947
+ children: /* @__PURE__ */ (0, J.jsx)("blockquote", {
5948
5948
  className: "text-sm",
5949
5949
  children: f
5950
5950
  })
5951
5951
  }), t[21] = f, t[22] = y);
5952
5952
  let b;
5953
- t[23] !== g || t[24] !== m ? (b = /* @__PURE__ */ (0, q.jsx)(a, {
5953
+ t[23] !== g || t[24] !== m ? (b = /* @__PURE__ */ (0, J.jsx)(a, {
5954
5954
  onClick: g,
5955
5955
  size: "xs",
5956
5956
  disabled: m,
5957
5957
  children: "Submit"
5958
5958
  }), t[23] = g, t[24] = m, t[25] = b) : b = t[25];
5959
5959
  let x;
5960
- return t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ (0, q.jsxs)("div", {
5960
+ return t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ (0, J.jsxs)("div", {
5961
5961
  className: "grid gap-4",
5962
5962
  children: [
5963
5963
  v,