@marimo-team/islands 0.14.18-dev4 → 0.14.18-dev40

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 (1228) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BxgomKEj.js → ConnectedDataExplorerComponent-D9q8jDgz.js} +2 -2
  2. package/dist/{ImageComparisonComponent-euoD7dEQ.js → ImageComparisonComponent-TLrFyeGm.js} +1 -1
  3. package/dist/{_baseUniq-B0fx6-mD.js → _baseUniq-C789h55S.js} +54 -54
  4. package/dist/{any-language-editor-Dhx2399Z.js → any-language-editor-CtYF3mh0.js} +1 -1
  5. package/dist/{architectureDiagram-SUXI7LT5-B0sXh36T.js → architectureDiagram-SUXI7LT5-tI_uA6-G.js} +5 -5
  6. package/dist/assets/{worker-BFGyNjDW.js → worker-COGufAQn.js} +866 -857
  7. package/dist/{blockDiagram-6J76NXCF-BV6y0dGc.js → blockDiagram-6J76NXCF-BkW28X9c.js} +5 -5
  8. package/dist/{c4Diagram-6F6E4RAY-DMvA8syT.js → c4Diagram-6F6E4RAY-Oc0r0zWU.js} +2 -2
  9. package/dist/{channel-DUrqW7jq.js → channel-Cug1-1-S.js} +1 -1
  10. package/dist/{chunk-353BL4L5-D07DCz1P.js → chunk-353BL4L5-BZJMXfnU.js} +1 -1
  11. package/dist/{chunk-67H74DCK-Dxl6YFgh.js → chunk-67H74DCK-m0H-ur8r.js} +1 -1
  12. package/dist/{chunk-AACKK3MU-CAcS9PuO.js → chunk-AACKK3MU-gr8QIV67.js} +1 -1
  13. package/dist/{chunk-BFAMUDN2-Co4EIchY.js → chunk-BFAMUDN2-BYrkUIjj.js} +1 -1
  14. package/dist/{chunk-E2GYISFI-C_TSWe1f.js → chunk-E2GYISFI-CeMgtQH_.js} +1 -1
  15. package/dist/{chunk-OW32GOEJ-C11RCuWa.js → chunk-OW32GOEJ-zkwG7LnM.js} +3 -3
  16. package/dist/{chunk-SKB7J2MH-rWkMGBQ9.js → chunk-SKB7J2MH-_tLm2ZU7.js} +1 -1
  17. package/dist/{chunk-SZ463SBG-C32KIeaO.js → chunk-SZ463SBG-CHYxV7Jf.js} +4 -4
  18. package/dist/{classDiagram-v2-YAWTLIQI-DxWIMGpC.js → classDiagram-M3E45YP4-D2Gg6x1M.js} +2 -2
  19. package/dist/{classDiagram-M3E45YP4-DxWIMGpC.js → classDiagram-v2-YAWTLIQI-D2Gg6x1M.js} +2 -2
  20. package/dist/{clone-ByH0K_W2.js → clone-BZjp8DHO.js} +1 -1
  21. package/dist/common-keywords-BefPf8TA.js +7 -0
  22. package/dist/{dagre-JOIXM2OF-f0SO6y9I.js → dagre-JOIXM2OF-C35wyuSf.js} +6 -6
  23. package/dist/{data-grid-overlay-editor-CfB3QC9_.js → data-grid-overlay-editor-DSpSXYZ0.js} +2 -2
  24. package/dist/{diagram-5UYTHUR4-F7GLu-Ns.js → diagram-5UYTHUR4-BTq6bqU6.js} +3 -3
  25. package/dist/{diagram-VMROVX33-Csog3YHt.js → diagram-VMROVX33-Cy-ErxuA.js} +5 -5
  26. package/dist/{diagram-ZTM2IBQH-Xjsw2NPe.js → diagram-ZTM2IBQH-mgYUHXfx.js} +3 -3
  27. package/dist/duckdb-keywords-WTV2Iln-.js +7 -0
  28. package/dist/{erDiagram-3M52JZNH-BAui6m1D.js → erDiagram-3M52JZNH-oW-ZhqQr.js} +4 -4
  29. package/dist/{flowDiagram-KYDEHFYC-0wQEMK2o.js → flowDiagram-KYDEHFYC-IkABodJ8.js} +5 -5
  30. package/dist/{ganttDiagram-EK5VF46D-DHo-b5pj.js → ganttDiagram-EK5VF46D-hP8YkTqz.js} +77 -77
  31. package/dist/{gitGraphDiagram-GW3U2K7C-wZ-56Hnm.js → gitGraphDiagram-GW3U2K7C-DcZiyFUT.js} +4 -4
  32. package/dist/{glide-data-editor-B3XVw2Mw.js → glide-data-editor-sn6tfLNF.js} +3 -3
  33. package/dist/{graph-DXnsoOOA.js → graph-B03e3k7d.js} +3 -3
  34. package/dist/{index-CU6lfdjU.js → index-BU6LQTfP.js} +144 -144
  35. package/dist/{index-B-ooTna3.js → index-Clz9Ku-U.js} +1 -1
  36. package/dist/{index-DO0k7DqJ.js → index-Cz2tYb3q.js} +1 -1
  37. package/dist/{index-B6IPVf5H.js → index-PgGpU5la.js} +1 -1
  38. package/dist/index-pjylFSfy.js +40315 -0
  39. package/dist/{infoDiagram-LHK5PUON-DUJ_JyYE.js → infoDiagram-LHK5PUON-DW_psL4D.js} +2 -2
  40. package/dist/{journeyDiagram-EWQZEKCU-CoKJET3s.js → journeyDiagram-EWQZEKCU-btmYkpZ5.js} +3 -3
  41. package/dist/{kanban-definition-ZSS6B67P-77ozoRYv.js → kanban-definition-ZSS6B67P-BJgjVeuK.js} +2 -2
  42. package/dist/{layout-CVyew7cl.js → layout-D5tYKGro.js} +35 -35
  43. package/dist/{linear-KLiyUEfW.js → linear-C57Qg6o9.js} +19 -19
  44. package/dist/{main-oBXj9Aa7.js → main-D1gyEFIz.js} +41512 -40168
  45. package/dist/main.js +1 -1
  46. package/dist/{mermaid-DaNqdymj.js → mermaid-B67irHCy.js} +29 -29
  47. package/dist/{min-CtguZ_r5.js → min-DB4yN-iG.js} +14 -14
  48. package/dist/{mindmap-definition-6CBA2TL7-B2lGu2md.js → mindmap-definition-6CBA2TL7-Btj_GH0i.js} +2 -2
  49. package/dist/{number-overlay-editor-oN-BU6fN.js → number-overlay-editor-DLOwjGyR.js} +2 -2
  50. package/dist/{pieDiagram-NIOCPIFQ-BCBeeFaR.js → pieDiagram-NIOCPIFQ-zbyN2OKJ.js} +3 -3
  51. package/dist/{quadrantDiagram-2OG54O6I-BC4xBrui.js → quadrantDiagram-2OG54O6I-6nUlmHsX.js} +2 -2
  52. package/dist/{react-plotly-CiGb_W-q.js → react-plotly-QT9ITkZn.js} +1 -1
  53. package/dist/{requirementDiagram-QOLK2EJ7-B2-hPu1P.js → requirementDiagram-QOLK2EJ7-DHTcmfBW.js} +3 -3
  54. package/dist/{sankeyDiagram-4UZDY2LN-OwmYOUUc.js → sankeyDiagram-4UZDY2LN-C-KvjQAY.js} +1 -1
  55. package/dist/{sequenceDiagram-SKLFT4DO-B27yiIzR.js → sequenceDiagram-SKLFT4DO-DM4_c2yP.js} +3 -3
  56. package/dist/{slides-component-CRfxAQyL.js → slides-component-W8fG0alk.js} +26 -26
  57. package/dist/{stateDiagram-MI5ZYTHO-C_LRbiOo.js → stateDiagram-MI5ZYTHO-CBM4CjaM.js} +4 -4
  58. package/dist/{stateDiagram-v2-5AN5P6BG-DKz7e8Yc.js → stateDiagram-v2-5AN5P6BG-QO6urHDg.js} +2 -2
  59. package/dist/{time-C_5XCLWA.js → time-C5vL_Q_i.js} +2 -2
  60. package/dist/{timeline-definition-MYPXXCX6-C39p9cJ6.js → timeline-definition-MYPXXCX6-CjPJ5yOK.js} +1 -1
  61. package/dist/{treemap-75Q7IDZK-DG5pexEL.js → treemap-75Q7IDZK-CaHoPejr.js} +131 -131
  62. package/dist/{vega-component-B1zImi__.js → vega-component-D4reQ-3p.js} +2 -2
  63. package/dist/{xychartDiagram-H2YORKM3-D3ljR9-t.js → xychartDiagram-H2YORKM3-DHBboBU3.js} +2 -2
  64. package/package.json +12 -6
  65. package/src/README.md +18 -0
  66. package/src/__mocks__/common.ts +160 -0
  67. package/src/__mocks__/notebook.ts +76 -0
  68. package/src/__mocks__/requests.ts +72 -0
  69. package/src/__mocks__/tracebacks.ts +32 -0
  70. package/src/__tests__/CellStatus.test.tsx +263 -0
  71. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +523 -0
  72. package/src/__tests__/chat-utils.test.ts +234 -0
  73. package/src/__tests__/lru.test.ts +74 -0
  74. package/src/__tests__/main.test.tsx +174 -0
  75. package/src/__tests__/setup.ts +17 -0
  76. package/src/__tests__/test-helpers.ts +24 -0
  77. package/src/assets/circle-check.ico +0 -0
  78. package/src/assets/circle-play.ico +0 -0
  79. package/src/assets/circle-x.ico +0 -0
  80. package/src/assets/gradient.png +0 -0
  81. package/src/assets/icon-16x16.png +0 -0
  82. package/src/assets/icon-32x32.png +0 -0
  83. package/src/assets/noise.png +0 -0
  84. package/src/components/ai/ai-model-dropdown.tsx +280 -0
  85. package/src/components/ai/ai-provider-icon.tsx +52 -0
  86. package/src/components/app-config/ai-config.tsx +855 -0
  87. package/src/components/app-config/app-config-button.tsx +100 -0
  88. package/src/components/app-config/app-config-form.tsx +307 -0
  89. package/src/components/app-config/common.tsx +48 -0
  90. package/src/components/app-config/constants.ts +13 -0
  91. package/src/components/app-config/incorrect-model-id.tsx +43 -0
  92. package/src/components/app-config/is-overridden.tsx +119 -0
  93. package/src/components/app-config/optional-features.tsx +251 -0
  94. package/src/components/app-config/state.ts +18 -0
  95. package/src/components/app-config/user-config-form.tsx +1361 -0
  96. package/src/components/audio/audio-recorder.tsx +63 -0
  97. package/src/components/buttons/clear-button.tsx +23 -0
  98. package/src/components/buttons/undo-button.tsx +35 -0
  99. package/src/components/chat/chat-panel.tsx +715 -0
  100. package/src/components/chat/markdown-renderer.tsx +217 -0
  101. package/src/components/chat/reasoning-accordion.tsx +50 -0
  102. package/src/components/chat/tool-call-accordion.tsx +118 -0
  103. package/src/components/data-table/SearchBar.tsx +66 -0
  104. package/src/components/data-table/TableActions.tsx +183 -0
  105. package/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap +1079 -0
  106. package/src/components/data-table/__tests__/chart-spec-model.test.ts +707 -0
  107. package/src/components/data-table/__tests__/column_formatting.test.ts +115 -0
  108. package/src/components/data-table/__tests__/columns.test.tsx +341 -0
  109. package/src/components/data-table/__tests__/data-table.test.tsx +60 -0
  110. package/src/components/data-table/__tests__/pagination.test.tsx +152 -0
  111. package/src/components/data-table/__tests__/types.test.ts +44 -0
  112. package/src/components/data-table/__tests__/url-detector.test.tsx +169 -0
  113. package/src/components/data-table/__tests__/useColumnPinning.test.ts +76 -0
  114. package/src/components/data-table/cell-selection/__tests__/feature.test.ts +187 -0
  115. package/src/components/data-table/cell-selection/feature.ts +123 -0
  116. package/src/components/data-table/cell-selection/types.ts +49 -0
  117. package/src/components/data-table/cell-styling/feature.ts +40 -0
  118. package/src/components/data-table/cell-styling/types.ts +26 -0
  119. package/src/components/data-table/charts/README.md +65 -0
  120. package/src/components/data-table/charts/__tests__/__snapshots__/spec-snapshot.test.ts.snap +47 -0
  121. package/src/components/data-table/charts/__tests__/altair-generator.test.ts +425 -0
  122. package/src/components/data-table/charts/__tests__/renderer.test.ts +20 -0
  123. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +83 -0
  124. package/src/components/data-table/charts/__tests__/spec.test.ts +997 -0
  125. package/src/components/data-table/charts/__tests__/storage.test.ts +103 -0
  126. package/src/components/data-table/charts/chart-spec/altair-generator.ts +162 -0
  127. package/src/components/data-table/charts/chart-spec/encodings.ts +173 -0
  128. package/src/components/data-table/charts/chart-spec/spec.ts +345 -0
  129. package/src/components/data-table/charts/chart-spec/tooltips.ts +168 -0
  130. package/src/components/data-table/charts/chart-spec/types.ts +77 -0
  131. package/src/components/data-table/charts/charts.tsx +492 -0
  132. package/src/components/data-table/charts/components/chart-items.tsx +369 -0
  133. package/src/components/data-table/charts/components/chart-states.tsx +37 -0
  134. package/src/components/data-table/charts/components/form-fields.tsx +872 -0
  135. package/src/components/data-table/charts/components/layouts.tsx +118 -0
  136. package/src/components/data-table/charts/constants.ts +159 -0
  137. package/src/components/data-table/charts/context.ts +20 -0
  138. package/src/components/data-table/charts/forms/common-chart.tsx +202 -0
  139. package/src/components/data-table/charts/forms/heatmap.tsx +44 -0
  140. package/src/components/data-table/charts/forms/pie.tsx +70 -0
  141. package/src/components/data-table/charts/lazy-chart.tsx +56 -0
  142. package/src/components/data-table/charts/schemas.ts +140 -0
  143. package/src/components/data-table/charts/storage.ts +88 -0
  144. package/src/components/data-table/charts/types.ts +124 -0
  145. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +227 -0
  146. package/src/components/data-table/column-formatting/feature.ts +247 -0
  147. package/src/components/data-table/column-formatting/types.ts +54 -0
  148. package/src/components/data-table/column-header.tsx +672 -0
  149. package/src/components/data-table/column-summary/chart-skeleton.tsx +57 -0
  150. package/src/components/data-table/column-summary/chart-spec-model.tsx +916 -0
  151. package/src/components/data-table/column-summary/column-summary.tsx +166 -0
  152. package/src/components/data-table/column-summary/legacy-chart-spec.ts +242 -0
  153. package/src/components/data-table/column-summary/utils.ts +142 -0
  154. package/src/components/data-table/column-wrapping/feature.ts +62 -0
  155. package/src/components/data-table/column-wrapping/types.ts +29 -0
  156. package/src/components/data-table/columns.tsx +528 -0
  157. package/src/components/data-table/copy-column/feature.ts +27 -0
  158. package/src/components/data-table/copy-column/types.ts +19 -0
  159. package/src/components/data-table/data-table.tsx +298 -0
  160. package/src/components/data-table/date-popover.tsx +146 -0
  161. package/src/components/data-table/download-actions.tsx +186 -0
  162. package/src/components/data-table/filter-pills.tsx +120 -0
  163. package/src/components/data-table/filters.ts +202 -0
  164. package/src/components/data-table/focus-row/feature.ts +41 -0
  165. package/src/components/data-table/focus-row/types.ts +32 -0
  166. package/src/components/data-table/header-items.tsx +295 -0
  167. package/src/components/data-table/hooks/use-column-pinning.ts +51 -0
  168. package/src/components/data-table/hooks/use-panel-ownership.ts +98 -0
  169. package/src/components/data-table/loading-table.tsx +56 -0
  170. package/src/components/data-table/mime-cell.tsx +68 -0
  171. package/src/components/data-table/pagination.tsx +329 -0
  172. package/src/components/data-table/range-focus/__tests__/atoms.test.ts +907 -0
  173. package/src/components/data-table/range-focus/__tests__/utils.test.ts +316 -0
  174. package/src/components/data-table/range-focus/atoms.ts +380 -0
  175. package/src/components/data-table/range-focus/cell-selection-indicator.tsx +37 -0
  176. package/src/components/data-table/range-focus/provider.tsx +13 -0
  177. package/src/components/data-table/range-focus/use-cell-range-selection.ts +119 -0
  178. package/src/components/data-table/range-focus/use-scroll-into-view.ts +46 -0
  179. package/src/components/data-table/range-focus/utils.ts +105 -0
  180. package/src/components/data-table/renderers.tsx +247 -0
  181. package/src/components/data-table/row-viewer-panel/__tests__/filter-rows.test.ts +82 -0
  182. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +58 -0
  183. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +371 -0
  184. package/src/components/data-table/types.ts +81 -0
  185. package/src/components/data-table/uniformSample.tsx +19 -0
  186. package/src/components/data-table/url-detector.tsx +111 -0
  187. package/src/components/data-table/utils.ts +46 -0
  188. package/src/components/databases/display.tsx +66 -0
  189. package/src/components/databases/engine-variable.tsx +51 -0
  190. package/src/components/databases/icon.tsx +91 -0
  191. package/src/components/databases/icons/clickhouse.svg +1 -0
  192. package/src/components/databases/icons/databricks.svg +1 -0
  193. package/src/components/databases/icons/datafusion.png +0 -0
  194. package/src/components/databases/icons/duckdb.svg +1 -0
  195. package/src/components/databases/icons/googlebigquery.svg +1 -0
  196. package/src/components/databases/icons/iceberg.png +0 -0
  197. package/src/components/databases/icons/motherduck.svg +9 -0
  198. package/src/components/databases/icons/mysql.svg +1 -0
  199. package/src/components/databases/icons/postgresql.svg +1 -0
  200. package/src/components/databases/icons/redshift.svg +1 -0
  201. package/src/components/databases/icons/snowflake.svg +1 -0
  202. package/src/components/databases/icons/spark.svg +1 -0
  203. package/src/components/databases/icons/sqlalchemy.svg +1 -0
  204. package/src/components/databases/icons/sqlite.svg +1 -0
  205. package/src/components/databases/icons/timeplus.svg +17 -0
  206. package/src/components/databases/icons/trino.svg +1 -0
  207. package/src/components/datasets/icons.tsx +55 -0
  208. package/src/components/datasources/__tests__/install-package-button.test.tsx +85 -0
  209. package/src/components/datasources/__tests__/utils.test.ts +171 -0
  210. package/src/components/datasources/column-preview.tsx +269 -0
  211. package/src/components/datasources/components.tsx +100 -0
  212. package/src/components/datasources/datasources.tsx +782 -0
  213. package/src/components/datasources/install-package-button.tsx +46 -0
  214. package/src/components/datasources/utils.ts +62 -0
  215. package/src/components/debug/indicator.tsx +19 -0
  216. package/src/components/debugger/debugger-code.css +3 -0
  217. package/src/components/debugger/debugger-code.tsx +222 -0
  218. package/src/components/dependency-graph/custom-node.tsx +89 -0
  219. package/src/components/dependency-graph/dependency-graph-minimap.tsx +197 -0
  220. package/src/components/dependency-graph/dependency-graph-tree.tsx +181 -0
  221. package/src/components/dependency-graph/dependency-graph.css +17 -0
  222. package/src/components/dependency-graph/dependency-graph.tsx +66 -0
  223. package/src/components/dependency-graph/elements.ts +185 -0
  224. package/src/components/dependency-graph/panels.tsx +279 -0
  225. package/src/components/dependency-graph/types.ts +21 -0
  226. package/src/components/dependency-graph/utils/changes.ts +54 -0
  227. package/src/components/dependency-graph/utils/layout.ts +45 -0
  228. package/src/components/dependency-graph/utils/useFitToViewOnDimensionChange.ts +25 -0
  229. package/src/components/editor/Cell.tsx +1175 -0
  230. package/src/components/editor/Disconnected.tsx +72 -0
  231. package/src/components/editor/Output.tsx +462 -0
  232. package/src/components/editor/RecoveryButton.tsx +161 -0
  233. package/src/components/editor/SortableCell.tsx +161 -0
  234. package/src/components/editor/__tests__/data-attributes.test.tsx +173 -0
  235. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +183 -0
  236. package/src/components/editor/actions/name-cell-input.tsx +137 -0
  237. package/src/components/editor/actions/types.ts +53 -0
  238. package/src/components/editor/actions/useCellActionButton.tsx +422 -0
  239. package/src/components/editor/actions/useConfigActions.tsx +182 -0
  240. package/src/components/editor/actions/useCopyNotebook.tsx +41 -0
  241. package/src/components/editor/actions/useHideAllMarkdownCode.ts +53 -0
  242. package/src/components/editor/actions/useNotebookActions.tsx +556 -0
  243. package/src/components/editor/actions/useRestartKernel.tsx +36 -0
  244. package/src/components/editor/ai/__tests__/completion-utils.test.ts +379 -0
  245. package/src/components/editor/ai/add-cell-with-ai.tsx +423 -0
  246. package/src/components/editor/ai/ai-completion-editor.tsx +261 -0
  247. package/src/components/editor/ai/completion-utils.ts +95 -0
  248. package/src/components/editor/ai/merge-editor.css +9 -0
  249. package/src/components/editor/alerts/connecting-alert.tsx +46 -0
  250. package/src/components/editor/alerts/floating-alert.tsx +47 -0
  251. package/src/components/editor/alerts/stdin-blocking-alert.tsx +61 -0
  252. package/src/components/editor/app-container.tsx +53 -0
  253. package/src/components/editor/boundary/ErrorBoundary.tsx +41 -0
  254. package/src/components/editor/cell/CellStatus.tsx +371 -0
  255. package/src/components/editor/cell/CreateCellButton.tsx +132 -0
  256. package/src/components/editor/cell/DeleteButton.tsx +58 -0
  257. package/src/components/editor/cell/PendingDeleteConfirmation.tsx +126 -0
  258. package/src/components/editor/cell/RunButton.tsx +109 -0
  259. package/src/components/editor/cell/StopButton.tsx +36 -0
  260. package/src/components/editor/cell/TinyCode.css +10 -0
  261. package/src/components/editor/cell/TinyCode.tsx +53 -0
  262. package/src/components/editor/cell/cell-actions.tsx +185 -0
  263. package/src/components/editor/cell/cell-context-menu.tsx +243 -0
  264. package/src/components/editor/cell/cell-status.css +21 -0
  265. package/src/components/editor/cell/code/cell-editor.tsx +546 -0
  266. package/src/components/editor/cell/code/icons.tsx +31 -0
  267. package/src/components/editor/cell/code/language-toggle.tsx +140 -0
  268. package/src/components/editor/cell/collapse.tsx +100 -0
  269. package/src/components/editor/cell/toolbar.tsx +89 -0
  270. package/src/components/editor/cell/useAddCell.ts +29 -0
  271. package/src/components/editor/cell/useDeleteCell.tsx +89 -0
  272. package/src/components/editor/cell/useRunCells.ts +86 -0
  273. package/src/components/editor/cell/useShouldShowInterrupt.ts +26 -0
  274. package/src/components/editor/cell/useSplitCell.tsx +41 -0
  275. package/src/components/editor/chrome/components/contribute-snippet-button.tsx +138 -0
  276. package/src/components/editor/chrome/components/feedback-button.tsx +105 -0
  277. package/src/components/editor/chrome/panels/__tests__/write-secret-modal.test.ts +43 -0
  278. package/src/components/editor/chrome/panels/constants.ts +2 -0
  279. package/src/components/editor/chrome/panels/context-aware-panel/atoms.ts +28 -0
  280. package/src/components/editor/chrome/panels/context-aware-panel/context-aware-panel.tsx +167 -0
  281. package/src/components/editor/chrome/panels/datasources-panel.tsx +6 -0
  282. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +23 -0
  283. package/src/components/editor/chrome/panels/documentation-panel.tsx +29 -0
  284. package/src/components/editor/chrome/panels/empty-state.tsx +28 -0
  285. package/src/components/editor/chrome/panels/error-panel.tsx +35 -0
  286. package/src/components/editor/chrome/panels/file-explorer-panel.tsx +33 -0
  287. package/src/components/editor/chrome/panels/logs-panel.tsx +97 -0
  288. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +129 -0
  289. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +172 -0
  290. package/src/components/editor/chrome/panels/outline-panel.css +6 -0
  291. package/src/components/editor/chrome/panels/outline-panel.tsx +39 -0
  292. package/src/components/editor/chrome/panels/packages-panel.tsx +635 -0
  293. package/src/components/editor/chrome/panels/packages-state.ts +5 -0
  294. package/src/components/editor/chrome/panels/scratchpad-panel.tsx +8 -0
  295. package/src/components/editor/chrome/panels/secrets-panel.tsx +155 -0
  296. package/src/components/editor/chrome/panels/snippets-panel.css +11 -0
  297. package/src/components/editor/chrome/panels/snippets-panel.tsx +230 -0
  298. package/src/components/editor/chrome/panels/tracing-panel.tsx +28 -0
  299. package/src/components/editor/chrome/panels/variable-panel.tsx +31 -0
  300. package/src/components/editor/chrome/panels/write-secret-modal.tsx +190 -0
  301. package/src/components/editor/chrome/state.ts +102 -0
  302. package/src/components/editor/chrome/types.ts +133 -0
  303. package/src/components/editor/chrome/wrapper/__tests__/minimap-state.test.ts +209 -0
  304. package/src/components/editor/chrome/wrapper/__tests__/storage.test.ts +41 -0
  305. package/src/components/editor/chrome/wrapper/app-chrome.css +22 -0
  306. package/src/components/editor/chrome/wrapper/app-chrome.tsx +256 -0
  307. package/src/components/editor/chrome/wrapper/footer-item.tsx +43 -0
  308. package/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx +47 -0
  309. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +111 -0
  310. package/src/components/editor/chrome/wrapper/footer-items/copilot-status.tsx +125 -0
  311. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +185 -0
  312. package/src/components/editor/chrome/wrapper/footer-items/minimap-status.tsx +21 -0
  313. package/src/components/editor/chrome/wrapper/footer-items/rtc-status.tsx +65 -0
  314. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +370 -0
  315. package/src/components/editor/chrome/wrapper/footer.tsx +90 -0
  316. package/src/components/editor/chrome/wrapper/minimap-state.ts +164 -0
  317. package/src/components/editor/chrome/wrapper/minimap.tsx +443 -0
  318. package/src/components/editor/chrome/wrapper/panels.tsx +10 -0
  319. package/src/components/editor/chrome/wrapper/sidebar.tsx +100 -0
  320. package/src/components/editor/chrome/wrapper/storage.ts +56 -0
  321. package/src/components/editor/chrome/wrapper/utils.ts +8 -0
  322. package/src/components/editor/code/readonly-python-code.tsx +160 -0
  323. package/src/components/editor/columns/__tests__/storage.test.ts +104 -0
  324. package/src/components/editor/columns/cell-column.tsx +105 -0
  325. package/src/components/editor/columns/sortable-column.tsx +175 -0
  326. package/src/components/editor/columns/storage.ts +56 -0
  327. package/src/components/editor/common.ts +20 -0
  328. package/src/components/editor/controls/Controls.tsx +225 -0
  329. package/src/components/editor/controls/command-palette-button.tsx +27 -0
  330. package/src/components/editor/controls/command-palette.tsx +210 -0
  331. package/src/components/editor/controls/keyboard-shortcuts.tsx +309 -0
  332. package/src/components/editor/controls/notebook-menu-dropdown.tsx +157 -0
  333. package/src/components/editor/controls/shutdown-button.tsx +70 -0
  334. package/src/components/editor/database/__tests__/__snapshots__/as-code.test.ts.snap +659 -0
  335. package/src/components/editor/database/__tests__/as-code.test.ts +598 -0
  336. package/src/components/editor/database/__tests__/secrets.test.ts +38 -0
  337. package/src/components/editor/database/add-database-form.tsx +395 -0
  338. package/src/components/editor/database/as-code.ts +786 -0
  339. package/src/components/editor/database/form-renderers.tsx +211 -0
  340. package/src/components/editor/database/schemas.ts +485 -0
  341. package/src/components/editor/database/secrets.ts +25 -0
  342. package/src/components/editor/documentation.css +139 -0
  343. package/src/components/editor/dynamic-favicon.tsx +126 -0
  344. package/src/components/editor/errors/auto-fix.tsx +61 -0
  345. package/src/components/editor/file-tree/__tests__/requesting-tree.test.ts +321 -0
  346. package/src/components/editor/file-tree/file-explorer.tsx +679 -0
  347. package/src/components/editor/file-tree/file-viewer.tsx +283 -0
  348. package/src/components/editor/file-tree/renderers.tsx +83 -0
  349. package/src/components/editor/file-tree/requesting-tree.tsx +228 -0
  350. package/src/components/editor/file-tree/state.tsx +26 -0
  351. package/src/components/editor/file-tree/types.ts +118 -0
  352. package/src/components/editor/file-tree/upload.tsx +101 -0
  353. package/src/components/editor/header/app-header.tsx +28 -0
  354. package/src/components/editor/header/filename-form.tsx +27 -0
  355. package/src/components/editor/header/filename-input.css +21 -0
  356. package/src/components/editor/header/filename-input.tsx +244 -0
  357. package/src/components/editor/header/status.tsx +72 -0
  358. package/src/components/editor/inputs/Inputs.css +118 -0
  359. package/src/components/editor/inputs/Inputs.styles.ts +66 -0
  360. package/src/components/editor/inputs/Inputs.tsx +34 -0
  361. package/src/components/editor/kiosk-mode.tsx +25 -0
  362. package/src/components/editor/links/cell-link-list.tsx +74 -0
  363. package/src/components/editor/links/cell-link.tsx +128 -0
  364. package/src/components/editor/navigation/__tests__/clipboard.test.ts +466 -0
  365. package/src/components/editor/navigation/__tests__/navigation.test.ts +1743 -0
  366. package/src/components/editor/navigation/__tests__/selection.test.ts +194 -0
  367. package/src/components/editor/navigation/clipboard.ts +205 -0
  368. package/src/components/editor/navigation/focus-utils.ts +48 -0
  369. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +499 -0
  370. package/src/components/editor/navigation/navigation.ts +698 -0
  371. package/src/components/editor/navigation/selection.ts +114 -0
  372. package/src/components/editor/navigation/state.ts +5 -0
  373. package/src/components/editor/navigation/vim-bindings.test.ts +109 -0
  374. package/src/components/editor/navigation/vim-bindings.ts +90 -0
  375. package/src/components/editor/notebook-banner.tsx +75 -0
  376. package/src/components/editor/output/CalloutOutput.styles.ts +22 -0
  377. package/src/components/editor/output/CalloutOutput.tsx +19 -0
  378. package/src/components/editor/output/ConsoleOutput.tsx +276 -0
  379. package/src/components/editor/output/EmotionCacheProvider.tsx +32 -0
  380. package/src/components/editor/output/HtmlOutput.tsx +25 -0
  381. package/src/components/editor/output/ImageOutput.tsx +25 -0
  382. package/src/components/editor/output/JsonOutput.tsx +424 -0
  383. package/src/components/editor/output/MarimoErrorOutput.tsx +511 -0
  384. package/src/components/editor/output/MarimoTracebackOutput.tsx +233 -0
  385. package/src/components/editor/output/Outputs.css +102 -0
  386. package/src/components/editor/output/TextOutput.tsx +42 -0
  387. package/src/components/editor/output/VideoOutput.tsx +11 -0
  388. package/src/components/editor/output/__tests__/ansi.test.ts +39 -0
  389. package/src/components/editor/output/__tests__/json-output.test.ts +269 -0
  390. package/src/components/editor/output/__tests__/traceback.test.tsx +105 -0
  391. package/src/components/editor/output/useWrapText.ts +14 -0
  392. package/src/components/editor/package-alert.tsx +596 -0
  393. package/src/components/editor/renderMimeIcon.tsx +38 -0
  394. package/src/components/editor/renderers/CellArray.tsx +352 -0
  395. package/src/components/editor/renderers/cells-renderer.tsx +96 -0
  396. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +650 -0
  397. package/src/components/editor/renderers/grid-layout/plugin.tsx +146 -0
  398. package/src/components/editor/renderers/grid-layout/styles.css +31 -0
  399. package/src/components/editor/renderers/grid-layout/types.ts +89 -0
  400. package/src/components/editor/renderers/layout-select.tsx +86 -0
  401. package/src/components/editor/renderers/plugins.ts +31 -0
  402. package/src/components/editor/renderers/slides-layout/plugin.tsx +31 -0
  403. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +74 -0
  404. package/src/components/editor/renderers/slides-layout/types.ts +12 -0
  405. package/src/components/editor/renderers/types.ts +75 -0
  406. package/src/components/editor/renderers/vertical-layout/__tests__/useDelayVisibility.test.ts +87 -0
  407. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +123 -0
  408. package/src/components/editor/renderers/vertical-layout/__tests__/vertical-layout.test.ts +173 -0
  409. package/src/components/editor/renderers/vertical-layout/sidebar/__tests__/sidebar.test.tsx +56 -0
  410. package/src/components/editor/renderers/vertical-layout/sidebar/sheet-sidebar.tsx +32 -0
  411. package/src/components/editor/renderers/vertical-layout/sidebar/sidebar-slot.tsx +10 -0
  412. package/src/components/editor/renderers/vertical-layout/sidebar/sidebar.css +20 -0
  413. package/src/components/editor/renderers/vertical-layout/sidebar/sidebar.tsx +30 -0
  414. package/src/components/editor/renderers/vertical-layout/sidebar/state.ts +46 -0
  415. package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +25 -0
  416. package/src/components/editor/renderers/vertical-layout/sidebar/wrapped-with-sidebar.tsx +38 -0
  417. package/src/components/editor/renderers/vertical-layout/useDelayVisibility.ts +32 -0
  418. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +107 -0
  419. package/src/components/editor/renderers/vertical-layout/vertical-layout-wrapper.tsx +46 -0
  420. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +451 -0
  421. package/src/components/editor/stdin-blocking-alert.tsx +83 -0
  422. package/src/components/export/export-output-button.tsx +14 -0
  423. package/src/components/find-replace/find-replace.tsx +293 -0
  424. package/src/components/forms/__tests__/form-utils.test.ts +104 -0
  425. package/src/components/forms/form-utils.ts +90 -0
  426. package/src/components/forms/form.tsx +817 -0
  427. package/src/components/forms/options.ts +59 -0
  428. package/src/components/forms/switchable-multi-select.tsx +134 -0
  429. package/src/components/home/components.tsx +189 -0
  430. package/src/components/home/state.ts +30 -0
  431. package/src/components/icons/copy-icon.tsx +59 -0
  432. package/src/components/icons/github-copilot.tsx +17 -0
  433. package/src/components/icons/large-spinner.tsx +39 -0
  434. package/src/components/icons/loading-ellipsis.tsx +46 -0
  435. package/src/components/icons/multi-icon.css +9 -0
  436. package/src/components/icons/multi-icon.tsx +30 -0
  437. package/src/components/icons/spinner.tsx +38 -0
  438. package/src/components/layout/toolbar.tsx +26 -0
  439. package/src/components/modal/ImperativeModal.tsx +187 -0
  440. package/src/components/pages/edit-page.tsx +37 -0
  441. package/src/components/pages/home-page.tsx +514 -0
  442. package/src/components/pages/run-page.tsx +55 -0
  443. package/src/components/scratchpad/scratchpad-history.ts +28 -0
  444. package/src/components/scratchpad/scratchpad.tsx +280 -0
  445. package/src/components/shortcuts/renderShortcut.tsx +208 -0
  446. package/src/components/slides/slides-component.tsx +132 -0
  447. package/src/components/slides/slides.css +100 -0
  448. package/src/components/sort/SortableCellsProvider.tsx +242 -0
  449. package/src/components/static-html/share-modal.tsx +181 -0
  450. package/src/components/static-html/static-banner.tsx +164 -0
  451. package/src/components/terminal/terminal.tsx +110 -0
  452. package/src/components/terminal/xterm.css +3 -0
  453. package/src/components/tracing/tracing-spec.ts +118 -0
  454. package/src/components/tracing/tracing.test.tsx +66 -0
  455. package/src/components/tracing/tracing.tsx +410 -0
  456. package/src/components/ui/accordion.tsx +70 -0
  457. package/src/components/ui/alert-dialog.tsx +176 -0
  458. package/src/components/ui/alert.tsx +64 -0
  459. package/src/components/ui/aria-popover.tsx +43 -0
  460. package/src/components/ui/badge.tsx +41 -0
  461. package/src/components/ui/button.tsx +156 -0
  462. package/src/components/ui/calendar.tsx +231 -0
  463. package/src/components/ui/card.tsx +83 -0
  464. package/src/components/ui/checkbox.tsx +33 -0
  465. package/src/components/ui/combobox.tsx +278 -0
  466. package/src/components/ui/command.tsx +165 -0
  467. package/src/components/ui/context-menu.tsx +193 -0
  468. package/src/components/ui/date-input.tsx +127 -0
  469. package/src/components/ui/date-picker.tsx +188 -0
  470. package/src/components/ui/dialog.tsx +155 -0
  471. package/src/components/ui/draggable-popover.tsx +68 -0
  472. package/src/components/ui/dropdown-menu.tsx +189 -0
  473. package/src/components/ui/field.tsx +90 -0
  474. package/src/components/ui/form.tsx +224 -0
  475. package/src/components/ui/fullscreen.tsx +38 -0
  476. package/src/components/ui/input.tsx +208 -0
  477. package/src/components/ui/kbd.tsx +22 -0
  478. package/src/components/ui/label.tsx +26 -0
  479. package/src/components/ui/links.tsx +23 -0
  480. package/src/components/ui/menu-items.tsx +101 -0
  481. package/src/components/ui/native-select.tsx +39 -0
  482. package/src/components/ui/navigation.tsx +154 -0
  483. package/src/components/ui/number-field.tsx +99 -0
  484. package/src/components/ui/popover.tsx +63 -0
  485. package/src/components/ui/progress.tsx +28 -0
  486. package/src/components/ui/radio-group.tsx +44 -0
  487. package/src/components/ui/range-slider.tsx +102 -0
  488. package/src/components/ui/scroll-area.tsx +47 -0
  489. package/src/components/ui/select.tsx +167 -0
  490. package/src/components/ui/sheet.tsx +143 -0
  491. package/src/components/ui/skeleton.tsx +16 -0
  492. package/src/components/ui/slider.tsx +80 -0
  493. package/src/components/ui/switch.tsx +54 -0
  494. package/src/components/ui/table.tsx +122 -0
  495. package/src/components/ui/tabs.tsx +55 -0
  496. package/src/components/ui/textarea.tsx +104 -0
  497. package/src/components/ui/toast.tsx +133 -0
  498. package/src/components/ui/toaster.tsx +30 -0
  499. package/src/components/ui/toggle.tsx +49 -0
  500. package/src/components/ui/tooltip.tsx +87 -0
  501. package/src/components/ui/typography.tsx +207 -0
  502. package/src/components/ui/use-restore-focus.ts +28 -0
  503. package/src/components/ui/use-toast.ts +224 -0
  504. package/src/components/utils/delay-mount.tsx +81 -0
  505. package/src/components/utils/lazy-mount.tsx +24 -0
  506. package/src/components/variables/common.tsx +37 -0
  507. package/src/components/variables/variables-table.tsx +335 -0
  508. package/src/core/MarimoApp.tsx +103 -0
  509. package/src/core/ai/__tests__/model-registry.test.ts +357 -0
  510. package/src/core/ai/chat-utils.ts +71 -0
  511. package/src/core/ai/config.ts +76 -0
  512. package/src/core/ai/context/__tests__/registry.test.ts +516 -0
  513. package/src/core/ai/context/context.ts +16 -0
  514. package/src/core/ai/context/providers/__tests__/__snapshots__/tables.test.ts.snap +291 -0
  515. package/src/core/ai/context/providers/__tests__/__snapshots__/variable.test.ts.snap +378 -0
  516. package/src/core/ai/context/providers/__tests__/tables.test.ts +271 -0
  517. package/src/core/ai/context/providers/__tests__/variable.test.ts +312 -0
  518. package/src/core/ai/context/providers/common.ts +7 -0
  519. package/src/core/ai/context/providers/tables.ts +208 -0
  520. package/src/core/ai/context/providers/variable.ts +72 -0
  521. package/src/core/ai/context/registry.ts +180 -0
  522. package/src/core/ai/ids/__tests__/ids.test.ts +193 -0
  523. package/src/core/ai/ids/ids.ts +70 -0
  524. package/src/core/ai/model-registry.ts +164 -0
  525. package/src/core/ai/state.ts +58 -0
  526. package/src/core/alerts/state.ts +75 -0
  527. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +1312 -0
  528. package/src/core/cells/__tests__/add-missing-import.test.ts +78 -0
  529. package/src/core/cells/__tests__/cell.test.ts +193 -0
  530. package/src/core/cells/__tests__/cells.test.ts +2664 -0
  531. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +239 -0
  532. package/src/core/cells/__tests__/focus.test.ts +271 -0
  533. package/src/core/cells/__tests__/ids.test.ts +90 -0
  534. package/src/core/cells/__tests__/names.test.ts +62 -0
  535. package/src/core/cells/__tests__/pending-delete-service.test.tsx +202 -0
  536. package/src/core/cells/__tests__/runs.test.ts +453 -0
  537. package/src/core/cells/__tests__/session.test.ts +757 -0
  538. package/src/core/cells/__tests__/utils.test.ts +428 -0
  539. package/src/core/cells/actions.ts +21 -0
  540. package/src/core/cells/add-missing-import.ts +114 -0
  541. package/src/core/cells/cell.ts +243 -0
  542. package/src/core/cells/cells.ts +1751 -0
  543. package/src/core/cells/collapseConsoleOutputs.tsx +133 -0
  544. package/src/core/cells/effects.ts +42 -0
  545. package/src/core/cells/focus.ts +128 -0
  546. package/src/core/cells/ids.ts +124 -0
  547. package/src/core/cells/logs.ts +114 -0
  548. package/src/core/cells/names.ts +107 -0
  549. package/src/core/cells/outline.ts +30 -0
  550. package/src/core/cells/outputs.ts +34 -0
  551. package/src/core/cells/pending-delete-service.ts +183 -0
  552. package/src/core/cells/runs.ts +196 -0
  553. package/src/core/cells/scrollCellIntoView.ts +133 -0
  554. package/src/core/cells/session.ts +281 -0
  555. package/src/core/cells/types.ts +128 -0
  556. package/src/core/cells/utils.ts +141 -0
  557. package/src/core/codemirror/__tests__/__snapshots__/setup.test.ts.snap +216 -0
  558. package/src/core/codemirror/__tests__/extensions.test.ts +117 -0
  559. package/src/core/codemirror/__tests__/format.test.ts +227 -0
  560. package/src/core/codemirror/__tests__/setup.test.ts +178 -0
  561. package/src/core/codemirror/ai/request.ts +72 -0
  562. package/src/core/codemirror/ai/resources.ts +90 -0
  563. package/src/core/codemirror/cells/extensions.ts +387 -0
  564. package/src/core/codemirror/cells/state.ts +32 -0
  565. package/src/core/codemirror/cells/traceback-decorations.ts +111 -0
  566. package/src/core/codemirror/cm.ts +267 -0
  567. package/src/core/codemirror/compat/__tests__/jupyter.test.ts +136 -0
  568. package/src/core/codemirror/compat/jupyter.tsx +244 -0
  569. package/src/core/codemirror/completion/Autocompleter.ts +172 -0
  570. package/src/core/codemirror/completion/__tests__/hints.test.ts +84 -0
  571. package/src/core/codemirror/completion/__tests__/keymap.test.ts +44 -0
  572. package/src/core/codemirror/completion/completer.ts +58 -0
  573. package/src/core/codemirror/completion/hints.ts +143 -0
  574. package/src/core/codemirror/completion/keymap.ts +70 -0
  575. package/src/core/codemirror/completion/utils.ts +18 -0
  576. package/src/core/codemirror/completion/variable-completions.ts +100 -0
  577. package/src/core/codemirror/config/extension.ts +63 -0
  578. package/src/core/codemirror/config/types.ts +10 -0
  579. package/src/core/codemirror/copilot/__tests__/copilot.test.ts +260 -0
  580. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +209 -0
  581. package/src/core/codemirror/copilot/__tests__/trim-utils.test.ts +291 -0
  582. package/src/core/codemirror/copilot/client.ts +123 -0
  583. package/src/core/codemirror/copilot/copilot-config.tsx +285 -0
  584. package/src/core/codemirror/copilot/extension.ts +285 -0
  585. package/src/core/codemirror/copilot/getCodes.ts +130 -0
  586. package/src/core/codemirror/copilot/language-server.ts +255 -0
  587. package/src/core/codemirror/copilot/state.ts +66 -0
  588. package/src/core/codemirror/copilot/trim-utils.ts +33 -0
  589. package/src/core/codemirror/copilot/types.ts +41 -0
  590. package/src/core/codemirror/editing/__tests__/commands.test.ts +106 -0
  591. package/src/core/codemirror/editing/__tests__/debugging.test.ts +193 -0
  592. package/src/core/codemirror/editing/commands.ts +25 -0
  593. package/src/core/codemirror/editing/debugging.ts +58 -0
  594. package/src/core/codemirror/editing/extensions.ts +4 -0
  595. package/src/core/codemirror/extensions.ts +95 -0
  596. package/src/core/codemirror/facet.ts +19 -0
  597. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +695 -0
  598. package/src/core/codemirror/find-replace/extension.ts +41 -0
  599. package/src/core/codemirror/find-replace/navigate.ts +221 -0
  600. package/src/core/codemirror/find-replace/query.ts +31 -0
  601. package/src/core/codemirror/find-replace/search-highlight.ts +148 -0
  602. package/src/core/codemirror/find-replace/state.ts +167 -0
  603. package/src/core/codemirror/format.ts +120 -0
  604. package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +205 -0
  605. package/src/core/codemirror/go-to-definition/commands.ts +80 -0
  606. package/src/core/codemirror/go-to-definition/extension.ts +23 -0
  607. package/src/core/codemirror/go-to-definition/underline.ts +223 -0
  608. package/src/core/codemirror/go-to-definition/utils.ts +126 -0
  609. package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +43 -0
  610. package/src/core/codemirror/keymaps/__tests__/vimrc.test.ts +121 -0
  611. package/src/core/codemirror/keymaps/keymaps.ts +163 -0
  612. package/src/core/codemirror/keymaps/vim.ts +348 -0
  613. package/src/core/codemirror/keymaps/vimrc.ts +149 -0
  614. package/src/core/codemirror/language/LanguageAdapters.ts +23 -0
  615. package/src/core/codemirror/language/__tests__/ast.test.ts +124 -0
  616. package/src/core/codemirror/language/__tests__/extension.test.ts +260 -0
  617. package/src/core/codemirror/language/__tests__/indentOneTab.test.ts +31 -0
  618. package/src/core/codemirror/language/__tests__/markdown.test.ts +495 -0
  619. package/src/core/codemirror/language/__tests__/sql.test.ts +1640 -0
  620. package/src/core/codemirror/language/__tests__/utils.test.ts +166 -0
  621. package/src/core/codemirror/language/commands.ts +59 -0
  622. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +163 -0
  623. package/src/core/codemirror/language/embedded/embedded-python.ts +131 -0
  624. package/src/core/codemirror/language/embedded/latex.ts +257 -0
  625. package/src/core/codemirror/language/extension.ts +322 -0
  626. package/src/core/codemirror/language/languages/markdown.ts +261 -0
  627. package/src/core/codemirror/language/languages/python.ts +329 -0
  628. package/src/core/codemirror/language/languages/sql/completion-sources.tsx +99 -0
  629. package/src/core/codemirror/language/languages/sql/completion-store.ts +191 -0
  630. package/src/core/codemirror/language/languages/sql/sql.ts +545 -0
  631. package/src/core/codemirror/language/languages/sql/utils.ts +42 -0
  632. package/src/core/codemirror/language/metadata.ts +71 -0
  633. package/src/core/codemirror/language/panel/markdown.tsx +63 -0
  634. package/src/core/codemirror/language/panel/panel.tsx +197 -0
  635. package/src/core/codemirror/language/panel/sql.tsx +132 -0
  636. package/src/core/codemirror/language/types.ts +41 -0
  637. package/src/core/codemirror/language/utils/ast.ts +84 -0
  638. package/src/core/codemirror/language/utils/indentOneTab.ts +9 -0
  639. package/src/core/codemirror/language/utils/quotes.ts +18 -0
  640. package/src/core/codemirror/language/utils.ts +78 -0
  641. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +860 -0
  642. package/src/core/codemirror/lsp/federated-lsp.ts +235 -0
  643. package/src/core/codemirror/lsp/lens.ts +130 -0
  644. package/src/core/codemirror/lsp/notebook-lsp.ts +604 -0
  645. package/src/core/codemirror/lsp/transports.ts +31 -0
  646. package/src/core/codemirror/lsp/types.ts +55 -0
  647. package/src/core/codemirror/lsp/utils.ts +11 -0
  648. package/src/core/codemirror/markdown/__tests__/commands.test.ts +522 -0
  649. package/src/core/codemirror/markdown/commands.ts +478 -0
  650. package/src/core/codemirror/markdown/completions.ts +273 -0
  651. package/src/core/codemirror/markdown/extension.ts +106 -0
  652. package/src/core/codemirror/misc/__tests__/dnd.test.ts +111 -0
  653. package/src/core/codemirror/misc/__tests__/paste.test.ts +239 -0
  654. package/src/core/codemirror/misc/dnd.ts +48 -0
  655. package/src/core/codemirror/misc/paste.ts +181 -0
  656. package/src/core/codemirror/placeholder/__tests__/extensions.test.ts +132 -0
  657. package/src/core/codemirror/placeholder/extensions.ts +99 -0
  658. package/src/core/codemirror/react-dom/createPanel.tsx +39 -0
  659. package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +1222 -0
  660. package/src/core/codemirror/reactive-references/analyzer.ts +608 -0
  661. package/src/core/codemirror/reactive-references/extension.ts +154 -0
  662. package/src/core/codemirror/readonly/__tests__/extension.test.ts +55 -0
  663. package/src/core/codemirror/readonly/extension.ts +187 -0
  664. package/src/core/codemirror/rtc/extension.ts +450 -0
  665. package/src/core/codemirror/rtc/loro/awareness.ts +496 -0
  666. package/src/core/codemirror/rtc/loro/colors.ts +38 -0
  667. package/src/core/codemirror/rtc/loro/sync.ts +159 -0
  668. package/src/core/codemirror/theme/__tests__/light.test.ts +136 -0
  669. package/src/core/codemirror/theme/dark.ts +50 -0
  670. package/src/core/codemirror/theme/light.ts +58 -0
  671. package/src/core/codemirror/types.ts +5 -0
  672. package/src/core/codemirror/utils.ts +103 -0
  673. package/src/core/codemirror/vim/cursor-visibility.ts +58 -0
  674. package/src/core/config/__tests__/config-schema.test.ts +232 -0
  675. package/src/core/config/capabilities.ts +15 -0
  676. package/src/core/config/config-schema.ts +296 -0
  677. package/src/core/config/config.ts +109 -0
  678. package/src/core/config/feature-flag.tsx +62 -0
  679. package/src/core/config/if-capability.tsx +19 -0
  680. package/src/core/config/widths.ts +5 -0
  681. package/src/core/constants.ts +52 -0
  682. package/src/core/datasets/__tests__/all-tables.test.ts +466 -0
  683. package/src/core/datasets/__tests__/data-source.test.ts +461 -0
  684. package/src/core/datasets/data-source-connections.ts +334 -0
  685. package/src/core/datasets/engines.ts +10 -0
  686. package/src/core/datasets/request-registry.ts +34 -0
  687. package/src/core/datasets/state.ts +143 -0
  688. package/src/core/datasets/types.ts +38 -0
  689. package/src/core/debugger/state.ts +10 -0
  690. package/src/core/documentation/state.ts +13 -0
  691. package/src/core/dom/__tests__/htmlUtils.test.ts +22 -0
  692. package/src/core/dom/__tests__/outline.test.ts +370 -0
  693. package/src/core/dom/defineCustomElement.ts +23 -0
  694. package/src/core/dom/events.ts +94 -0
  695. package/src/core/dom/htmlUtils.ts +75 -0
  696. package/src/core/dom/outline.ts +123 -0
  697. package/src/core/dom/ui-element.css +8 -0
  698. package/src/core/dom/ui-element.ts +249 -0
  699. package/src/core/dom/uiregistry.ts +209 -0
  700. package/src/core/edit-app.tsx +189 -0
  701. package/src/core/errors/__tests__/errors.test.ts +62 -0
  702. package/src/core/errors/__tests__/utils.test.ts +108 -0
  703. package/src/core/errors/errors.ts +96 -0
  704. package/src/core/errors/state.ts +44 -0
  705. package/src/core/errors/utils.ts +67 -0
  706. package/src/core/export/hooks.ts +60 -0
  707. package/src/core/functions/FunctionRegistry.ts +18 -0
  708. package/src/core/hotkeys/__tests__/shortcuts.test.ts +166 -0
  709. package/src/core/hotkeys/actions.ts +38 -0
  710. package/src/core/hotkeys/hotkeys.ts +503 -0
  711. package/src/core/hotkeys/shortcuts.ts +117 -0
  712. package/src/core/islands/__tests__/parse.test.ts +89 -0
  713. package/src/core/islands/bridge.ts +196 -0
  714. package/src/core/islands/components/output-wrapper.tsx +154 -0
  715. package/src/core/islands/components/web-components.tsx +120 -0
  716. package/src/core/islands/islands.css +14 -0
  717. package/src/core/islands/main.ts +200 -0
  718. package/src/core/islands/parse.ts +161 -0
  719. package/src/core/islands/state.ts +30 -0
  720. package/src/core/islands/toast.ts +41 -0
  721. package/src/core/islands/utils.ts +5 -0
  722. package/src/core/islands/worker/controller.ts +52 -0
  723. package/src/core/islands/worker/worker.tsx +178 -0
  724. package/src/core/kernel/RuntimeState.ts +94 -0
  725. package/src/core/kernel/__tests__/RuntimeState.test.ts +57 -0
  726. package/src/core/kernel/__tests__/handlers.test.ts +61 -0
  727. package/src/core/kernel/__tests__/session.test.ts +10 -0
  728. package/src/core/kernel/handlers.ts +159 -0
  729. package/src/core/kernel/messages.ts +54 -0
  730. package/src/core/kernel/queryParamHandlers.ts +39 -0
  731. package/src/core/kernel/session.ts +50 -0
  732. package/src/core/layout/layout.ts +99 -0
  733. package/src/core/layout/useTogglePresenting.ts +50 -0
  734. package/src/core/meta/globals.ts +25 -0
  735. package/src/core/meta/state.ts +25 -0
  736. package/src/core/mime.ts +9 -0
  737. package/src/core/mode.ts +80 -0
  738. package/src/core/network/DeferredRequestRegistry.ts +71 -0
  739. package/src/core/network/__tests__/DeferredRequestRegistry.test.ts +37 -0
  740. package/src/core/network/__tests__/api.test.ts +80 -0
  741. package/src/core/network/api.ts +145 -0
  742. package/src/core/network/auth.ts +13 -0
  743. package/src/core/network/connection.ts +33 -0
  744. package/src/core/network/requests-network.ts +398 -0
  745. package/src/core/network/requests-static.ts +88 -0
  746. package/src/core/network/requests-toasting.ts +91 -0
  747. package/src/core/network/requests.ts +24 -0
  748. package/src/core/network/resolve.ts +17 -0
  749. package/src/core/network/types.ts +188 -0
  750. package/src/core/packages/toast-components.tsx +88 -0
  751. package/src/core/packages/useInstallPackage.ts +46 -0
  752. package/src/core/rtc/state.ts +20 -0
  753. package/src/core/run-app.tsx +69 -0
  754. package/src/core/runtime/__tests__/config.test.ts +173 -0
  755. package/src/core/runtime/__tests__/createWsUrl.test.ts +61 -0
  756. package/src/core/runtime/__tests__/runtime.test.ts +603 -0
  757. package/src/core/runtime/config.ts +45 -0
  758. package/src/core/runtime/runtime.ts +277 -0
  759. package/src/core/runtime/types.ts +7 -0
  760. package/src/core/runtime/utils.ts +9 -0
  761. package/src/core/saving/file-state.ts +15 -0
  762. package/src/core/saving/filename.ts +55 -0
  763. package/src/core/saving/save-component.tsx +274 -0
  764. package/src/core/saving/state.ts +51 -0
  765. package/src/core/saving/useAutoSave.ts +68 -0
  766. package/src/core/secrets/request-registry.ts +16 -0
  767. package/src/core/slots/slots.ts +9 -0
  768. package/src/core/state/__tests__/jotai.test.ts +25 -0
  769. package/src/core/state/jotai.ts +69 -0
  770. package/src/core/state/observable.ts +23 -0
  771. package/src/core/static/__tests__/download-html.test.ts +41 -0
  772. package/src/core/static/__tests__/files.test.ts +494 -0
  773. package/src/core/static/__tests__/virtual-file-tracker.test.ts +92 -0
  774. package/src/core/static/download-html.ts +59 -0
  775. package/src/core/static/files.ts +150 -0
  776. package/src/core/static/static-state.ts +19 -0
  777. package/src/core/static/types.ts +8 -0
  778. package/src/core/static/virtual-file-tracker.ts +83 -0
  779. package/src/core/variables/__tests__/state.test.ts +148 -0
  780. package/src/core/variables/state.ts +81 -0
  781. package/src/core/variables/types.ts +22 -0
  782. package/src/core/vscode/vscode-bindings.ts +176 -0
  783. package/src/core/wasm/PyodideLoader.tsx +72 -0
  784. package/src/core/wasm/__tests__/router.test.ts +57 -0
  785. package/src/core/wasm/__tests__/share.test.ts +35 -0
  786. package/src/core/wasm/__tests__/state.test.ts +124 -0
  787. package/src/core/wasm/__tests__/store.test.ts +55 -0
  788. package/src/core/wasm/bridge.ts +622 -0
  789. package/src/core/wasm/router.ts +39 -0
  790. package/src/core/wasm/rpc.ts +32 -0
  791. package/src/core/wasm/share.ts +15 -0
  792. package/src/core/wasm/state.ts +21 -0
  793. package/src/core/wasm/store.ts +122 -0
  794. package/src/core/wasm/utils.ts +12 -0
  795. package/src/core/wasm/worker/bootstrap.ts +223 -0
  796. package/src/core/wasm/worker/constants.ts +2 -0
  797. package/src/core/wasm/worker/fs.ts +90 -0
  798. package/src/core/wasm/worker/getController.ts +16 -0
  799. package/src/core/wasm/worker/getFS.ts +9 -0
  800. package/src/core/wasm/worker/getMarimoWheel.ts +15 -0
  801. package/src/core/wasm/worker/getPyodideVersion.ts +10 -0
  802. package/src/core/wasm/worker/message-buffer.ts +32 -0
  803. package/src/core/wasm/worker/save-worker.ts +107 -0
  804. package/src/core/wasm/worker/tracer.ts +7 -0
  805. package/src/core/wasm/worker/types.ts +97 -0
  806. package/src/core/wasm/worker/worker.ts +375 -0
  807. package/src/core/websocket/StaticWebsocket.ts +61 -0
  808. package/src/core/websocket/connection-utils.ts +59 -0
  809. package/src/core/websocket/types.ts +43 -0
  810. package/src/core/websocket/useMarimoWebSocket.tsx +386 -0
  811. package/src/core/websocket/useWebSocket.tsx +88 -0
  812. package/src/css/admonition.css +127 -0
  813. package/src/css/app/App.css +77 -0
  814. package/src/css/app/Cell.css +433 -0
  815. package/src/css/app/Header.css +25 -0
  816. package/src/css/app/codemirror-completions.css +308 -0
  817. package/src/css/app/codemirror.css +136 -0
  818. package/src/css/app/fonts.css +50 -0
  819. package/src/css/app/print.css +86 -0
  820. package/src/css/app/reset.css +18 -0
  821. package/src/css/codehilite.css +354 -0
  822. package/src/css/common.css +45 -0
  823. package/src/css/globals.css +176 -0
  824. package/src/css/index.css +10 -0
  825. package/src/css/katex-fonts.css +214 -0
  826. package/src/css/katex.min.css +1182 -0
  827. package/src/css/md-tooltip.css +52 -0
  828. package/src/css/md.css +365 -0
  829. package/src/css/progress.css +93 -0
  830. package/src/css/table.css +45 -0
  831. package/src/custom.d.ts +24 -0
  832. package/src/fonts/Fira_Mono/FiraMono-Bold.ttf +0 -0
  833. package/src/fonts/Fira_Mono/FiraMono-Medium.ttf +0 -0
  834. package/src/fonts/Fira_Mono/FiraMono-Regular.ttf +0 -0
  835. package/src/fonts/KaTeX/KaTeX_AMS-Regular.ttf +0 -0
  836. package/src/fonts/KaTeX/KaTeX_AMS-Regular.woff +0 -0
  837. package/src/fonts/KaTeX/KaTeX_AMS-Regular.woff2 +0 -0
  838. package/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf +0 -0
  839. package/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff +0 -0
  840. package/src/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2 +0 -0
  841. package/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf +0 -0
  842. package/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff +0 -0
  843. package/src/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2 +0 -0
  844. package/src/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf +0 -0
  845. package/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff +0 -0
  846. package/src/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2 +0 -0
  847. package/src/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf +0 -0
  848. package/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff +0 -0
  849. package/src/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2 +0 -0
  850. package/src/fonts/KaTeX/KaTeX_Main-Bold.ttf +0 -0
  851. package/src/fonts/KaTeX/KaTeX_Main-Bold.woff +0 -0
  852. package/src/fonts/KaTeX/KaTeX_Main-Bold.woff2 +0 -0
  853. package/src/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf +0 -0
  854. package/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff +0 -0
  855. package/src/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2 +0 -0
  856. package/src/fonts/KaTeX/KaTeX_Main-Italic.ttf +0 -0
  857. package/src/fonts/KaTeX/KaTeX_Main-Italic.woff +0 -0
  858. package/src/fonts/KaTeX/KaTeX_Main-Italic.woff2 +0 -0
  859. package/src/fonts/KaTeX/KaTeX_Main-Regular.ttf +0 -0
  860. package/src/fonts/KaTeX/KaTeX_Main-Regular.woff +0 -0
  861. package/src/fonts/KaTeX/KaTeX_Main-Regular.woff2 +0 -0
  862. package/src/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf +0 -0
  863. package/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff +0 -0
  864. package/src/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2 +0 -0
  865. package/src/fonts/KaTeX/KaTeX_Math-Italic.ttf +0 -0
  866. package/src/fonts/KaTeX/KaTeX_Math-Italic.woff +0 -0
  867. package/src/fonts/KaTeX/KaTeX_Math-Italic.woff2 +0 -0
  868. package/src/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf +0 -0
  869. package/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff +0 -0
  870. package/src/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2 +0 -0
  871. package/src/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf +0 -0
  872. package/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff +0 -0
  873. package/src/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2 +0 -0
  874. package/src/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf +0 -0
  875. package/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff +0 -0
  876. package/src/fonts/KaTeX/KaTeX_SansSerif-Regular.woff2 +0 -0
  877. package/src/fonts/KaTeX/KaTeX_Script-Regular.ttf +0 -0
  878. package/src/fonts/KaTeX/KaTeX_Script-Regular.woff +0 -0
  879. package/src/fonts/KaTeX/KaTeX_Script-Regular.woff2 +0 -0
  880. package/src/fonts/KaTeX/KaTeX_Size1-Regular.ttf +0 -0
  881. package/src/fonts/KaTeX/KaTeX_Size1-Regular.woff +0 -0
  882. package/src/fonts/KaTeX/KaTeX_Size1-Regular.woff2 +0 -0
  883. package/src/fonts/KaTeX/KaTeX_Size2-Regular.ttf +0 -0
  884. package/src/fonts/KaTeX/KaTeX_Size2-Regular.woff +0 -0
  885. package/src/fonts/KaTeX/KaTeX_Size2-Regular.woff2 +0 -0
  886. package/src/fonts/KaTeX/KaTeX_Size3-Regular.ttf +0 -0
  887. package/src/fonts/KaTeX/KaTeX_Size3-Regular.woff +0 -0
  888. package/src/fonts/KaTeX/KaTeX_Size3-Regular.woff2 +0 -0
  889. package/src/fonts/KaTeX/KaTeX_Size4-Regular.ttf +0 -0
  890. package/src/fonts/KaTeX/KaTeX_Size4-Regular.woff +0 -0
  891. package/src/fonts/KaTeX/KaTeX_Size4-Regular.woff2 +0 -0
  892. package/src/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf +0 -0
  893. package/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff +0 -0
  894. package/src/fonts/KaTeX/KaTeX_Typewriter-Regular.woff2 +0 -0
  895. package/src/fonts/Lora/Lora-Italic-VariableFont_wght.ttf +0 -0
  896. package/src/fonts/Lora/Lora-VariableFont_wght.ttf +0 -0
  897. package/src/fonts/Lora/static/Lora-Bold.ttf +0 -0
  898. package/src/fonts/Lora/static/Lora-BoldItalic.ttf +0 -0
  899. package/src/fonts/Lora/static/Lora-Italic.ttf +0 -0
  900. package/src/fonts/Lora/static/Lora-Medium.ttf +0 -0
  901. package/src/fonts/Lora/static/Lora-MediumItalic.ttf +0 -0
  902. package/src/fonts/Lora/static/Lora-Regular.ttf +0 -0
  903. package/src/fonts/Lora/static/Lora-SemiBold.ttf +0 -0
  904. package/src/fonts/Lora/static/Lora-SemiBoldItalic.ttf +0 -0
  905. package/src/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  906. package/src/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  907. package/src/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  908. package/src/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  909. package/src/hooks/__tests__/useBoolean.test.tsx +33 -0
  910. package/src/hooks/__tests__/useDebounce.test.tsx +182 -0
  911. package/src/hooks/__tests__/useEffectSkipFirstRender.test.tsx +42 -0
  912. package/src/hooks/__tests__/useEventListener.test.tsx +148 -0
  913. package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +76 -0
  914. package/src/hooks/__tests__/useInterval.test.tsx +70 -0
  915. package/src/hooks/__tests__/usePackageMetadata.test.tsx +219 -0
  916. package/src/hooks/__tests__/useResizeHandle.test.tsx +240 -0
  917. package/src/hooks/__tests__/useResizeObserver.test.tsx +86 -0
  918. package/src/hooks/__tests__/useTimer.test.tsx +62 -0
  919. package/src/hooks/debug.ts +116 -0
  920. package/src/hooks/useAsyncData.ts +392 -0
  921. package/src/hooks/useAudioRecorder.ts +89 -0
  922. package/src/hooks/useAutoGrowInputProps.ts +56 -0
  923. package/src/hooks/useBoolean.ts +26 -0
  924. package/src/hooks/useCellRenderCount.ts +15 -0
  925. package/src/hooks/useDebounce.ts +95 -0
  926. package/src/hooks/useDeepCompareMemoize.ts +22 -0
  927. package/src/hooks/useEffectSkipFirstRender.ts +24 -0
  928. package/src/hooks/useElapsedTime.ts +25 -0
  929. package/src/hooks/useEvent.ts +2 -0
  930. package/src/hooks/useEventListener.ts +68 -0
  931. package/src/hooks/useHotkey.ts +77 -0
  932. package/src/hooks/useInternalStateWithSync.ts +26 -0
  933. package/src/hooks/useInterval.ts +49 -0
  934. package/src/hooks/useIsDragging.tsx +39 -0
  935. package/src/hooks/useLifecycle.ts +20 -0
  936. package/src/hooks/useLocalStorage.ts +22 -0
  937. package/src/hooks/useNonce.ts +9 -0
  938. package/src/hooks/usePackageMetadata.ts +52 -0
  939. package/src/hooks/useRecentCommands.ts +25 -0
  940. package/src/hooks/useResizeHandle.ts +110 -0
  941. package/src/hooks/useResizeObserver.ts +101 -0
  942. package/src/hooks/useScript.ts +90 -0
  943. package/src/hooks/useSelectAllContent.ts +42 -0
  944. package/src/hooks/useTimer.ts +48 -0
  945. package/src/main.tsx +20 -0
  946. package/src/mount.tsx +331 -0
  947. package/src/plugins/core/BadPlugin.tsx +72 -0
  948. package/src/plugins/core/RenderHTML.tsx +136 -0
  949. package/src/plugins/core/__test__/RenderHTML.test.ts +146 -0
  950. package/src/plugins/core/builder.ts +59 -0
  951. package/src/plugins/core/registerReactComponent.tsx +535 -0
  952. package/src/plugins/core/rpc.ts +55 -0
  953. package/src/plugins/core/sidebar-element.tsx +104 -0
  954. package/src/plugins/impl/ButtonPlugin.tsx +95 -0
  955. package/src/plugins/impl/CheckboxPlugin.tsx +56 -0
  956. package/src/plugins/impl/CodeEditorPlugin.tsx +119 -0
  957. package/src/plugins/impl/DataEditorPlugin.tsx +181 -0
  958. package/src/plugins/impl/DataTablePlugin.tsx +948 -0
  959. package/src/plugins/impl/DatePickerPlugin.tsx +74 -0
  960. package/src/plugins/impl/DateRangePlugin.tsx +82 -0
  961. package/src/plugins/impl/DateTimePickerPlugin.tsx +76 -0
  962. package/src/plugins/impl/DictPlugin.tsx +80 -0
  963. package/src/plugins/impl/DropdownPlugin.tsx +102 -0
  964. package/src/plugins/impl/FileBrowserPlugin.tsx +500 -0
  965. package/src/plugins/impl/FileUploadPlugin.tsx +302 -0
  966. package/src/plugins/impl/FormPlugin.tsx +294 -0
  967. package/src/plugins/impl/MicrophonePlugin.tsx +58 -0
  968. package/src/plugins/impl/MultiselectPlugin.tsx +207 -0
  969. package/src/plugins/impl/NumberPlugin.tsx +84 -0
  970. package/src/plugins/impl/RadioPlugin.tsx +77 -0
  971. package/src/plugins/impl/RangeSliderPlugin.tsx +163 -0
  972. package/src/plugins/impl/RefreshPlugin.tsx +158 -0
  973. package/src/plugins/impl/SearchableSelect.tsx +122 -0
  974. package/src/plugins/impl/SliderPlugin.tsx +166 -0
  975. package/src/plugins/impl/SwitchPlugin.tsx +48 -0
  976. package/src/plugins/impl/TabsPlugin.tsx +83 -0
  977. package/src/plugins/impl/TextAreaPlugin.tsx +131 -0
  978. package/src/plugins/impl/TextInputPlugin.tsx +169 -0
  979. package/src/plugins/impl/__tests__/DateTimePickerPlugin.test.tsx +45 -0
  980. package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +178 -0
  981. package/src/plugins/impl/__tests__/MultiSelectPlugin.test.ts +41 -0
  982. package/src/plugins/impl/__tests__/NumberPlugin.test.tsx +144 -0
  983. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +269 -0
  984. package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +181 -0
  985. package/src/plugins/impl/anywidget/__tests__/model.test.ts +370 -0
  986. package/src/plugins/impl/anywidget/model.ts +314 -0
  987. package/src/plugins/impl/chat/ChatPlugin.tsx +98 -0
  988. package/src/plugins/impl/chat/chat-ui.tsx +713 -0
  989. package/src/plugins/impl/chat/types.ts +39 -0
  990. package/src/plugins/impl/code/LazyAnyLanguageCodeMirror.tsx +6 -0
  991. package/src/plugins/impl/code/any-language-editor.tsx +68 -0
  992. package/src/plugins/impl/common/error-banner.tsx +111 -0
  993. package/src/plugins/impl/common/intent.ts +18 -0
  994. package/src/plugins/impl/common/labeled.tsx +69 -0
  995. package/src/plugins/impl/data-editor/__tests__/data-utils.test.ts +876 -0
  996. package/src/plugins/impl/data-editor/__tests__/glide-utils.test.ts +452 -0
  997. package/src/plugins/impl/data-editor/components.tsx +179 -0
  998. package/src/plugins/impl/data-editor/data-utils.ts +123 -0
  999. package/src/plugins/impl/data-editor/glide-data-editor.tsx +651 -0
  1000. package/src/plugins/impl/data-editor/glide-utils.ts +200 -0
  1001. package/src/plugins/impl/data-editor/themes.ts +49 -0
  1002. package/src/plugins/impl/data-editor/types.ts +44 -0
  1003. package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +268 -0
  1004. package/src/plugins/impl/data-explorer/DataExplorerPlugin.tsx +31 -0
  1005. package/src/plugins/impl/data-explorer/components/column-summary.tsx +174 -0
  1006. package/src/plugins/impl/data-explorer/components/icons.tsx +30 -0
  1007. package/src/plugins/impl/data-explorer/components/query-form.tsx +296 -0
  1008. package/src/plugins/impl/data-explorer/encoding.ts +107 -0
  1009. package/src/plugins/impl/data-explorer/functions/function.ts +83 -0
  1010. package/src/plugins/impl/data-explorer/functions/types.ts +32 -0
  1011. package/src/plugins/impl/data-explorer/marks.ts +21 -0
  1012. package/src/plugins/impl/data-explorer/queries/field-suggestion.ts +65 -0
  1013. package/src/plugins/impl/data-explorer/queries/histograms.ts +41 -0
  1014. package/src/plugins/impl/data-explorer/queries/queries.ts +204 -0
  1015. package/src/plugins/impl/data-explorer/queries/removeUndefined.ts +11 -0
  1016. package/src/plugins/impl/data-explorer/queries/types.ts +54 -0
  1017. package/src/plugins/impl/data-explorer/queries/utils.ts +85 -0
  1018. package/src/plugins/impl/data-explorer/spec.ts +28 -0
  1019. package/src/plugins/impl/data-explorer/state/reducer.ts +92 -0
  1020. package/src/plugins/impl/data-explorer/state/types.ts +28 -0
  1021. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +303 -0
  1022. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +1600 -0
  1023. package/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx +67 -0
  1024. package/src/plugins/impl/data-frames/forms/context.ts +13 -0
  1025. package/src/plugins/impl/data-frames/forms/datatype-icon.tsx +43 -0
  1026. package/src/plugins/impl/data-frames/forms/renderers.tsx +518 -0
  1027. package/src/plugins/impl/data-frames/panel.tsx +308 -0
  1028. package/src/plugins/impl/data-frames/schema.ts +211 -0
  1029. package/src/plugins/impl/data-frames/types.ts +91 -0
  1030. package/src/plugins/impl/data-frames/utils/__tests__/getUpdatedColumnTypes.test.ts +191 -0
  1031. package/src/plugins/impl/data-frames/utils/__tests__/operators.test.ts +116 -0
  1032. package/src/plugins/impl/data-frames/utils/getUpdatedColumnTypes.ts +67 -0
  1033. package/src/plugins/impl/data-frames/utils/operators.ts +202 -0
  1034. package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +39 -0
  1035. package/src/plugins/impl/multiselectFilterFn.tsx +22 -0
  1036. package/src/plugins/impl/panel/PanelPlugin.tsx +266 -0
  1037. package/src/plugins/impl/panel/__tests__/utils.test.ts +119 -0
  1038. package/src/plugins/impl/panel/utils.ts +104 -0
  1039. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +300 -0
  1040. package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +73 -0
  1041. package/src/plugins/impl/plotly/mapbox.css +359 -0
  1042. package/src/plugins/impl/plotly/parse-from-template.ts +58 -0
  1043. package/src/plugins/impl/plotly/plotly.css +280 -0
  1044. package/src/plugins/impl/vega/VegaPlugin.tsx +40 -0
  1045. package/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap +1210 -0
  1046. package/src/plugins/impl/vega/__tests__/encodings.test.ts +172 -0
  1047. package/src/plugins/impl/vega/__tests__/loader.test.ts +73 -0
  1048. package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +575 -0
  1049. package/src/plugins/impl/vega/__tests__/params.test.ts +52 -0
  1050. package/src/plugins/impl/vega/__tests__/resolve-data.test.ts +236 -0
  1051. package/src/plugins/impl/vega/__tests__/vega.test.ts +603 -0
  1052. package/src/plugins/impl/vega/batched.ts +41 -0
  1053. package/src/plugins/impl/vega/encodings.ts +111 -0
  1054. package/src/plugins/impl/vega/fix-relative-url.ts +15 -0
  1055. package/src/plugins/impl/vega/formats.ts +25 -0
  1056. package/src/plugins/impl/vega/loader.ts +320 -0
  1057. package/src/plugins/impl/vega/make-selectable.ts +248 -0
  1058. package/src/plugins/impl/vega/marks.ts +36 -0
  1059. package/src/plugins/impl/vega/params.ts +192 -0
  1060. package/src/plugins/impl/vega/resolve-data.ts +101 -0
  1061. package/src/plugins/impl/vega/types.ts +32 -0
  1062. package/src/plugins/impl/vega/utils.ts +46 -0
  1063. package/src/plugins/impl/vega/vega-component.tsx +271 -0
  1064. package/src/plugins/impl/vega/vega-loader.ts +53 -0
  1065. package/src/plugins/impl/vega/vega.css +31 -0
  1066. package/src/plugins/layout/AccordionPlugin.tsx +63 -0
  1067. package/src/plugins/layout/CalloutPlugin.tsx +34 -0
  1068. package/src/plugins/layout/DownloadPlugin.tsx +136 -0
  1069. package/src/plugins/layout/ImageComparisonPlugin.tsx +35 -0
  1070. package/src/plugins/layout/JsonOutputPlugin.tsx +47 -0
  1071. package/src/plugins/layout/LazyPlugin.tsx +98 -0
  1072. package/src/plugins/layout/MimeRenderPlugin.tsx +45 -0
  1073. package/src/plugins/layout/NavigationMenuPlugin.tsx +219 -0
  1074. package/src/plugins/layout/ProgressPlugin.tsx +175 -0
  1075. package/src/plugins/layout/RoutesPlugin.tsx +81 -0
  1076. package/src/plugins/layout/StatPlugin.tsx +100 -0
  1077. package/src/plugins/layout/TexPlugin.tsx +102 -0
  1078. package/src/plugins/layout/__test__/ProgressPlugin.test.ts +26 -0
  1079. package/src/plugins/layout/carousel/CarouselPlugin.tsx +48 -0
  1080. package/src/plugins/layout/mermaid/MermaidPlugin.tsx +26 -0
  1081. package/src/plugins/layout/mermaid/mermaid.tsx +94 -0
  1082. package/src/plugins/layout/navigation-menu.css +37 -0
  1083. package/src/plugins/plugins.ts +116 -0
  1084. package/src/plugins/stateless-plugin.ts +29 -0
  1085. package/src/plugins/types.ts +82 -0
  1086. package/src/stories/__fixtures__/vega.ts +225 -0
  1087. package/src/stories/accordion.stories.tsx +100 -0
  1088. package/src/stories/alert-dialog.mdx +42 -0
  1089. package/src/stories/app-chrome.stories.tsx +26 -0
  1090. package/src/stories/button.stories.tsx +90 -0
  1091. package/src/stories/callout.stories.tsx +73 -0
  1092. package/src/stories/cell-status.stories.tsx +145 -0
  1093. package/src/stories/cell.stories.tsx +336 -0
  1094. package/src/stories/checkbox.stories.tsx +44 -0
  1095. package/src/stories/colors.stories.tsx +156 -0
  1096. package/src/stories/combobox.stories.tsx +133 -0
  1097. package/src/stories/context-menu.mdx +23 -0
  1098. package/src/stories/data-explorer.stories.tsx +30 -0
  1099. package/src/stories/data-table.stories.tsx +130 -0
  1100. package/src/stories/dataframe.stories.tsx +46 -0
  1101. package/src/stories/debugger.stories.tsx +34 -0
  1102. package/src/stories/dialog.stories.tsx +80 -0
  1103. package/src/stories/dropdown-menu.mdx +159 -0
  1104. package/src/stories/editor-inputs.stories.tsx +47 -0
  1105. package/src/stories/editor.stories.tsx +91 -0
  1106. package/src/stories/file-upload.stories.tsx +103 -0
  1107. package/src/stories/form-wrapper.stories.tsx +147 -0
  1108. package/src/stories/input.stories.tsx +56 -0
  1109. package/src/stories/label.mdx +9 -0
  1110. package/src/stories/log-viewer.stories.tsx +74 -0
  1111. package/src/stories/number-field.mdx +17 -0
  1112. package/src/stories/number-field.stories.tsx +41 -0
  1113. package/src/stories/progress-component.stories.tsx +74 -0
  1114. package/src/stories/progress.stories.tsx +33 -0
  1115. package/src/stories/radio-group.mdx +54 -0
  1116. package/src/stories/select-native.stories.tsx +49 -0
  1117. package/src/stories/select.stories.tsx +92 -0
  1118. package/src/stories/slider.stories.tsx +27 -0
  1119. package/src/stories/stat.stories.tsx +123 -0
  1120. package/src/stories/switch.mdx +20 -0
  1121. package/src/stories/switchable-multi-select.stories.tsx +31 -0
  1122. package/src/stories/tabs.mdx +59 -0
  1123. package/src/stories/textarea.stories.tsx +58 -0
  1124. package/src/stories/theme.stories.tsx +111 -0
  1125. package/src/stories/tooltip.mdx +32 -0
  1126. package/src/stories/typography.stories.tsx +80 -0
  1127. package/src/stories/variables.stories.tsx +58 -0
  1128. package/src/stories/vega.stories.tsx +57 -0
  1129. package/src/theme/ThemeProvider.tsx +32 -0
  1130. package/src/theme/namespace.tsx +23 -0
  1131. package/src/theme/useTheme.ts +89 -0
  1132. package/src/utils/Deferred.ts +20 -0
  1133. package/src/utils/Logger.ts +91 -0
  1134. package/src/utils/__tests__/Deferred.test.ts +38 -0
  1135. package/src/utils/__tests__/arrays.test.ts +130 -0
  1136. package/src/utils/__tests__/batch-requests.test.ts +60 -0
  1137. package/src/utils/__tests__/blob.test.ts +52 -0
  1138. package/src/utils/__tests__/cell-urls.test.ts +92 -0
  1139. package/src/utils/__tests__/createReducer.test.ts +184 -0
  1140. package/src/utils/__tests__/data-views.test.ts +112 -0
  1141. package/src/utils/__tests__/dates.test.ts +188 -0
  1142. package/src/utils/__tests__/edit-distance.test.ts +302 -0
  1143. package/src/utils/__tests__/errors.test.ts +54 -0
  1144. package/src/utils/__tests__/filenames.test.ts +30 -0
  1145. package/src/utils/__tests__/id-tree.test.ts +1994 -0
  1146. package/src/utils/__tests__/json-parser.test.ts +79 -0
  1147. package/src/utils/__tests__/local-storage.test.ts +77 -0
  1148. package/src/utils/__tests__/lru.test.ts +74 -0
  1149. package/src/utils/__tests__/maps.test.ts +91 -0
  1150. package/src/utils/__tests__/math.test.ts +29 -0
  1151. package/src/utils/__tests__/multi-map.test.ts +295 -0
  1152. package/src/utils/__tests__/numbers.test.ts +76 -0
  1153. package/src/utils/__tests__/path.test.ts +170 -0
  1154. package/src/utils/__tests__/pluralize.test.ts +47 -0
  1155. package/src/utils/__tests__/routes.test.ts +134 -0
  1156. package/src/utils/__tests__/sets.test.ts +41 -0
  1157. package/src/utils/__tests__/shallow-compare.test.ts +55 -0
  1158. package/src/utils/__tests__/strings.test.ts +68 -0
  1159. package/src/utils/__tests__/time.test.ts +61 -0
  1160. package/src/utils/__tests__/timed-cache.test.ts +142 -0
  1161. package/src/utils/__tests__/timeout.test.ts +153 -0
  1162. package/src/utils/__tests__/traceback.test.ts +34 -0
  1163. package/src/utils/__tests__/url.test.ts +100 -0
  1164. package/src/utils/__tests__/urls.test.ts +10 -0
  1165. package/src/utils/__tests__/versions.test.ts +63 -0
  1166. package/src/utils/__tests__/waitForWs.test.ts +76 -0
  1167. package/src/utils/arrays.ts +75 -0
  1168. package/src/utils/assertExists.ts +12 -0
  1169. package/src/utils/assertNever.ts +20 -0
  1170. package/src/utils/batch-requests.ts +28 -0
  1171. package/src/utils/blob.ts +45 -0
  1172. package/src/utils/cell-urls.ts +31 -0
  1173. package/src/utils/cn.ts +8 -0
  1174. package/src/utils/copy.ts +17 -0
  1175. package/src/utils/createReducer.ts +137 -0
  1176. package/src/utils/data-views.ts +54 -0
  1177. package/src/utils/dates.ts +145 -0
  1178. package/src/utils/dereference.ts +10 -0
  1179. package/src/utils/download.ts +47 -0
  1180. package/src/utils/edit-distance.ts +141 -0
  1181. package/src/utils/errors.ts +63 -0
  1182. package/src/utils/events.ts +85 -0
  1183. package/src/utils/fileToBase64.ts +30 -0
  1184. package/src/utils/filenames.ts +29 -0
  1185. package/src/utils/functions.ts +24 -0
  1186. package/src/utils/id-tree.tsx +1032 -0
  1187. package/src/utils/idle.ts +19 -0
  1188. package/src/utils/invariant.ts +37 -0
  1189. package/src/utils/json/__tests__/base64.test.ts +100 -0
  1190. package/src/utils/json/base64.ts +51 -0
  1191. package/src/utils/json/json-parser.ts +65 -0
  1192. package/src/utils/lazy.ts +30 -0
  1193. package/src/utils/links.ts +11 -0
  1194. package/src/utils/localStorage.ts +132 -0
  1195. package/src/utils/lru.ts +68 -0
  1196. package/src/utils/maps.ts +65 -0
  1197. package/src/utils/math.ts +6 -0
  1198. package/src/utils/mergeRefs.ts +14 -0
  1199. package/src/utils/multi-map.ts +71 -0
  1200. package/src/utils/numbers.ts +124 -0
  1201. package/src/utils/objects.ts +105 -0
  1202. package/src/utils/once.ts +17 -0
  1203. package/src/utils/pathUtils.test.ts +113 -0
  1204. package/src/utils/pathUtils.ts +76 -0
  1205. package/src/utils/paths.ts +67 -0
  1206. package/src/utils/pluralize.ts +35 -0
  1207. package/src/utils/python-poet/__tests__/poet.test.ts +286 -0
  1208. package/src/utils/python-poet/poet.ts +196 -0
  1209. package/src/utils/reload-safe.ts +15 -0
  1210. package/src/utils/repl.ts +23 -0
  1211. package/src/utils/routes.ts +36 -0
  1212. package/src/utils/scroll.ts +38 -0
  1213. package/src/utils/sets.ts +30 -0
  1214. package/src/utils/shallow-compare.ts +30 -0
  1215. package/src/utils/staticImplements.ts +7 -0
  1216. package/src/utils/strings.ts +64 -0
  1217. package/src/utils/time.ts +39 -0
  1218. package/src/utils/timed-cache.ts +52 -0
  1219. package/src/utils/timeout.ts +42 -0
  1220. package/src/utils/traceback.ts +104 -0
  1221. package/src/utils/tracer.ts +106 -0
  1222. package/src/utils/typed.ts +17 -0
  1223. package/src/utils/url.ts +12 -0
  1224. package/src/utils/urls.ts +33 -0
  1225. package/src/utils/uuid.ts +8 -0
  1226. package/src/utils/versions.ts +66 -0
  1227. package/src/utils/vitals.ts +30 -0
  1228. package/src/utils/waitForWs.ts +31 -0
@@ -1,26 +1,26 @@
1
- var or = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
2
- var wn = or((Sn, Ye) => {
3
- const dr = 1e10, cr = 1e3;
4
- function we(t, e) {
1
+ var dr = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
2
+ var xn = dr((On, Xe) => {
3
+ const cr = 1e10, lr = 1e3;
4
+ function be(t, e) {
5
5
  const r = t.map((n) => `"${n}"`).join(", ");
6
6
  return new Error(`This RPC instance cannot ${e} because the transport did not provide one or more of these methods: ${r}`);
7
7
  }
8
- function lr(t = {}) {
8
+ function ur(t = {}) {
9
9
  let e = {};
10
10
  function r(y) {
11
11
  e = y;
12
12
  }
13
13
  let n = {};
14
- function a(y) {
15
- n.unregisterHandler && n.unregisterHandler(), n = y, n.registerHandler?.(ir);
14
+ function s(y) {
15
+ n.unregisterHandler && n.unregisterHandler(), n = y, n.registerHandler?.(or);
16
16
  }
17
- let s;
17
+ let a;
18
18
  function i(y) {
19
19
  if (typeof y == "function") {
20
- s = y;
20
+ a = y;
21
21
  return;
22
22
  }
23
- s = (b, E) => {
23
+ a = (b, E) => {
24
24
  const C = y[b];
25
25
  if (C)
26
26
  return C(E);
@@ -30,19 +30,19 @@ var wn = or((Sn, Ye) => {
30
30
  return $(b, E);
31
31
  };
32
32
  }
33
- const { maxRequestTime: o = cr } = t;
34
- t.transport && a(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
33
+ const { maxRequestTime: o = lr } = t;
34
+ t.transport && s(t.transport), t.requestHandler && i(t.requestHandler), t._debugHooks && r(t._debugHooks);
35
35
  let d = 0;
36
36
  function l() {
37
- return d <= dr ? ++d : d = 0;
37
+ return d <= cr ? ++d : d = 0;
38
38
  }
39
39
  const h = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
40
40
  function S(y, ...b) {
41
41
  const E = b[0];
42
42
  return new Promise((C, $) => {
43
43
  if (!n.send)
44
- throw we(["send"], "make requests");
45
- const z = l(), rt = {
44
+ throw be(["send"], "make requests");
45
+ const z = l(), st = {
46
46
  type: "request",
47
47
  id: z,
48
48
  method: y,
@@ -50,16 +50,16 @@ var wn = or((Sn, Ye) => {
50
50
  };
51
51
  h.set(z, { resolve: C, reject: $ }), o !== 1 / 0 && x.set(z, setTimeout(() => {
52
52
  x.delete(z), $(new Error("RPC request timed out."));
53
- }, o)), e.onSend?.(rt), n.send(rt);
53
+ }, o)), e.onSend?.(st), n.send(st);
54
54
  });
55
55
  }
56
56
  const j = new Proxy(S, {
57
57
  get: (y, b, E) => b in y ? Reflect.get(y, b, E) : (C) => S(b, C)
58
58
  }), D = j;
59
- function ke(y, ...b) {
59
+ function we(y, ...b) {
60
60
  const E = b[0];
61
61
  if (!n.send)
62
- throw we(["send"], "send messages");
62
+ throw be(["send"], "send messages");
63
63
  const C = {
64
64
  type: "message",
65
65
  id: y,
@@ -67,31 +67,31 @@ var wn = or((Sn, Ye) => {
67
67
  };
68
68
  e.onSend?.(C), n.send(C);
69
69
  }
70
- const et = new Proxy(ke, {
71
- get: (y, b, E) => b in y ? Reflect.get(y, b, E) : (C) => ke(b, C)
72
- }), tt = et, Y = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Set();
70
+ const rt = new Proxy(we, {
71
+ get: (y, b, E) => b in y ? Reflect.get(y, b, E) : (C) => we(b, C)
72
+ }), nt = rt, Y = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ new Set();
73
73
  function ar(y, b) {
74
74
  if (!n.registerHandler)
75
- throw we(["registerHandler"], "register message listeners");
75
+ throw be(["registerHandler"], "register message listeners");
76
76
  if (y === "*") {
77
- $e.add(b);
77
+ Ze.add(b);
78
78
  return;
79
79
  }
80
80
  Y.has(y) || Y.set(y, /* @__PURE__ */ new Set()), Y.get(y)?.add(b);
81
81
  }
82
- function sr(y, b) {
82
+ function ir(y, b) {
83
83
  if (y === "*") {
84
- $e.delete(b);
84
+ Ze.delete(b);
85
85
  return;
86
86
  }
87
87
  Y.get(y)?.delete(b), Y.get(y)?.size === 0 && Y.delete(y);
88
88
  }
89
- async function ir(y) {
89
+ async function or(y) {
90
90
  if (e.onReceive?.(y), !("type" in y))
91
91
  throw new Error("Message does not contain a type.");
92
92
  if (y.type === "request") {
93
- if (!n.send || !s)
94
- throw we(["send", "requestHandler"], "handle requests");
93
+ if (!n.send || !a)
94
+ throw be(["send", "requestHandler"], "handle requests");
95
95
  const { id: b, method: E, params: C } = y;
96
96
  let $;
97
97
  try {
@@ -99,7 +99,7 @@ var wn = or((Sn, Ye) => {
99
99
  type: "response",
100
100
  id: b,
101
101
  success: !0,
102
- payload: await s(E, C)
102
+ payload: await a(E, C)
103
103
  };
104
104
  } catch (z) {
105
105
  if (!(z instanceof Error))
@@ -122,7 +122,7 @@ var wn = or((Sn, Ye) => {
122
122
  return;
123
123
  }
124
124
  if (y.type === "message") {
125
- for (const E of $e)
125
+ for (const E of Ze)
126
126
  E(y.id, y.payload);
127
127
  const b = Y.get(y.id);
128
128
  if (!b)
@@ -134,84 +134,84 @@ var wn = or((Sn, Ye) => {
134
134
  throw new Error(`Unexpected RPC message type: ${y.type}`);
135
135
  }
136
136
  return {
137
- setTransport: a,
137
+ setTransport: s,
138
138
  setRequestHandler: i,
139
139
  request: j,
140
140
  requestProxy: D,
141
- send: et,
142
- sendProxy: tt,
141
+ send: rt,
142
+ sendProxy: nt,
143
143
  addMessageListener: ar,
144
- removeMessageListener: sr,
145
- proxy: { send: tt, request: D },
144
+ removeMessageListener: ir,
145
+ proxy: { send: nt, request: D },
146
146
  _setDebugHooks: r
147
147
  };
148
148
  }
149
- function ur(t) {
150
- return lr(t);
149
+ function fr(t) {
150
+ return ur(t);
151
151
  }
152
- const bt = "[transport-id]";
153
- function fr(t, e) {
152
+ const St = "[transport-id]";
153
+ function hr(t, e) {
154
154
  const { transportId: r } = e;
155
- return r != null ? { [bt]: r, data: t } : t;
155
+ return r != null ? { [St]: r, data: t } : t;
156
156
  }
157
- function hr(t, e) {
158
- const { transportId: r, filter: n } = e, a = n?.();
159
- if (r != null && a != null)
157
+ function pr(t, e) {
158
+ const { transportId: r, filter: n } = e, s = n?.();
159
+ if (r != null && s != null)
160
160
  throw new Error("Cannot use both `transportId` and `filter` at the same time");
161
- let s = t;
161
+ let a = t;
162
162
  if (r) {
163
- if (t[bt] !== r)
163
+ if (t[St] !== r)
164
164
  return [!0];
165
- s = t.data;
165
+ a = t.data;
166
166
  }
167
- return a === !1 ? [!0] : [!1, s];
167
+ return s === !1 ? [!0] : [!1, a];
168
168
  }
169
- function pr(t, e = {}) {
170
- const { transportId: r, filter: n, remotePort: a } = e, s = t, i = a ?? t;
169
+ function mr(t, e = {}) {
170
+ const { transportId: r, filter: n, remotePort: s } = e, a = t, i = s ?? t;
171
171
  let o;
172
172
  return {
173
173
  send(d) {
174
- i.postMessage(fr(d, { transportId: r }));
174
+ i.postMessage(hr(d, { transportId: r }));
175
175
  },
176
176
  registerHandler(d) {
177
177
  o = (l) => {
178
- const h = l.data, [x, S] = hr(h, {
178
+ const h = l.data, [x, S] = pr(h, {
179
179
  transportId: r,
180
180
  filter: () => n?.(l)
181
181
  });
182
182
  x || d(S);
183
- }, s.addEventListener("message", o);
183
+ }, a.addEventListener("message", o);
184
184
  },
185
185
  unregisterHandler() {
186
- o && s.removeEventListener("message", o);
186
+ o && a.removeEventListener("message", o);
187
187
  }
188
188
  };
189
189
  }
190
- function mr(t) {
191
- return pr(self, t);
190
+ function yr(t) {
191
+ return mr(self, t);
192
192
  }
193
- const yr = "marimo-transport";
194
- var gr = Object.defineProperty, k = (t, e) => gr(t, "name", { value: e, configurable: !0 }), xt = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
193
+ const gr = "marimo-transport";
194
+ var _r = Object.defineProperty, k = (t, e) => _r(t, "name", { value: e, configurable: !0 }), Tt = ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, { get: (e, r) => (typeof require < "u" ? require : e)[r] }) : t)(function(t) {
195
195
  if (typeof require < "u") return require.apply(this, arguments);
196
196
  throw new Error('Dynamic require of "' + t + '" is not supported');
197
197
  });
198
- function St(t) {
198
+ function Ot(t) {
199
199
  return !isNaN(parseFloat(t)) && isFinite(t);
200
200
  }
201
- k(St, "_isNumber");
201
+ k(Ot, "_isNumber");
202
202
  function W(t) {
203
203
  return t.charAt(0).toUpperCase() + t.substring(1);
204
204
  }
205
205
  k(W, "_capitalize");
206
- function je(t) {
206
+ function Fe(t) {
207
207
  return function() {
208
208
  return this[t];
209
209
  };
210
210
  }
211
- k(je, "_getter");
212
- var te = ["isConstructor", "isEval", "isNative", "isToplevel"], re = ["columnNumber", "lineNumber"], ne = ["fileName", "functionName", "source"], _r = ["args"], vr = ["evalOrigin"], be = te.concat(re, ne, _r, vr);
211
+ k(Fe, "_getter");
212
+ var re = ["isConstructor", "isEval", "isNative", "isToplevel"], ne = ["columnNumber", "lineNumber"], se = ["fileName", "functionName", "source"], vr = ["args"], kr = ["evalOrigin"], xe = re.concat(ne, se, vr, kr);
213
213
  function I(t) {
214
- if (t) for (var e = 0; e < be.length; e++) t[be[e]] !== void 0 && this["set" + W(be[e])](t[be[e]]);
214
+ if (t) for (var e = 0; e < xe.length; e++) t[xe[e]] !== void 0 && this["set" + W(xe[e])](t[xe[e]]);
215
215
  }
216
216
  k(I, "StackFrame");
217
217
  I.prototype = { getArgs: function() {
@@ -230,30 +230,30 @@ var wn = or((Sn, Ye) => {
230
230
  return this.getIsEval() ? t ? "[eval] (" + t + ":" + e + ":" + r + ")" : "[eval]:" + e + ":" + r : n ? n + " (" + t + ":" + e + ":" + r + ")" : t + ":" + e + ":" + r;
231
231
  } };
232
232
  I.fromString = k(function(t) {
233
- var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), a = t.substring(e + 1, r).split(","), s = t.substring(r + 1);
234
- if (s.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s, ""), o = i[1], d = i[2], l = i[3];
235
- return new I({ functionName: n, args: a || void 0, fileName: o, lineNumber: d || void 0, columnNumber: l || void 0 });
233
+ var e = t.indexOf("("), r = t.lastIndexOf(")"), n = t.substring(0, e), s = t.substring(e + 1, r).split(","), a = t.substring(r + 1);
234
+ if (a.indexOf("@") === 0) var i = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a, ""), o = i[1], d = i[2], l = i[3];
235
+ return new I({ functionName: n, args: s || void 0, fileName: o, lineNumber: d || void 0, columnNumber: l || void 0 });
236
236
  }, "StackFrame$$fromString");
237
- for (Q = 0; Q < te.length; Q++) I.prototype["get" + W(te[Q])] = je(te[Q]), I.prototype["set" + W(te[Q])] = /* @__PURE__ */ function(t) {
237
+ for (Q = 0; Q < re.length; Q++) I.prototype["get" + W(re[Q])] = Fe(re[Q]), I.prototype["set" + W(re[Q])] = /* @__PURE__ */ function(t) {
238
238
  return function(e) {
239
239
  this[t] = !!e;
240
240
  };
241
- }(te[Q]);
241
+ }(re[Q]);
242
242
  var Q;
243
- for (X = 0; X < re.length; X++) I.prototype["get" + W(re[X])] = je(re[X]), I.prototype["set" + W(re[X])] = /* @__PURE__ */ function(t) {
243
+ for (X = 0; X < ne.length; X++) I.prototype["get" + W(ne[X])] = Fe(ne[X]), I.prototype["set" + W(ne[X])] = /* @__PURE__ */ function(t) {
244
244
  return function(e) {
245
- if (!St(e)) throw new TypeError(t + " must be a Number");
245
+ if (!Ot(e)) throw new TypeError(t + " must be a Number");
246
246
  this[t] = Number(e);
247
247
  };
248
- }(re[X]);
248
+ }(ne[X]);
249
249
  var X;
250
- for (G = 0; G < ne.length; G++) I.prototype["get" + W(ne[G])] = je(ne[G]), I.prototype["set" + W(ne[G])] = /* @__PURE__ */ function(t) {
250
+ for (G = 0; G < se.length; G++) I.prototype["get" + W(se[G])] = Fe(se[G]), I.prototype["set" + W(se[G])] = /* @__PURE__ */ function(t) {
251
251
  return function(e) {
252
252
  this[t] = String(e);
253
253
  };
254
- }(ne[G]);
255
- var G, Fe = I;
256
- function Tt() {
254
+ }(se[G]);
255
+ var G, Me = I;
256
+ function Et() {
257
257
  var t = /^\s*at .*(\S+:\d+|\(native\))/m, e = /^(eval@)?(\[native code])?$/;
258
258
  return { parse: k(function(r) {
259
259
  if (r.stack && r.stack.match(t)) return this.parseV8OrIE(r);
@@ -261,78 +261,78 @@ var wn = or((Sn, Ye) => {
261
261
  throw new Error("Cannot parse given Error object");
262
262
  }, "ErrorStackParser$$parse"), extractLocation: k(function(r) {
263
263
  if (r.indexOf(":") === -1) return [r];
264
- var n = /(.+?)(?::(\d+))?(?::(\d+))?$/, a = n.exec(r.replace(/[()]/g, ""));
265
- return [a[1], a[2] || void 0, a[3] || void 0];
264
+ var n = /(.+?)(?::(\d+))?(?::(\d+))?$/, s = n.exec(r.replace(/[()]/g, ""));
265
+ return [s[1], s[2] || void 0, s[3] || void 0];
266
266
  }, "ErrorStackParser$$extractLocation"), parseV8OrIE: k(function(r) {
267
267
  var n = r.stack.split(`
268
- `).filter(function(a) {
269
- return !!a.match(t);
268
+ `).filter(function(s) {
269
+ return !!s.match(t);
270
270
  }, this);
271
- return n.map(function(a) {
272
- a.indexOf("(eval ") > -1 && (a = a.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
273
- var s = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = s.match(/ (\(.+\)$)/);
274
- s = i ? s.replace(i[0], "") : s;
275
- var o = this.extractLocation(i ? i[1] : s), d = i && s || void 0, l = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
276
- return new Fe({ functionName: d, fileName: l, lineNumber: o[1], columnNumber: o[2], source: a });
271
+ return n.map(function(s) {
272
+ s.indexOf("(eval ") > -1 && (s = s.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
273
+ var a = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), i = a.match(/ (\(.+\)$)/);
274
+ a = i ? a.replace(i[0], "") : a;
275
+ var o = this.extractLocation(i ? i[1] : a), d = i && a || void 0, l = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
276
+ return new Me({ functionName: d, fileName: l, lineNumber: o[1], columnNumber: o[2], source: s });
277
277
  }, this);
278
278
  }, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: k(function(r) {
279
279
  var n = r.stack.split(`
280
- `).filter(function(a) {
281
- return !a.match(e);
280
+ `).filter(function(s) {
281
+ return !s.match(e);
282
282
  }, this);
283
- return n.map(function(a) {
284
- if (a.indexOf(" > eval") > -1 && (a = a.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), a.indexOf("@") === -1 && a.indexOf(":") === -1) return new Fe({ functionName: a });
285
- var s = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = a.match(s), o = i && i[1] ? i[1] : void 0, d = this.extractLocation(a.replace(s, ""));
286
- return new Fe({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source: a });
283
+ return n.map(function(s) {
284
+ if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new Me({ functionName: s });
285
+ var a = /((.*".+"[^@]*)?[^@]*)(?:@)/, i = s.match(a), o = i && i[1] ? i[1] : void 0, d = this.extractLocation(s.replace(a, ""));
286
+ return new Me({ functionName: o, fileName: d[0], lineNumber: d[1], columnNumber: d[2], source: s });
287
287
  }, this);
288
288
  }, "ErrorStackParser$$parseFFOrSafari") };
289
289
  }
290
- k(Tt, "ErrorStackParser");
291
- var kr = new Tt(), wr = kr, L = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, Ot = L && typeof Ye < "u" && typeof Ye.exports < "u" && typeof xt < "u" && typeof __dirname < "u", br = L && !Ot, xr = typeof Deno < "u", Et = !L && !xr, Sr = Et && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", Tr = Et && typeof importScripts == "function" && typeof self == "object";
290
+ k(Et, "ErrorStackParser");
291
+ var wr = new Et(), br = wr, L = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && !process.browser, Nt = L && typeof Xe < "u" && typeof Xe.exports < "u" && typeof Tt < "u" && typeof __dirname < "u", xr = L && !Nt, Sr = typeof Deno < "u", Rt = !L && !Sr, Tr = Rt && typeof window == "object" && typeof document == "object" && typeof document.createElement == "function" && "sessionStorage" in window && typeof importScripts != "function", Or = Rt && typeof importScripts == "function" && typeof self == "object";
292
292
  typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") > -1;
293
- var Nt, Me, Rt, nt, Qe;
294
- async function Xe() {
295
- if (!L || (Nt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, nt = await import("./__vite-browser-external-CPvbk0mb.js"), Qe = await import("./__vite-browser-external-CPvbk0mb.js"), Rt = (await import("./__vite-browser-external-CPvbk0mb.js")).default, Me = await import("./__vite-browser-external-CPvbk0mb.js"), Ge = Me.sep, typeof xt < "u")) return;
296
- let t = nt, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), a = { fs: t, crypto: e, ws: r, child_process: n };
297
- globalThis.require = function(s) {
298
- return a[s];
293
+ var Ct, De, At, at, Ge;
294
+ async function Ke() {
295
+ if (!L || (Ct = (await import("./__vite-browser-external-CPvbk0mb.js")).default, at = await import("./__vite-browser-external-CPvbk0mb.js"), Ge = await import("./__vite-browser-external-CPvbk0mb.js"), At = (await import("./__vite-browser-external-CPvbk0mb.js")).default, De = await import("./__vite-browser-external-CPvbk0mb.js"), et = De.sep, typeof Tt < "u")) return;
296
+ let t = at, e = await import("./__vite-browser-external-CPvbk0mb.js"), r = await import("./__vite-browser-external-CPvbk0mb.js"), n = await import("./__vite-browser-external-CPvbk0mb.js"), s = { fs: t, crypto: e, ws: r, child_process: n };
297
+ globalThis.require = function(a) {
298
+ return s[a];
299
299
  };
300
300
  }
301
- k(Xe, "initNodeModules");
302
- function Ct(t, e) {
303
- return Me.resolve(e || ".", t);
301
+ k(Ke, "initNodeModules");
302
+ function It(t, e) {
303
+ return De.resolve(e || ".", t);
304
304
  }
305
- k(Ct, "node_resolvePath");
306
- function At(t, e) {
305
+ k(It, "node_resolvePath");
306
+ function Pt(t, e) {
307
307
  return e === void 0 && (e = location), new URL(t, e).toString();
308
308
  }
309
- k(At, "browser_resolvePath");
310
- var Le;
311
- L ? Le = Ct : Le = At;
312
- var Ge;
313
- L || (Ge = "/");
314
- function It(t, e) {
315
- return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: Qe.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
309
+ k(Pt, "browser_resolvePath");
310
+ var qe;
311
+ L ? qe = It : qe = Pt;
312
+ var et;
313
+ L || (et = "/");
314
+ function jt(t, e) {
315
+ return t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? { response: fetch(t) } : { binary: Ge.readFile(t).then((r) => new Uint8Array(r.buffer, r.byteOffset, r.byteLength)) };
316
316
  }
317
- k(It, "node_getBinaryResponse");
318
- function Pt(t, e) {
317
+ k(jt, "node_getBinaryResponse");
318
+ function $t(t, e) {
319
319
  let r = new URL(t, location);
320
320
  return { response: fetch(r, e ? { integrity: e } : {}) };
321
321
  }
322
- k(Pt, "browser_getBinaryResponse");
323
- var Te;
324
- L ? Te = It : Te = Pt;
325
- async function jt(t, e) {
326
- let { response: r, binary: n } = Te(t, e);
322
+ k($t, "browser_getBinaryResponse");
323
+ var Oe;
324
+ L ? Oe = jt : Oe = $t;
325
+ async function Ft(t, e) {
326
+ let { response: r, binary: n } = Oe(t, e);
327
327
  if (n) return n;
328
- let a = await r;
329
- if (!a.ok) throw new Error(`Failed to load '${t}': request failed.`);
330
- return new Uint8Array(await a.arrayBuffer());
331
- }
332
- k(jt, "loadBinaryFile");
333
- var xe;
334
- if (Sr) xe = k(async (t) => await import(t), "loadScript");
335
- else if (Tr) xe = k(async (t) => {
328
+ let s = await r;
329
+ if (!s.ok) throw new Error(`Failed to load '${t}': request failed.`);
330
+ return new Uint8Array(await s.arrayBuffer());
331
+ }
332
+ k(Ft, "loadBinaryFile");
333
+ var Se;
334
+ if (Tr) Se = k(async (t) => await import(t), "loadScript");
335
+ else if (Or) Se = k(async (t) => {
336
336
  try {
337
337
  globalThis.importScripts(t);
338
338
  } catch (e) {
@@ -340,50 +340,50 @@ var wn = or((Sn, Ye) => {
340
340
  else throw e;
341
341
  }
342
342
  }, "loadScript");
343
- else if (L) xe = $t;
343
+ else if (L) Se = Zt;
344
344
  else throw new Error("Cannot determine runtime environment");
345
- async function $t(t) {
346
- t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? Rt.runInThisContext(await (await fetch(t)).text()) : await import(Nt.pathToFileURL(t).href);
345
+ async function Zt(t) {
346
+ t.startsWith("file://") && (t = t.slice(7)), t.includes("://") ? At.runInThisContext(await (await fetch(t)).text()) : await import(Ct.pathToFileURL(t).href);
347
347
  }
348
- k($t, "nodeLoadScript");
349
- async function Ft(t) {
348
+ k(Zt, "nodeLoadScript");
349
+ async function Mt(t) {
350
350
  if (L) {
351
- await Xe();
352
- let e = await Qe.readFile(t, { encoding: "utf8" });
351
+ await Ke();
352
+ let e = await Ge.readFile(t, { encoding: "utf8" });
353
353
  return JSON.parse(e);
354
354
  } else return await (await fetch(t)).json();
355
355
  }
356
- k(Ft, "loadLockFile");
357
- async function Zt() {
358
- if (Ot) return __dirname;
356
+ k(Mt, "loadLockFile");
357
+ async function Lt() {
358
+ if (Nt) return __dirname;
359
359
  let t;
360
360
  try {
361
361
  throw new Error();
362
362
  } catch (n) {
363
363
  t = n;
364
364
  }
365
- let e = wr.parse(t)[0].fileName;
366
- if (L && !e.startsWith("file://") && (e = `file://${e}`), br) {
365
+ let e = br.parse(t)[0].fileName;
366
+ if (L && !e.startsWith("file://") && (e = `file://${e}`), xr) {
367
367
  let n = await import("./__vite-browser-external-CPvbk0mb.js");
368
368
  return (await import("./__vite-browser-external-CPvbk0mb.js")).fileURLToPath(n.dirname(e));
369
369
  }
370
- let r = e.lastIndexOf(Ge);
370
+ let r = e.lastIndexOf(et);
371
371
  if (r === -1) throw new Error("Could not extract indexURL path from pyodide module location");
372
372
  return e.slice(0, r);
373
373
  }
374
- k(Zt, "calculateDirname");
375
- function Mt(t) {
376
- let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, a = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(s) {
377
- if (!s.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
374
+ k(Lt, "calculateDirname");
375
+ function Dt(t) {
376
+ let e = t.FS, r = t.FS.filesystems.MEMFS, n = t.PATH, s = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(a) {
377
+ if (!a.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
378
378
  return r.mount.apply(null, arguments);
379
- }, syncfs: async (s, i, o) => {
379
+ }, syncfs: async (a, i, o) => {
380
380
  try {
381
- let d = a.getLocalSet(s), l = await a.getRemoteSet(s), h = i ? l : d, x = i ? d : l;
382
- await a.reconcile(s, h, x), o(null);
381
+ let d = s.getLocalSet(a), l = await s.getRemoteSet(a), h = i ? l : d, x = i ? d : l;
382
+ await s.reconcile(a, h, x), o(null);
383
383
  } catch (d) {
384
384
  o(d);
385
385
  }
386
- }, getLocalSet: (s) => {
386
+ }, getLocalSet: (a) => {
387
387
  let i = /* @__PURE__ */ Object.create(null);
388
388
  function o(h) {
389
389
  return h !== "." && h !== "..";
@@ -393,47 +393,47 @@ var wn = or((Sn, Ye) => {
393
393
  return (x) => n.join2(h, x);
394
394
  }
395
395
  k(d, "toAbsolute");
396
- let l = e.readdir(s.mountpoint).filter(o).map(d(s.mountpoint));
396
+ let l = e.readdir(a.mountpoint).filter(o).map(d(a.mountpoint));
397
397
  for (; l.length; ) {
398
398
  let h = l.pop(), x = e.stat(h);
399
399
  e.isDir(x.mode) && l.push.apply(l, e.readdir(h).filter(o).map(d(h))), i[h] = { timestamp: x.mtime, mode: x.mode };
400
400
  }
401
401
  return { type: "local", entries: i };
402
- }, getRemoteSet: async (s) => {
403
- let i = /* @__PURE__ */ Object.create(null), o = await Or(s.opts.fileSystemHandle);
404
- for (let [d, l] of o) d !== "." && (i[n.join2(s.mountpoint, d)] = { timestamp: l.kind === "file" ? new Date((await l.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: l.kind === "file" ? a.FILE_MODE : a.DIR_MODE });
402
+ }, getRemoteSet: async (a) => {
403
+ let i = /* @__PURE__ */ Object.create(null), o = await Er(a.opts.fileSystemHandle);
404
+ for (let [d, l] of o) d !== "." && (i[n.join2(a.mountpoint, d)] = { timestamp: l.kind === "file" ? new Date((await l.getFile()).lastModified) : /* @__PURE__ */ new Date(), mode: l.kind === "file" ? s.FILE_MODE : s.DIR_MODE });
405
405
  return { type: "remote", entries: i, handles: o };
406
- }, loadLocalEntry: (s) => {
407
- let i = e.lookupPath(s).node, o = e.stat(s);
406
+ }, loadLocalEntry: (a) => {
407
+ let i = e.lookupPath(a).node, o = e.stat(a);
408
408
  if (e.isDir(o.mode)) return { timestamp: o.mtime, mode: o.mode };
409
409
  if (e.isFile(o.mode)) return i.contents = r.getFileDataAsTypedArray(i), { timestamp: o.mtime, mode: o.mode, contents: i.contents };
410
410
  throw new Error("node type not supported");
411
- }, storeLocalEntry: (s, i) => {
412
- if (e.isDir(i.mode)) e.mkdirTree(s, i.mode);
413
- else if (e.isFile(i.mode)) e.writeFile(s, i.contents, { canOwn: !0 });
411
+ }, storeLocalEntry: (a, i) => {
412
+ if (e.isDir(i.mode)) e.mkdirTree(a, i.mode);
413
+ else if (e.isFile(i.mode)) e.writeFile(a, i.contents, { canOwn: !0 });
414
414
  else throw new Error("node type not supported");
415
- e.chmod(s, i.mode), e.utime(s, i.timestamp, i.timestamp);
416
- }, removeLocalEntry: (s) => {
417
- var i = e.stat(s);
418
- e.isDir(i.mode) ? e.rmdir(s) : e.isFile(i.mode) && e.unlink(s);
419
- }, loadRemoteEntry: async (s) => {
420
- if (s.kind === "file") {
421
- let i = await s.getFile();
422
- return { contents: new Uint8Array(await i.arrayBuffer()), mode: a.FILE_MODE, timestamp: new Date(i.lastModified) };
415
+ e.chmod(a, i.mode), e.utime(a, i.timestamp, i.timestamp);
416
+ }, removeLocalEntry: (a) => {
417
+ var i = e.stat(a);
418
+ e.isDir(i.mode) ? e.rmdir(a) : e.isFile(i.mode) && e.unlink(a);
419
+ }, loadRemoteEntry: async (a) => {
420
+ if (a.kind === "file") {
421
+ let i = await a.getFile();
422
+ return { contents: new Uint8Array(await i.arrayBuffer()), mode: s.FILE_MODE, timestamp: new Date(i.lastModified) };
423
423
  } else {
424
- if (s.kind === "directory") return { mode: a.DIR_MODE, timestamp: /* @__PURE__ */ new Date() };
425
- throw new Error("unknown kind: " + s.kind);
424
+ if (a.kind === "directory") return { mode: s.DIR_MODE, timestamp: /* @__PURE__ */ new Date() };
425
+ throw new Error("unknown kind: " + a.kind);
426
426
  }
427
- }, storeRemoteEntry: async (s, i, o) => {
428
- let d = s.get(n.dirname(i)), l = e.isFile(o.mode) ? await d.getFileHandle(n.basename(i), { create: !0 }) : await d.getDirectoryHandle(n.basename(i), { create: !0 });
427
+ }, storeRemoteEntry: async (a, i, o) => {
428
+ let d = a.get(n.dirname(i)), l = e.isFile(o.mode) ? await d.getFileHandle(n.basename(i), { create: !0 }) : await d.getDirectoryHandle(n.basename(i), { create: !0 });
429
429
  if (l.kind === "file") {
430
430
  let h = await l.createWritable();
431
431
  await h.write(o.contents), await h.close();
432
432
  }
433
- s.set(i, l);
434
- }, removeRemoteEntry: async (s, i) => {
435
- await s.get(n.dirname(i)).removeEntry(n.basename(i)), s.delete(i);
436
- }, reconcile: async (s, i, o) => {
433
+ a.set(i, l);
434
+ }, removeRemoteEntry: async (a, i) => {
435
+ await a.get(n.dirname(i)).removeEntry(n.basename(i)), a.delete(i);
436
+ }, reconcile: async (a, i, o) => {
437
437
  let d = 0, l = [];
438
438
  Object.keys(i.entries).forEach(function(S) {
439
439
  let j = i.entries[S], D = o.entries[S];
@@ -445,46 +445,46 @@ var wn = or((Sn, Ye) => {
445
445
  }), h.sort().reverse(), !d) return;
446
446
  let x = i.type === "remote" ? i.handles : o.handles;
447
447
  for (let S of l) {
448
- let j = n.normalize(S.replace(s.mountpoint, "/")).substring(1);
448
+ let j = n.normalize(S.replace(a.mountpoint, "/")).substring(1);
449
449
  if (o.type === "local") {
450
- let D = x.get(j), ke = await a.loadRemoteEntry(D);
451
- a.storeLocalEntry(S, ke);
450
+ let D = x.get(j), we = await s.loadRemoteEntry(D);
451
+ s.storeLocalEntry(S, we);
452
452
  } else {
453
- let D = a.loadLocalEntry(S);
454
- await a.storeRemoteEntry(x, j, D);
453
+ let D = s.loadLocalEntry(S);
454
+ await s.storeRemoteEntry(x, j, D);
455
455
  }
456
456
  }
457
- for (let S of h) if (o.type === "local") a.removeLocalEntry(S);
457
+ for (let S of h) if (o.type === "local") s.removeLocalEntry(S);
458
458
  else {
459
- let j = n.normalize(S.replace(s.mountpoint, "/")).substring(1);
460
- await a.removeRemoteEntry(x, j);
459
+ let j = n.normalize(S.replace(a.mountpoint, "/")).substring(1);
460
+ await s.removeRemoteEntry(x, j);
461
461
  }
462
462
  } };
463
- t.FS.filesystems.NATIVEFS_ASYNC = a;
463
+ t.FS.filesystems.NATIVEFS_ASYNC = s;
464
464
  }
465
- k(Mt, "initializeNativeFS");
466
- var Or = k(async (t) => {
465
+ k(Dt, "initializeNativeFS");
466
+ var Er = k(async (t) => {
467
467
  let e = [];
468
- async function r(a) {
469
- for await (let s of a.values()) e.push(s), s.kind === "directory" && await r(s);
468
+ async function r(s) {
469
+ for await (let a of s.values()) e.push(a), a.kind === "directory" && await r(a);
470
470
  }
471
471
  k(r, "collect"), await r(t);
472
472
  let n = /* @__PURE__ */ new Map();
473
473
  n.set(".", t);
474
- for (let a of e) {
475
- let s = (await t.resolve(a)).join("/");
476
- n.set(s, a);
474
+ for (let s of e) {
475
+ let a = (await t.resolve(s)).join("/");
476
+ n.set(a, s);
477
477
  }
478
478
  return n;
479
479
  }, "getFsHandles");
480
- function Lt(t) {
481
- let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: Ut(t), quit(r, n) {
480
+ function qt(t) {
481
+ let e = { noImageDecoding: !0, noAudioDecoding: !0, noWasmDecoding: !1, preRun: Bt(t), quit(r, n) {
482
482
  throw e.exited = { status: r, toThrow: n }, n;
483
- }, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: Ht(t.indexURL) };
483
+ }, print: t.stdout, printErr: t.stderr, thisProgram: t._sysExecutable, arguments: t.args, API: { config: t }, locateFile: (r) => t.indexURL + r, instantiateWasm: Wt(t.indexURL) };
484
484
  return e;
485
485
  }
486
- k(Lt, "createSettings");
487
- function Dt(t) {
486
+ k(qt, "createSettings");
487
+ function Vt(t) {
488
488
  return function(e) {
489
489
  let r = "/";
490
490
  try {
@@ -495,14 +495,14 @@ var wn = or((Sn, Ye) => {
495
495
  e.FS.chdir(t);
496
496
  };
497
497
  }
498
- k(Dt, "createHomeDirectory");
499
- function qt(t) {
498
+ k(Vt, "createHomeDirectory");
499
+ function zt(t) {
500
500
  return function(e) {
501
501
  Object.assign(e.ENV, t);
502
502
  };
503
503
  }
504
- k(qt, "setEnvironment");
505
- function Vt(t) {
504
+ k(zt, "setEnvironment");
505
+ function Ut(t) {
506
506
  return t ? [async (e) => {
507
507
  e.addRunDependency("fsInitHook");
508
508
  try {
@@ -512,57 +512,57 @@ var wn = or((Sn, Ye) => {
512
512
  }
513
513
  }] : [];
514
514
  }
515
- k(Vt, "callFsInitHook");
516
- function zt(t) {
517
- let e = jt(t);
515
+ k(Ut, "callFsInitHook");
516
+ function Ht(t) {
517
+ let e = Ft(t);
518
518
  return async (r) => {
519
- let n = r._py_version_major(), a = r._py_version_minor();
520
- r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${a}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
519
+ let n = r._py_version_major(), s = r._py_version_minor();
520
+ r.FS.mkdirTree("/lib"), r.API.sitePackages = `/lib/python${n}.${s}/site-packages`, r.FS.mkdirTree(r.API.sitePackages), r.addRunDependency("install-stdlib");
521
521
  try {
522
- let s = await e;
523
- r.FS.writeFile(`/lib/python${n}${a}.zip`, s);
524
- } catch (s) {
525
- console.error("Error occurred while installing the standard library:"), console.error(s);
522
+ let a = await e;
523
+ r.FS.writeFile(`/lib/python${n}${s}.zip`, a);
524
+ } catch (a) {
525
+ console.error("Error occurred while installing the standard library:"), console.error(a);
526
526
  } finally {
527
527
  r.removeRunDependency("install-stdlib");
528
528
  }
529
529
  };
530
530
  }
531
- k(zt, "installStdlib");
532
- function Ut(t) {
531
+ k(Ht, "installStdlib");
532
+ function Bt(t) {
533
533
  let e;
534
- return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...Vt(t.fsInit), zt(e), Dt(t.env.HOME), qt(t.env), Mt];
534
+ return t.stdLibURL != null ? e = t.stdLibURL : e = t.indexURL + "python_stdlib.zip", [...Ut(t.fsInit), Ht(e), Vt(t.env.HOME), zt(t.env), Dt];
535
535
  }
536
- k(Ut, "getFileSystemInitializationFuncs");
537
- function Ht(t) {
536
+ k(Bt, "getFileSystemInitializationFuncs");
537
+ function Wt(t) {
538
538
  if (typeof WasmOffsetConverter < "u") return;
539
- let { binary: e, response: r } = Te(t + "pyodide.asm.wasm");
540
- return function(n, a) {
539
+ let { binary: e, response: r } = Oe(t + "pyodide.asm.wasm");
540
+ return function(n, s) {
541
541
  return async function() {
542
542
  try {
543
- let s;
544
- r ? s = await WebAssembly.instantiateStreaming(r, n) : s = await WebAssembly.instantiate(await e, n);
545
- let { instance: i, module: o } = s;
546
- a(i, o);
547
- } catch (s) {
548
- console.warn("wasm instantiation failed!"), console.warn(s);
543
+ let a;
544
+ r ? a = await WebAssembly.instantiateStreaming(r, n) : a = await WebAssembly.instantiate(await e, n);
545
+ let { instance: i, module: o } = a;
546
+ s(i, o);
547
+ } catch (a) {
548
+ console.warn("wasm instantiation failed!"), console.warn(a);
549
549
  }
550
550
  }(), {};
551
551
  };
552
552
  }
553
- k(Ht, "getInstantiateWasmFunc");
554
- var De = "0.27.7";
555
- async function qe(t = {}) {
553
+ k(Wt, "getInstantiateWasmFunc");
554
+ var Ve = "0.27.7";
555
+ async function ze(t = {}) {
556
556
  var e, r;
557
- await Xe();
558
- let n = t.indexURL || await Zt();
559
- n = Le(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
560
- let a = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !0, checkAPIVersion: !0, BUILD_ID: "e94377f5ce7dcf67e0417b69a0016733c2cfb6b4622ee8c490a6f17eb58e863b" }, s = Object.assign(a, t);
561
- (e = s.env).HOME ?? (e.HOME = "/home/pyodide"), (r = s.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
562
- let i = Lt(s), o = i.API;
563
- if (o.lockFilePromise = Ft(s.lockFileURL), typeof _createPyodideModule != "function") {
564
- let S = `${s.indexURL}pyodide.asm.js`;
565
- await xe(S);
557
+ await Ke();
558
+ let n = t.indexURL || await Lt();
559
+ n = qe(n), n.endsWith("/") || (n += "/"), t.indexURL = n;
560
+ let s = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: n + "pyodide-lock.json", args: [], env: {}, packageCacheDir: n, packages: [], enableRunUntilComplete: !0, checkAPIVersion: !0, BUILD_ID: "e94377f5ce7dcf67e0417b69a0016733c2cfb6b4622ee8c490a6f17eb58e863b" }, a = Object.assign(s, t);
561
+ (e = a.env).HOME ?? (e.HOME = "/home/pyodide"), (r = a.env).PYTHONINSPECT ?? (r.PYTHONINSPECT = "1");
562
+ let i = qt(a), o = i.API;
563
+ if (o.lockFilePromise = Mt(a.lockFileURL), typeof _createPyodideModule != "function") {
564
+ let S = `${a.indexURL}pyodide.asm.js`;
565
+ await Se(S);
566
566
  }
567
567
  let d;
568
568
  if (t._loadSnapshot) {
@@ -571,21 +571,21 @@ var wn = or((Sn, Ye) => {
571
571
  }
572
572
  let l = await _createPyodideModule(i);
573
573
  if (i.exited) throw i.exited.toThrow;
574
- if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== De && s.checkAPIVersion) throw new Error(`Pyodide version does not match: '${De}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
574
+ if (t.pyproxyToStringRepr && o.setPyProxyToStringMethod(!0), o.version !== Ve && a.checkAPIVersion) throw new Error(`Pyodide version does not match: '${Ve}' <==> '${o.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
575
575
  l.locateFile = (S) => {
576
576
  throw new Error("Didn't expect to load any more file_packager files!");
577
577
  };
578
578
  let h;
579
579
  d && (h = o.restoreSnapshot(d));
580
580
  let x = o.finalizeBootstrap(h, t._snapshotDeserializer);
581
- return o.sys.path.insert(0, ""), x.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${x.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(s.stdin, s.stdout, s.stderr), x;
581
+ return o.sys.path.insert(0, ""), x.version.includes("dev") || o.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${x.version}/full/`), o._pyodide.set_excepthook(), await o.packageIndexReady, o.initializeStreams(a.stdin, a.stdout, a.stderr), x;
582
582
  }
583
- k(qe, "loadPyodide");
584
- const Er = !1;
585
- function Nr(t) {
586
- return t.includes("dev") && Er ? "dev" : `v${De}`;
583
+ k(ze, "loadPyodide");
584
+ const Nr = !1;
585
+ function Rr(t) {
586
+ return t.includes("dev") && Nr ? "dev" : `v${Ve}`;
587
587
  }
588
- class Rr {
588
+ class Cr {
589
589
  constructor(e) {
590
590
  this.onMessage = e, this.buffer = [];
591
591
  }
@@ -601,10 +601,10 @@ var wn = or((Sn, Ye) => {
601
601
  this.started = !0, this.buffer.forEach((e) => this.onMessage(e)), this.buffer = [];
602
602
  };
603
603
  }
604
- const fe = {
604
+ const he = {
605
605
  NOOP: () => {
606
606
  }
607
- }, Bt = (t, e) => {
607
+ }, Jt = (t, e) => {
608
608
  const r = `[${t}]`;
609
609
  return {
610
610
  debug: (...n) => e.debug(r, ...n),
@@ -612,10 +612,10 @@ var wn = or((Sn, Ye) => {
612
612
  warn: (...n) => e.warn(r, ...n),
613
613
  error: (...n) => e.error(r, ...n),
614
614
  trace: (...n) => e.trace(r, ...n),
615
- get: (n) => Bt(`${t}.${n}`, e),
616
- disabled: (n = !0) => n ? Ee : e
615
+ get: (n) => Jt(`${t}.${n}`, e),
616
+ disabled: (n = !0) => n ? Ne : e
617
617
  };
618
- }, Oe = {
618
+ }, Ee = {
619
619
  debug: (...t) => {
620
620
  console.debug(...t);
621
621
  },
@@ -631,22 +631,22 @@ var wn = or((Sn, Ye) => {
631
631
  trace: (...t) => {
632
632
  console.trace(...t);
633
633
  },
634
- get: (t) => Bt(t, Oe),
635
- disabled: (t = !0) => t ? Ee : Oe
636
- }, Ee = {
637
- debug: () => fe.NOOP,
638
- log: () => fe.NOOP,
639
- warn: () => fe.NOOP,
640
- error: () => fe.NOOP,
641
- trace: () => fe.NOOP,
642
- get: () => Ee,
643
- disabled: () => Ee
634
+ get: (t) => Jt(t, Ee),
635
+ disabled: (t = !0) => t ? Ne : Ee
636
+ }, Ne = {
637
+ debug: () => he.NOOP,
638
+ log: () => he.NOOP,
639
+ warn: () => he.NOOP,
640
+ error: () => he.NOOP,
641
+ trace: () => he.NOOP,
642
+ get: () => Ne,
643
+ disabled: () => Ne
644
644
  };
645
- function Cr() {
646
- return typeof window < "u" && window.Logger || Oe;
645
+ function Ar() {
646
+ return typeof window < "u" && window.Logger || Ee;
647
647
  }
648
- const H = Cr();
649
- class Ar {
648
+ const H = Ar();
649
+ class Ir {
650
650
  promise;
651
651
  resolve;
652
652
  reject;
@@ -663,49 +663,49 @@ var wn = or((Sn, Ye) => {
663
663
  }
664
664
  var w;
665
665
  (function(t) {
666
- t.assertEqual = (a) => {
666
+ t.assertEqual = (s) => {
667
667
  };
668
- function e(a) {
668
+ function e(s) {
669
669
  }
670
670
  t.assertIs = e;
671
- function r(a) {
671
+ function r(s) {
672
672
  throw new Error();
673
673
  }
674
- t.assertNever = r, t.arrayToEnum = (a) => {
675
- const s = {};
676
- for (const i of a)
677
- s[i] = i;
678
- return s;
679
- }, t.getValidEnumValues = (a) => {
680
- const s = t.objectKeys(a).filter((o) => typeof a[a[o]] != "number"), i = {};
681
- for (const o of s)
682
- i[o] = a[o];
674
+ t.assertNever = r, t.arrayToEnum = (s) => {
675
+ const a = {};
676
+ for (const i of s)
677
+ a[i] = i;
678
+ return a;
679
+ }, t.getValidEnumValues = (s) => {
680
+ const a = t.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
681
+ for (const o of a)
682
+ i[o] = s[o];
683
683
  return t.objectValues(i);
684
- }, t.objectValues = (a) => t.objectKeys(a).map(function(s) {
685
- return a[s];
686
- }), t.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
687
- const s = [];
688
- for (const i in a)
689
- Object.prototype.hasOwnProperty.call(a, i) && s.push(i);
690
- return s;
691
- }, t.find = (a, s) => {
692
- for (const i of a)
693
- if (s(i))
684
+ }, t.objectValues = (s) => t.objectKeys(s).map(function(a) {
685
+ return s[a];
686
+ }), t.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
687
+ const a = [];
688
+ for (const i in s)
689
+ Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
690
+ return a;
691
+ }, t.find = (s, a) => {
692
+ for (const i of s)
693
+ if (a(i))
694
694
  return i;
695
- }, t.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
696
- function n(a, s = " | ") {
697
- return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
695
+ }, t.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
696
+ function n(s, a = " | ") {
697
+ return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
698
698
  }
699
- t.joinValues = n, t.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
699
+ t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
700
700
  })(w || (w = {}));
701
- var at;
701
+ var it;
702
702
  (function(t) {
703
703
  t.mergeShapes = (e, r) => ({
704
704
  ...e,
705
705
  ...r
706
706
  // second overwrites first
707
707
  });
708
- })(at || (at = {}));
708
+ })(it || (it = {}));
709
709
  const f = w.arrayToEnum([
710
710
  "string",
711
711
  "nan",
@@ -780,16 +780,16 @@ var wn = or((Sn, Ye) => {
780
780
  Object.setPrototypeOf ? Object.setPrototypeOf(this, r) : this.__proto__ = r, this.name = "ZodError", this.issues = e;
781
781
  }
782
782
  format(e) {
783
- const r = e || function(s) {
784
- return s.message;
785
- }, n = { _errors: [] }, a = (s) => {
786
- for (const i of s.issues)
783
+ const r = e || function(a) {
784
+ return a.message;
785
+ }, n = { _errors: [] }, s = (a) => {
786
+ for (const i of a.issues)
787
787
  if (i.code === "invalid_union")
788
- i.unionErrors.map(a);
788
+ i.unionErrors.map(s);
789
789
  else if (i.code === "invalid_return_type")
790
- a(i.returnTypeError);
790
+ s(i.returnTypeError);
791
791
  else if (i.code === "invalid_arguments")
792
- a(i.argumentsError);
792
+ s(i.argumentsError);
793
793
  else if (i.path.length === 0)
794
794
  n._errors.push(r(i));
795
795
  else {
@@ -800,7 +800,7 @@ var wn = or((Sn, Ye) => {
800
800
  }
801
801
  }
802
802
  };
803
- return a(this), n;
803
+ return s(this), n;
804
804
  }
805
805
  static assert(e) {
806
806
  if (!(e instanceof V))
@@ -817,12 +817,12 @@ var wn = or((Sn, Ye) => {
817
817
  }
818
818
  flatten(e = (r) => r.message) {
819
819
  const r = {}, n = [];
820
- for (const a of this.issues)
821
- if (a.path.length > 0) {
822
- const s = a.path[0];
823
- r[s] = r[s] || [], r[s].push(e(a));
820
+ for (const s of this.issues)
821
+ if (s.path.length > 0) {
822
+ const a = s.path[0];
823
+ r[a] = r[a] || [], r[a].push(e(s));
824
824
  } else
825
- n.push(e(a));
825
+ n.push(e(s));
826
826
  return { formErrors: n, fieldErrors: r };
827
827
  }
828
828
  get formErrors() {
@@ -830,7 +830,7 @@ var wn = or((Sn, Ye) => {
830
830
  }
831
831
  }
832
832
  V.create = (t) => new V(t);
833
- const Ve = (t, e) => {
833
+ const Ue = (t, e) => {
834
834
  let r;
835
835
  switch (t.code) {
836
836
  case c.invalid_type:
@@ -886,33 +886,33 @@ var wn = or((Sn, Ye) => {
886
886
  }
887
887
  return { message: r };
888
888
  };
889
- let Ir = Ve;
890
- function Pr() {
891
- return Ir;
892
- }
893
- const jr = (t) => {
894
- const { data: e, path: r, errorMaps: n, issueData: a } = t, s = [...r, ...a.path || []], i = {
895
- ...a,
896
- path: s
889
+ let Pr = Ue;
890
+ function jr() {
891
+ return Pr;
892
+ }
893
+ const $r = (t) => {
894
+ const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
895
+ ...s,
896
+ path: a
897
897
  };
898
- if (a.message !== void 0)
898
+ if (s.message !== void 0)
899
899
  return {
900
- ...a,
901
- path: s,
902
- message: a.message
900
+ ...s,
901
+ path: a,
902
+ message: s.message
903
903
  };
904
904
  let o = "";
905
905
  const d = n.filter((l) => !!l).slice().reverse();
906
906
  for (const l of d)
907
907
  o = l(i, { data: e, defaultError: o }).message;
908
908
  return {
909
- ...a,
910
- path: s,
909
+ ...s,
910
+ path: a,
911
911
  message: o
912
912
  };
913
913
  };
914
914
  function u(t, e) {
915
- const r = Pr(), n = jr({
915
+ const r = jr(), n = $r({
916
916
  issueData: e,
917
917
  data: t.data,
918
918
  path: t.path,
@@ -923,9 +923,9 @@ var wn = or((Sn, Ye) => {
923
923
  // then schema-bound map if available
924
924
  r,
925
925
  // then global override map
926
- r === Ve ? void 0 : Ve
926
+ r === Ue ? void 0 : Ue
927
927
  // then global default map
928
- ].filter((a) => !!a)
928
+ ].filter((s) => !!s)
929
929
  });
930
930
  t.common.issues.push(n);
931
931
  }
@@ -941,19 +941,19 @@ var wn = or((Sn, Ye) => {
941
941
  }
942
942
  static mergeArray(e, r) {
943
943
  const n = [];
944
- for (const a of r) {
945
- if (a.status === "aborted")
944
+ for (const s of r) {
945
+ if (s.status === "aborted")
946
946
  return g;
947
- a.status === "dirty" && e.dirty(), n.push(a.value);
947
+ s.status === "dirty" && e.dirty(), n.push(s.value);
948
948
  }
949
949
  return { status: e.value, value: n };
950
950
  }
951
951
  static async mergeObjectAsync(e, r) {
952
952
  const n = [];
953
- for (const a of r) {
954
- const s = await a.key, i = await a.value;
953
+ for (const s of r) {
954
+ const a = await s.key, i = await s.value;
955
955
  n.push({
956
- key: s,
956
+ key: a,
957
957
  value: i
958
958
  });
959
959
  }
@@ -961,32 +961,32 @@ var wn = or((Sn, Ye) => {
961
961
  }
962
962
  static mergeObjectSync(e, r) {
963
963
  const n = {};
964
- for (const a of r) {
965
- const { key: s, value: i } = a;
966
- if (s.status === "aborted" || i.status === "aborted")
964
+ for (const s of r) {
965
+ const { key: a, value: i } = s;
966
+ if (a.status === "aborted" || i.status === "aborted")
967
967
  return g;
968
- s.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), s.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (n[s.value] = i.value);
968
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
969
969
  }
970
970
  return { status: e.value, value: n };
971
971
  }
972
972
  }
973
973
  const g = Object.freeze({
974
974
  status: "aborted"
975
- }), ye = (t) => ({ status: "dirty", value: t }), P = (t) => ({ status: "valid", value: t }), st = (t) => t.status === "aborted", it = (t) => t.status === "dirty", ie = (t) => t.status === "valid", Ne = (t) => typeof Promise < "u" && t instanceof Promise;
975
+ }), ge = (t) => ({ status: "dirty", value: t }), P = (t) => ({ status: "valid", value: t }), ot = (t) => t.status === "aborted", dt = (t) => t.status === "dirty", oe = (t) => t.status === "valid", Re = (t) => typeof Promise < "u" && t instanceof Promise;
976
976
  var p;
977
977
  (function(t) {
978
978
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
979
979
  })(p || (p = {}));
980
980
  class M {
981
- constructor(e, r, n, a) {
982
- this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = a;
981
+ constructor(e, r, n, s) {
982
+ this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
983
983
  }
984
984
  get path() {
985
985
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
986
986
  }
987
987
  }
988
- const ot = (t, e) => {
989
- if (ie(e))
988
+ const ct = (t, e) => {
989
+ if (oe(e))
990
990
  return { success: !0, data: e.value };
991
991
  if (!t.common.issues.length)
992
992
  throw new Error("Validation failed but no issues detected.");
@@ -1003,13 +1003,13 @@ var wn = or((Sn, Ye) => {
1003
1003
  function _(t) {
1004
1004
  if (!t)
1005
1005
  return {};
1006
- const { errorMap: e, invalid_type_error: r, required_error: n, description: a } = t;
1006
+ const { errorMap: e, invalid_type_error: r, required_error: n, description: s } = t;
1007
1007
  if (e && (r || n))
1008
1008
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
1009
- return e ? { errorMap: e, description: a } : { errorMap: (i, o) => {
1009
+ return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
1010
1010
  const { message: d } = t;
1011
1011
  return i.code === "invalid_enum_value" ? { message: d ?? o.defaultError } : typeof o.data > "u" ? { message: d ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: d ?? r ?? o.defaultError };
1012
- }, description: a };
1012
+ }, description: s };
1013
1013
  }
1014
1014
  class v {
1015
1015
  get description() {
@@ -1043,7 +1043,7 @@ var wn = or((Sn, Ye) => {
1043
1043
  }
1044
1044
  _parseSync(e) {
1045
1045
  const r = this._parse(e);
1046
- if (Ne(r))
1046
+ if (Re(r))
1047
1047
  throw new Error("Synchronous parse encountered promise.");
1048
1048
  return r;
1049
1049
  }
@@ -1069,8 +1069,8 @@ var wn = or((Sn, Ye) => {
1069
1069
  parent: null,
1070
1070
  data: e,
1071
1071
  parsedType: U(e)
1072
- }, a = this._parseSync({ data: e, path: n.path, parent: n });
1073
- return ot(n, a);
1072
+ }, s = this._parseSync({ data: e, path: n.path, parent: n });
1073
+ return ct(n, s);
1074
1074
  }
1075
1075
  "~validate"(e) {
1076
1076
  const r = {
@@ -1087,7 +1087,7 @@ var wn = or((Sn, Ye) => {
1087
1087
  if (!this["~standard"].async)
1088
1088
  try {
1089
1089
  const n = this._parseSync({ data: e, path: [], parent: r });
1090
- return ie(n) ? {
1090
+ return oe(n) ? {
1091
1091
  value: n.value
1092
1092
  } : {
1093
1093
  issues: r.common.issues
@@ -1098,7 +1098,7 @@ var wn = or((Sn, Ye) => {
1098
1098
  async: !0
1099
1099
  };
1100
1100
  }
1101
- return this._parseAsync({ data: e, path: [], parent: r }).then((n) => ie(n) ? {
1101
+ return this._parseAsync({ data: e, path: [], parent: r }).then((n) => oe(n) ? {
1102
1102
  value: n.value
1103
1103
  } : {
1104
1104
  issues: r.common.issues
@@ -1122,24 +1122,24 @@ var wn = or((Sn, Ye) => {
1122
1122
  parent: null,
1123
1123
  data: e,
1124
1124
  parsedType: U(e)
1125
- }, a = this._parse({ data: e, path: n.path, parent: n }), s = await (Ne(a) ? a : Promise.resolve(a));
1126
- return ot(n, s);
1125
+ }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Re(s) ? s : Promise.resolve(s));
1126
+ return ct(n, a);
1127
1127
  }
1128
1128
  refine(e, r) {
1129
- const n = (a) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(a) : r;
1130
- return this._refinement((a, s) => {
1131
- const i = e(a), o = () => s.addIssue({
1129
+ const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
1130
+ return this._refinement((s, a) => {
1131
+ const i = e(s), o = () => a.addIssue({
1132
1132
  code: c.custom,
1133
- ...n(a)
1133
+ ...n(s)
1134
1134
  });
1135
1135
  return typeof Promise < "u" && i instanceof Promise ? i.then((d) => d ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
1136
1136
  });
1137
1137
  }
1138
1138
  refinement(e, r) {
1139
- return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof r == "function" ? r(n, a) : r), !1));
1139
+ return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof r == "function" ? r(n, s) : r), !1));
1140
1140
  }
1141
1141
  _refinement(e) {
1142
- return new ce({
1142
+ return new le({
1143
1143
  schema: this,
1144
1144
  typeName: m.ZodEffects,
1145
1145
  effect: { type: "refinement", refinement: e }
@@ -1159,7 +1159,7 @@ var wn = or((Sn, Ye) => {
1159
1159
  return B.create(this, this._def);
1160
1160
  }
1161
1161
  nullable() {
1162
- return le.create(this, this._def);
1162
+ return ue.create(this, this._def);
1163
1163
  }
1164
1164
  nullish() {
1165
1165
  return this.nullable().optional();
@@ -1168,16 +1168,16 @@ var wn = or((Sn, Ye) => {
1168
1168
  return Z.create(this);
1169
1169
  }
1170
1170
  promise() {
1171
- return Pe.create(this, this._def);
1171
+ return je.create(this, this._def);
1172
1172
  }
1173
1173
  or(e) {
1174
- return Ce.create([this, e], this._def);
1174
+ return Ae.create([this, e], this._def);
1175
1175
  }
1176
1176
  and(e) {
1177
- return Ae.create(this, e, this._def);
1177
+ return Ie.create(this, e, this._def);
1178
1178
  }
1179
1179
  transform(e) {
1180
- return new ce({
1180
+ return new le({
1181
1181
  ..._(this._def),
1182
1182
  schema: this,
1183
1183
  typeName: m.ZodEffects,
@@ -1186,7 +1186,7 @@ var wn = or((Sn, Ye) => {
1186
1186
  }
1187
1187
  default(e) {
1188
1188
  const r = typeof e == "function" ? e : () => e;
1189
- return new He({
1189
+ return new We({
1190
1190
  ..._(this._def),
1191
1191
  innerType: this,
1192
1192
  defaultValue: r,
@@ -1194,7 +1194,7 @@ var wn = or((Sn, Ye) => {
1194
1194
  });
1195
1195
  }
1196
1196
  brand() {
1197
- return new nn({
1197
+ return new sn({
1198
1198
  typeName: m.ZodBranded,
1199
1199
  type: this,
1200
1200
  ..._(this._def)
@@ -1202,7 +1202,7 @@ var wn = or((Sn, Ye) => {
1202
1202
  }
1203
1203
  catch(e) {
1204
1204
  const r = typeof e == "function" ? e : () => e;
1205
- return new Be({
1205
+ return new Je({
1206
1206
  ..._(this._def),
1207
1207
  innerType: this,
1208
1208
  catchValue: r,
@@ -1217,10 +1217,10 @@ var wn = or((Sn, Ye) => {
1217
1217
  });
1218
1218
  }
1219
1219
  pipe(e) {
1220
- return Ke.create(this, e);
1220
+ return tt.create(this, e);
1221
1221
  }
1222
1222
  readonly() {
1223
- return We.create(this);
1223
+ return Ye.create(this);
1224
1224
  }
1225
1225
  isOptional() {
1226
1226
  return this.safeParse(void 0).success;
@@ -1229,199 +1229,199 @@ var wn = or((Sn, Ye) => {
1229
1229
  return this.safeParse(null).success;
1230
1230
  }
1231
1231
  }
1232
- const $r = /^c[^\s-]{8,}$/i, Fr = /^[0-9a-z]+$/, Zr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Mr = /^[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}$/i, Lr = /^[a-z0-9_-]{21}$/i, Dr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, qr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Vr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, zr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1233
- let Ze;
1234
- const Ur = /^(?:(?: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])$/, Hr = /^(?:(?: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])$/, Br = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Wr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Jr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Yr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Wt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Qr = new RegExp(`^${Wt}$`);
1235
- function Jt(t) {
1232
+ const Fr = /^c[^\s-]{8,}$/i, Zr = /^[0-9a-z]+$/, Mr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Lr = /^[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}$/i, Dr = /^[a-z0-9_-]{21}$/i, qr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Vr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, zr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ur = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1233
+ let Le;
1234
+ const Hr = /^(?:(?: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])$/, Br = /^(?:(?: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])$/, Wr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Jr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Yr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Qr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Yt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Xr = new RegExp(`^${Yt}$`);
1235
+ function Qt(t) {
1236
1236
  let e = "[0-5]\\d";
1237
1237
  t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
1238
1238
  const r = t.precision ? "+" : "?";
1239
1239
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`;
1240
1240
  }
1241
- function Xr(t) {
1242
- return new RegExp(`^${Jt(t)}$`);
1243
- }
1244
1241
  function Gr(t) {
1245
- let e = `${Wt}T${Jt(t)}`;
1242
+ return new RegExp(`^${Qt(t)}$`);
1243
+ }
1244
+ function Kr(t) {
1245
+ let e = `${Yt}T${Qt(t)}`;
1246
1246
  const r = [];
1247
1247
  return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
1248
1248
  }
1249
- function Kr(t, e) {
1250
- return !!((e === "v4" || !e) && Ur.test(t) || (e === "v6" || !e) && Br.test(t));
1251
- }
1252
1249
  function en(t, e) {
1253
- if (!Dr.test(t))
1250
+ return !!((e === "v4" || !e) && Hr.test(t) || (e === "v6" || !e) && Wr.test(t));
1251
+ }
1252
+ function tn(t, e) {
1253
+ if (!qr.test(t))
1254
1254
  return !1;
1255
1255
  try {
1256
1256
  const [r] = t.split(".");
1257
1257
  if (!r)
1258
1258
  return !1;
1259
- const n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), a = JSON.parse(atob(n));
1260
- return !(typeof a != "object" || a === null || "typ" in a && a?.typ !== "JWT" || !a.alg || e && a.alg !== e);
1259
+ const n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
1260
+ return !(typeof s != "object" || s === null || "typ" in s && s?.typ !== "JWT" || !s.alg || e && s.alg !== e);
1261
1261
  } catch {
1262
1262
  return !1;
1263
1263
  }
1264
1264
  }
1265
- function tn(t, e) {
1266
- return !!((e === "v4" || !e) && Hr.test(t) || (e === "v6" || !e) && Wr.test(t));
1265
+ function rn(t, e) {
1266
+ return !!((e === "v4" || !e) && Br.test(t) || (e === "v6" || !e) && Jr.test(t));
1267
1267
  }
1268
1268
  class q extends v {
1269
1269
  _parse(e) {
1270
1270
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
1271
- const s = this._getOrReturnCtx(e);
1272
- return u(s, {
1271
+ const a = this._getOrReturnCtx(e);
1272
+ return u(a, {
1273
1273
  code: c.invalid_type,
1274
1274
  expected: f.string,
1275
- received: s.parsedType
1275
+ received: a.parsedType
1276
1276
  }), g;
1277
1277
  }
1278
1278
  const n = new A();
1279
- let a;
1280
- for (const s of this._def.checks)
1281
- if (s.kind === "min")
1282
- e.data.length < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
1279
+ let s;
1280
+ for (const a of this._def.checks)
1281
+ if (a.kind === "min")
1282
+ e.data.length < a.value && (s = this._getOrReturnCtx(e, s), u(s, {
1283
1283
  code: c.too_small,
1284
- minimum: s.value,
1284
+ minimum: a.value,
1285
1285
  type: "string",
1286
1286
  inclusive: !0,
1287
1287
  exact: !1,
1288
- message: s.message
1288
+ message: a.message
1289
1289
  }), n.dirty());
1290
- else if (s.kind === "max")
1291
- e.data.length > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
1290
+ else if (a.kind === "max")
1291
+ e.data.length > a.value && (s = this._getOrReturnCtx(e, s), u(s, {
1292
1292
  code: c.too_big,
1293
- maximum: s.value,
1293
+ maximum: a.value,
1294
1294
  type: "string",
1295
1295
  inclusive: !0,
1296
1296
  exact: !1,
1297
- message: s.message
1297
+ message: a.message
1298
1298
  }), n.dirty());
1299
- else if (s.kind === "length") {
1300
- const i = e.data.length > s.value, o = e.data.length < s.value;
1301
- (i || o) && (a = this._getOrReturnCtx(e, a), i ? u(a, {
1299
+ else if (a.kind === "length") {
1300
+ const i = e.data.length > a.value, o = e.data.length < a.value;
1301
+ (i || o) && (s = this._getOrReturnCtx(e, s), i ? u(s, {
1302
1302
  code: c.too_big,
1303
- maximum: s.value,
1303
+ maximum: a.value,
1304
1304
  type: "string",
1305
1305
  inclusive: !0,
1306
1306
  exact: !0,
1307
- message: s.message
1308
- }) : o && u(a, {
1307
+ message: a.message
1308
+ }) : o && u(s, {
1309
1309
  code: c.too_small,
1310
- minimum: s.value,
1310
+ minimum: a.value,
1311
1311
  type: "string",
1312
1312
  inclusive: !0,
1313
1313
  exact: !0,
1314
- message: s.message
1314
+ message: a.message
1315
1315
  }), n.dirty());
1316
- } else if (s.kind === "email")
1317
- Vr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1316
+ } else if (a.kind === "email")
1317
+ zr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1318
1318
  validation: "email",
1319
1319
  code: c.invalid_string,
1320
- message: s.message
1320
+ message: a.message
1321
1321
  }), n.dirty());
1322
- else if (s.kind === "emoji")
1323
- Ze || (Ze = new RegExp(zr, "u")), Ze.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1322
+ else if (a.kind === "emoji")
1323
+ Le || (Le = new RegExp(Ur, "u")), Le.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1324
1324
  validation: "emoji",
1325
1325
  code: c.invalid_string,
1326
- message: s.message
1326
+ message: a.message
1327
1327
  }), n.dirty());
1328
- else if (s.kind === "uuid")
1329
- Mr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1328
+ else if (a.kind === "uuid")
1329
+ Lr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1330
1330
  validation: "uuid",
1331
1331
  code: c.invalid_string,
1332
- message: s.message
1332
+ message: a.message
1333
1333
  }), n.dirty());
1334
- else if (s.kind === "nanoid")
1335
- Lr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1334
+ else if (a.kind === "nanoid")
1335
+ Dr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1336
1336
  validation: "nanoid",
1337
1337
  code: c.invalid_string,
1338
- message: s.message
1338
+ message: a.message
1339
1339
  }), n.dirty());
1340
- else if (s.kind === "cuid")
1341
- $r.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1340
+ else if (a.kind === "cuid")
1341
+ Fr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1342
1342
  validation: "cuid",
1343
1343
  code: c.invalid_string,
1344
- message: s.message
1344
+ message: a.message
1345
1345
  }), n.dirty());
1346
- else if (s.kind === "cuid2")
1347
- Fr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1346
+ else if (a.kind === "cuid2")
1347
+ Zr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1348
1348
  validation: "cuid2",
1349
1349
  code: c.invalid_string,
1350
- message: s.message
1350
+ message: a.message
1351
1351
  }), n.dirty());
1352
- else if (s.kind === "ulid")
1353
- Zr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1352
+ else if (a.kind === "ulid")
1353
+ Mr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1354
1354
  validation: "ulid",
1355
1355
  code: c.invalid_string,
1356
- message: s.message
1356
+ message: a.message
1357
1357
  }), n.dirty());
1358
- else if (s.kind === "url")
1358
+ else if (a.kind === "url")
1359
1359
  try {
1360
1360
  new URL(e.data);
1361
1361
  } catch {
1362
- a = this._getOrReturnCtx(e, a), u(a, {
1362
+ s = this._getOrReturnCtx(e, s), u(s, {
1363
1363
  validation: "url",
1364
1364
  code: c.invalid_string,
1365
- message: s.message
1365
+ message: a.message
1366
1366
  }), n.dirty();
1367
1367
  }
1368
- else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1368
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1369
1369
  validation: "regex",
1370
1370
  code: c.invalid_string,
1371
- message: s.message
1372
- }), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (a = this._getOrReturnCtx(e, a), u(a, {
1371
+ message: a.message
1372
+ }), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), u(s, {
1373
1373
  code: c.invalid_string,
1374
- validation: { includes: s.value, position: s.position },
1375
- message: s.message
1376
- }), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
1374
+ validation: { includes: a.value, position: a.position },
1375
+ message: a.message
1376
+ }), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), u(s, {
1377
1377
  code: c.invalid_string,
1378
- validation: { startsWith: s.value },
1379
- message: s.message
1380
- }), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (a = this._getOrReturnCtx(e, a), u(a, {
1378
+ validation: { startsWith: a.value },
1379
+ message: a.message
1380
+ }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), u(s, {
1381
1381
  code: c.invalid_string,
1382
- validation: { endsWith: s.value },
1383
- message: s.message
1384
- }), n.dirty()) : s.kind === "datetime" ? Gr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1382
+ validation: { endsWith: a.value },
1383
+ message: a.message
1384
+ }), n.dirty()) : a.kind === "datetime" ? Kr(a).test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1385
1385
  code: c.invalid_string,
1386
1386
  validation: "datetime",
1387
- message: s.message
1388
- }), n.dirty()) : s.kind === "date" ? Qr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1387
+ message: a.message
1388
+ }), n.dirty()) : a.kind === "date" ? Xr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1389
1389
  code: c.invalid_string,
1390
1390
  validation: "date",
1391
- message: s.message
1392
- }), n.dirty()) : s.kind === "time" ? Xr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1391
+ message: a.message
1392
+ }), n.dirty()) : a.kind === "time" ? Gr(a).test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1393
1393
  code: c.invalid_string,
1394
1394
  validation: "time",
1395
- message: s.message
1396
- }), n.dirty()) : s.kind === "duration" ? qr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1395
+ message: a.message
1396
+ }), n.dirty()) : a.kind === "duration" ? Vr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1397
1397
  validation: "duration",
1398
1398
  code: c.invalid_string,
1399
- message: s.message
1400
- }), n.dirty()) : s.kind === "ip" ? Kr(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
1399
+ message: a.message
1400
+ }), n.dirty()) : a.kind === "ip" ? en(e.data, a.version) || (s = this._getOrReturnCtx(e, s), u(s, {
1401
1401
  validation: "ip",
1402
1402
  code: c.invalid_string,
1403
- message: s.message
1404
- }), n.dirty()) : s.kind === "jwt" ? en(e.data, s.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
1403
+ message: a.message
1404
+ }), n.dirty()) : a.kind === "jwt" ? tn(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), u(s, {
1405
1405
  validation: "jwt",
1406
1406
  code: c.invalid_string,
1407
- message: s.message
1408
- }), n.dirty()) : s.kind === "cidr" ? tn(e.data, s.version) || (a = this._getOrReturnCtx(e, a), u(a, {
1407
+ message: a.message
1408
+ }), n.dirty()) : a.kind === "cidr" ? rn(e.data, a.version) || (s = this._getOrReturnCtx(e, s), u(s, {
1409
1409
  validation: "cidr",
1410
1410
  code: c.invalid_string,
1411
- message: s.message
1412
- }), n.dirty()) : s.kind === "base64" ? Jr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1411
+ message: a.message
1412
+ }), n.dirty()) : a.kind === "base64" ? Yr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1413
1413
  validation: "base64",
1414
1414
  code: c.invalid_string,
1415
- message: s.message
1416
- }), n.dirty()) : s.kind === "base64url" ? Yr.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
1415
+ message: a.message
1416
+ }), n.dirty()) : a.kind === "base64url" ? Qr.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
1417
1417
  validation: "base64url",
1418
1418
  code: c.invalid_string,
1419
- message: s.message
1420
- }), n.dirty()) : w.assertNever(s);
1419
+ message: a.message
1420
+ }), n.dirty()) : w.assertNever(a);
1421
1421
  return { status: n.value, value: e.data };
1422
1422
  }
1423
1423
  _regex(e, r, n) {
1424
- return this.refinement((a) => e.test(a), {
1424
+ return this.refinement((s) => e.test(s), {
1425
1425
  validation: r,
1426
1426
  code: c.invalid_string,
1427
1427
  ...p.errToObj(n)
@@ -1648,54 +1648,54 @@ var wn = or((Sn, Ye) => {
1648
1648
  coerce: t?.coerce ?? !1,
1649
1649
  ..._(t)
1650
1650
  });
1651
- function rn(t, e) {
1652
- const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = r > n ? r : n, s = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
1653
- return s % i / 10 ** a;
1651
+ function nn(t, e) {
1652
+ const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = r > n ? r : n, a = Number.parseInt(t.toFixed(s).replace(".", "")), i = Number.parseInt(e.toFixed(s).replace(".", ""));
1653
+ return a % i / 10 ** s;
1654
1654
  }
1655
- class oe extends v {
1655
+ class de extends v {
1656
1656
  constructor() {
1657
1657
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1658
1658
  }
1659
1659
  _parse(e) {
1660
1660
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
1661
- const s = this._getOrReturnCtx(e);
1662
- return u(s, {
1661
+ const a = this._getOrReturnCtx(e);
1662
+ return u(a, {
1663
1663
  code: c.invalid_type,
1664
1664
  expected: f.number,
1665
- received: s.parsedType
1665
+ received: a.parsedType
1666
1666
  }), g;
1667
1667
  }
1668
1668
  let n;
1669
- const a = new A();
1670
- for (const s of this._def.checks)
1671
- s.kind === "int" ? w.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1669
+ const s = new A();
1670
+ for (const a of this._def.checks)
1671
+ a.kind === "int" ? w.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1672
1672
  code: c.invalid_type,
1673
1673
  expected: "integer",
1674
1674
  received: "float",
1675
- message: s.message
1676
- }), a.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1675
+ message: a.message
1676
+ }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1677
1677
  code: c.too_small,
1678
- minimum: s.value,
1678
+ minimum: a.value,
1679
1679
  type: "number",
1680
- inclusive: s.inclusive,
1680
+ inclusive: a.inclusive,
1681
1681
  exact: !1,
1682
- message: s.message
1683
- }), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1682
+ message: a.message
1683
+ }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1684
1684
  code: c.too_big,
1685
- maximum: s.value,
1685
+ maximum: a.value,
1686
1686
  type: "number",
1687
- inclusive: s.inclusive,
1687
+ inclusive: a.inclusive,
1688
1688
  exact: !1,
1689
- message: s.message
1690
- }), a.dirty()) : s.kind === "multipleOf" ? rn(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
1689
+ message: a.message
1690
+ }), s.dirty()) : a.kind === "multipleOf" ? nn(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
1691
1691
  code: c.not_multiple_of,
1692
- multipleOf: s.value,
1693
- message: s.message
1694
- }), a.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1692
+ multipleOf: a.value,
1693
+ message: a.message
1694
+ }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1695
1695
  code: c.not_finite,
1696
- message: s.message
1697
- }), a.dirty()) : w.assertNever(s);
1698
- return { status: a.value, value: e.data };
1696
+ message: a.message
1697
+ }), s.dirty()) : w.assertNever(a);
1698
+ return { status: s.value, value: e.data };
1699
1699
  }
1700
1700
  gte(e, r) {
1701
1701
  return this.setLimit("min", e, !0, p.toString(r));
@@ -1709,8 +1709,8 @@ var wn = or((Sn, Ye) => {
1709
1709
  lt(e, r) {
1710
1710
  return this.setLimit("max", e, !1, p.toString(r));
1711
1711
  }
1712
- setLimit(e, r, n, a) {
1713
- return new oe({
1712
+ setLimit(e, r, n, s) {
1713
+ return new de({
1714
1714
  ...this._def,
1715
1715
  checks: [
1716
1716
  ...this._def.checks,
@@ -1718,13 +1718,13 @@ var wn = or((Sn, Ye) => {
1718
1718
  kind: e,
1719
1719
  value: r,
1720
1720
  inclusive: n,
1721
- message: p.toString(a)
1721
+ message: p.toString(s)
1722
1722
  }
1723
1723
  ]
1724
1724
  });
1725
1725
  }
1726
1726
  _addCheck(e) {
1727
- return new oe({
1727
+ return new de({
1728
1728
  ...this._def,
1729
1729
  checks: [...this._def.checks, e]
1730
1730
  });
@@ -1818,13 +1818,13 @@ var wn = or((Sn, Ye) => {
1818
1818
  return Number.isFinite(r) && Number.isFinite(e);
1819
1819
  }
1820
1820
  }
1821
- oe.create = (t) => new oe({
1821
+ de.create = (t) => new de({
1822
1822
  checks: [],
1823
1823
  typeName: m.ZodNumber,
1824
1824
  coerce: t?.coerce || !1,
1825
1825
  ..._(t)
1826
1826
  });
1827
- class _e extends v {
1827
+ class ve extends v {
1828
1828
  constructor() {
1829
1829
  super(...arguments), this.min = this.gte, this.max = this.lte;
1830
1830
  }
@@ -1838,26 +1838,26 @@ var wn = or((Sn, Ye) => {
1838
1838
  if (this._getType(e) !== f.bigint)
1839
1839
  return this._getInvalidInput(e);
1840
1840
  let n;
1841
- const a = new A();
1842
- for (const s of this._def.checks)
1843
- s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1841
+ const s = new A();
1842
+ for (const a of this._def.checks)
1843
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1844
1844
  code: c.too_small,
1845
1845
  type: "bigint",
1846
- minimum: s.value,
1847
- inclusive: s.inclusive,
1848
- message: s.message
1849
- }), a.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1846
+ minimum: a.value,
1847
+ inclusive: a.inclusive,
1848
+ message: a.message
1849
+ }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1850
1850
  code: c.too_big,
1851
1851
  type: "bigint",
1852
- maximum: s.value,
1853
- inclusive: s.inclusive,
1854
- message: s.message
1855
- }), a.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), u(n, {
1852
+ maximum: a.value,
1853
+ inclusive: a.inclusive,
1854
+ message: a.message
1855
+ }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), u(n, {
1856
1856
  code: c.not_multiple_of,
1857
- multipleOf: s.value,
1858
- message: s.message
1859
- }), a.dirty()) : w.assertNever(s);
1860
- return { status: a.value, value: e.data };
1857
+ multipleOf: a.value,
1858
+ message: a.message
1859
+ }), s.dirty()) : w.assertNever(a);
1860
+ return { status: s.value, value: e.data };
1861
1861
  }
1862
1862
  _getInvalidInput(e) {
1863
1863
  const r = this._getOrReturnCtx(e);
@@ -1879,8 +1879,8 @@ var wn = or((Sn, Ye) => {
1879
1879
  lt(e, r) {
1880
1880
  return this.setLimit("max", e, !1, p.toString(r));
1881
1881
  }
1882
- setLimit(e, r, n, a) {
1883
- return new _e({
1882
+ setLimit(e, r, n, s) {
1883
+ return new ve({
1884
1884
  ...this._def,
1885
1885
  checks: [
1886
1886
  ...this._def.checks,
@@ -1888,13 +1888,13 @@ var wn = or((Sn, Ye) => {
1888
1888
  kind: e,
1889
1889
  value: r,
1890
1890
  inclusive: n,
1891
- message: p.toString(a)
1891
+ message: p.toString(s)
1892
1892
  }
1893
1893
  ]
1894
1894
  });
1895
1895
  }
1896
1896
  _addCheck(e) {
1897
- return new _e({
1897
+ return new ve({
1898
1898
  ...this._def,
1899
1899
  checks: [...this._def.checks, e]
1900
1900
  });
@@ -1951,13 +1951,13 @@ var wn = or((Sn, Ye) => {
1951
1951
  return e;
1952
1952
  }
1953
1953
  }
1954
- _e.create = (t) => new _e({
1954
+ ve.create = (t) => new ve({
1955
1955
  checks: [],
1956
1956
  typeName: m.ZodBigInt,
1957
1957
  coerce: t?.coerce ?? !1,
1958
1958
  ..._(t)
1959
1959
  });
1960
- class ze extends v {
1960
+ class He extends v {
1961
1961
  _parse(e) {
1962
1962
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1963
1963
  const n = this._getOrReturnCtx(e);
@@ -1970,52 +1970,52 @@ var wn = or((Sn, Ye) => {
1970
1970
  return P(e.data);
1971
1971
  }
1972
1972
  }
1973
- ze.create = (t) => new ze({
1973
+ He.create = (t) => new He({
1974
1974
  typeName: m.ZodBoolean,
1975
1975
  coerce: t?.coerce || !1,
1976
1976
  ..._(t)
1977
1977
  });
1978
- class Re extends v {
1978
+ class Ce extends v {
1979
1979
  _parse(e) {
1980
1980
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1981
- const s = this._getOrReturnCtx(e);
1982
- return u(s, {
1981
+ const a = this._getOrReturnCtx(e);
1982
+ return u(a, {
1983
1983
  code: c.invalid_type,
1984
1984
  expected: f.date,
1985
- received: s.parsedType
1985
+ received: a.parsedType
1986
1986
  }), g;
1987
1987
  }
1988
1988
  if (Number.isNaN(e.data.getTime())) {
1989
- const s = this._getOrReturnCtx(e);
1990
- return u(s, {
1989
+ const a = this._getOrReturnCtx(e);
1990
+ return u(a, {
1991
1991
  code: c.invalid_date
1992
1992
  }), g;
1993
1993
  }
1994
1994
  const n = new A();
1995
- let a;
1996
- for (const s of this._def.checks)
1997
- s.kind === "min" ? e.data.getTime() < s.value && (a = this._getOrReturnCtx(e, a), u(a, {
1995
+ let s;
1996
+ for (const a of this._def.checks)
1997
+ a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), u(s, {
1998
1998
  code: c.too_small,
1999
- message: s.message,
1999
+ message: a.message,
2000
2000
  inclusive: !0,
2001
2001
  exact: !1,
2002
- minimum: s.value,
2002
+ minimum: a.value,
2003
2003
  type: "date"
2004
- }), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (a = this._getOrReturnCtx(e, a), u(a, {
2004
+ }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), u(s, {
2005
2005
  code: c.too_big,
2006
- message: s.message,
2006
+ message: a.message,
2007
2007
  inclusive: !0,
2008
2008
  exact: !1,
2009
- maximum: s.value,
2009
+ maximum: a.value,
2010
2010
  type: "date"
2011
- }), n.dirty()) : w.assertNever(s);
2011
+ }), n.dirty()) : w.assertNever(a);
2012
2012
  return {
2013
2013
  status: n.value,
2014
2014
  value: new Date(e.data.getTime())
2015
2015
  };
2016
2016
  }
2017
2017
  _addCheck(e) {
2018
- return new Re({
2018
+ return new Ce({
2019
2019
  ...this._def,
2020
2020
  checks: [...this._def.checks, e]
2021
2021
  });
@@ -2047,13 +2047,13 @@ var wn = or((Sn, Ye) => {
2047
2047
  return e != null ? new Date(e) : null;
2048
2048
  }
2049
2049
  }
2050
- Re.create = (t) => new Re({
2050
+ Ce.create = (t) => new Ce({
2051
2051
  checks: [],
2052
2052
  coerce: t?.coerce || !1,
2053
2053
  typeName: m.ZodDate,
2054
2054
  ..._(t)
2055
2055
  });
2056
- class dt extends v {
2056
+ class lt extends v {
2057
2057
  _parse(e) {
2058
2058
  if (this._getType(e) !== f.symbol) {
2059
2059
  const n = this._getOrReturnCtx(e);
@@ -2066,11 +2066,11 @@ var wn = or((Sn, Ye) => {
2066
2066
  return P(e.data);
2067
2067
  }
2068
2068
  }
2069
- dt.create = (t) => new dt({
2069
+ lt.create = (t) => new lt({
2070
2070
  typeName: m.ZodSymbol,
2071
2071
  ..._(t)
2072
2072
  });
2073
- class ct extends v {
2073
+ class ut extends v {
2074
2074
  _parse(e) {
2075
2075
  if (this._getType(e) !== f.undefined) {
2076
2076
  const n = this._getOrReturnCtx(e);
@@ -2083,11 +2083,11 @@ var wn = or((Sn, Ye) => {
2083
2083
  return P(e.data);
2084
2084
  }
2085
2085
  }
2086
- ct.create = (t) => new ct({
2086
+ ut.create = (t) => new ut({
2087
2087
  typeName: m.ZodUndefined,
2088
2088
  ..._(t)
2089
2089
  });
2090
- class lt extends v {
2090
+ class ft extends v {
2091
2091
  _parse(e) {
2092
2092
  if (this._getType(e) !== f.null) {
2093
2093
  const n = this._getOrReturnCtx(e);
@@ -2100,11 +2100,11 @@ var wn = or((Sn, Ye) => {
2100
2100
  return P(e.data);
2101
2101
  }
2102
2102
  }
2103
- lt.create = (t) => new lt({
2103
+ ft.create = (t) => new ft({
2104
2104
  typeName: m.ZodNull,
2105
2105
  ..._(t)
2106
2106
  });
2107
- class ut extends v {
2107
+ class ht extends v {
2108
2108
  constructor() {
2109
2109
  super(...arguments), this._any = !0;
2110
2110
  }
@@ -2112,11 +2112,11 @@ var wn = or((Sn, Ye) => {
2112
2112
  return P(e.data);
2113
2113
  }
2114
2114
  }
2115
- ut.create = (t) => new ut({
2115
+ ht.create = (t) => new ht({
2116
2116
  typeName: m.ZodAny,
2117
2117
  ..._(t)
2118
2118
  });
2119
- class ft extends v {
2119
+ class pt extends v {
2120
2120
  constructor() {
2121
2121
  super(...arguments), this._unknown = !0;
2122
2122
  }
@@ -2124,7 +2124,7 @@ var wn = or((Sn, Ye) => {
2124
2124
  return P(e.data);
2125
2125
  }
2126
2126
  }
2127
- ft.create = (t) => new ft({
2127
+ pt.create = (t) => new pt({
2128
2128
  typeName: m.ZodUnknown,
2129
2129
  ..._(t)
2130
2130
  });
@@ -2142,7 +2142,7 @@ var wn = or((Sn, Ye) => {
2142
2142
  typeName: m.ZodNever,
2143
2143
  ..._(t)
2144
2144
  });
2145
- class ht extends v {
2145
+ class mt extends v {
2146
2146
  _parse(e) {
2147
2147
  if (this._getType(e) !== f.undefined) {
2148
2148
  const n = this._getOrReturnCtx(e);
@@ -2155,49 +2155,49 @@ var wn = or((Sn, Ye) => {
2155
2155
  return P(e.data);
2156
2156
  }
2157
2157
  }
2158
- ht.create = (t) => new ht({
2158
+ mt.create = (t) => new mt({
2159
2159
  typeName: m.ZodVoid,
2160
2160
  ..._(t)
2161
2161
  });
2162
2162
  class Z extends v {
2163
2163
  _parse(e) {
2164
- const { ctx: r, status: n } = this._processInputParams(e), a = this._def;
2164
+ const { ctx: r, status: n } = this._processInputParams(e), s = this._def;
2165
2165
  if (r.parsedType !== f.array)
2166
2166
  return u(r, {
2167
2167
  code: c.invalid_type,
2168
2168
  expected: f.array,
2169
2169
  received: r.parsedType
2170
2170
  }), g;
2171
- if (a.exactLength !== null) {
2172
- const i = r.data.length > a.exactLength.value, o = r.data.length < a.exactLength.value;
2171
+ if (s.exactLength !== null) {
2172
+ const i = r.data.length > s.exactLength.value, o = r.data.length < s.exactLength.value;
2173
2173
  (i || o) && (u(r, {
2174
2174
  code: i ? c.too_big : c.too_small,
2175
- minimum: o ? a.exactLength.value : void 0,
2176
- maximum: i ? a.exactLength.value : void 0,
2175
+ minimum: o ? s.exactLength.value : void 0,
2176
+ maximum: i ? s.exactLength.value : void 0,
2177
2177
  type: "array",
2178
2178
  inclusive: !0,
2179
2179
  exact: !0,
2180
- message: a.exactLength.message
2180
+ message: s.exactLength.message
2181
2181
  }), n.dirty());
2182
2182
  }
2183
- if (a.minLength !== null && r.data.length < a.minLength.value && (u(r, {
2183
+ if (s.minLength !== null && r.data.length < s.minLength.value && (u(r, {
2184
2184
  code: c.too_small,
2185
- minimum: a.minLength.value,
2185
+ minimum: s.minLength.value,
2186
2186
  type: "array",
2187
2187
  inclusive: !0,
2188
2188
  exact: !1,
2189
- message: a.minLength.message
2190
- }), n.dirty()), a.maxLength !== null && r.data.length > a.maxLength.value && (u(r, {
2189
+ message: s.minLength.message
2190
+ }), n.dirty()), s.maxLength !== null && r.data.length > s.maxLength.value && (u(r, {
2191
2191
  code: c.too_big,
2192
- maximum: a.maxLength.value,
2192
+ maximum: s.maxLength.value,
2193
2193
  type: "array",
2194
2194
  inclusive: !0,
2195
2195
  exact: !1,
2196
- message: a.maxLength.message
2196
+ message: s.maxLength.message
2197
2197
  }), n.dirty()), r.common.async)
2198
- return Promise.all([...r.data].map((i, o) => a.type._parseAsync(new M(r, i, r.path, o)))).then((i) => A.mergeArray(n, i));
2199
- const s = [...r.data].map((i, o) => a.type._parseSync(new M(r, i, r.path, o)));
2200
- return A.mergeArray(n, s);
2198
+ return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new M(r, i, r.path, o)))).then((i) => A.mergeArray(n, i));
2199
+ const a = [...r.data].map((i, o) => s.type._parseSync(new M(r, i, r.path, o)));
2200
+ return A.mergeArray(n, a);
2201
2201
  }
2202
2202
  get element() {
2203
2203
  return this._def.type;
@@ -2246,7 +2246,7 @@ var wn = or((Sn, Ye) => {
2246
2246
  } else return t instanceof Z ? new Z({
2247
2247
  ...t._def,
2248
2248
  type: ae(t.element)
2249
- }) : t instanceof B ? B.create(ae(t.unwrap())) : t instanceof le ? le.create(ae(t.unwrap())) : t instanceof ee ? ee.create(t.items.map((e) => ae(e))) : t;
2249
+ }) : t instanceof B ? B.create(ae(t.unwrap())) : t instanceof ue ? ue.create(ae(t.unwrap())) : t instanceof ee ? ee.create(t.items.map((e) => ae(e))) : t;
2250
2250
  }
2251
2251
  class T extends v {
2252
2252
  constructor() {
@@ -2267,17 +2267,17 @@ var wn = or((Sn, Ye) => {
2267
2267
  received: l.parsedType
2268
2268
  }), g;
2269
2269
  }
2270
- const { status: n, ctx: a } = this._processInputParams(e), { shape: s, keys: i } = this._getCached(), o = [];
2270
+ const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
2271
2271
  if (!(this._def.catchall instanceof J && this._def.unknownKeys === "strip"))
2272
- for (const l in a.data)
2272
+ for (const l in s.data)
2273
2273
  i.includes(l) || o.push(l);
2274
2274
  const d = [];
2275
2275
  for (const l of i) {
2276
- const h = s[l], x = a.data[l];
2276
+ const h = a[l], x = s.data[l];
2277
2277
  d.push({
2278
2278
  key: { status: "valid", value: l },
2279
- value: h._parse(new M(a, x, a.path, l)),
2280
- alwaysSet: l in a.data
2279
+ value: h._parse(new M(s, x, s.path, l)),
2280
+ alwaysSet: l in s.data
2281
2281
  });
2282
2282
  }
2283
2283
  if (this._def.catchall instanceof J) {
@@ -2286,10 +2286,10 @@ var wn = or((Sn, Ye) => {
2286
2286
  for (const h of o)
2287
2287
  d.push({
2288
2288
  key: { status: "valid", value: h },
2289
- value: { status: "valid", value: a.data[h] }
2289
+ value: { status: "valid", value: s.data[h] }
2290
2290
  });
2291
2291
  else if (l === "strict")
2292
- o.length > 0 && (u(a, {
2292
+ o.length > 0 && (u(s, {
2293
2293
  code: c.unrecognized_keys,
2294
2294
  keys: o
2295
2295
  }), n.dirty());
@@ -2297,18 +2297,18 @@ var wn = or((Sn, Ye) => {
2297
2297
  } else {
2298
2298
  const l = this._def.catchall;
2299
2299
  for (const h of o) {
2300
- const x = a.data[h];
2300
+ const x = s.data[h];
2301
2301
  d.push({
2302
2302
  key: { status: "valid", value: h },
2303
2303
  value: l._parse(
2304
- new M(a, x, a.path, h)
2304
+ new M(s, x, s.path, h)
2305
2305
  //, ctx.child(key), value, getParsedType(value)
2306
2306
  ),
2307
- alwaysSet: h in a.data
2307
+ alwaysSet: h in s.data
2308
2308
  });
2309
2309
  }
2310
2310
  }
2311
- return a.common.async ? Promise.resolve().then(async () => {
2311
+ return s.common.async ? Promise.resolve().then(async () => {
2312
2312
  const l = [];
2313
2313
  for (const h of d) {
2314
2314
  const x = await h.key, S = await h.value;
@@ -2330,11 +2330,11 @@ var wn = or((Sn, Ye) => {
2330
2330
  unknownKeys: "strict",
2331
2331
  ...e !== void 0 ? {
2332
2332
  errorMap: (r, n) => {
2333
- const a = this._def.errorMap?.(r, n).message ?? n.defaultError;
2333
+ const s = this._def.errorMap?.(r, n).message ?? n.defaultError;
2334
2334
  return r.code === "unrecognized_keys" ? {
2335
- message: p.errToObj(e).message ?? a
2335
+ message: p.errToObj(e).message ?? s
2336
2336
  } : {
2337
- message: a
2337
+ message: s
2338
2338
  };
2339
2339
  }
2340
2340
  } : {}
@@ -2486,8 +2486,8 @@ var wn = or((Sn, Ye) => {
2486
2486
  partial(e) {
2487
2487
  const r = {};
2488
2488
  for (const n of w.objectKeys(this.shape)) {
2489
- const a = this.shape[n];
2490
- e && !e[n] ? r[n] = a : r[n] = a.optional();
2489
+ const s = this.shape[n];
2490
+ e && !e[n] ? r[n] = s : r[n] = s.optional();
2491
2491
  }
2492
2492
  return new T({
2493
2493
  ...this._def,
@@ -2500,10 +2500,10 @@ var wn = or((Sn, Ye) => {
2500
2500
  if (e && !e[n])
2501
2501
  r[n] = this.shape[n];
2502
2502
  else {
2503
- let s = this.shape[n];
2504
- for (; s instanceof B; )
2505
- s = s._def.innerType;
2506
- r[n] = s;
2503
+ let a = this.shape[n];
2504
+ for (; a instanceof B; )
2505
+ a = a._def.innerType;
2506
+ r[n] = a;
2507
2507
  }
2508
2508
  return new T({
2509
2509
  ...this._def,
@@ -2511,7 +2511,7 @@ var wn = or((Sn, Ye) => {
2511
2511
  });
2512
2512
  }
2513
2513
  keyof() {
2514
- return Yt(w.objectKeys(this.shape));
2514
+ return Xt(w.objectKeys(this.shape));
2515
2515
  }
2516
2516
  }
2517
2517
  T.create = (t, e) => new T({
@@ -2535,24 +2535,24 @@ var wn = or((Sn, Ye) => {
2535
2535
  typeName: m.ZodObject,
2536
2536
  ..._(e)
2537
2537
  });
2538
- class Ce extends v {
2538
+ class Ae extends v {
2539
2539
  _parse(e) {
2540
2540
  const { ctx: r } = this._processInputParams(e), n = this._def.options;
2541
- function a(s) {
2542
- for (const o of s)
2541
+ function s(a) {
2542
+ for (const o of a)
2543
2543
  if (o.result.status === "valid")
2544
2544
  return o.result;
2545
- for (const o of s)
2545
+ for (const o of a)
2546
2546
  if (o.result.status === "dirty")
2547
2547
  return r.common.issues.push(...o.ctx.common.issues), o.result;
2548
- const i = s.map((o) => new V(o.ctx.common.issues));
2548
+ const i = a.map((o) => new V(o.ctx.common.issues));
2549
2549
  return u(r, {
2550
2550
  code: c.invalid_union,
2551
2551
  unionErrors: i
2552
2552
  }), g;
2553
2553
  }
2554
2554
  if (r.common.async)
2555
- return Promise.all(n.map(async (s) => {
2555
+ return Promise.all(n.map(async (a) => {
2556
2556
  const i = {
2557
2557
  ...r,
2558
2558
  common: {
@@ -2562,16 +2562,16 @@ var wn = or((Sn, Ye) => {
2562
2562
  parent: null
2563
2563
  };
2564
2564
  return {
2565
- result: await s._parseAsync({
2565
+ result: await a._parseAsync({
2566
2566
  data: r.data,
2567
2567
  path: r.path,
2568
2568
  parent: i
2569
2569
  }),
2570
2570
  ctx: i
2571
2571
  };
2572
- })).then(a);
2572
+ })).then(s);
2573
2573
  {
2574
- let s;
2574
+ let a;
2575
2575
  const i = [];
2576
2576
  for (const d of n) {
2577
2577
  const l = {
@@ -2588,10 +2588,10 @@ var wn = or((Sn, Ye) => {
2588
2588
  });
2589
2589
  if (h.status === "valid")
2590
2590
  return h;
2591
- h.status === "dirty" && !s && (s = { result: h, ctx: l }), l.common.issues.length && i.push(l.common.issues);
2591
+ h.status === "dirty" && !a && (a = { result: h, ctx: l }), l.common.issues.length && i.push(l.common.issues);
2592
2592
  }
2593
- if (s)
2594
- return r.common.issues.push(...s.ctx.common.issues), s.result;
2593
+ if (a)
2594
+ return r.common.issues.push(...a.ctx.common.issues), a.result;
2595
2595
  const o = i.map((d) => new V(d));
2596
2596
  return u(r, {
2597
2597
  code: c.invalid_union,
@@ -2603,19 +2603,19 @@ var wn = or((Sn, Ye) => {
2603
2603
  return this._def.options;
2604
2604
  }
2605
2605
  }
2606
- Ce.create = (t, e) => new Ce({
2606
+ Ae.create = (t, e) => new Ae({
2607
2607
  options: t,
2608
2608
  typeName: m.ZodUnion,
2609
2609
  ..._(e)
2610
2610
  });
2611
- function Ue(t, e) {
2611
+ function Be(t, e) {
2612
2612
  const r = U(t), n = U(e);
2613
2613
  if (t === e)
2614
2614
  return { valid: !0, data: t };
2615
2615
  if (r === f.object && n === f.object) {
2616
- const a = w.objectKeys(e), s = w.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
2617
- for (const o of s) {
2618
- const d = Ue(t[o], e[o]);
2616
+ const s = w.objectKeys(e), a = w.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
2617
+ for (const o of a) {
2618
+ const d = Be(t[o], e[o]);
2619
2619
  if (!d.valid)
2620
2620
  return { valid: !1 };
2621
2621
  i[o] = d.data;
@@ -2624,23 +2624,23 @@ var wn = or((Sn, Ye) => {
2624
2624
  } else if (r === f.array && n === f.array) {
2625
2625
  if (t.length !== e.length)
2626
2626
  return { valid: !1 };
2627
- const a = [];
2628
- for (let s = 0; s < t.length; s++) {
2629
- const i = t[s], o = e[s], d = Ue(i, o);
2627
+ const s = [];
2628
+ for (let a = 0; a < t.length; a++) {
2629
+ const i = t[a], o = e[a], d = Be(i, o);
2630
2630
  if (!d.valid)
2631
2631
  return { valid: !1 };
2632
- a.push(d.data);
2632
+ s.push(d.data);
2633
2633
  }
2634
- return { valid: !0, data: a };
2634
+ return { valid: !0, data: s };
2635
2635
  } else return r === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2636
2636
  }
2637
- class Ae extends v {
2637
+ class Ie extends v {
2638
2638
  _parse(e) {
2639
- const { status: r, ctx: n } = this._processInputParams(e), a = (s, i) => {
2640
- if (st(s) || st(i))
2639
+ const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
2640
+ if (ot(a) || ot(i))
2641
2641
  return g;
2642
- const o = Ue(s.value, i.value);
2643
- return o.valid ? ((it(s) || it(i)) && r.dirty(), { status: r.value, value: o.data }) : (u(n, {
2642
+ const o = Be(a.value, i.value);
2643
+ return o.valid ? ((dt(a) || dt(i)) && r.dirty(), { status: r.value, value: o.data }) : (u(n, {
2644
2644
  code: c.invalid_intersection_types
2645
2645
  }), g);
2646
2646
  };
@@ -2655,7 +2655,7 @@ var wn = or((Sn, Ye) => {
2655
2655
  path: n.path,
2656
2656
  parent: n
2657
2657
  })
2658
- ]).then(([s, i]) => a(s, i)) : a(this._def.left._parseSync({
2658
+ ]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
2659
2659
  data: n.data,
2660
2660
  path: n.path,
2661
2661
  parent: n
@@ -2666,7 +2666,7 @@ var wn = or((Sn, Ye) => {
2666
2666
  }));
2667
2667
  }
2668
2668
  }
2669
- Ae.create = (t, e, r) => new Ae({
2669
+ Ie.create = (t, e, r) => new Ie({
2670
2670
  left: t,
2671
2671
  right: e,
2672
2672
  typeName: m.ZodIntersection,
@@ -2696,11 +2696,11 @@ var wn = or((Sn, Ye) => {
2696
2696
  exact: !1,
2697
2697
  type: "array"
2698
2698
  }), r.dirty());
2699
- const s = [...n.data].map((i, o) => {
2699
+ const a = [...n.data].map((i, o) => {
2700
2700
  const d = this._def.items[o] || this._def.rest;
2701
2701
  return d ? d._parse(new M(n, i, n.path, o)) : null;
2702
2702
  }).filter((i) => !!i);
2703
- return n.common.async ? Promise.all(s).then((i) => A.mergeArray(r, i)) : A.mergeArray(r, s);
2703
+ return n.common.async ? Promise.all(a).then((i) => A.mergeArray(r, i)) : A.mergeArray(r, a);
2704
2704
  }
2705
2705
  get items() {
2706
2706
  return this._def.items;
@@ -2722,7 +2722,7 @@ var wn = or((Sn, Ye) => {
2722
2722
  ..._(e)
2723
2723
  });
2724
2724
  };
2725
- class Ie extends v {
2725
+ class Pe extends v {
2726
2726
  get keySchema() {
2727
2727
  return this._def.keyType;
2728
2728
  }
@@ -2737,25 +2737,25 @@ var wn = or((Sn, Ye) => {
2737
2737
  expected: f.object,
2738
2738
  received: n.parsedType
2739
2739
  }), g;
2740
- const a = [], s = this._def.keyType, i = this._def.valueType;
2740
+ const s = [], a = this._def.keyType, i = this._def.valueType;
2741
2741
  for (const o in n.data)
2742
- a.push({
2743
- key: s._parse(new M(n, o, n.path, o)),
2742
+ s.push({
2743
+ key: a._parse(new M(n, o, n.path, o)),
2744
2744
  value: i._parse(new M(n, n.data[o], n.path, o)),
2745
2745
  alwaysSet: o in n.data
2746
2746
  });
2747
- return n.common.async ? A.mergeObjectAsync(r, a) : A.mergeObjectSync(r, a);
2747
+ return n.common.async ? A.mergeObjectAsync(r, s) : A.mergeObjectSync(r, s);
2748
2748
  }
2749
2749
  get element() {
2750
2750
  return this._def.valueType;
2751
2751
  }
2752
2752
  static create(e, r, n) {
2753
- return r instanceof v ? new Ie({
2753
+ return r instanceof v ? new Pe({
2754
2754
  keyType: e,
2755
2755
  valueType: r,
2756
2756
  typeName: m.ZodRecord,
2757
2757
  ..._(n)
2758
- }) : new Ie({
2758
+ }) : new Pe({
2759
2759
  keyType: q.create(),
2760
2760
  valueType: e,
2761
2761
  typeName: m.ZodRecord,
@@ -2763,7 +2763,7 @@ var wn = or((Sn, Ye) => {
2763
2763
  });
2764
2764
  }
2765
2765
  }
2766
- class pt extends v {
2766
+ class yt extends v {
2767
2767
  get keySchema() {
2768
2768
  return this._def.keyType;
2769
2769
  }
@@ -2778,9 +2778,9 @@ var wn = or((Sn, Ye) => {
2778
2778
  expected: f.map,
2779
2779
  received: n.parsedType
2780
2780
  }), g;
2781
- const a = this._def.keyType, s = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
2782
- key: a._parse(new M(n, o, n.path, [l, "key"])),
2783
- value: s._parse(new M(n, d, n.path, [l, "value"]))
2781
+ const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
2782
+ key: s._parse(new M(n, o, n.path, [l, "key"])),
2783
+ value: a._parse(new M(n, d, n.path, [l, "value"]))
2784
2784
  }));
2785
2785
  if (n.common.async) {
2786
2786
  const o = /* @__PURE__ */ new Map();
@@ -2805,13 +2805,13 @@ var wn = or((Sn, Ye) => {
2805
2805
  }
2806
2806
  }
2807
2807
  }
2808
- pt.create = (t, e, r) => new pt({
2808
+ yt.create = (t, e, r) => new yt({
2809
2809
  valueType: e,
2810
2810
  keyType: t,
2811
2811
  typeName: m.ZodMap,
2812
2812
  ..._(r)
2813
2813
  });
2814
- class ve extends v {
2814
+ class ke extends v {
2815
2815
  _parse(e) {
2816
2816
  const { status: r, ctx: n } = this._processInputParams(e);
2817
2817
  if (n.parsedType !== f.set)
@@ -2820,23 +2820,23 @@ var wn = or((Sn, Ye) => {
2820
2820
  expected: f.set,
2821
2821
  received: n.parsedType
2822
2822
  }), g;
2823
- const a = this._def;
2824
- a.minSize !== null && n.data.size < a.minSize.value && (u(n, {
2823
+ const s = this._def;
2824
+ s.minSize !== null && n.data.size < s.minSize.value && (u(n, {
2825
2825
  code: c.too_small,
2826
- minimum: a.minSize.value,
2826
+ minimum: s.minSize.value,
2827
2827
  type: "set",
2828
2828
  inclusive: !0,
2829
2829
  exact: !1,
2830
- message: a.minSize.message
2831
- }), r.dirty()), a.maxSize !== null && n.data.size > a.maxSize.value && (u(n, {
2830
+ message: s.minSize.message
2831
+ }), r.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (u(n, {
2832
2832
  code: c.too_big,
2833
- maximum: a.maxSize.value,
2833
+ maximum: s.maxSize.value,
2834
2834
  type: "set",
2835
2835
  inclusive: !0,
2836
2836
  exact: !1,
2837
- message: a.maxSize.message
2837
+ message: s.maxSize.message
2838
2838
  }), r.dirty());
2839
- const s = this._def.valueType;
2839
+ const a = this._def.valueType;
2840
2840
  function i(d) {
2841
2841
  const l = /* @__PURE__ */ new Set();
2842
2842
  for (const h of d) {
@@ -2846,17 +2846,17 @@ var wn = or((Sn, Ye) => {
2846
2846
  }
2847
2847
  return { status: r.value, value: l };
2848
2848
  }
2849
- const o = [...n.data.values()].map((d, l) => s._parse(new M(n, d, n.path, l)));
2849
+ const o = [...n.data.values()].map((d, l) => a._parse(new M(n, d, n.path, l)));
2850
2850
  return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
2851
2851
  }
2852
2852
  min(e, r) {
2853
- return new ve({
2853
+ return new ke({
2854
2854
  ...this._def,
2855
2855
  minSize: { value: e, message: p.toString(r) }
2856
2856
  });
2857
2857
  }
2858
2858
  max(e, r) {
2859
- return new ve({
2859
+ return new ke({
2860
2860
  ...this._def,
2861
2861
  maxSize: { value: e, message: p.toString(r) }
2862
2862
  });
@@ -2868,14 +2868,14 @@ var wn = or((Sn, Ye) => {
2868
2868
  return this.min(1, e);
2869
2869
  }
2870
2870
  }
2871
- ve.create = (t, e) => new ve({
2871
+ ke.create = (t, e) => new ke({
2872
2872
  valueType: t,
2873
2873
  minSize: null,
2874
2874
  maxSize: null,
2875
2875
  typeName: m.ZodSet,
2876
2876
  ..._(e)
2877
2877
  });
2878
- class mt extends v {
2878
+ class gt extends v {
2879
2879
  get schema() {
2880
2880
  return this._def.getter();
2881
2881
  }
@@ -2884,12 +2884,12 @@ var wn = or((Sn, Ye) => {
2884
2884
  return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
2885
2885
  }
2886
2886
  }
2887
- mt.create = (t, e) => new mt({
2887
+ gt.create = (t, e) => new gt({
2888
2888
  getter: t,
2889
2889
  typeName: m.ZodLazy,
2890
2890
  ..._(e)
2891
2891
  });
2892
- class yt extends v {
2892
+ class _t extends v {
2893
2893
  _parse(e) {
2894
2894
  if (e.data !== this._def.value) {
2895
2895
  const r = this._getOrReturnCtx(e);
@@ -2905,19 +2905,19 @@ var wn = or((Sn, Ye) => {
2905
2905
  return this._def.value;
2906
2906
  }
2907
2907
  }
2908
- yt.create = (t, e) => new yt({
2908
+ _t.create = (t, e) => new _t({
2909
2909
  value: t,
2910
2910
  typeName: m.ZodLiteral,
2911
2911
  ..._(e)
2912
2912
  });
2913
- function Yt(t, e) {
2914
- return new de({
2913
+ function Xt(t, e) {
2914
+ return new ce({
2915
2915
  values: t,
2916
2916
  typeName: m.ZodEnum,
2917
2917
  ..._(e)
2918
2918
  });
2919
2919
  }
2920
- class de extends v {
2920
+ class ce extends v {
2921
2921
  _parse(e) {
2922
2922
  if (typeof e.data != "string") {
2923
2923
  const r = this._getOrReturnCtx(e), n = this._def.values;
@@ -2959,36 +2959,36 @@ var wn = or((Sn, Ye) => {
2959
2959
  return e;
2960
2960
  }
2961
2961
  extract(e, r = this._def) {
2962
- return de.create(e, {
2962
+ return ce.create(e, {
2963
2963
  ...this._def,
2964
2964
  ...r
2965
2965
  });
2966
2966
  }
2967
2967
  exclude(e, r = this._def) {
2968
- return de.create(this.options.filter((n) => !e.includes(n)), {
2968
+ return ce.create(this.options.filter((n) => !e.includes(n)), {
2969
2969
  ...this._def,
2970
2970
  ...r
2971
2971
  });
2972
2972
  }
2973
2973
  }
2974
- de.create = Yt;
2975
- class gt extends v {
2974
+ ce.create = Xt;
2975
+ class vt extends v {
2976
2976
  _parse(e) {
2977
2977
  const r = w.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2978
2978
  if (n.parsedType !== f.string && n.parsedType !== f.number) {
2979
- const a = w.objectValues(r);
2979
+ const s = w.objectValues(r);
2980
2980
  return u(n, {
2981
- expected: w.joinValues(a),
2981
+ expected: w.joinValues(s),
2982
2982
  received: n.parsedType,
2983
2983
  code: c.invalid_type
2984
2984
  }), g;
2985
2985
  }
2986
2986
  if (this._cache || (this._cache = new Set(w.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2987
- const a = w.objectValues(r);
2987
+ const s = w.objectValues(r);
2988
2988
  return u(n, {
2989
2989
  received: n.data,
2990
2990
  code: c.invalid_enum_value,
2991
- options: a
2991
+ options: s
2992
2992
  }), g;
2993
2993
  }
2994
2994
  return P(e.data);
@@ -2997,12 +2997,12 @@ var wn = or((Sn, Ye) => {
2997
2997
  return this._def.values;
2998
2998
  }
2999
2999
  }
3000
- gt.create = (t, e) => new gt({
3000
+ vt.create = (t, e) => new vt({
3001
3001
  values: t,
3002
3002
  typeName: m.ZodNativeEnum,
3003
3003
  ..._(e)
3004
3004
  });
3005
- class Pe extends v {
3005
+ class je extends v {
3006
3006
  unwrap() {
3007
3007
  return this._def.type;
3008
3008
  }
@@ -3015,18 +3015,18 @@ var wn = or((Sn, Ye) => {
3015
3015
  received: r.parsedType
3016
3016
  }), g;
3017
3017
  const n = r.parsedType === f.promise ? r.data : Promise.resolve(r.data);
3018
- return P(n.then((a) => this._def.type.parseAsync(a, {
3018
+ return P(n.then((s) => this._def.type.parseAsync(s, {
3019
3019
  path: r.path,
3020
3020
  errorMap: r.common.contextualErrorMap
3021
3021
  })));
3022
3022
  }
3023
3023
  }
3024
- Pe.create = (t, e) => new Pe({
3024
+ je.create = (t, e) => new je({
3025
3025
  type: t,
3026
3026
  typeName: m.ZodPromise,
3027
3027
  ..._(e)
3028
3028
  });
3029
- class ce extends v {
3029
+ class le extends v {
3030
3030
  innerType() {
3031
3031
  return this._def.schema;
3032
3032
  }
@@ -3034,7 +3034,7 @@ var wn = or((Sn, Ye) => {
3034
3034
  return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3035
3035
  }
3036
3036
  _parse(e) {
3037
- const { status: r, ctx: n } = this._processInputParams(e), a = this._def.effect || null, s = {
3037
+ const { status: r, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
3038
3038
  addIssue: (i) => {
3039
3039
  u(n, i), i.fatal ? r.abort() : r.dirty();
3040
3040
  },
@@ -3042,8 +3042,8 @@ var wn = or((Sn, Ye) => {
3042
3042
  return n.path;
3043
3043
  }
3044
3044
  };
3045
- if (s.addIssue = s.addIssue.bind(s), a.type === "preprocess") {
3046
- const i = a.transform(n.data, s);
3045
+ if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
3046
+ const i = s.transform(n.data, a);
3047
3047
  if (n.common.async)
3048
3048
  return Promise.resolve(i).then(async (o) => {
3049
3049
  if (r.value === "aborted")
@@ -3053,7 +3053,7 @@ var wn = or((Sn, Ye) => {
3053
3053
  path: n.path,
3054
3054
  parent: n
3055
3055
  });
3056
- return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ? ye(d.value) : d;
3056
+ return d.status === "aborted" ? g : d.status === "dirty" || r.value === "dirty" ? ge(d.value) : d;
3057
3057
  });
3058
3058
  {
3059
3059
  if (r.value === "aborted")
@@ -3063,12 +3063,12 @@ var wn = or((Sn, Ye) => {
3063
3063
  path: n.path,
3064
3064
  parent: n
3065
3065
  });
3066
- return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ? ye(o.value) : o;
3066
+ return o.status === "aborted" ? g : o.status === "dirty" || r.value === "dirty" ? ge(o.value) : o;
3067
3067
  }
3068
3068
  }
3069
- if (a.type === "refinement") {
3069
+ if (s.type === "refinement") {
3070
3070
  const i = (o) => {
3071
- const d = a.refinement(o, s);
3071
+ const d = s.refinement(o, a);
3072
3072
  if (n.common.async)
3073
3073
  return Promise.resolve(d);
3074
3074
  if (d instanceof Promise)
@@ -3085,34 +3085,34 @@ var wn = or((Sn, Ye) => {
3085
3085
  } else
3086
3086
  return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? g : (o.status === "dirty" && r.dirty(), i(o.value).then(() => ({ status: r.value, value: o.value }))));
3087
3087
  }
3088
- if (a.type === "transform")
3088
+ if (s.type === "transform")
3089
3089
  if (n.common.async === !1) {
3090
3090
  const i = this._def.schema._parseSync({
3091
3091
  data: n.data,
3092
3092
  path: n.path,
3093
3093
  parent: n
3094
3094
  });
3095
- if (!ie(i))
3095
+ if (!oe(i))
3096
3096
  return g;
3097
- const o = a.transform(i.value, s);
3097
+ const o = s.transform(i.value, a);
3098
3098
  if (o instanceof Promise)
3099
3099
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
3100
3100
  return { status: r.value, value: o };
3101
3101
  } else
3102
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ie(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({
3102
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => oe(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({
3103
3103
  status: r.value,
3104
3104
  value: o
3105
3105
  })) : g);
3106
- w.assertNever(a);
3106
+ w.assertNever(s);
3107
3107
  }
3108
3108
  }
3109
- ce.create = (t, e, r) => new ce({
3109
+ le.create = (t, e, r) => new le({
3110
3110
  schema: t,
3111
3111
  typeName: m.ZodEffects,
3112
3112
  effect: e,
3113
3113
  ..._(r)
3114
3114
  });
3115
- ce.createWithPreprocess = (t, e, r) => new ce({
3115
+ le.createWithPreprocess = (t, e, r) => new le({
3116
3116
  schema: e,
3117
3117
  effect: { type: "preprocess", transform: t },
3118
3118
  typeName: m.ZodEffects,
@@ -3131,7 +3131,7 @@ var wn = or((Sn, Ye) => {
3131
3131
  typeName: m.ZodOptional,
3132
3132
  ..._(e)
3133
3133
  });
3134
- class le extends v {
3134
+ class ue extends v {
3135
3135
  _parse(e) {
3136
3136
  return this._getType(e) === f.null ? P(null) : this._def.innerType._parse(e);
3137
3137
  }
@@ -3139,12 +3139,12 @@ var wn = or((Sn, Ye) => {
3139
3139
  return this._def.innerType;
3140
3140
  }
3141
3141
  }
3142
- le.create = (t, e) => new le({
3142
+ ue.create = (t, e) => new ue({
3143
3143
  innerType: t,
3144
3144
  typeName: m.ZodNullable,
3145
3145
  ..._(e)
3146
3146
  });
3147
- class He extends v {
3147
+ class We extends v {
3148
3148
  _parse(e) {
3149
3149
  const { ctx: r } = this._processInputParams(e);
3150
3150
  let n = r.data;
@@ -3158,13 +3158,13 @@ var wn = or((Sn, Ye) => {
3158
3158
  return this._def.innerType;
3159
3159
  }
3160
3160
  }
3161
- He.create = (t, e) => new He({
3161
+ We.create = (t, e) => new We({
3162
3162
  innerType: t,
3163
3163
  typeName: m.ZodDefault,
3164
3164
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
3165
3165
  ..._(e)
3166
3166
  });
3167
- class Be extends v {
3167
+ class Je extends v {
3168
3168
  _parse(e) {
3169
3169
  const { ctx: r } = this._processInputParams(e), n = {
3170
3170
  ...r,
@@ -3172,16 +3172,16 @@ var wn = or((Sn, Ye) => {
3172
3172
  ...r.common,
3173
3173
  issues: []
3174
3174
  }
3175
- }, a = this._def.innerType._parse({
3175
+ }, s = this._def.innerType._parse({
3176
3176
  data: n.data,
3177
3177
  path: n.path,
3178
3178
  parent: {
3179
3179
  ...n
3180
3180
  }
3181
3181
  });
3182
- return Ne(a) ? a.then((s) => ({
3182
+ return Re(s) ? s.then((a) => ({
3183
3183
  status: "valid",
3184
- value: s.status === "valid" ? s.value : this._def.catchValue({
3184
+ value: a.status === "valid" ? a.value : this._def.catchValue({
3185
3185
  get error() {
3186
3186
  return new V(n.common.issues);
3187
3187
  },
@@ -3189,7 +3189,7 @@ var wn = or((Sn, Ye) => {
3189
3189
  })
3190
3190
  })) : {
3191
3191
  status: "valid",
3192
- value: a.status === "valid" ? a.value : this._def.catchValue({
3192
+ value: s.status === "valid" ? s.value : this._def.catchValue({
3193
3193
  get error() {
3194
3194
  return new V(n.common.issues);
3195
3195
  },
@@ -3201,13 +3201,13 @@ var wn = or((Sn, Ye) => {
3201
3201
  return this._def.innerType;
3202
3202
  }
3203
3203
  }
3204
- Be.create = (t, e) => new Be({
3204
+ Je.create = (t, e) => new Je({
3205
3205
  innerType: t,
3206
3206
  typeName: m.ZodCatch,
3207
3207
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
3208
3208
  ..._(e)
3209
3209
  });
3210
- class _t extends v {
3210
+ class kt extends v {
3211
3211
  _parse(e) {
3212
3212
  if (this._getType(e) !== f.nan) {
3213
3213
  const n = this._getOrReturnCtx(e);
@@ -3220,11 +3220,11 @@ var wn = or((Sn, Ye) => {
3220
3220
  return { status: "valid", value: e.data };
3221
3221
  }
3222
3222
  }
3223
- _t.create = (t) => new _t({
3223
+ kt.create = (t) => new kt({
3224
3224
  typeName: m.ZodNaN,
3225
3225
  ..._(t)
3226
3226
  });
3227
- class nn extends v {
3227
+ class sn extends v {
3228
3228
  _parse(e) {
3229
3229
  const { ctx: r } = this._processInputParams(e), n = r.data;
3230
3230
  return this._def.type._parse({
@@ -3237,56 +3237,56 @@ var wn = or((Sn, Ye) => {
3237
3237
  return this._def.type;
3238
3238
  }
3239
3239
  }
3240
- class Ke extends v {
3240
+ class tt extends v {
3241
3241
  _parse(e) {
3242
3242
  const { status: r, ctx: n } = this._processInputParams(e);
3243
3243
  if (n.common.async)
3244
3244
  return (async () => {
3245
- const s = await this._def.in._parseAsync({
3245
+ const a = await this._def.in._parseAsync({
3246
3246
  data: n.data,
3247
3247
  path: n.path,
3248
3248
  parent: n
3249
3249
  });
3250
- return s.status === "aborted" ? g : s.status === "dirty" ? (r.dirty(), ye(s.value)) : this._def.out._parseAsync({
3251
- data: s.value,
3250
+ return a.status === "aborted" ? g : a.status === "dirty" ? (r.dirty(), ge(a.value)) : this._def.out._parseAsync({
3251
+ data: a.value,
3252
3252
  path: n.path,
3253
3253
  parent: n
3254
3254
  });
3255
3255
  })();
3256
3256
  {
3257
- const a = this._def.in._parseSync({
3257
+ const s = this._def.in._parseSync({
3258
3258
  data: n.data,
3259
3259
  path: n.path,
3260
3260
  parent: n
3261
3261
  });
3262
- return a.status === "aborted" ? g : a.status === "dirty" ? (r.dirty(), {
3262
+ return s.status === "aborted" ? g : s.status === "dirty" ? (r.dirty(), {
3263
3263
  status: "dirty",
3264
- value: a.value
3264
+ value: s.value
3265
3265
  }) : this._def.out._parseSync({
3266
- data: a.value,
3266
+ data: s.value,
3267
3267
  path: n.path,
3268
3268
  parent: n
3269
3269
  });
3270
3270
  }
3271
3271
  }
3272
3272
  static create(e, r) {
3273
- return new Ke({
3273
+ return new tt({
3274
3274
  in: e,
3275
3275
  out: r,
3276
3276
  typeName: m.ZodPipeline
3277
3277
  });
3278
3278
  }
3279
3279
  }
3280
- class We extends v {
3280
+ class Ye extends v {
3281
3281
  _parse(e) {
3282
- const r = this._def.innerType._parse(e), n = (a) => (ie(a) && (a.value = Object.freeze(a.value)), a);
3283
- return Ne(r) ? r.then((a) => n(a)) : n(r);
3282
+ const r = this._def.innerType._parse(e), n = (s) => (oe(s) && (s.value = Object.freeze(s.value)), s);
3283
+ return Re(r) ? r.then((s) => n(s)) : n(r);
3284
3284
  }
3285
3285
  unwrap() {
3286
3286
  return this._def.innerType;
3287
3287
  }
3288
3288
  }
3289
- We.create = (t, e) => new We({
3289
+ Ye.create = (t, e) => new Ye({
3290
3290
  innerType: t,
3291
3291
  typeName: m.ZodReadonly,
3292
3292
  ..._(e)
@@ -3295,32 +3295,32 @@ var wn = or((Sn, Ye) => {
3295
3295
  (function(t) {
3296
3296
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
3297
3297
  })(m || (m = {}));
3298
- const R = q.create, he = oe.create, F = ze.create;
3298
+ const O = q.create, pe = de.create, F = He.create;
3299
3299
  J.create;
3300
- const Qt = Z.create, O = T.create, an = Ce.create;
3301
- Ae.create;
3300
+ const $e = Z.create, N = T.create, an = Ae.create;
3301
+ Ie.create;
3302
3302
  ee.create;
3303
- const sn = Ie.create, N = de.create;
3304
- Pe.create;
3303
+ const on = Pe.create, R = ce.create;
3304
+ je.create;
3305
3305
  B.create;
3306
- le.create;
3307
- const Je = O({
3308
- detail: R()
3309
- }), Xt = O({
3310
- error: R()
3306
+ ue.create;
3307
+ const Qe = N({
3308
+ detail: O()
3309
+ }), Gt = N({
3310
+ error: O()
3311
3311
  });
3312
- function Gt(t) {
3312
+ function Kt(t) {
3313
3313
  if (!t)
3314
3314
  return "Unknown error";
3315
3315
  if (t instanceof Error) {
3316
- const e = Je.safeParse(t.cause);
3317
- return e.success ? e.data.detail : on(t.message);
3316
+ const e = Qe.safeParse(t.cause);
3317
+ return e.success ? e.data.detail : dn(t.message);
3318
3318
  }
3319
3319
  if (typeof t == "object") {
3320
- const e = Je.safeParse(t);
3320
+ const e = Qe.safeParse(t);
3321
3321
  if (e.success)
3322
3322
  return e.data.detail;
3323
- const r = Xt.safeParse(t);
3323
+ const r = Gt.safeParse(t);
3324
3324
  if (r.success)
3325
3325
  return r.data.error;
3326
3326
  }
@@ -3330,113 +3330,121 @@ var wn = or((Sn, Ye) => {
3330
3330
  return String(t);
3331
3331
  }
3332
3332
  }
3333
- function on(t) {
3334
- const e = dn(t);
3333
+ function dn(t) {
3334
+ const e = cn(t);
3335
3335
  if (!e)
3336
3336
  return t;
3337
- const r = Je.safeParse(e);
3337
+ const r = Qe.safeParse(e);
3338
3338
  if (r.success)
3339
3339
  return r.data.detail;
3340
- const n = Xt.safeParse(e);
3340
+ const n = Gt.safeParse(e);
3341
3341
  return n.success ? n.data.error : t;
3342
3342
  }
3343
- function dn(t) {
3343
+ function cn(t) {
3344
3344
  try {
3345
3345
  return JSON.parse(t);
3346
3346
  } catch {
3347
3347
  return t;
3348
3348
  }
3349
3349
  }
3350
- function Kt(t, e) {
3350
+ function er(t, e) {
3351
3351
  if (!t)
3352
3352
  throw new Error(e);
3353
3353
  }
3354
- const cn = [
3354
+ const ln = [
3355
3355
  "pip",
3356
3356
  "uv",
3357
3357
  "rye",
3358
3358
  "poetry",
3359
3359
  "pixi"
3360
- ], er = [
3360
+ ], tr = [
3361
3361
  "normal",
3362
3362
  "compact",
3363
3363
  "medium",
3364
3364
  "full",
3365
3365
  "columns"
3366
- ], tr = [
3366
+ ], rr = [
3367
3367
  "auto",
3368
3368
  "native",
3369
3369
  "polars",
3370
3370
  "lazy-polars",
3371
3371
  "pandas"
3372
- ], rr = ["html", "markdown", "ipynb"], ln = O({
3373
- completion: O({
3372
+ ], nr = ["html", "markdown", "ipynb"], te = N({
3373
+ api_key: O().optional(),
3374
+ base_url: O().optional()
3375
+ }).passthrough(), un = N({
3376
+ chat_model: O().nullish(),
3377
+ edit_model: O().nullish(),
3378
+ autocomplete_model: O().nullish(),
3379
+ displayed_models: $e(O()).default([]),
3380
+ custom_models: $e(O()).default([])
3381
+ }), fn = N({
3382
+ completion: N({
3374
3383
  activate_on_typing: F().default(!0),
3375
- copilot: an([F(), N(["github", "codeium", "custom"])]).default(!1).transform((t) => t === !0 ? "github" : t),
3376
- codeium_api_key: R().nullish()
3384
+ copilot: an([F(), R(["github", "codeium", "custom"])]).default(!1).transform((t) => t === !0 ? "github" : t),
3385
+ codeium_api_key: O().nullish()
3377
3386
  }).passthrough().default({}),
3378
- save: O({
3379
- autosave: N(["off", "after_delay"]).default("after_delay"),
3380
- autosave_delay: he().nonnegative().transform((t) => Math.max(t, 1e3)).default(1e3),
3387
+ save: N({
3388
+ autosave: R(["off", "after_delay"]).default("after_delay"),
3389
+ autosave_delay: pe().nonnegative().transform((t) => Math.max(t, 1e3)).default(1e3),
3381
3390
  format_on_save: F().default(!1)
3382
3391
  }).passthrough().default({}),
3383
- formatting: O({
3384
- line_length: he().nonnegative().default(79).transform((t) => Math.min(t, 1e3))
3392
+ formatting: N({
3393
+ line_length: pe().nonnegative().default(79).transform((t) => Math.min(t, 1e3))
3385
3394
  }).passthrough().default({}),
3386
- keymap: O({
3387
- preset: N(["default", "vim"]).default("default"),
3388
- overrides: sn(R()).default({}),
3395
+ keymap: N({
3396
+ preset: R(["default", "vim"]).default("default"),
3397
+ overrides: on(O()).default({}),
3389
3398
  destructive_delete: F().default(!0)
3390
3399
  }).passthrough().default({}),
3391
- runtime: O({
3400
+ runtime: N({
3392
3401
  auto_instantiate: F().default(!0),
3393
- on_cell_change: N(["lazy", "autorun"]).default("autorun"),
3394
- auto_reload: N(["off", "lazy", "autorun"]).default("off"),
3395
- watcher_on_save: N(["lazy", "autorun"]).default("lazy"),
3396
- default_sql_output: N(tr).default("auto"),
3397
- default_auto_download: Qt(N(rr)).default([])
3402
+ on_cell_change: R(["lazy", "autorun"]).default("autorun"),
3403
+ auto_reload: R(["off", "lazy", "autorun"]).default("off"),
3404
+ watcher_on_save: R(["lazy", "autorun"]).default("lazy"),
3405
+ default_sql_output: R(rr).default("auto"),
3406
+ default_auto_download: $e(R(nr)).default([])
3398
3407
  }).passthrough().default({}),
3399
- display: O({
3400
- theme: N(["light", "dark", "system"]).default("light"),
3401
- code_editor_font_size: he().nonnegative().default(14),
3402
- cell_output: N(["above", "below"]).default("above"),
3403
- dataframes: N(["rich", "plain"]).default("rich"),
3404
- default_table_page_size: he().default(10),
3405
- default_table_max_columns: he().default(50),
3406
- default_width: N(er).default("medium").transform((t) => t === "normal" ? "compact" : t),
3408
+ display: N({
3409
+ theme: R(["light", "dark", "system"]).default("light"),
3410
+ code_editor_font_size: pe().nonnegative().default(14),
3411
+ cell_output: R(["above", "below"]).default("above"),
3412
+ dataframes: R(["rich", "plain"]).default("rich"),
3413
+ default_table_page_size: pe().default(10),
3414
+ default_table_max_columns: pe().default(50),
3415
+ default_width: R(tr).default("medium").transform((t) => t === "normal" ? "compact" : t),
3407
3416
  reference_highlighting: F().default(!1)
3408
3417
  }).passthrough().default({}),
3409
- package_management: O({
3410
- manager: N(cn).default("pip")
3418
+ package_management: N({
3419
+ manager: R(ln).default("pip")
3411
3420
  }).passthrough().default({ manager: "pip" }),
3412
- ai: O({
3413
- rules: R().default(""),
3414
- mode: N(["manual", "ask"]).default("manual"),
3415
- open_ai: O({
3416
- api_key: R().optional(),
3417
- base_url: R().optional(),
3418
- model: R().optional()
3419
- }).optional(),
3420
- anthropic: O({
3421
- api_key: R().optional()
3422
- }).optional(),
3423
- google: O({
3424
- api_key: R().optional()
3421
+ ai: N({
3422
+ rules: O().default(""),
3423
+ mode: R(["manual", "ask"]).default("manual"),
3424
+ open_ai: te.optional(),
3425
+ anthropic: te.optional(),
3426
+ google: te.optional(),
3427
+ ollama: te.optional(),
3428
+ open_ai_compatible: te.optional(),
3429
+ azure: te.optional(),
3430
+ bedrock: N({
3431
+ region_name: O().optional(),
3432
+ profile_name: O().optional(),
3433
+ aws_access_key_id: O().optional(),
3434
+ aws_secret_access_key: O().optional()
3425
3435
  }).optional(),
3426
- bedrock: O({
3427
- region_name: R().optional(),
3428
- profile_name: R().optional(),
3429
- aws_access_key_id: R().optional(),
3430
- aws_secret_access_key: R().optional()
3431
- }).optional()
3436
+ models: un.default({
3437
+ displayed_models: [],
3438
+ custom_models: []
3439
+ })
3432
3440
  }).passthrough().default({}),
3433
- experimental: O({
3441
+ experimental: N({
3434
3442
  markdown: F().optional(),
3435
3443
  rtc: F().optional()
3436
3444
  // Add new experimental features here
3437
3445
  }).passthrough().default({}),
3438
- server: O({}).passthrough().default({}),
3439
- sharing: O({
3446
+ server: N({}).passthrough().default({}),
3447
+ sharing: N({
3440
3448
  html: F().optional(),
3441
3449
  wasm: F().optional()
3442
3450
  }).passthrough().optional()
@@ -3452,89 +3460,90 @@ var wn = or((Sn, Ye) => {
3452
3460
  ai: {
3453
3461
  rules: "",
3454
3462
  mode: "manual",
3455
- open_ai: {}
3456
- }
3457
- }), un = R(), fn = N(tr).default("auto");
3458
- O({
3459
- width: N(er).default("medium").transform((t) => t === "normal" ? "compact" : t),
3460
- app_title: un.nullish(),
3461
- css_file: R().nullish(),
3462
- html_head_file: R().nullish(),
3463
- auto_download: Qt(N(rr)).default([]),
3464
- sql_output: fn
3463
+ open_ai: {},
3464
+ models: {}
3465
+ }
3466
+ }), hn = O(), pn = R(rr).default("auto");
3467
+ N({
3468
+ width: R(tr).default("medium").transform((t) => t === "normal" ? "compact" : t),
3469
+ app_title: hn.nullish(),
3470
+ css_file: O().nullish(),
3471
+ html_head_file: O().nullish(),
3472
+ auto_download: $e(R(nr)).default([]),
3473
+ sql_output: pn
3465
3474
  }).default({ width: "medium", auto_download: [] });
3466
- function hn() {
3467
- return ln.parse({});
3475
+ function mn() {
3476
+ return fn.parse({});
3468
3477
  }
3469
- const vt = (t) => new TextDecoder().decode(t);
3470
- function ge(t) {
3478
+ const wt = (t) => new TextDecoder().decode(t);
3479
+ function _e(t) {
3471
3480
  return t.FS;
3472
3481
  }
3473
- const pe = "notebook.py", me = "/marimo", K = {
3474
- NOTEBOOK_FILENAME: pe,
3475
- HOME_DIR: me,
3482
+ const me = "notebook.py", ye = "/marimo", K = {
3483
+ NOTEBOOK_FILENAME: me,
3484
+ HOME_DIR: ye,
3476
3485
  createHomeDir: (t) => {
3477
- const e = ge(t);
3486
+ const e = _e(t);
3478
3487
  try {
3479
- e.mkdirTree(me);
3488
+ e.mkdirTree(ye);
3480
3489
  } catch {
3481
3490
  }
3482
- e.chdir(me);
3491
+ e.chdir(ye);
3483
3492
  },
3484
3493
  mountFS: (t) => {
3485
- ge(t).mount(t.FS.filesystems.IDBFS, { root: "." }, me);
3494
+ _e(t).mount(t.FS.filesystems.IDBFS, { root: "." }, ye);
3486
3495
  },
3487
3496
  populateFilesToMemory: async (t) => {
3488
- await kt(t, !0);
3497
+ await bt(t, !0);
3489
3498
  },
3490
3499
  persistFilesToRemote: async (t) => {
3491
- await kt(t, !1);
3500
+ await bt(t, !1);
3492
3501
  },
3493
3502
  readNotebook: (t) => {
3494
- const e = ge(t), r = `${me}/${pe}`;
3495
- return vt(e.readFile(r));
3503
+ const e = _e(t), r = `${ye}/${me}`;
3504
+ return wt(e.readFile(r));
3496
3505
  },
3497
3506
  initNotebookCode: (t) => {
3498
- const { pyodide: e, filename: r, code: n } = t, a = ge(e), s = (i) => {
3507
+ const { pyodide: e, filename: r, code: n } = t, s = _e(e), a = (i) => {
3499
3508
  try {
3500
- return vt(a.readFile(i));
3509
+ return wt(s.readFile(i));
3501
3510
  } catch {
3502
3511
  return null;
3503
3512
  }
3504
3513
  };
3505
- if (r && r !== pe) {
3506
- const i = s(r);
3514
+ if (r && r !== me) {
3515
+ const i = a(r);
3507
3516
  if (i)
3508
3517
  return {
3509
3518
  code: i,
3510
3519
  filename: r
3511
3520
  };
3512
3521
  }
3513
- return a.writeFile(pe, n), {
3522
+ return s.writeFile(me, n), {
3514
3523
  code: n,
3515
- filename: pe
3524
+ filename: me
3516
3525
  };
3517
3526
  }
3518
3527
  };
3519
- function kt(t, e) {
3528
+ function bt(t, e) {
3520
3529
  return new Promise((r, n) => {
3521
- ge(t).syncfs(e, (a) => {
3522
- if (a instanceof Error) {
3523
- n(a);
3530
+ _e(t).syncfs(e, (s) => {
3531
+ if (s instanceof Error) {
3532
+ n(s);
3524
3533
  return;
3525
3534
  }
3526
3535
  r();
3527
3536
  });
3528
3537
  });
3529
3538
  }
3530
- class pn {
3539
+ class yn {
3531
3540
  spans = [];
3532
3541
  startSpan(e, r = {}) {
3533
3542
  const n = {
3534
3543
  name: e,
3535
3544
  startTime: Date.now(),
3536
3545
  attributes: r,
3537
- end: (a = "ok") => this.endSpan(n, a)
3546
+ end: (s = "ok") => this.endSpan(n, s)
3538
3547
  };
3539
3548
  return this.spans.push(n), n;
3540
3549
  }
@@ -3545,45 +3554,45 @@ var wn = or((Sn, Ye) => {
3545
3554
  return this.spans;
3546
3555
  }
3547
3556
  wrap(e, r, n = {}) {
3548
- const a = this.startSpan(r || e.name, n);
3557
+ const s = this.startSpan(r || e.name, n);
3549
3558
  try {
3550
- const s = e();
3551
- return this.endSpan(a), s;
3552
- } catch (s) {
3553
- throw this.endSpan(a, "error"), s;
3559
+ const a = e();
3560
+ return this.endSpan(s), a;
3561
+ } catch (a) {
3562
+ throw this.endSpan(s, "error"), a;
3554
3563
  }
3555
3564
  }
3556
3565
  wrapAsync(e, r, n = {}) {
3557
- return async (...a) => {
3558
- const s = this.startSpan(r || e.name, n);
3566
+ return async (...s) => {
3567
+ const a = this.startSpan(r || e.name, n);
3559
3568
  try {
3560
- const i = await e(...a);
3561
- return this.endSpan(s), i;
3569
+ const i = await e(...s);
3570
+ return this.endSpan(a), i;
3562
3571
  } catch (i) {
3563
- throw this.endSpan(s, "error"), i;
3572
+ throw this.endSpan(a, "error"), i;
3564
3573
  }
3565
3574
  };
3566
3575
  }
3567
3576
  logSpans() {
3568
3577
  }
3569
3578
  }
3570
- const se = new pn();
3571
- globalThis.t = se;
3572
- const mn = !1;
3573
- class yn {
3579
+ const ie = new yn();
3580
+ globalThis.t = ie;
3581
+ const gn = !1;
3582
+ class _n {
3574
3583
  pyodide = null;
3575
3584
  get requirePyodide() {
3576
- return Kt(this.pyodide, "Pyodide not loaded"), this.pyodide;
3585
+ return er(this.pyodide, "Pyodide not loaded"), this.pyodide;
3577
3586
  }
3578
3587
  async bootstrap(e) {
3579
3588
  return await this.loadPyodideAndPackages(e);
3580
3589
  }
3581
3590
  async loadPyodideAndPackages(e) {
3582
- if (!qe)
3591
+ if (!ze)
3583
3592
  throw new Error("loadPyodide is not defined");
3584
- const r = se.startSpan("loadPyodide");
3593
+ const r = ie.startSpan("loadPyodide");
3585
3594
  try {
3586
- const n = await qe({
3595
+ const n = await ze({
3587
3596
  // Perf: These get loaded while pyodide is being bootstrapped
3588
3597
  packages: [
3589
3598
  "micropip",
@@ -3593,7 +3602,7 @@ var wn = or((Sn, Ye) => {
3593
3602
  "narwhals",
3594
3603
  "packaging"
3595
3604
  ],
3596
- _makeSnapshot: mn,
3605
+ _makeSnapshot: gn,
3597
3606
  lockFileURL: `https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,
3598
3607
  // Without this, this fails in Firefox with
3599
3608
  // `Could not extract indexURL path from pyodide module`
@@ -3606,7 +3615,7 @@ var wn = or((Sn, Ye) => {
3606
3615
  }
3607
3616
  }
3608
3617
  async mountFilesystem(e) {
3609
- const r = se.startSpan("mountFilesystem");
3618
+ const r = ie.startSpan("mountFilesystem");
3610
3619
  return K.createHomeDir(this.requirePyodide), K.mountFS(this.requirePyodide), await K.populateFilesToMemory(this.requirePyodide), r.end("ok"), K.initNotebookCode({
3611
3620
  pyodide: this.requirePyodide,
3612
3621
  code: e.code,
@@ -3614,11 +3623,11 @@ var wn = or((Sn, Ye) => {
3614
3623
  });
3615
3624
  }
3616
3625
  async startSession(e) {
3617
- const { code: r, filename: n, onMessage: a, queryParameters: s, userConfig: i } = e;
3626
+ const { code: r, filename: n, onMessage: s, queryParameters: a, userConfig: i } = e;
3618
3627
  self.messenger = {
3619
- callback: a
3620
- }, self.query_params = s, self.user_config = i;
3621
- const o = se.startSpan("startSession.runPython"), d = n || K.NOTEBOOK_FILENAME, [l, h, x] = this.requirePyodide.runPython(
3628
+ callback: s
3629
+ }, self.query_params = a, self.user_config = i;
3630
+ const o = ie.startSpan("startSession.runPython"), d = n || K.NOTEBOOK_FILENAME, [l, h, x] = this.requirePyodide.runPython(
3622
3631
  `
3623
3632
  print("[py] Starting marimo...")
3624
3633
  import asyncio
@@ -3660,13 +3669,13 @@ ${e}`, e = `import pygments
3660
3669
  ${e}`, e = `import jedi
3661
3670
  ${e}`, e = `import pyodide_http
3662
3671
  ${e}`;
3663
- const a = [...r];
3664
- let s = se.startSpan("pyodide.loadPackage");
3672
+ const s = [...r];
3673
+ let a = ie.startSpan("pyodide.loadPackage");
3665
3674
  await n.loadPackagesFromImports(e, {
3666
3675
  errorCallback: H.error,
3667
3676
  messageCallback: H.log
3668
- }), s.end(), s = se.startSpan("micropip.install");
3669
- const i = a.filter(
3677
+ }), a.end(), a = ie.startSpan("micropip.install");
3678
+ const i = s.filter(
3670
3679
  (o) => !n.loadedPackages[o]
3671
3680
  );
3672
3681
  i.length > 0 && await n.runPythonAsync(`
@@ -3679,10 +3688,10 @@ ${e}`;
3679
3688
  await micropip.install(missing)
3680
3689
  `).catch((o) => {
3681
3690
  H.error("Failed to load packages from micropip", o);
3682
- }), s.end();
3691
+ }), a.end();
3683
3692
  }
3684
3693
  }
3685
- class gn extends yn {
3694
+ class vn extends _n {
3686
3695
  async bootstrap(e) {
3687
3696
  return await super.bootstrap(e);
3688
3697
  }
@@ -3694,8 +3703,8 @@ ${e}`;
3694
3703
  code: r,
3695
3704
  filename: n
3696
3705
  });
3697
- } catch (a) {
3698
- H.error(a);
3706
+ } catch (s) {
3707
+ H.error(s);
3699
3708
  }
3700
3709
  return { code: r, filename: n };
3701
3710
  }
@@ -3705,46 +3714,46 @@ ${e}`;
3705
3714
  code: e.code,
3706
3715
  filename: e.filename,
3707
3716
  onMessage: e.onMessage,
3708
- userConfig: hn()
3717
+ userConfig: mn()
3709
3718
  });
3710
3719
  }
3711
3720
  }
3712
- async function _n() {
3713
- const t = kn(), e = Nr(t);
3721
+ async function kn() {
3722
+ const t = bn(), e = Rr(t);
3714
3723
  try {
3715
- self.controller = new gn(), self.pyodide = await self.controller.bootstrap({
3724
+ self.controller = new vn(), self.pyodide = await self.controller.bootstrap({
3716
3725
  version: t,
3717
3726
  pyodideVersion: e
3718
3727
  });
3719
3728
  } catch (r) {
3720
- H.error("Error bootstrapping", r), ue.send.initializedError({
3721
- error: Gt(r)
3729
+ H.error("Error bootstrapping", r), fe.send.initializedError({
3730
+ error: Kt(r)
3722
3731
  });
3723
3732
  }
3724
3733
  }
3725
- const Se = _n(), nr = new Rr(
3734
+ const Te = kn(), sr = new Cr(
3726
3735
  (t) => {
3727
- ue.send.kernelMessage({ message: t });
3736
+ fe.send.kernelMessage({ message: t });
3728
3737
  }
3729
- ), wt = new Ar(), vn = {
3738
+ ), xt = new Ir(), wn = {
3730
3739
  /**
3731
3740
  * Start the session
3732
3741
  */
3733
3742
  startSession: async (t) => {
3734
- await Se;
3743
+ await Te;
3735
3744
  try {
3736
- Kt(self.controller, "Controller not loaded");
3745
+ er(self.controller, "Controller not loaded");
3737
3746
  const e = await self.controller.mountFilesystem({
3738
3747
  code: t.code,
3739
3748
  filename: `app-${t.appId}.py`
3740
3749
  }), r = await self.controller.startSession({
3741
3750
  ...e,
3742
- onMessage: nr.push
3751
+ onMessage: sr.push
3743
3752
  });
3744
- wt.resolve(r), ue.send.initialized({});
3753
+ xt.resolve(r), fe.send.initialized({});
3745
3754
  } catch (e) {
3746
- ue.send.initializedError({
3747
- error: Gt(e)
3755
+ fe.send.initializedError({
3756
+ error: Kt(e)
3748
3757
  });
3749
3758
  }
3750
3759
  },
@@ -3752,7 +3761,7 @@ ${e}`;
3752
3761
  * Load packages
3753
3762
  */
3754
3763
  loadPackages: async (t) => {
3755
- await Se, t.includes("mo.sql") && (t = `import pandas
3764
+ await Te, t.includes("mo.sql") && (t = `import pandas
3756
3765
  ${t}`, t = `import duckdb
3757
3766
  ${t}`, t = `import sqlglot
3758
3767
  ${t}`, t.includes("polars") && (t = `import pyarrow
@@ -3765,28 +3774,28 @@ ${t}`)), await self.pyodide.loadPackagesFromImports(t, {
3765
3774
  * Call a function on the bridge
3766
3775
  */
3767
3776
  bridge: async (t) => {
3768
- await Se;
3769
- const { functionName: e, payload: r } = t, n = await wt.promise, a = r == null ? null : typeof r == "string" ? r : JSON.stringify(r), s = a == null ? (
3777
+ await Te;
3778
+ const { functionName: e, payload: r } = t, n = await xt.promise, s = r == null ? null : typeof r == "string" ? r : JSON.stringify(r), a = s == null ? (
3770
3779
  // @ts-expect-error ehh TypeScript
3771
3780
  await n[e]()
3772
3781
  ) : (
3773
3782
  // @ts-expect-error ehh TypeScript
3774
- await n[e](a)
3783
+ await n[e](s)
3775
3784
  );
3776
- return typeof s == "string" ? JSON.parse(s) : s;
3785
+ return typeof a == "string" ? JSON.parse(a) : a;
3777
3786
  }
3778
- }, ue = ur({
3779
- transport: mr({
3780
- transportId: yr
3787
+ }, fe = fr({
3788
+ transport: yr({
3789
+ transportId: gr
3781
3790
  }),
3782
- requestHandler: vn
3791
+ requestHandler: wn
3783
3792
  });
3784
- ue.send("ready", {});
3785
- ue.addMessageListener("consumerReady", async () => {
3786
- await Se, nr.start();
3793
+ fe.send("ready", {});
3794
+ fe.addMessageListener("consumerReady", async () => {
3795
+ await Te, sr.start();
3787
3796
  });
3788
- function kn() {
3797
+ function bn() {
3789
3798
  return self.name;
3790
3799
  }
3791
3800
  });
3792
- export default wn();
3801
+ export default xn();