@marimo-team/islands 0.25.3-dev18 → 0.25.3-dev181

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 (618) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CNMliVzw.js → ConnectedDataExplorerComponent-Le_OBfmt.js} +21 -19
  2. package/dist/{ErrorBoundary-DP07HKNC.js → ErrorBoundary-Do1bDnqE.js} +19 -19
  3. package/dist/{abnfDiagram-VCTEODGH-D-Ez91gV.js → abnfDiagram-VCTEODGH-Tf1ghyQQ.js} +2 -2
  4. package/dist/any-language-editor-BVFHDDQ3.js +75 -0
  5. package/dist/{architectureDiagram-5GKGNRK7-CTpcNtO8.js → architectureDiagram-5GKGNRK7-xlnbTG0T.js} +1 -1
  6. package/dist/{arrays-CN1djC4k.js → arrays-R6JsImiT.js} +8 -0
  7. package/dist/assets/__vite-browser-external-DVeFf2e7.js +1 -0
  8. package/dist/assets/worker-C1pfNBsx.js +113 -0
  9. package/dist/{button-CvjkwdSk.js → button-BQRdqQi1.js} +199 -192
  10. package/dist/{capabilities-CQ5IjhzL.js → capabilities-CI4xUPsp.js} +2 -2
  11. package/dist/{chat-ui-DaHynk8g.js → chat-ui-X-cWrL9u.js} +541 -540
  12. package/dist/{check-EDwSwP89.js → check-C9Mp9eCK.js} +1 -1
  13. package/dist/{chunk-IMKFNOWR-DGxi-zeo.js → chunk-IMKFNOWR-Cmd4a5jy.js} +1 -1
  14. package/dist/{chunk-SHT3W25Y-CV9J3rAB.js → chunk-SHT3W25Y-mSNp-WpO.js} +1 -1
  15. package/dist/{chunk-SVP7TREG-BL-9Fqgg.js → chunk-SVP7TREG-CWC49D8X.js} +1 -1
  16. package/dist/{chunk-TICWLB2K-Cu_XMjDM.js → chunk-TICWLB2K-De9FINtG.js} +1 -1
  17. package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
  18. package/dist/{classDiagram-ZZMXUADV-BXXV13Hq.js → classDiagram-ZZMXUADV-DweTkYdp.js} +2 -2
  19. package/dist/{classDiagram-v2-VYDZK3BY-B7FXJ1Cp.js → classDiagram-v2-VYDZK3BY-A6MR2TiE.js} +2 -2
  20. package/dist/{code-visibility-hTy956cB.js → code-visibility-CjilY2pq.js} +25 -25
  21. package/dist/{common-CiockEHa.js → common-CgbJYN1L.js} +6994 -6819
  22. package/dist/{copy-icon-Ft7t9bqz.js → copy-icon-De584pZ4.js} +3 -3
  23. package/dist/{cynefinDiagram-5FMLGOSQ-CH96rwba.js → cynefinDiagram-5FMLGOSQ-BSvo5le-.js} +1 -1
  24. package/dist/{dagre-GXQ25YYZ-BD3PmpFY.js → dagre-GXQ25YYZ-tXRQslO6.js} +1 -1
  25. package/dist/{data-grid-overlay-editor-XsGuhhu5.js → data-grid-overlay-editor-Bov1HRwt.js} +5 -5
  26. package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
  27. package/dist/{diagram-S7CK7UJ4-BsSJJldB.js → diagram-S7CK7UJ4-r3t5VtwI.js} +1 -1
  28. package/dist/{diagram-UQ7AKVKN-muQtNZc4.js → diagram-UQ7AKVKN-qgbC8YnT.js} +1 -1
  29. package/dist/{diagram-VX7I27RA-CdhuZAqR.js → diagram-VX7I27RA-CiHxEwtp.js} +1 -1
  30. package/dist/{diagram-Z3DM3KII-BD8mXjOj.js → diagram-Z3DM3KII-D95u15Ev.js} +1 -1
  31. package/dist/{dialog-CEBFZNyc.js → dialog-DVRfQuhD.js} +25 -25
  32. package/dist/{dist-F8Ep36rk.js → dist-B1M0bGO3.js} +1 -1
  33. package/dist/{dist-D6d86eNJ.js → dist-BA13RJj5.js} +1 -1
  34. package/dist/{dist-Bvs24R_E.js → dist-BJtmSgcE.js} +48 -48
  35. package/dist/{dist-CN_BeG2I.js → dist-Ba2VIn1K.js} +53 -53
  36. package/dist/{dist-PXYI_yuP.js → dist-Bj4bmwUm.js} +12 -12
  37. package/dist/{dist-DoE4XJBC.js → dist-BmS-ZGjl.js} +8626 -8626
  38. package/dist/{dist-BorMD-uX.js → dist-Bzogh7CW.js} +87 -87
  39. package/dist/{dist-CN8zI-XC.js → dist-CThPVKaP.js} +1385 -1382
  40. package/dist/{dist-DiDibOYr.js → dist-CTi5FTiV.js} +87 -87
  41. package/dist/{dist-diIx5qJW.js → dist-Ck_C32ye.js} +2 -2
  42. package/dist/{dist-BLfKmR-l.js → dist-D1fnFp1J.js} +1 -1
  43. package/dist/{dist-OR1OnN-y.js → dist-D3x9__Fu.js} +46 -46
  44. package/dist/{dist-BMQf5zIS.js → dist-D7mrh5sO.js} +36 -36
  45. package/dist/{dist-CSJ0MDRw.js → dist-D9Q3xjiP.js} +1 -1
  46. package/dist/{dist-BuaRHxOc.js → dist-DP60Ubh8.js} +2 -2
  47. package/dist/{dist-CSbh1PNP.js → dist-DTv9KkpW.js} +12 -12
  48. package/dist/{dist-D-wwqlzJ.js → dist-DVVwOfrD.js} +109 -109
  49. package/dist/{dist-C8fAKSH1.js → dist-DYXM73-k.js} +36 -36
  50. package/dist/{dist-DBtSl3sf.js → dist-DjeybPOb.js} +1 -1
  51. package/dist/{dist-CrSP_H1M.js → dist-DtGn9N4h.js} +197 -197
  52. package/dist/{dist-CLdpGQVr.js → dist-KN80qWCP.js} +2 -2
  53. package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
  54. package/dist/{dist-Cg7gzw-a.js → dist-O0qFpEJh.js} +56 -56
  55. package/dist/{dist-CkTTIdBe.js → dist-OUle2RT7.js} +207 -207
  56. package/dist/{dist-BK4Oj99o.js → dist-T5rh6JvL.js} +1 -1
  57. package/dist/{dropdown-menu-CP_qCYHC.js → dropdown-menu-DCMbbQ35.js} +1481 -1433
  58. package/dist/{ebnfDiagram-PWID7BFC-BIN1sweE.js → ebnfDiagram-PWID7BFC-P7e4bryK.js} +2 -2
  59. package/dist/{erDiagram-RLTQ6QDP-Ctp5cfoN.js → erDiagram-RLTQ6QDP-CUHZcmRj.js} +1 -1
  60. package/dist/{error-banner-D-WCIiMt.js → error-banner-DxJ3s8YO.js} +86 -86
  61. package/dist/{error-entries-Bv6bZPF3.js → error-entries-mpoD5t79.js} +4771 -4702
  62. package/dist/{esm-D2gTsXEV.js → esm-Bbw_Njjx.js} +575 -575
  63. package/dist/{esm-AMFssoNp.js → esm-mDQNEFe_.js} +354 -354
  64. package/dist/{feedback-button-CZNhgq7U.js → feedback-button-M3asLLYJ.js} +37 -37
  65. package/dist/{flowDiagram-HODETNUW-3EfLrlFb.js → flowDiagram-HODETNUW-BGZ95AzI.js} +2 -2
  66. package/dist/{formats-27CW_UP4.js → formats-DI7HEVv7.js} +3 -3
  67. package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
  68. package/dist/{glide-data-editor-DNPChdXf.js → glide-data-editor-BYx8nPvz.js} +370 -368
  69. package/dist/{glide-utils-DJyqh0EM.js → glide-utils-D98laidb.js} +16 -16
  70. package/dist/{globals-DcKi3Zmn.js → globals-Cha-b9Oo.js} +3 -3
  71. package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
  72. package/dist/{html-to-image-Bf8QMGi4.js → html-to-image-BoZthB4P.js} +668 -622
  73. package/dist/{infoDiagram-27XIBGKW-DipQoHxl.js → infoDiagram-27XIBGKW-BF0YX70D.js} +1 -1
  74. package/dist/{ishikawaDiagram-5VMMS53U-DgFMjSGz.js → ishikawaDiagram-5VMMS53U-_itsAAn-.js} +1 -1
  75. package/dist/{kanban-definition-UXKFOSKX-w1ACVjgl.js → kanban-definition-UXKFOSKX-VNW2Beqh.js} +1 -1
  76. package/dist/{label-BDKF3Afc.js → label-Qvw1E97W.js} +3 -3
  77. package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
  78. package/dist/{loader-BQOfjTIJ.js → loader-DOVB0Syl.js} +12 -12
  79. package/dist/main.js +9822 -7824
  80. package/dist/{mermaid-CHo49Yv-.js → mermaid-CZ6FrClS.js} +38 -38
  81. package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
  82. package/dist/{mindmap-definition-YA3MSWOX-CrT0KSfX.js → mindmap-definition-YA3MSWOX-DR4ripvd.js} +1 -1
  83. package/dist/{number-overlay-editor-GnpmNxbw.js → number-overlay-editor-9juAuy71.js} +3 -3
  84. package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
  85. package/dist/{once-BtE-wKRL.js → once-eG8Vmvjd.js} +1 -1
  86. package/dist/{pegDiagram-XKGWAZYB-BqvywNJA.js → pegDiagram-XKGWAZYB-CFr3XlGl.js} +2 -2
  87. package/dist/{pieDiagram-E7YTZNPT-BfxJ_XCc.js → pieDiagram-E7YTZNPT-j91XYSLY.js} +1 -1
  88. package/dist/precisionRound-DhAzeRcm.js +49 -0
  89. package/dist/{process-output-BZg56CCb.js → process-output-DLS4Mqg_.js} +4 -4
  90. package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
  91. package/dist/{railroadDiagram-O6MQD6OU-8vFLVTPu.js → railroadDiagram-O6MQD6OU-Cd47ZV9E.js} +2 -2
  92. package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
  93. package/dist/{requirementDiagram-BXWQKSXE-a_MxGvxe.js → requirementDiagram-BXWQKSXE-eJH6gLtX.js} +1 -1
  94. package/dist/{reveal-component-B1Wbl-hd.js → reveal-component-DPgpYGKs.js} +14 -14
  95. package/dist/{select-BButFi-d.js → select-2KOiReNY.js} +536 -457
  96. package/dist/{sequenceDiagram-WJ2MYXX4-CXFMnxGh.js → sequenceDiagram-WJ2MYXX4-DdfFEIrm.js} +1 -1
  97. package/dist/{spec-BwarBpUJ.js → spec-h69nC3SI.js} +41 -11
  98. package/dist/{stateDiagram-D77RDMKH-DQeA_CwI.js → stateDiagram-D77RDMKH-DkjDvip8.js} +2 -2
  99. package/dist/{stateDiagram-v2-MP3YSRHH-BxxQucm1.js → stateDiagram-v2-MP3YSRHH-DBHACnOo.js} +2 -2
  100. package/dist/style.css +1 -1
  101. package/dist/{swimlanes-42K2YHIH-Do6L-cYg.js → swimlanes-42K2YHIH-ogImlOmp.js} +1 -1
  102. package/dist/{swimlanesDiagram-VR7AAH4N-DUzPvSVU.js → swimlanesDiagram-VR7AAH4N-D6x-zsci.js} +2 -2
  103. package/dist/{swiper-component-DKntyn8p.js → swiper-component-BkCm-kLg.js} +2 -2
  104. package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
  105. package/dist/{timeline-definition-24CTP7MA-D3c46WM5.js → timeline-definition-24CTP7MA-DQpLtsHD.js} +1 -1
  106. package/dist/{toDate-UtiwmnH2.js → toDate-CDzoofJo.js} +37 -36
  107. package/dist/{toast-B9UMEi8u.js → toast-B5t9o6s_.js} +219 -201
  108. package/dist/{tooltip-BO1REbqs.js → tooltip-s4zZxwKe.js} +325 -301
  109. package/dist/{use-restore-focus-BEM7sFWl.js → use-restore-focus-BgDTd2tc.js} +1482 -1433
  110. package/dist/{useAsyncData-Deh5kszT.js → useAsyncData-Bn8SxUqM.js} +15 -14
  111. package/dist/{useDateFormatter-D8XruNGG.js → useDateFormatter-D3Tkfzej.js} +2 -2
  112. package/dist/{useDeepCompareMemoize-DXwzRINI.js → useDeepCompareMemoize-CC2tnPCk.js} +1 -1
  113. package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-CSdWn6NP.js} +1 -1
  114. package/dist/{useLifecycle-j7D9uD1o.js → useLifecycle-BJlxHqWa.js} +28 -25
  115. package/dist/{useTheme-CRnjkku0.js → useTheme-DMfQYmlG.js} +301 -297
  116. package/dist/{vega-component-BeF9dfyO.js → vega-component-CovWHi60.js} +148 -148
  117. package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
  118. package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
  119. package/dist/{vennDiagram-4TSXK5OY-BSZD8JcZ.js → vennDiagram-4TSXK5OY-BD-SL_vq.js} +1 -1
  120. package/dist/{wardleyDiagram-VM6X3IG4-48cUWkfA.js → wardleyDiagram-VM6X3IG4-BDgJV4ah.js} +1 -1
  121. package/dist/{xychartDiagram-S5SC5T6Z-CswYgYeu.js → xychartDiagram-S5SC5T6Z-1hIHN6Rl.js} +2 -2
  122. package/package.json +16 -16
  123. package/src/__mocks__/document.tsx +54 -0
  124. package/src/__mocks__/notebook.ts +2 -1
  125. package/src/__mocks__/requests.ts +0 -3
  126. package/src/__tests__/module-entry.test.ts +44 -0
  127. package/src/__tests__/mount.test.ts +1 -21
  128. package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +12 -11
  129. package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
  130. package/src/components/ai/ai-model-dropdown.tsx +11 -6
  131. package/src/components/app-config/ai-config.tsx +7 -2
  132. package/src/components/app-config/user-config-form.tsx +35 -0
  133. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  134. package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
  135. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  136. package/src/components/chat/acp/blocks.tsx +3 -2
  137. package/src/components/chat/acp/session-tabs.tsx +8 -3
  138. package/src/components/chat/chat-components.tsx +2 -0
  139. package/src/components/chat/chat-panel.tsx +12 -11
  140. package/src/components/chat/chat-utils.ts +4 -8
  141. package/src/components/data-table/TableBottomBar.tsx +4 -1
  142. package/src/components/data-table/TableTopBar.tsx +2 -0
  143. package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
  144. package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
  145. package/src/components/data-table/__tests__/columns.test.tsx +105 -0
  146. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  147. package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
  148. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  149. package/src/components/data-table/__tests__/export-actions.test.tsx +105 -0
  150. package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
  151. package/src/components/data-table/__tests__/pagination.test.tsx +28 -1
  152. package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
  153. package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
  154. package/src/components/data-table/cell-selection/feature.ts +2 -2
  155. package/src/components/data-table/cell-selection/types.ts +2 -2
  156. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
  157. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
  158. package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
  159. package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
  160. package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
  161. package/src/components/data-table/charts/charts.tsx +40 -30
  162. package/src/components/data-table/charts/storage.ts +16 -5
  163. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  164. package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
  165. package/src/components/data-table/column-summary/column-summary.tsx +2 -4
  166. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  167. package/src/components/data-table/columns.tsx +45 -46
  168. package/src/components/data-table/context-menu.tsx +36 -20
  169. package/src/components/data-table/data-table.tsx +17 -1
  170. package/src/components/data-table/date-popover.tsx +6 -4
  171. package/src/components/data-table/export-actions.tsx +76 -48
  172. package/src/components/data-table/pagination.tsx +44 -33
  173. package/src/components/data-table/range-focus/atoms.ts +4 -6
  174. package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
  175. package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
  176. package/src/components/data-table/renderers.tsx +16 -7
  177. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
  178. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +4 -4
  179. package/src/components/data-table/search-highlight.tsx +79 -0
  180. package/src/components/data-table/types.ts +1 -0
  181. package/src/components/data-table/url-detector.tsx +49 -9
  182. package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
  183. package/src/components/datasources/__tests__/column-preview.test.tsx +96 -5
  184. package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
  185. package/src/components/datasources/__tests__/table-list.test.tsx +118 -0
  186. package/src/components/datasources/__tests__/utils.test.ts +57 -6
  187. package/src/components/datasources/column-preview.tsx +17 -12
  188. package/src/components/datasources/datasources.tsx +55 -42
  189. package/src/components/datasources/utils.ts +32 -23
  190. package/src/components/debugger/debugger-code.tsx +5 -0
  191. package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
  192. package/src/components/dependency-graph/elements.ts +24 -21
  193. package/src/components/dependency-graph/minimap-content.tsx +2 -6
  194. package/src/components/dependency-graph/panels.tsx +4 -2
  195. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
  196. package/src/components/editor/SortableCell.tsx +1 -3
  197. package/src/components/editor/__tests__/Output.test.tsx +50 -32
  198. package/src/{core/attachments/__tests__/toast.test.tsx → components/editor/__tests__/agent-toast.test.tsx} +1 -1
  199. package/src/components/editor/__tests__/data-attributes.test.tsx +28 -13
  200. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  201. package/src/components/editor/__tests__/output-persistence.test.tsx +6 -1
  202. package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
  203. package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +69 -0
  204. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +34 -8
  205. package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +2 -6
  206. package/src/components/editor/actions/name-cell-input.tsx +4 -3
  207. package/src/components/editor/actions/pair-with-agent-commands.ts +2 -2
  208. package/src/components/editor/actions/pair-with-agent-modal.tsx +19 -16
  209. package/src/components/editor/actions/useCellActionButton.tsx +20 -26
  210. package/src/components/editor/actions/useNotebookActions.tsx +14 -19
  211. package/src/components/editor/actions/useRestartKernel.tsx +1 -1
  212. package/src/components/editor/actions/useSetCodeVisibility.ts +10 -11
  213. package/src/components/editor/actions/useSetOutputsExpanded.ts +13 -18
  214. package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
  215. package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
  216. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
  217. package/src/components/editor/alerts/connection-notice.tsx +1 -1
  218. package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
  219. package/src/components/editor/app-container.tsx +1 -1
  220. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
  221. package/src/components/editor/cell/CreateCellButton.tsx +15 -21
  222. package/src/components/editor/cell/DeleteButton.tsx +3 -2
  223. package/src/components/editor/cell/RunButton.tsx +2 -2
  224. package/src/components/editor/cell/StagedAICell.tsx +10 -2
  225. package/src/components/editor/cell/StopButton.tsx +2 -2
  226. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +3 -1
  227. package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
  228. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  229. package/src/components/editor/cell/code/cell-editor.tsx +22 -36
  230. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  231. package/src/components/editor/cell/collapse.tsx +5 -3
  232. package/src/components/editor/cell/useAddCell.ts +4 -8
  233. package/src/components/editor/cell/useDeleteCell.tsx +10 -36
  234. package/src/components/editor/cell/useRunCells.ts +2 -5
  235. package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
  236. package/src/components/editor/cell/useSplitCell.tsx +2 -1
  237. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
  238. package/src/components/editor/chrome/components/feedback-button.tsx +1 -1
  239. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +31 -2
  240. package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
  241. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
  242. package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
  243. package/src/components/editor/chrome/panels/logs-panel.tsx +2 -1
  244. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
  245. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
  246. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
  247. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
  248. package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
  249. package/src/components/editor/chrome/panels/snippets-panel.tsx +10 -12
  250. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +9 -18
  251. package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +92 -0
  252. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +61 -2
  253. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +4 -4
  254. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  255. package/src/components/editor/chrome/wrapper/footer-items/document-sync-status.tsx +54 -0
  256. package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
  257. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
  258. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
  259. package/src/components/editor/chrome/wrapper/footer.tsx +2 -0
  260. package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +12 -2
  261. package/src/components/editor/chrome/wrapper/storage.ts +1 -1
  262. package/src/components/editor/columns/sortable-column.tsx +1 -1
  263. package/src/components/editor/connections/components.tsx +5 -10
  264. package/src/components/editor/controls/Controls.tsx +3 -3
  265. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  266. package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
  267. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +10 -4
  268. package/src/components/editor/controls/command-palette.tsx +22 -10
  269. package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
  270. package/src/components/editor/documentation.css +34 -11
  271. package/src/components/editor/dynamic-favicon.tsx +21 -40
  272. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +9 -23
  273. package/src/components/editor/errors/auto-fix.tsx +4 -8
  274. package/src/components/editor/errors/send-error-report-button.tsx +3 -6
  275. package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
  276. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
  277. package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
  278. package/src/components/editor/file-tree/file-explorer.tsx +48 -15
  279. package/src/components/editor/file-tree/file-name-input.tsx +1 -0
  280. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  281. package/src/components/editor/file-tree/use-file-search.ts +35 -21
  282. package/src/components/editor/header/__tests__/status.test.tsx +5 -3
  283. package/src/components/editor/header/app-header.tsx +1 -1
  284. package/src/components/editor/header/status.tsx +40 -20
  285. package/src/components/editor/links/__tests__/cell-link.test.tsx +148 -0
  286. package/src/components/editor/links/cell-link.tsx +16 -6
  287. package/src/components/editor/navigation/__tests__/clipboard.test.ts +60 -38
  288. package/src/components/editor/navigation/__tests__/navigation.test.ts +73 -64
  289. package/src/components/editor/navigation/clipboard.ts +12 -11
  290. package/src/components/editor/navigation/focus-utils.ts +4 -4
  291. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +11 -20
  292. package/src/components/editor/navigation/navigation.ts +20 -28
  293. package/src/components/editor/notebook-banner.tsx +1 -0
  294. package/src/components/editor/notebook-cell.tsx +19 -13
  295. package/src/components/editor/output/MarimoErrorOutput.tsx +2 -1
  296. package/src/components/editor/output/MarimoTracebackOutput.tsx +19 -17
  297. package/src/components/editor/output/Outputs.css +8 -0
  298. package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
  299. package/src/components/editor/output/ansi-reduce.ts +33 -20
  300. package/src/components/editor/output/console/ConsoleOutput.tsx +19 -25
  301. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +125 -69
  302. package/src/components/editor/package-alert.tsx +14 -7
  303. package/src/components/editor/renderers/cell-array.tsx +10 -17
  304. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
  305. package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
  306. package/src/components/home/components.tsx +17 -31
  307. package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
  308. package/src/components/icons/large-spinner.tsx +3 -14
  309. package/src/components/icons/spinner.tsx +1 -1
  310. package/src/components/markdown/markdown-renderer.tsx +4 -8
  311. package/src/components/mcp/mcp-status-indicator.tsx +1 -1
  312. package/src/components/pages/__tests__/home-page.test.tsx +116 -0
  313. package/src/components/pages/edit-page.tsx +32 -17
  314. package/src/components/pages/home-page.tsx +164 -91
  315. package/src/components/scratchpad/scratchpad.test.tsx +97 -0
  316. package/src/components/scratchpad/scratchpad.tsx +20 -10
  317. package/src/components/slides/__tests__/minimap-actions.test.tsx +9 -25
  318. package/src/components/slides/minimap.tsx +7 -3
  319. package/src/components/slides/reveal-component.tsx +4 -2
  320. package/src/components/slides/slide-cell-view.tsx +4 -4
  321. package/src/components/slides/slide-form.tsx +1 -0
  322. package/src/components/sort/SortableCellsProvider.tsx +2 -1
  323. package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
  324. package/src/components/tracing/tracing.tsx +45 -41
  325. package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
  326. package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
  327. package/src/components/ui/alert-dialog.tsx +1 -1
  328. package/src/components/ui/draggable-popover.tsx +24 -2
  329. package/src/components/ui/range-slider.tsx +22 -9
  330. package/src/core/ai/__tests__/staged-cells.test.ts +26 -25
  331. package/src/core/ai/context/providers/datasource.ts +6 -2
  332. package/src/core/ai/staged-cells.ts +15 -18
  333. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +5 -17
  334. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +2 -2
  335. package/src/core/ai/tools/base.ts +18 -9
  336. package/src/core/ai/tools/edit-notebook-tool.ts +74 -69
  337. package/src/core/ai/tools/registry.ts +13 -8
  338. package/src/core/ai/tools/sample-tool.ts +6 -7
  339. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -0
  340. package/src/core/cells/__tests__/actions.test.ts +474 -34
  341. package/src/core/cells/__tests__/add-missing-import.test.ts +7 -8
  342. package/src/core/cells/__tests__/cell.test.ts +39 -0
  343. package/src/core/cells/__tests__/cells.test.ts +260 -1165
  344. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
  345. package/src/core/cells/__tests__/document.test.ts +414 -0
  346. package/src/core/cells/__tests__/flush-document.test.ts +40 -0
  347. package/src/core/cells/__tests__/notebook-outline.test.ts +114 -0
  348. package/src/core/cells/__tests__/outputs.test.tsx +71 -53
  349. package/src/core/cells/__tests__/session.test.ts +117 -36
  350. package/src/core/cells/__tests__/with-document-save.test.ts +67 -0
  351. package/src/core/cells/actions.ts +391 -3
  352. package/src/core/cells/add-missing-import.ts +46 -42
  353. package/src/core/cells/cell.ts +14 -3
  354. package/src/core/cells/cells.ts +99 -599
  355. package/src/core/cells/columns.ts +38 -0
  356. package/src/core/cells/document.ts +392 -0
  357. package/src/core/cells/outputs.ts +12 -28
  358. package/src/core/cells/pending-delete-service.ts +2 -6
  359. package/src/core/cells/session.ts +1 -1
  360. package/src/core/cells/types.ts +22 -1
  361. package/src/core/codemirror/__tests__/setup.test.ts +29 -29
  362. package/src/core/codemirror/ai/__tests__/resources.test.ts +117 -0
  363. package/src/core/codemirror/ai/resources.ts +1 -1
  364. package/src/core/codemirror/cells/__tests__/extensions.test.ts +42 -1
  365. package/src/core/codemirror/cells/extensions.ts +27 -9
  366. package/src/core/codemirror/cells/state.ts +1 -1
  367. package/src/core/codemirror/format.ts +6 -5
  368. package/src/core/codemirror/keymaps/vim.ts +4 -8
  369. package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
  370. package/src/core/codemirror/language/__tests__/utils.test.ts +187 -15
  371. package/src/core/codemirror/language/cell-code.ts +114 -0
  372. package/src/core/codemirror/language/extension.ts +52 -35
  373. package/src/core/codemirror/language/languages/markdown.ts +8 -6
  374. package/src/core/codemirror/language/languages/python.ts +16 -10
  375. package/src/core/codemirror/language/languages/sql/sql.ts +16 -24
  376. package/src/core/codemirror/language/panel/panel.tsx +1 -0
  377. package/src/core/codemirror/language/types.ts +7 -7
  378. package/src/core/codemirror/language/utils.ts +9 -39
  379. package/src/core/codemirror/lsp/notebook-lsp.ts +6 -5
  380. package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
  381. package/src/core/codemirror/readonly/extension.ts +2 -2
  382. package/src/core/codemirror/rtc/extension.ts +24 -13
  383. package/src/core/codemirror/rtc/loro/awareness.ts +34 -19
  384. package/src/core/codemirror/rtc/loro/sync.ts +1 -0
  385. package/src/core/codemirror/utils.ts +1 -0
  386. package/src/core/config/__tests__/config-schema.test.ts +5 -3
  387. package/src/core/config/config-schema.ts +3 -0
  388. package/src/core/datasets/__tests__/data-source-discovery.test.ts +5 -5
  389. package/src/core/datasets/data-source-discovery.ts +4 -6
  390. package/src/core/edit-app.tsx +19 -23
  391. package/src/core/errors/error-entries.ts +3 -0
  392. package/src/core/export/hooks.ts +1 -1
  393. package/src/core/export/layout.ts +2 -2
  394. package/src/core/hotkeys/actions.ts +2 -4
  395. package/src/core/islands/__tests__/bootstrap.test.ts +73 -43
  396. package/src/core/islands/__tests__/bridge.test.ts +72 -25
  397. package/src/core/islands/bootstrap.ts +46 -53
  398. package/src/core/islands/bridge.ts +74 -23
  399. package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
  400. package/src/core/islands/worker/__tests__/controller.test.ts +62 -4
  401. package/src/core/islands/worker/controller.ts +4 -10
  402. package/src/core/islands/worker/worker.tsx +33 -33
  403. package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
  404. package/src/core/kernel/__tests__/handlers.test.ts +7 -153
  405. package/src/core/kernel/handlers.ts +18 -59
  406. package/src/core/network/__tests__/connection.test.ts +1 -1
  407. package/src/core/network/__tests__/requests-lazy.test.ts +1 -3
  408. package/src/core/network/connection-notice.ts +1 -1
  409. package/src/core/network/connection.ts +1 -1
  410. package/src/core/network/requests-lazy.ts +1 -4
  411. package/src/core/network/requests-network.ts +0 -25
  412. package/src/core/network/requests-static.ts +0 -3
  413. package/src/core/network/requests-toasting.tsx +0 -3
  414. package/src/core/network/types.ts +0 -12
  415. package/src/core/network/useConnectionNotice.ts +8 -2
  416. package/src/core/notebook/attachments.ts +38 -0
  417. package/src/core/notebook/document/__tests__/codemirror.test.ts +552 -0
  418. package/src/core/notebook/document/__tests__/draft.test.ts +363 -0
  419. package/src/core/notebook/document/__tests__/fixtures.ts +92 -0
  420. package/src/core/notebook/document/__tests__/hold.test.ts +88 -0
  421. package/src/core/notebook/document/__tests__/hooks.test.tsx +391 -0
  422. package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +61 -0
  423. package/src/core/notebook/document/__tests__/model.test.ts +247 -0
  424. package/src/core/notebook/document/__tests__/protocol-fixtures.ts +38 -0
  425. package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +230 -0
  426. package/src/core/notebook/document/__tests__/scenario-fixture.ts +43 -0
  427. package/src/core/notebook/document/__tests__/scenarios.test.ts +205 -0
  428. package/src/core/notebook/document/__tests__/state.test.ts +459 -0
  429. package/src/core/notebook/document/__tests__/submission.test.ts +203 -0
  430. package/src/core/notebook/document/__tests__/test-host.test.ts +92 -0
  431. package/src/core/notebook/document/__tests__/test-host.ts +247 -0
  432. package/src/core/notebook/document/__tests__/test-notebook.ts +149 -0
  433. package/src/core/notebook/document/__tests__/user.ts +61 -0
  434. package/src/core/notebook/document/codemirror.ts +216 -0
  435. package/src/core/notebook/document/draft.ts +502 -0
  436. package/src/core/notebook/document/hooks.tsx +118 -0
  437. package/src/core/notebook/document/index.ts +24 -0
  438. package/src/core/notebook/document/model.ts +105 -0
  439. package/src/core/notebook/document/select.ts +41 -0
  440. package/src/core/notebook/document/state.ts +378 -0
  441. package/src/core/notebook/document/sync.ts +418 -0
  442. package/src/core/notebook/index.ts +18 -0
  443. package/src/core/notebook/replica/AGENTS.md +11 -0
  444. package/src/core/notebook/replica/__tests__/attachments.test.ts +56 -0
  445. package/src/core/notebook/replica/__tests__/document.test.ts +126 -0
  446. package/src/core/notebook/replica/__tests__/fixtures.ts +79 -0
  447. package/src/core/notebook/replica/__tests__/replica.test.ts +550 -0
  448. package/src/core/notebook/replica/backend.ts +19 -0
  449. package/src/core/notebook/replica/connection.ts +42 -0
  450. package/src/core/notebook/replica/index.ts +13 -0
  451. package/src/core/notebook/replica/replica.ts +286 -0
  452. package/src/core/notebook/replica/resources/attachments.ts +22 -0
  453. package/src/core/notebook/replica/resources/document.ts +101 -0
  454. package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
  455. package/src/core/packages/useSandboxController.ts +1 -1
  456. package/src/core/run-app.tsx +48 -51
  457. package/src/core/runtime/__tests__/adapter.test.ts +1 -1
  458. package/src/core/runtime/__tests__/createWsUrl.test.ts +77 -7
  459. package/src/core/runtime/__tests__/runtime.test.ts +32 -58
  460. package/src/core/runtime/adapter.ts +1 -1
  461. package/src/core/runtime/config.ts +2 -2
  462. package/src/core/runtime/runtime.ts +38 -42
  463. package/src/core/runtime/types.ts +0 -2
  464. package/src/core/saving/filename.ts +1 -1
  465. package/src/core/saving/save-component.tsx +10 -4
  466. package/src/core/saving/useAutoSave.ts +1 -1
  467. package/src/core/session/__tests__/backend.test.ts +235 -0
  468. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +183 -0
  469. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +663 -0
  470. package/src/core/session/active-notebook.ts +11 -0
  471. package/src/core/session/backend.ts +125 -0
  472. package/src/core/{websocket → session}/types.ts +2 -2
  473. package/src/core/session/useNotebookReplica.ts +72 -0
  474. package/src/core/{websocket → session}/useNotebookSession.tsx +74 -68
  475. package/src/core/state/__tests__/jotai.test.tsx +108 -0
  476. package/src/core/state/jotai.ts +1 -1
  477. package/src/core/static/__tests__/files.test.ts +38 -10
  478. package/src/core/static/files.ts +2 -0
  479. package/src/core/{websocket → transports}/__tests__/connection-state.test.ts +1 -13
  480. package/src/core/transports/__tests__/server.test.ts +408 -0
  481. package/src/core/transports/__tests__/static.test.ts +175 -0
  482. package/src/core/transports/__tests__/wasm.test.ts +166 -0
  483. package/src/core/{websocket → transports}/connection-state.ts +9 -16
  484. package/src/core/transports/server.ts +152 -0
  485. package/src/core/transports/static.ts +84 -0
  486. package/src/core/transports/wasm.ts +97 -0
  487. package/src/core/wasm/__tests__/bridge.test.ts +213 -50
  488. package/src/core/wasm/__tests__/worker.test.ts +187 -0
  489. package/src/core/wasm/bridge.ts +75 -69
  490. package/src/core/wasm/rpc.ts +15 -3
  491. package/src/core/wasm/store.ts +3 -3
  492. package/src/core/wasm/worker/bootstrap.ts +55 -51
  493. package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
  494. package/src/core/wasm/worker/save-worker.ts +9 -10
  495. package/src/core/wasm/worker/types.ts +29 -18
  496. package/src/core/wasm/worker/worker.ts +88 -44
  497. package/src/css/globals.css +66 -22
  498. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  499. package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
  500. package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
  501. package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
  502. package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
  503. package/src/hooks/__tests__/useScript.test.tsx +77 -0
  504. package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
  505. package/src/hooks/useAsyncData.ts +3 -3
  506. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  507. package/src/hooks/useDebounce.ts +6 -10
  508. package/src/hooks/useDeepCompareMemoize.ts +1 -1
  509. package/src/hooks/useDelayElapsed.ts +14 -10
  510. package/src/hooks/useElapsedTime.ts +3 -3
  511. package/src/hooks/useEventListener.ts +1 -2
  512. package/src/hooks/useInputHistory.ts +4 -7
  513. package/src/hooks/useInternalStateWithSync.ts +6 -6
  514. package/src/hooks/useResizeObserver.ts +4 -7
  515. package/src/hooks/useScript.ts +67 -70
  516. package/src/hooks/useStateForKey.ts +93 -0
  517. package/src/mount.tsx +1 -5
  518. package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
  519. package/src/plugins/core/registerReactComponent.tsx +1 -1
  520. package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
  521. package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
  522. package/src/plugins/impl/DataTablePlugin.tsx +69 -37
  523. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  524. package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
  525. package/src/plugins/impl/FormPlugin.tsx +1 -1
  526. package/src/plugins/impl/RangeSliderPlugin.tsx +16 -2
  527. package/src/plugins/impl/RefreshPlugin.tsx +1 -0
  528. package/src/plugins/impl/SliderPlugin.tsx +6 -8
  529. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +387 -1
  530. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
  531. package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
  532. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
  533. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +153 -0
  534. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  535. package/src/plugins/impl/anywidget/model.ts +3 -1
  536. package/src/plugins/impl/anywidget/registry.ts +18 -14
  537. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  538. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  539. package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
  540. package/src/plugins/impl/chat/chat-ui.tsx +14 -11
  541. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  542. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  543. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  544. package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
  545. package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
  546. package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
  547. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -2
  548. package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
  549. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +66 -66
  550. package/src/plugins/impl/data-frames/panel.tsx +43 -16
  551. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  552. package/src/plugins/impl/panel/PanelPlugin.tsx +16 -17
  553. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  554. package/src/plugins/impl/panel/utils.ts +17 -0
  555. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
  556. package/src/plugins/impl/plotly/selection.ts +25 -19
  557. package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
  558. package/src/plugins/impl/vega/make-selectable.ts +4 -7
  559. package/src/plugins/layout/RoutesPlugin.tsx +1 -1
  560. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  561. package/src/stories/button.stories.tsx +1 -0
  562. package/src/stories/cell.stories.tsx +1 -1
  563. package/src/stories/data-table.stories.tsx +31 -0
  564. package/src/stories/editor.stories.tsx +24 -17
  565. package/src/stories/form-wrapper.stories.tsx +2 -2
  566. package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
  567. package/src/stories/runtime-story.tsx +23 -16
  568. package/src/stories/select.stories.tsx +2 -2
  569. package/src/stories/switchable-multi-select.stories.tsx +1 -1
  570. package/src/utils/__tests__/arrays.test.ts +35 -0
  571. package/src/utils/__tests__/batch-requests.test.ts +3 -3
  572. package/src/utils/__tests__/{createReducer.test.ts → createReducer.test.tsx} +29 -0
  573. package/src/utils/__tests__/numbers.test.ts +105 -1
  574. package/src/utils/__tests__/objects.test.ts +21 -0
  575. package/src/utils/arrays.ts +11 -2
  576. package/src/utils/blob.ts +1 -1
  577. package/src/utils/createReducer.ts +53 -26
  578. package/src/utils/maps.ts +0 -3
  579. package/src/utils/numbers.ts +79 -18
  580. package/src/utils/objects.ts +4 -9
  581. package/src/utils/once.ts +19 -19
  582. package/src/utils/tracer.ts +9 -5
  583. package/src/utils/zod-utils.ts +1 -3
  584. package/dist/any-language-editor-DZ_YTVus.js +0 -76
  585. package/dist/assets/__vite-browser-external-BXYkiFsk.js +0 -1
  586. package/dist/assets/worker-HPY9fbhz.js +0 -114
  587. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
  588. package/dist/precisionRound-DMIVQrt2.js +0 -97
  589. package/src/core/attachments/state.ts +0 -21
  590. package/src/core/cells/__tests__/apply-transaction.test.ts +0 -991
  591. package/src/core/cells/__tests__/document-changes.test.ts +0 -1140
  592. package/src/core/cells/__tests__/document-roundtrip.test.ts +0 -392
  593. package/src/core/cells/document-changes.ts +0 -944
  594. package/src/core/host/AGENTS.md +0 -6
  595. package/src/core/host/__tests__/events.test.ts +0 -46
  596. package/src/core/host/__tests__/notebook-client.test.ts +0 -191
  597. package/src/core/host/__tests__/protocol.test.ts +0 -214
  598. package/src/core/host/connection.ts +0 -81
  599. package/src/core/host/events.ts +0 -60
  600. package/src/core/host/notebook-client.ts +0 -226
  601. package/src/core/host/protocol.ts +0 -1943
  602. package/src/core/state/__tests__/jotai.test.ts +0 -25
  603. package/src/core/wasm/worker/message-buffer.ts +0 -33
  604. package/src/core/websocket/__tests__/createConnectionTransport.test.ts +0 -49
  605. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +0 -140
  606. package/src/core/websocket/__tests__/useNotebookSession.hook.test.tsx +0 -883
  607. package/src/core/websocket/transports/__tests__/basic.test.ts +0 -275
  608. package/src/core/websocket/transports/__tests__/sse.test.ts +0 -335
  609. package/src/core/websocket/transports/__tests__/transport.test.ts +0 -308
  610. package/src/core/websocket/transports/__tests__/ws.test.ts +0 -125
  611. package/src/core/websocket/transports/basic.ts +0 -102
  612. package/src/core/websocket/transports/create.ts +0 -31
  613. package/src/core/websocket/transports/sse.ts +0 -308
  614. package/src/core/websocket/transports/transport.ts +0 -50
  615. package/src/core/websocket/transports/ws.ts +0 -98
  616. package/src/core/websocket/useNotebookClient.ts +0 -80
  617. /package/src/{core/attachments/toast.ts → components/editor/agent-toast.ts} +0 -0
  618. /package/src/core/{websocket → session}/connection-utils.ts +0 -0
@@ -1,27 +1,27 @@
1
1
  import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { c as n, g as r, h as i, t as a } from "./button-CvjkwdSk.js";
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-Ft7t9bqz.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 j, z as te } from "./html-to-image-Bf8QMGi4.js";
7
- import { h as M, t as ne } from "./tooltip-BO1REbqs.js";
8
- import { Ct as re, Dt as ie, L as ae, Pt as oe, Rt as se, St as ce, Ut as le, Z as ue, ct as de, fn as fe, h as pe, hn as me, ht as he, i as ge, it as _e, ln as ve, lt as ye, r as be, t as xe, tn as Se, tt as Ce, un as we, w as Te, wt as Ee } from "./error-entries-Bv6bZPF3.js";
9
- import { A as De, C as Oe, M as ke, b as Ae } from "./select-BButFi-d.js";
10
- import { _ as je, f as Me, h as Ne, i as Pe, n as Fe, t as Ie } from "./dropdown-menu-CP_qCYHC.js";
11
- import { C as Le, d as Re } from "./toDate-UtiwmnH2.js";
12
- import { d as ze, f as Be, i as Ve, n as He, t as Ue, u as We } from "./process-output-BZg56CCb.js";
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
13
  import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
14
- import { A as Ke, C as qe, D as Je, E as Ye, F as Xe, L as Ze, M as Qe, O as $e, P as et, R as tt, S as nt, T as rt, V as it, b as at, j as ot, v as st, w as ct, x as lt, y as ut, z as dt } from "./use-restore-focus-BEM7sFWl.js";
15
- import { n as ft } from "./error-banner-D-WCIiMt.js";
16
- import { t as pt } from "./label-BDKF3Afc.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
17
  import { t as mt } from "./isEmpty-BSZ1LaUo.js";
18
- import { A as ht, T as gt, n as _t } from "./useTheme-CRnjkku0.js";
19
- import { $ as vt, Mt as yt, Pt as bt, Rt as xt, Vt as St, Z as Ct, ht as wt, jt as Tt, mt as Et, nt as Dt, tt as Ot, zt as kt } from "./dist-DoE4XJBC.js";
20
- import { t as At } from "./objects-CzUgoMIF.js";
21
- import { n as jt, o as Mt, r as Nt } from "./dist-CkTTIdBe.js";
22
- import { n as Pt } from "./dist-CrSP_H1M.js";
23
- import { n as Ft, t as It } from "./esm-AMFssoNp.js";
24
- import { t as Lt } from "./useAsyncData-Deh5kszT.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
25
  var Rt = M("ban", [["circle", {
26
26
  cx: "12",
27
27
  cy: "12",
@@ -167,7 +167,7 @@ Error message: ${un(t)}`,
167
167
  static isInstance(e) {
168
168
  return P.hasMarker(e, vn);
169
169
  }
170
- }, Cn = "AI_TypeValidationError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En, Dn, On = class e extends (Dn = P, En = Tn, Dn) {
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) {
@@ -192,25 +192,25 @@ Error message: ${un(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 = P, 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 P.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,7 +396,7 @@ 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];
@@ -408,16 +408,16 @@ var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRS
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" && I(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] = I(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(I) : I(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(I)), e.allOf != null && (e.allOf = e.allOf.map(I)), e.oneOf != null && (e.oneOf = e.oneOf.map(I));
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] = I(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 I(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 tr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), nr = {
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 tr = /* @__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
- }, rr = (e) => typeof e == "string" ? {
484
- ...nr,
483
+ }, nr = (e) => typeof e == "string" ? {
484
+ ...tr,
485
485
  name: e
486
486
  } : {
487
- ...nr,
487
+ ...tr,
488
488
  ...e
489
489
  };
490
- function L() {
490
+ function R() {
491
491
  return {};
492
492
  }
493
- function ir(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 = V(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 ar(e) {
500
+ function ir(e) {
501
501
  let t = {
502
502
  type: "integer",
503
503
  format: "int64"
@@ -514,16 +514,16 @@ function ar(e) {
514
514
  }
515
515
  return t;
516
516
  }
517
- function or() {
517
+ function ar() {
518
518
  return { type: "boolean" };
519
519
  }
520
- function sr(e, t) {
521
- return V(e.type._def, t);
520
+ function or(e, t) {
521
+ return H(e.type._def, t);
522
522
  }
523
- var cr = (e, t) => V(e.innerType._def, t);
524
- function lr(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) => lr(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 lr(e, t, n) {
534
534
  type: "string",
535
535
  format: "date"
536
536
  };
537
- case "integer": return ur(e);
537
+ case "integer": return lr(e);
538
538
  }
539
539
  }
540
- var ur = (e) => {
540
+ var lr = (e) => {
541
541
  let t = {
542
542
  type: "integer",
543
543
  format: "unix-time"
@@ -550,31 +550,31 @@ var ur = (e) => {
550
550
  }
551
551
  return t;
552
552
  };
553
- function dr(e, t) {
553
+ function ur(e, t) {
554
554
  return {
555
- ...V(e.innerType._def, t),
555
+ ...H(e.innerType._def, t),
556
556
  default: e.defaultValue()
557
557
  };
558
558
  }
559
- function fr(e, t) {
560
- return t.effectStrategy === "input" ? V(e.schema._def, t) : L();
559
+ function dr(e, t) {
560
+ return t.effectStrategy === "input" ? H(e.schema._def, t) : R();
561
561
  }
562
- function pr(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 mr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
- function hr(e, t) {
570
- let n = [V(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
- }), V(e.right._def, {
577
+ }), H(e.right._def, {
578
578
  ...t,
579
579
  currentPath: [
580
580
  ...t.currentPath,
@@ -583,7 +583,7 @@ function hr(e, t) {
583
583
  ]
584
584
  })].filter((e) => !!e), r = [];
585
585
  return n.forEach((e) => {
586
- if (mr(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 hr(e, t) {
594
594
  }
595
595
  }), r.length ? { allOf: r } : void 0;
596
596
  }
597
- function gr(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 _r = void 0, R = {
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: () => (_r === void 0 && (_r = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), _r),
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 _r = void 0, R = {
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 vr(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 vr(e, t) {
629
629
  case "email":
630
630
  switch (t.emailStrategy) {
631
631
  case "format:email":
632
- z(n, "email", r.message, t);
632
+ B(n, "email", r.message, t);
633
633
  break;
634
634
  case "format:idn-email":
635
- z(n, "idn-email", r.message, t);
635
+ B(n, "idn-email", r.message, t);
636
636
  break;
637
- case "pattern:zod": B(n, R.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
- z(n, "uri", r.message, t);
641
+ B(n, "uri", r.message, t);
642
642
  break;
643
643
  case "uuid":
644
- z(n, "uuid", r.message, t);
644
+ B(n, "uuid", r.message, t);
645
645
  break;
646
646
  case "regex":
647
- B(n, r.regex, r.message, t);
647
+ V(n, r.regex, r.message, t);
648
648
  break;
649
649
  case "cuid":
650
- B(n, R.cuid, r.message, t);
650
+ V(n, z.cuid, r.message, t);
651
651
  break;
652
652
  case "cuid2":
653
- B(n, R.cuid2, r.message, t);
653
+ V(n, z.cuid2, r.message, t);
654
654
  break;
655
655
  case "startsWith":
656
- B(n, RegExp(`^${yr(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
- B(n, RegExp(`${yr(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
- z(n, "date-time", r.message, t);
662
+ B(n, "date-time", r.message, t);
663
663
  break;
664
664
  case "date":
665
- z(n, "date", r.message, t);
665
+ B(n, "date", r.message, t);
666
666
  break;
667
667
  case "time":
668
- z(n, "time", r.message, t);
668
+ B(n, "time", r.message, t);
669
669
  break;
670
670
  case "duration":
671
- z(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
- B(n, RegExp(yr(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" && z(n, "ipv4", r.message, t), r.version !== "v4" && z(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
- B(n, R.base64url, r.message, t);
683
+ V(n, z.base64url, r.message, t);
684
684
  break;
685
685
  case "jwt":
686
- B(n, R.jwt, r.message, t);
686
+ V(n, z.jwt, r.message, t);
687
687
  break;
688
688
  case "cidr":
689
- r.version !== "v6" && B(n, R.ipv4Cidr, r.message, t), r.version !== "v4" && B(n, R.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
- B(n, R.emoji(), r.message, t);
692
+ V(n, z.emoji(), r.message, t);
693
693
  break;
694
694
  case "ulid":
695
- B(n, R.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
- z(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": B(n, R.base64, r.message, t);
705
+ case "pattern:zod": V(n, z.base64, r.message, t);
706
706
  }
707
707
  break;
708
- case "nanoid": B(n, R.nanoid, r.message, t);
708
+ case "nanoid": V(n, z.nanoid, r.message, t);
709
709
  }
710
710
  return n;
711
711
  }
712
- function yr(e, t) {
713
- return t.patternStrategy === "escape" ? xr(e) : e;
712
+ function vr(e, t) {
713
+ return t.patternStrategy === "escape" ? br(e) : e;
714
714
  }
715
- var br = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
- function xr(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++) br.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 z(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 B(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: Sr(t, r),
729
+ pattern: xr(t, r),
730
730
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
731
- })) : e.pattern = Sr(t, r);
731
+ })) : e.pattern = xr(t, r);
732
732
  }
733
- function Sr(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 Sr(e, t) {
778
778
  }
779
779
  return i;
780
780
  }
781
- function Cr(e, t) {
781
+ function Sr(e, t) {
782
782
  let n = {
783
783
  type: "object",
784
- additionalProperties: V(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 } = vr(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 Cr(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 } = sr(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 Cr(e, t) {
806
806
  }
807
807
  return n;
808
808
  }
809
- function wr(e, t) {
810
- return t.mapStrategy === "record" ? Cr(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: [V(e.keyType._def, {
815
+ items: [H(e.keyType._def, {
816
816
  ...t,
817
817
  currentPath: [
818
818
  ...t.currentPath,
@@ -820,7 +820,7 @@ function wr(e, t) {
820
820
  "items",
821
821
  "0"
822
822
  ]
823
- }) || L(), V(e.valueType._def, {
823
+ }) || R(), H(e.valueType._def, {
824
824
  ...t,
825
825
  currentPath: [
826
826
  ...t.currentPath,
@@ -828,37 +828,37 @@ function wr(e, t) {
828
828
  "items",
829
829
  "1"
830
830
  ]
831
- }) || L()],
831
+ }) || R()],
832
832
  minItems: 2,
833
833
  maxItems: 2
834
834
  }
835
835
  };
836
836
  }
837
- function Tr(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 Er() {
845
- return { not: L() };
844
+ function Tr() {
845
+ return { not: R() };
846
846
  }
847
- function Dr() {
847
+ function Er() {
848
848
  return { type: "null" };
849
849
  }
850
- var Or = {
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 kr(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 Or && (!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 = Or[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 kr(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 Ar(e, t);
889
+ return kr(e, t);
890
890
  }
891
- var Ar = (e, t) => {
892
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => V(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 Ar = (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 jr(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: [Or[e.innerType._def.typeName], "null"] };
910
- let n = V(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 jr(e, t) {
917
917
  });
918
918
  return n && { anyOf: [n, { type: "null" }] };
919
919
  }
920
- function Mr(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 Mr(e) {
934
934
  }
935
935
  return t;
936
936
  }
937
- function Nr(e, t) {
937
+ function Mr(e, t) {
938
938
  let n = {
939
939
  type: "object",
940
940
  properties: {}
@@ -942,7 +942,7 @@ function Nr(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 = Fr(a), s = V(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 Nr(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 = Pr(e, t);
961
+ let a = Nr(e, t);
962
962
  return a !== void 0 && (n.additionalProperties = a), n;
963
963
  }
964
- function Pr(e, t) {
965
- if (e.catchall._def.typeName !== "ZodNever") return V(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 Pr(e, t) {
972
972
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
973
973
  }
974
974
  }
975
- function Fr(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 Ir = (e, t) => {
983
- if (t.currentPath.toString() === t.propertyPath?.toString()) return V(e.innerType._def, t);
984
- let n = V(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 Ir = (e, t) => {
989
989
  "1"
990
990
  ]
991
991
  });
992
- return n ? { anyOf: [{ not: L() }, n] } : L();
993
- }, Lr = (e, t) => {
994
- if (t.pipeStrategy === "input") return V(e.in._def, t);
995
- if (t.pipeStrategy === "output") return V(e.out._def, t);
996
- let n = V(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 Ir = (e, t) => {
1001
1001
  "0"
1002
1002
  ]
1003
1003
  });
1004
- return { allOf: [n, V(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 Ir = (e, t) => {
1010
1010
  ]
1011
1011
  })].filter((e) => e !== void 0) };
1012
1012
  };
1013
- function Rr(e, t) {
1014
- return V(e.type._def, t);
1013
+ function Lr(e, t) {
1014
+ return H(e.type._def, t);
1015
1015
  }
1016
- function zr(e, t) {
1016
+ function Rr(e, t) {
1017
1017
  let n = {
1018
1018
  type: "array",
1019
1019
  uniqueItems: !0,
1020
- items: V(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 Br(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) => V(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 Br(e, t) {
1036
1036
  `${n}`
1037
1037
  ]
1038
1038
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
1039
- additionalItems: V(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 Br(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) => V(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 Br(e, t) {
1054
1054
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
1055
1055
  };
1056
1056
  }
1057
- function Vr() {
1058
- return { not: L() };
1057
+ function Br() {
1058
+ return { not: R() };
1059
1059
  }
1060
- function Hr() {
1061
- return L();
1060
+ function Vr() {
1061
+ return R();
1062
1062
  }
1063
- var Ur = (e, t) => V(e.innerType._def, t), Wr = (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 vr(e, n);
1066
- case "ZodNumber": return Mr(e);
1067
- case "ZodObject": return Nr(e, n);
1068
- case "ZodBigInt": return ar(e);
1069
- case "ZodBoolean": return or();
1070
- case "ZodDate": return lr(e, n);
1071
- case "ZodUndefined": return Vr();
1072
- case "ZodNull": return Dr();
1073
- case "ZodArray": return ir(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 kr(e, n);
1076
- case "ZodIntersection": return hr(e, n);
1077
- case "ZodTuple": return Br(e, n);
1078
- case "ZodRecord": return Cr(e, n);
1079
- case "ZodLiteral": return gr(e);
1080
- case "ZodEnum": return pr(e);
1081
- case "ZodNativeEnum": return Tr(e);
1082
- case "ZodNullable": return jr(e, n);
1083
- case "ZodOptional": return Ir(e, n);
1084
- case "ZodMap": return wr(e, n);
1085
- case "ZodSet": return zr(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 Rr(e, n);
1087
+ case "ZodPromise": return Lr(e, n);
1088
1088
  case "ZodNaN":
1089
- case "ZodNever": return Er();
1090
- case "ZodEffects": return fr(e, n);
1091
- case "ZodAny": return L();
1092
- case "ZodUnknown": return Hr();
1093
- case "ZodDefault": return dr(e, n);
1094
- case "ZodBranded": return sr(e, n);
1095
- case "ZodReadonly": return Ur(e, n);
1096
- case "ZodCatch": return cr(e, n);
1097
- case "ZodPipeline": return Lr(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
- }, Gr = (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 V(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 !== tr) return i;
1112
+ if (i !== er) return i;
1113
1113
  }
1114
1114
  if (r && !n) {
1115
- let e = Kr(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 V(e, t, n = !1) {
1121
1121
  jsonSchema: void 0
1122
1122
  };
1123
1123
  t.seen.set(e, i);
1124
- let a = Wr(e, e.typeName, t), o = typeof a == "function" ? V(a(), t) : a;
1125
- if (o && qr(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 Kr = (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: Gr(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`), L()) : t.$refStrategy === "seen" ? L() : 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
- }, qr = (e, t, n) => (e.description && (n.description = e.description), n), Jr = (e) => {
1139
- let t = rr(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 Kr = (e, t) => {
1155
1155
  jsonSchema: void 0
1156
1156
  }]))
1157
1157
  };
1158
- }, Yr = (e, t) => {
1159
- let n = Jr(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]: V(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) ?? L()
1169
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = V(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) ?? L(), 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 Kr = (e, t) => {
1190
1190
  }
1191
1191
  };
1192
1192
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1193
- }, Xr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
- function Zr(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 Qr(e, { validate: t } = {}) {
1198
+ function Zr(e, { validate: t } = {}) {
1199
1199
  return {
1200
- [Xr]: !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 Qr(e, { validate: t } = {}) {
1205
1205
  validate: t
1206
1206
  };
1207
1207
  }
1208
- function $r(e) {
1209
- return typeof e == "object" && !!e && Xr in e && e[Xr] === !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 ei(e) {
1212
- return e == null ? Qr({
1211
+ function $r(e) {
1212
+ return e == null ? Zr({
1213
1213
  type: "object",
1214
1214
  properties: {},
1215
1215
  additionalProperties: !1
1216
- }) : $r(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? oi(e) : ti(e) : e();
1216
+ }) : Qr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? ai(e) : ei(e) : e();
1217
1217
  }
1218
- function ti(e) {
1219
- return Qr(() => {
1220
- if (!ni(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 ti(e) {
1226
1226
  value: n.value
1227
1227
  } : {
1228
1228
  success: !1,
1229
- error: new On({
1229
+ error: new F({
1230
1230
  value: t,
1231
1231
  cause: n.issues
1232
1232
  })
1233
1233
  };
1234
1234
  } });
1235
1235
  }
1236
- function ni(e) {
1236
+ function ti(e) {
1237
1237
  return e["~standard"].jsonSchema != null;
1238
1238
  }
1239
- function ri(e, t) {
1239
+ function ni(e, t) {
1240
1240
  let n = t?.useReferences ?? !1;
1241
- return Qr(() => Yr(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 ri(e, t) {
1249
1249
  };
1250
1250
  } });
1251
1251
  }
1252
- function ii(e, t) {
1252
+ function ri(e, t) {
1253
1253
  let n = t?.useReferences ?? !1;
1254
- return Qr(() => er(it(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 dt(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 ii(e, t) {
1266
1266
  };
1267
1267
  } });
1268
1268
  }
1269
- function ai(e) {
1269
+ function ii(e) {
1270
1270
  return "_zod" in e;
1271
1271
  }
1272
- function oi(e, t) {
1273
- return ai(e) ? ii(e, t) : ri(e, t);
1272
+ function ai(e, t) {
1273
+ return ii(e) ? ri(e, t) : ni(e, t);
1274
1274
  }
1275
- async function si({ value: e, schema: t, context: n }) {
1276
- let r = await ci({
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 On.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 ci({ value: e, schema: t, context: n }) {
1289
- let r = ei(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 ci({ value: e, schema: t, context: n }) {
1300
1300
  rawValue: e
1301
1301
  } : {
1302
1302
  success: !1,
1303
- error: On.wrap({
1303
+ error: F.wrap({
1304
1304
  value: e,
1305
1305
  cause: t.error,
1306
1306
  context: n
@@ -1310,7 +1310,7 @@ async function ci({ value: e, schema: t, context: n }) {
1310
1310
  } catch (t) {
1311
1311
  return {
1312
1312
  success: !1,
1313
- error: On.wrap({
1313
+ error: F.wrap({
1314
1314
  value: e,
1315
1315
  cause: t,
1316
1316
  context: n
@@ -1319,14 +1319,14 @@ async function ci({ value: e, schema: t, context: n }) {
1319
1319
  };
1320
1320
  }
1321
1321
  }
1322
- async function li({ 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 ci({
1329
+ } : await si({
1330
1330
  value: n,
1331
1331
  schema: t
1332
1332
  });
@@ -1341,15 +1341,15 @@ async function li({ text: e, schema: t }) {
1341
1341
  };
1342
1342
  }
1343
1343
  }
1344
- function ui({ 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 li({
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 H(e) {
1352
+ async function ui(e) {
1353
1353
  return typeof e == "function" && (e = e()), Promise.resolve(e);
1354
1354
  }
1355
1355
  new TextDecoder();
@@ -1446,23 +1446,23 @@ function Fi(e, t) {
1446
1446
  return n;
1447
1447
  }
1448
1448
  var W = {
1449
- array: nt,
1450
- boolean: qe,
1451
- custom: ct,
1452
- discriminatedUnion: rt,
1453
- enum: st,
1454
- instanceof: ut,
1455
- lazy: Ye,
1456
- literal: Je,
1457
- looseObject: $e,
1458
- never: Ke,
1459
- null: at,
1460
- number: ot,
1461
- object: Qe,
1462
- record: et,
1463
- string: Xe,
1464
- union: Ze,
1465
- unknown: tt
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
+ string: Ze,
1464
+ union: dt,
1465
+ unknown: qe
1466
1466
  }, Ii = W.lazy(() => W.union([
1467
1467
  W.null(),
1468
1468
  W.string(),
@@ -1474,7 +1474,7 @@ var W = {
1474
1474
  W.string(),
1475
1475
  W.instanceof(Uint8Array),
1476
1476
  W.instanceof(ArrayBuffer),
1477
- W.custom(Jn, { message: "Must be a Buffer" })
1477
+ W.custom(qn, { message: "Must be a Buffer" })
1478
1478
  ]), Ri = W.record(W.string(), W.string()), zi = W.object({
1479
1479
  type: W.literal("text"),
1480
1480
  text: W.string(),
@@ -1882,11 +1882,11 @@ async function ra(e) {
1882
1882
  value: void 0,
1883
1883
  state: "undefined-input"
1884
1884
  };
1885
- let t = await li({ 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 li({ text: na(e) }), t.success ? {
1889
+ } : (t = await ci({ text: na(e) }), t.success ? {
1890
1890
  value: t.value,
1891
1891
  state: "repaired-parse"
1892
1892
  } : {
@@ -1905,17 +1905,17 @@ var ia = () => ({
1905
1905
  },
1906
1906
  createElementStreamTransform() {}
1907
1907
  }), aa = ({ schema: e, name: t, description: n }) => {
1908
- let r = ei(e);
1908
+ let r = $r(e);
1909
1909
  return {
1910
1910
  name: "object",
1911
- responseFormat: H(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 li({ text: e });
1918
+ let n = await ci({ text: e });
1919
1919
  if (!n.success) throw new U({
1920
1920
  message: "No object generated: could not parse the response.",
1921
1921
  cause: n.error,
@@ -1924,7 +1924,7 @@ var ia = () => ({
1924
1924
  usage: t.usage,
1925
1925
  finishReason: t.finishReason
1926
1926
  });
1927
- let i = await ci({
1927
+ let i = await si({
1928
1928
  value: n.value,
1929
1929
  schema: r
1930
1930
  });
@@ -1961,10 +1961,10 @@ var ia = () => ({
1961
1961
  value: t,
1962
1962
  message: "minItems must be less than or equal to maxItems"
1963
1963
  });
1964
- let a = ei(e);
1964
+ let a = $r(e);
1965
1965
  return {
1966
1966
  name: "array",
1967
- responseFormat: H(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,7 +1987,7 @@ var ia = () => ({
1987
1987
  };
1988
1988
  }),
1989
1989
  async parseCompleteOutput({ text: e }, r) {
1990
- let i = await li({ text: e });
1990
+ let i = await ci({ text: e });
1991
1991
  if (!i.success) throw new U({
1992
1992
  message: "No object generated: could not parse the response.",
1993
1993
  cause: i.error,
@@ -1999,7 +1999,7 @@ var ia = () => ({
1999
1999
  let o = i.value;
2000
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 On({
2002
+ cause: new F({
2003
2003
  value: o,
2004
2004
  cause: "response must be an object with an elements array"
2005
2005
  }),
@@ -2023,7 +2023,7 @@ var ia = () => ({
2023
2023
  });
2024
2024
  let c = [];
2025
2025
  for (let t of o.elements) {
2026
- let n = await ci({
2026
+ let n = await si({
2027
2027
  value: t,
2028
2028
  schema: a
2029
2029
  });
@@ -2050,7 +2050,7 @@ var ia = () => ({
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 ci({
2053
+ let t = await si({
2054
2054
  value: e,
2055
2055
  schema: a
2056
2056
  });
@@ -2092,11 +2092,11 @@ function sa({ name: e, value: t }) {
2092
2092
  }
2093
2093
  }
2094
2094
  function ca({ value: e, minItems: t, maxItems: n }) {
2095
- if (t != null && e.length < t) return new On({
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 On({
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
  });
@@ -2119,7 +2119,7 @@ var la = ({ 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 li({ text: t });
2122
+ let r = await ci({ text: t });
2123
2123
  if (!r.success) throw new U({
2124
2124
  message: "No object generated: could not parse the response.",
2125
2125
  cause: r.error,
@@ -2131,7 +2131,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2131
2131
  let i = r.value;
2132
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 On({
2134
+ cause: new F({
2135
2135
  value: i,
2136
2136
  cause: "response must be an object that contains a choice value."
2137
2137
  }),
@@ -2165,7 +2165,7 @@ var la = ({ 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 li({ text: e });
2168
+ let n = await ci({ text: e });
2169
2169
  if (!n.success) throw new U({
2170
2170
  message: "No object generated: could not parse the response.",
2171
2171
  cause: n.error,
@@ -2187,10 +2187,10 @@ var la = ({ 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
  });
@@ -2231,7 +2231,7 @@ function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream:
2231
2231
  headers: da(n, pa)
2232
2232
  });
2233
2233
  }
2234
- var ha = W.record(W.string(), Ii.optional()), ga = Zr(() => oi(W.union([
2234
+ var ha = W.record(W.string(), Ii.optional()), ga = Xr(() => ai(W.union([
2235
2235
  W.looseObject({
2236
2236
  type: W.literal("text-start"),
2237
2237
  id: W.string(),
@@ -2548,7 +2548,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2548
2548
  async function h(e) {
2549
2549
  if (e != null) {
2550
2550
  let n = r.message.metadata == null ? e : Fi(r.message.metadata, e);
2551
- t != null && await si({
2551
+ t != null && await oi({
2552
2552
  value: n,
2553
2553
  schema: t,
2554
2554
  context: {
@@ -2861,7 +2861,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2861
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 si({
2864
+ await oi({
2865
2865
  value: e.data,
2866
2866
  schema: n[e.type],
2867
2867
  context: {
@@ -2900,25 +2900,25 @@ async function Ea({ 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
- }), W.record(W.string(), Ii.optional()), W.record(W.string(), W.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
  });
@@ -2944,7 +2944,7 @@ var { atob: Da } = globalThis, Oa = class {
2944
2944
  });
2945
2945
  }
2946
2946
  };
2947
- F({
2947
+ I({
2948
2948
  prefix: "aiobj",
2949
2949
  size: 24
2950
2950
  }), W.object({
@@ -2964,7 +2964,7 @@ F({
2964
2964
  description: W.string().optional(),
2965
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
  });
@@ -2980,7 +2980,7 @@ async function ka({ response: e, url: t, fallbackMessage: n }) {
2980
2980
  }
2981
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
  });
@@ -3008,9 +3008,9 @@ var Ma = class {
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 H(this.body), r = await H(this.headers), i = await H(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 Ma = 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,
@@ -3050,9 +3050,9 @@ var Ma = class {
3050
3050
  return this.processResponseStream(d.body);
3051
3051
  }
3052
3052
  async reconnectToStream(e) {
3053
- let t = await H(this.body), n = await H(this.headers), r = await H(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,7 +3063,7 @@ var Ma = class {
3063
3063
  headers: i,
3064
3064
  credentials: r,
3065
3065
  requestMetadata: e.metadata
3066
- }), o = a?.api ?? ja(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,
@@ -3083,7 +3083,7 @@ var Ma = class {
3083
3083
  super(e);
3084
3084
  }
3085
3085
  processResponseStream(e) {
3086
- return ui({
3086
+ return li({
3087
3087
  stream: e,
3088
3088
  schema: ga
3089
3089
  }).pipeThrough(new TransformStream({ async transform(e, t) {
@@ -3092,7 +3092,7 @@ var Ma = class {
3092
3092
  } }));
3093
3093
  }
3094
3094
  }, Pa = class {
3095
- constructor({ generateId: e = qn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
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
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({
@@ -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(pe), 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,14 +3666,14 @@ 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;
3676
+ if (b(e)) return null;
3677
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,
@@ -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 = ae(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,
@@ -3700,13 +3700,13 @@ function lo(e, t, n) {
3700
3700
  function uo(e, t) {
3701
3701
  let n = [`Code:\n${e.cellCode}`];
3702
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 = w(e.cellId, t);
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}`,
@@ -3721,7 +3721,7 @@ function po(e) {
3721
3721
  function mo(e) {
3722
3722
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
3723
3723
  }
3724
- var ho = new he("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 he("error", "errors"), go = class extends T {
3730
3730
  super(), this.store = e;
3731
3731
  }
3732
3732
  getItems() {
3733
- let e = ge(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 he("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 he("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 = oe(), 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 he("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) => {
@@ -3940,7 +3940,7 @@ var ho = new he("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 he("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 he("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 he("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,
3999
- type: Ee(n),
3998
+ boost: n.source_type === "local" ? S.LOCAL_TABLE : S.REMOTE_TABLE,
3999
+ type: ce(n),
4000
4000
  apply: `@${t}`,
4001
4001
  section: {
4002
- name: Ee(n) === "dataframe" ? "Dataframe" : "Table",
4003
- rank: x.TABLE.rank
4002
+ name: ce(n) === "dataframe" ? "Dataframe" : "Table",
4003
+ rank: O.TABLE.rank
4004
4004
  },
4005
4005
  info: () => this.createTableInfoElement(t, n)
4006
4006
  };
@@ -4058,7 +4058,7 @@ var ho = new he("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 he("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: () => ue(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 he("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(re), n = e.get(ce), r = e.get(ye);
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(ie());
4111
+ return new yo(ae());
4112
4112
  }
4113
4113
  //#endregion
4114
4114
  //#region src/components/editor/ai/completion-utils.ts
@@ -4201,7 +4201,7 @@ var Do = (e) => {
4201
4201
  let l = o ? "reasoning" : s, u;
4202
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, J.jsx)(j, {
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
4206
  children: /* @__PURE__ */ (0, J.jsxs)("span", {
4207
4207
  className: "flex items-center gap-2",
@@ -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, J.jsx)(_, {
4216
+ t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(j, {
4217
4217
  className: "pb-2 px-2",
4218
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
4220
  children: /* @__PURE__ */ (0, J.jsx)("div", {
4221
4221
  className: "pr-6",
4222
- children: /* @__PURE__ */ (0, J.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, J.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, J.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",
@@ -4342,7 +4342,7 @@ var jo = (e) => {
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, J.jsx)(me, { 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
4347
  t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
4348
4348
  className: "font-semibold",
@@ -4403,13 +4403,13 @@ function Po(e) {
4403
4403
  function Fo(e) {
4404
4404
  return e == null || typeof e == "object" && mt(e);
4405
4405
  }
4406
- var Io = $e({
4407
- status: Xe().default("success"),
4408
- auth_required: qe().default(!1),
4409
- action_url: lt().optional(),
4410
- next_steps: lt().optional(),
4411
- meta: lt().optional(),
4412
- message: Xe().nullish()
4406
+ var Io = Ke({
4407
+ status: Ze().default("success"),
4408
+ auth_required: ct().default(!1),
4409
+ action_url: nt().optional(),
4410
+ next_steps: nt().optional(),
4411
+ meta: nt().optional(),
4412
+ message: Ze().nullish()
4413
4413
  }), Lo = (e) => {
4414
4414
  let t = (0, N.c)(12), { data: n } = e, r;
4415
4415
  if (t[0] !== n) {
@@ -4439,7 +4439,7 @@ var Io = $e({
4439
4439
  let m;
4440
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, J.jsx)(ve, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.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
  })]
@@ -4508,7 +4508,7 @@ var Bo = {
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, J.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;
@@ -4521,7 +4521,7 @@ var Bo = {
4521
4521
  default: {
4522
4522
  Oe(n);
4523
4523
  let e;
4524
- return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.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
  };
@@ -4540,37 +4540,37 @@ var Wo = (e) => {
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, J.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, J.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, J.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, J.jsx)(j, {
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, J.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
4575
  children: /* @__PURE__ */ (0, J.jsx)(Go, {
4576
4576
  state: r,
@@ -4580,13 +4580,13 @@ 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, J.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, J.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,
@@ -4699,7 +4699,7 @@ 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, J.jsx)(q.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(O, { content: o.text }, s);
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
4703
  case "reasoning": return /* @__PURE__ */ (0, J.jsx)(ko, {
4704
4704
  reasoning: o.text,
4705
4705
  index: s,
@@ -4723,12 +4723,12 @@ var Wo = (e) => {
4723
4723
  isActive: i
4724
4724
  }, s);
4725
4725
  case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4726
- icon: /* @__PURE__ */ (0, J.jsx)(we, { className: "h-3 w-3 shrink-0" }),
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
4730
  case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4731
- icon: /* @__PURE__ */ (0, J.jsx)(fe, { className: "h-3 w-3 shrink-0" }),
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
@@ -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 yt.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 = xt.define(), $o = xt.define(), es = 50, ts = kt.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(wt.of([{
4817
+ return n && r.push(kt.of([{
4818
4818
  key: "ArrowUp",
4819
4819
  run: ns
4820
4820
  }, {
@@ -4823,8 +4823,8 @@ function is(e = {}) {
4823
4823
  }])), r;
4824
4824
  }
4825
4825
  //#endregion
4826
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4827
- var as = xt.define(), Q = kt.define({
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 = yt.define(), Q = Et.define({
4828
4828
  create() {
4829
4829
  return /* @__PURE__ */ new Map();
4830
4830
  },
@@ -4836,7 +4836,7 @@ var as = xt.define(), Q = kt.define({
4836
4836
  }
4837
4837
  return r;
4838
4838
  }
4839
- }), os = kt.define({
4839
+ }), os = Et.define({
4840
4840
  create() {
4841
4841
  return {
4842
4842
  onResourceClick: void 0,
@@ -4848,8 +4848,8 @@ var as = xt.define(), Q = kt.define({
4848
4848
  update(e) {
4849
4849
  return e;
4850
4850
  }
4851
- }), ss = xt.define();
4852
- kt.define({
4851
+ }), ss = yt.define();
4852
+ Et.define({
4853
4853
  create() {
4854
4854
  return /* @__PURE__ */ new Map();
4855
4855
  },
@@ -4863,7 +4863,7 @@ kt.define({
4863
4863
  }
4864
4864
  });
4865
4865
  //#endregion
4866
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4866
+ //#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/completion.js
4867
4867
  var cs = (e, t) => async (n) => {
4868
4868
  let r = n.matchBefore(/@(\w+)?/);
4869
4869
  if (!r || r.from === r.to && !n.explicit) return null;
@@ -4896,8 +4896,8 @@ function $(e) {
4896
4896
  return e.matchAll(new RegExp(ls.source, "g"));
4897
4897
  }
4898
4898
  //#endregion
4899
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4900
- var us = class extends Dt {
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 Ct {
4901
4901
  resource;
4902
4902
  view;
4903
4903
  constructor(e, t) {
@@ -4918,7 +4918,7 @@ var us = class extends Dt {
4918
4918
  e.preventDefault(), e.stopPropagation(), i(this.resource);
4919
4919
  }), e;
4920
4920
  }
4921
- }, ds = class extends Dt {
4921
+ }, ds = class extends Ct {
4922
4922
  uri;
4923
4923
  view;
4924
4924
  constructor(e, t) {
@@ -4938,10 +4938,10 @@ 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(Ct.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(Ct.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 Ct.set(n);
4944
+ return Tt.set(n);
4945
4945
  }
4946
4946
  var ps = Ot.fromClass(class {
4947
4947
  decorations;
@@ -4953,7 +4953,7 @@ var ps = Ot.fromClass(class {
4953
4953
  }
4954
4954
  }, { decorations: (e) => e.decorations });
4955
4955
  //#endregion
4956
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
4956
+ //#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/hover.js
4957
4957
  function ms(e) {
4958
4958
  let t = document.createElement("div");
4959
4959
  t.className = "cm-tooltip-cursor";
@@ -4983,7 +4983,7 @@ function hs(e, t, n, r = 0) {
4983
4983
  return null;
4984
4984
  }
4985
4985
  function gs(e) {
4986
- return Et((t, n) => {
4986
+ return Dt((t, n) => {
4987
4987
  let { from: r, text: i } = t.state.doc.lineAt(n), a = hs(i, n, t.state.field(Q), r);
4988
4988
  return a ? {
4989
4989
  pos: a.start,
@@ -4996,7 +4996,7 @@ function gs(e) {
4996
4996
  });
4997
4997
  }
4998
4998
  //#endregion
4999
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
4999
+ //#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/input-filter.js
5000
5000
  function _s(e, t) {
5001
5001
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
5002
5002
  if (o.length === 0) return null;
@@ -5053,8 +5053,8 @@ function xs(e, t) {
5053
5053
  }
5054
5054
  return null;
5055
5055
  }
5056
- var Ss = Tt.transactionFilter.of((e) => {
5057
- let t = e.annotation(St.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;
@@ -5239,8 +5239,8 @@ function ks(e, t = {}) {
5239
5239
  return Ot.fromClass(Os(e, t));
5240
5240
  }
5241
5241
  //#endregion
5242
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5243
- var As = vt.baseTheme({
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 = 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,7 +5273,7 @@ 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
- bt.high(wt.of([{
5276
+ xt.high(kt.of([{
5277
5277
  key: "Tab",
5278
5278
  preventDefault: !0,
5279
5279
  run: (e) => jt(e)
@@ -5301,10 +5301,10 @@ function Fs(e) {
5301
5301
  }
5302
5302
  function Is(e) {
5303
5303
  let t = document.createElement("div");
5304
- return t.innerHTML = e, { dom: t };
5304
+ return t.textContent = e, { dom: t };
5305
5305
  }
5306
- Se("marimo:ai-language", "python", de);
5307
- var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) => {
5306
+ _e("marimo:ai-language", "python", he);
5307
+ var Ls = "marimo:ai-prompt-history", Rs = new Ee(Je(Ze()), () => []), zs = (e) => {
5308
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
5310
  let y = ht(v), b, x, S, C;
@@ -5324,7 +5324,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) =
5324
5324
  let T;
5325
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 = bt.highest(wt.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 se(nt(Xe()), () => []), zs = (e) =
5348
5348
  }
5349
5349
  }])), t[12] = m, t[13] = E);
5350
5350
  let D;
5351
- t[14] === h ? D = t[15] : (D = wt.of([{
5351
+ t[14] === h ? D = t[15] : (D = kt.of([{
5352
5352
  key: "Escape",
5353
5353
  preventDefault: !0,
5354
5354
  stopPropagation: !0,
@@ -5361,7 +5361,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) =
5361
5361
  S,
5362
5362
  C,
5363
5363
  w,
5364
- vt.lineWrapping,
5364
+ St.lineWrapping,
5365
5365
  T,
5366
5366
  E,
5367
5367
  D
@@ -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 = Qe({
5395
- type: Je("stream_chunk"),
5396
- message_id: Xe(),
5397
- content: lt().nullable().transform((e) => e),
5398
- is_final: qe().optional()
5394
+ var Hs = g, Us = tt({
5395
+ type: st("stream_chunk"),
5396
+ message_id: Ze(),
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,13 +5407,15 @@ 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, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null), v = (0, q.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
5412
  let y = (0, q.useRef)(s);
5413
- y.current = s;
5413
+ (0, q.useLayoutEffect)(() => {
5414
+ y.current = s;
5415
+ }, [s]);
5414
5416
  let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
5415
5417
  S.current = null, w(null);
5416
- }, { data: D } = Lt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: j, stop: te, error: M, regenerate: re, clearError: ie, addToolApprovalResponse: ae } = 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({
5417
5419
  sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
5418
5420
  transport: new Na({ fetch: async (t, n) => {
5419
5421
  if (n === void 0) return fetch(t);
@@ -5429,7 +5431,7 @@ var Gs = (e) => {
5429
5431
  let t = i.messages.map((e) => ({
5430
5432
  ...e,
5431
5433
  content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
5432
- })), n = _e();
5434
+ })), n = ue();
5433
5435
  T();
5434
5436
  let s = new ReadableStream({
5435
5437
  start(t) {
@@ -5467,7 +5469,7 @@ var Gs = (e) => {
5467
5469
  } }),
5468
5470
  messages: O,
5469
5471
  onFinish: ({ messages: t, isAbort: n, finishReason: i }) => {
5470
- 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:", {
5471
5473
  finishReason: i,
5472
5474
  isAbort: n
5473
5475
  }), n) {
@@ -5515,19 +5517,20 @@ var Gs = (e) => {
5515
5517
  displayLabel: e,
5516
5518
  apply: e
5517
5519
  }))
5518
- }, ue = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5520
+ }, de = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5519
5521
  (0, q.useEffect)(() => {
5520
- v.current?.scrollTo({
5521
- top: v.current.scrollHeight,
5522
+ _.current?.scrollTo({
5523
+ top: _.current.scrollHeight,
5522
5524
  behavior: "smooth"
5523
5525
  });
5524
- }, [k.length, v]);
5525
- let de = _.current?.view, fe = () => {
5526
- if (de) {
5527
- let e = de.state.doc.length;
5528
- de.dispatch({ changes: {
5526
+ }, [k.length, _]);
5527
+ let fe = () => {
5528
+ let e = g.current?.view;
5529
+ if (e) {
5530
+ let t = e.state.doc.length;
5531
+ e.dispatch({ changes: {
5529
5532
  from: 0,
5530
- to: e,
5533
+ to: t,
5531
5534
  insert: ""
5532
5535
  } });
5533
5536
  }
@@ -5540,6 +5543,7 @@ var Gs = (e) => {
5540
5543
  /* @__PURE__ */ (0, J.jsx)("div", {
5541
5544
  className: "absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg",
5542
5545
  children: /* @__PURE__ */ (0, J.jsx)(a, {
5546
+ "aria-label": "Reset chat",
5543
5547
  variant: "text",
5544
5548
  size: "icon",
5545
5549
  disabled: k.length === 0,
@@ -5551,7 +5555,7 @@ var Gs = (e) => {
5551
5555
  }),
5552
5556
  /* @__PURE__ */ (0, J.jsxs)("div", {
5553
5557
  className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
5554
- ref: v,
5558
+ ref: _,
5555
5559
  children: [
5556
5560
  k.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
5557
5561
  className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
@@ -5581,23 +5585,24 @@ var Gs = (e) => {
5581
5585
  addToolApprovalResponse: r ? ae : void 0
5582
5586
  })
5583
5587
  }), /* @__PURE__ */ (0, J.jsxs)("div", {
5584
- className: "flex justify-end text-xs gap-2 invisible group-hover:visible",
5588
+ className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
5585
5589
  children: [/* @__PURE__ */ (0, J.jsx)(l, {
5586
5590
  value: n,
5587
5591
  className: "h-3 w-3",
5588
5592
  buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
5589
5593
  }), /* @__PURE__ */ (0, J.jsx)("button", {
5590
5594
  type: "button",
5595
+ "aria-label": "Delete message",
5591
5596
  onClick: () => se(e.id),
5592
5597
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5593
- children: /* @__PURE__ */ (0, J.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)" })
5594
5599
  })]
5595
5600
  })]
5596
- }, `${e.id}-${t}`);
5601
+ }, e.id);
5597
5602
  }),
5598
5603
  oe && /* @__PURE__ */ (0, J.jsx)("div", {
5599
5604
  className: "flex items-center justify-center mb-4",
5600
- children: /* @__PURE__ */ (0, J.jsx)(E, { size: "small" })
5605
+ children: /* @__PURE__ */ (0, J.jsx)(D, { size: "small" })
5601
5606
  }),
5602
5607
  M && /* @__PURE__ */ (0, J.jsxs)("div", {
5603
5608
  className: "flex items-center justify-center space-x-2 mb-4",
@@ -5629,7 +5634,7 @@ var Gs = (e) => {
5629
5634
  }, ...r ?? []]
5630
5635
  }), fe();
5631
5636
  },
5632
- ref: g,
5637
+ ref: h,
5633
5638
  inert: e.disabled || void 0,
5634
5639
  className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
5635
5640
  children: [
@@ -5641,19 +5646,20 @@ var Gs = (e) => {
5641
5646
  prompts: e.prompts,
5642
5647
  onSelect: (e) => {
5643
5648
  o(e), requestAnimationFrame(() => {
5644
- de?.focus(), Ce(de);
5649
+ let e = g.current?.view;
5650
+ e?.focus(), ve(e);
5645
5651
  });
5646
5652
  }
5647
5653
  }),
5648
5654
  /* @__PURE__ */ (0, J.jsx)(zs, {
5649
5655
  className: "rounded-sm mr-2",
5650
- placeholder: ue,
5656
+ placeholder: de,
5651
5657
  value: t,
5652
- inputRef: _,
5658
+ inputRef: g,
5653
5659
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
5654
5660
  onChange: o,
5655
5661
  onSubmit: (e, t) => {
5656
- t.trim() && g.current?.requestSubmit();
5662
+ t.trim() && h.current?.requestSubmit();
5657
5663
  },
5658
5664
  onClose: () => {},
5659
5665
  additionalCompletions: le
@@ -5673,7 +5679,7 @@ var Gs = (e) => {
5673
5679
  variant: "text",
5674
5680
  size: "sm",
5675
5681
  onClick: () => {
5676
- p(void 0), h.current && (h.current.value = "");
5682
+ p(void 0), m.current && (m.current.value = "");
5677
5683
  },
5678
5684
  children: /* @__PURE__ */ (0, J.jsx)(De, { className: "size-3" })
5679
5685
  }),
@@ -5681,11 +5687,11 @@ var Gs = (e) => {
5681
5687
  type: "button",
5682
5688
  variant: "text",
5683
5689
  size: "sm",
5684
- onClick: () => h.current?.click(),
5690
+ onClick: () => m.current?.click(),
5685
5691
  children: /* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-4" })
5686
5692
  }), /* @__PURE__ */ (0, J.jsx)("input", {
5687
5693
  type: "file",
5688
- ref: h,
5694
+ ref: m,
5689
5695
  className: "hidden",
5690
5696
  multiple: !0,
5691
5697
  accept: Array.isArray(e.allowAttachments) ? e.allowAttachments.join(",") : void 0,
@@ -5767,10 +5773,10 @@ var Gs = (e) => {
5767
5773
  t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (e) => {
5768
5774
  e.key === "Enter" && (e.preventDefault(), o(!1));
5769
5775
  }, t[3] = l) : l = t[3];
5770
- let u = l, f;
5771
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(ne, {
5776
+ let f = l, p;
5777
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)(ne, {
5772
5778
  content: "Configuration",
5773
- children: /* @__PURE__ */ (0, J.jsx)(d, {
5779
+ children: /* @__PURE__ */ (0, J.jsx)(h, {
5774
5780
  asChild: !0,
5775
5781
  children: /* @__PURE__ */ (0, J.jsx)(a, {
5776
5782
  variant: "outline",
@@ -5779,13 +5785,13 @@ var Gs = (e) => {
5779
5785
  children: /* @__PURE__ */ (0, J.jsx)(Gt, { className: "h-3 w-3" })
5780
5786
  })
5781
5787
  })
5782
- }), t[4] = f) : f = t[4];
5788
+ }), t[4] = p) : p = t[4];
5783
5789
  let m;
5784
5790
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, J.jsx)("h4", {
5785
5791
  className: "font-bold leading-none",
5786
5792
  children: "Configuration"
5787
5793
  }), t[5] = m) : m = t[5];
5788
- let h;
5794
+ let g;
5789
5795
  if (t[6] !== n || t[7] !== c) {
5790
5796
  let e;
5791
5797
  t[9] === c ? e = t[10] : (e = (e) => {
@@ -5813,33 +5819,33 @@ var Gs = (e) => {
5813
5819
  maxValue: Ks[t].max,
5814
5820
  step: Ks[t].step ?? 1,
5815
5821
  onChange: (e) => c(t, e),
5816
- onKeyDown: u,
5822
+ onKeyDown: f,
5817
5823
  className: "col-span-3"
5818
5824
  })]
5819
5825
  }, t);
5820
- }, t[9] = c, t[10] = e), h = At.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5821
- } else h = t[8];
5822
- let g;
5823
- t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, J.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, {
5824
5830
  className: "w-70 border",
5825
5831
  children: /* @__PURE__ */ (0, J.jsxs)("div", {
5826
5832
  className: "grid gap-3",
5827
- children: [m, h]
5833
+ children: [m, g]
5828
5834
  })
5829
- }), t[11] = h, t[12] = g);
5830
- let _;
5831
- return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, J.jsxs)(te, {
5835
+ }), t[11] = g, t[12] = _);
5836
+ let v;
5837
+ return t[13] !== i || t[14] !== _ ? (v = /* @__PURE__ */ (0, J.jsxs)(u, {
5832
5838
  open: i,
5833
5839
  onOpenChange: o,
5834
- children: [f, g]
5835
- }), 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;
5836
5842
  }, Js = (e) => {
5837
5843
  let t = (0, N.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
5838
5844
  t[0] === r ? l = t[1] : (l = (e) => {
5839
5845
  [...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
5840
5846
  }, t[0] = r, t[1] = l);
5841
- let u = l, d;
5842
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(ne, {
5847
+ let f = l, p;
5848
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)(ne, {
5843
5849
  content: "Select a prompt",
5844
5850
  children: /* @__PURE__ */ (0, J.jsx)(Me, {
5845
5851
  asChild: !0,
@@ -5847,78 +5853,73 @@ var Gs = (e) => {
5847
5853
  variant: "outline",
5848
5854
  size: "sm",
5849
5855
  className: "border-none shadow-none hover:bg-transparent",
5850
- children: /* @__PURE__ */ (0, J.jsx)(ee, { className: "h-3 w-3" })
5856
+ children: /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3" })
5851
5857
  })
5852
5858
  })
5853
- }), t[2] = d) : d = t[2];
5854
- let f;
5855
- 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) {
5856
5862
  let e;
5857
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(Pe, {
5858
- onSelect: () => u(e),
5863
+ t[6] === f ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(Pe, {
5864
+ onSelect: () => f(e),
5859
5865
  className: "whitespace-normal text-left",
5860
5866
  children: e
5861
- }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
5862
- } else f = t[5];
5863
- let m;
5864
- t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Ie, { children: [d, /* @__PURE__ */ (0, J.jsx)(Fe, {
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, {
5865
5871
  side: "right",
5866
5872
  align: "end",
5867
5873
  onCloseAutoFocus: Xs,
5868
5874
  className: "w-64 max-h-96 overflow-y-auto",
5869
- children: f
5870
- })] }) }), t[8] = f, t[9] = m);
5871
- let h;
5872
- t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
5873
- let g;
5874
- t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, J.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, {
5875
5881
  side: "right",
5876
5882
  align: "end",
5877
5883
  className: "min-w-80 px-2",
5878
5884
  children: /* @__PURE__ */ (0, J.jsx)(Ys, {
5879
5885
  prompt: s,
5880
- onClose: h,
5886
+ onClose: _,
5881
5887
  onSelect: r
5882
- })
5883
- }), t[11] = r, t[12] = s, t[13] = g) : g = t[13];
5884
- let _;
5885
- return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, J.jsxs)(te, {
5888
+ }, s)
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, {
5886
5892
  open: i,
5887
5893
  onOpenChange: o,
5888
- children: [m, g]
5889
- }), 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;
5890
5896
  }, Ys = (e) => {
5891
- let t = (0, N.c)(32), { prompt: n, onClose: r, onSelect: i } = e, o;
5892
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {}, t[0] = o) : o = t[0];
5893
- let [s, c] = (0, q.useState)(o), l, u;
5894
- t[1] === n ? (l = t[2], u = t[3]) : (l = () => {
5895
- let e = [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {});
5896
- c(e);
5897
- }, u = [n], t[1] = n, t[2] = l, t[3] = u), (0, q.useEffect)(l, u);
5898
- let d;
5899
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = (e, t) => {
5897
+ let t = (0, N.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
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, q.useState)(o), l;
5900
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
5900
5901
  c((n) => ({
5901
5902
  ...n,
5902
5903
  [e]: t
5903
5904
  }));
5904
- }, t[4] = d) : d = t[4];
5905
- let f = d, p;
5906
- if (t[5] !== n || t[6] !== s) {
5905
+ }, t[2] = l) : l = t[2];
5906
+ let u = l, d;
5907
+ if (t[3] !== n || t[4] !== s) {
5907
5908
  let e;
5908
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[8] = e) : e = t[8];
5909
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (e = /{{(\w+)}}/g, t[6] = e) : e = t[6];
5909
5910
  let r;
5910
- t[9] === s ? r = t[10] : (r = (e, t) => s[t] || `{{${t}}}`, t[9] = s, t[10] = r), p = n.replaceAll(e, r), t[5] = n, t[6] = s, t[7] = p;
5911
- } else p = t[7];
5911
+ t[7] === s ? r = t[8] : (r = (e, t) => s[t] || `{{${t}}}`, t[7] = s, t[8] = r), d = n.replaceAll(e, r), t[3] = n, t[4] = s, t[5] = d;
5912
+ } else d = t[5];
5913
+ let f = d, p;
5914
+ t[9] === s ? p = t[10] : (p = Object.values(s).some(Qs), t[9] = s, t[10] = p);
5912
5915
  let m = p, h;
5913
- t[11] === s ? h = t[12] : (h = Object.values(s).some(Qs), t[11] = s, t[12] = h);
5916
+ t[11] !== r || t[12] !== i || t[13] !== f ? (h = () => {
5917
+ i(f), r();
5918
+ }, t[11] = r, t[12] = i, t[13] = f, t[14] = h) : h = t[14];
5914
5919
  let g = h, _;
5915
- t[13] !== r || t[14] !== i || t[15] !== m ? (_ = () => {
5916
- i(m), r();
5917
- }, t[13] = r, t[14] = i, t[15] = m, t[16] = _) : _ = t[16];
5918
- let v = _, y;
5919
- t[17] === s ? y = t[18] : (y = Object.entries(s), t[17] = s, t[18] = y);
5920
- let b;
5921
- t[19] !== v || t[20] !== g || t[21] !== y ? (b = y.map((e, t) => {
5920
+ t[15] === s ? _ = t[16] : (_ = Object.entries(s), t[15] = s, t[16] = _);
5921
+ let v;
5922
+ t[17] !== g || t[18] !== m || t[19] !== _ ? (v = _.map((e, t) => {
5922
5923
  let [n, r] = e;
5923
5924
  return /* @__PURE__ */ (0, J.jsxs)("div", {
5924
5925
  className: "grid grid-cols-4 items-center gap-2",
@@ -5929,41 +5930,41 @@ var Gs = (e) => {
5929
5930
  }), /* @__PURE__ */ (0, J.jsx)(Ne, {
5930
5931
  id: n,
5931
5932
  value: r,
5932
- onChange: (e) => f(n, e.target.value),
5933
+ onChange: (e) => u(n, e.target.value),
5933
5934
  rootClassName: "col-span-3 w-full",
5934
5935
  className: "m-0",
5935
5936
  placeholder: `Enter value for ${n}`,
5936
5937
  autoFocus: t === 0,
5937
5938
  onKeyDown: (e) => {
5938
- e.key === "Enter" && !g && v();
5939
+ e.key === "Enter" && !m && g();
5939
5940
  }
5940
5941
  })]
5941
5942
  }, n);
5942
- }), t[19] = v, t[20] = g, t[21] = y, t[22] = b) : b = t[22];
5943
- let x;
5944
- t[23] === m ? x = t[24] : (x = /* @__PURE__ */ (0, J.jsx)("div", {
5943
+ }), t[17] = g, t[18] = m, t[19] = _, t[20] = v) : v = t[20];
5944
+ let y;
5945
+ t[21] === f ? y = t[22] : (y = /* @__PURE__ */ (0, J.jsx)("div", {
5945
5946
  className: "grid gap-2 prose dark:prose-invert",
5946
5947
  children: /* @__PURE__ */ (0, J.jsx)("blockquote", {
5947
5948
  className: "text-sm",
5948
- children: m
5949
+ children: f
5949
5950
  })
5950
- }), t[23] = m, t[24] = x);
5951
- let S;
5952
- t[25] !== v || t[26] !== g ? (S = /* @__PURE__ */ (0, J.jsx)(a, {
5953
- onClick: v,
5951
+ }), t[21] = f, t[22] = y);
5952
+ let b;
5953
+ t[23] !== g || t[24] !== m ? (b = /* @__PURE__ */ (0, J.jsx)(a, {
5954
+ onClick: g,
5954
5955
  size: "xs",
5955
- disabled: g,
5956
+ disabled: m,
5956
5957
  children: "Submit"
5957
- }), t[25] = v, t[26] = g, t[27] = S) : S = t[27];
5958
- let C;
5959
- return t[28] !== x || t[29] !== S || t[30] !== b ? (C = /* @__PURE__ */ (0, J.jsxs)("div", {
5958
+ }), t[23] = g, t[24] = m, t[25] = b) : b = t[25];
5959
+ let x;
5960
+ return t[26] !== v || t[27] !== y || t[28] !== b ? (x = /* @__PURE__ */ (0, J.jsxs)("div", {
5960
5961
  className: "grid gap-4",
5961
5962
  children: [
5962
- b,
5963
- x,
5964
- S
5963
+ v,
5964
+ y,
5965
+ b
5965
5966
  ]
5966
- }), t[28] = x, t[29] = S, t[30] = b, t[31] = C) : C = t[31], C;
5967
+ }), t[26] = v, t[27] = y, t[28] = b, t[29] = x) : x = t[29], x;
5967
5968
  };
5968
5969
  function Xs(e) {
5969
5970
  return e.preventDefault();