@marimo-team/frontend 0.23.5-dev4 → 0.23.5-dev6

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 (280) hide show
  1. package/dist/assets/{CellStatus-PIeZtHEl.js → CellStatus-DKMrz26-.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-BPVOWDZX.js → ConnectedDataExplorerComponent-DNoHDaQW.js} +1 -1
  3. package/dist/assets/{DeferredRequestRegistry-DjHgMr3S.js → DeferredRequestRegistry-CUzZ0y7K.js} +1 -1
  4. package/dist/assets/{ImperativeModal-BBqcKmmk.js → ImperativeModal-D7lQ0Q7_.js} +1 -1
  5. package/dist/assets/{JsonOutput-CsshJCMI.js → JsonOutput-Bw-rSneQ.js} +7 -7
  6. package/dist/assets/{LazyAnyLanguageCodeMirror-0gZO1asr.js → LazyAnyLanguageCodeMirror-BF3xpDgO.js} +2 -2
  7. package/dist/assets/{MarimoErrorOutput-B9_RO5eX.js → MarimoErrorOutput-Dbk0HqOA.js} +2 -2
  8. package/dist/assets/{RSPContexts-BeHIgT4C.js → RSPContexts-CINae4Gg.js} +1 -1
  9. package/dist/assets/RenderHTML-8cI8zL5y.js +1 -0
  10. package/dist/assets/RunButton-DHxYW_jZ.js +1 -0
  11. package/dist/assets/{add-cell-with-ai-DjfY8mF1.js → add-cell-with-ai-DfniMbLM.js} +8 -8
  12. package/dist/assets/{add-connection-dialog-BY0poJft.js → add-connection-dialog-C14LN8_M.js} +6 -6
  13. package/dist/assets/{agent-panel-BvH5q5xP.js → agent-panel-CkK6oJn7.js} +3 -3
  14. package/dist/assets/{ai-model-dropdown-By4Ohb0R.js → ai-model-dropdown-BFTnsrTP.js} +4 -4
  15. package/dist/assets/{any-language-editor-uGTbJddl.js → any-language-editor-C9DM60EN.js} +1 -1
  16. package/dist/assets/{app-config-button-YS8lpoUa.js → app-config-button-c_2rVezv.js} +1 -1
  17. package/dist/assets/{architectureDiagram-VXUJARFQ-Bkuya2Lz.js → architectureDiagram-VXUJARFQ-JNogHSZh.js} +1 -1
  18. package/dist/assets/{blockDiagram-VD42YOAC-BypAXGhs.js → blockDiagram-VD42YOAC-Dy-_c6-H.js} +1 -1
  19. package/dist/assets/{c4Diagram-YG6GDRKO-C8Q7ceaK.js → c4Diagram-YG6GDRKO-DHRUX7S-.js} +1 -1
  20. package/dist/assets/{cache-panel-BHTrsFvx.js → cache-panel-B_zs00Q_.js} +1 -1
  21. package/dist/assets/{cell-editor-B43gqTef.js → cell-editor-F9uW-xZK.js} +10 -10
  22. package/dist/assets/{cell-link-d38hFEon.js → cell-link-BRdZl0OJ.js} +1 -1
  23. package/dist/assets/{cells-A-ljPpuj.js → cells-CcBfzJ1Z.js} +51 -51
  24. package/dist/assets/channel-CWEEnT6g.js +1 -0
  25. package/dist/assets/{chat-display-Be0U92hE.js → chat-display-NiFkPnNN.js} +1 -1
  26. package/dist/assets/{chat-panel-BEz970S3.js → chat-panel-C6V6gxrr.js} +1 -1
  27. package/dist/assets/{chat-ui-CdW7awFa.js → chat-ui-BLiRBYhk.js} +1 -1
  28. package/dist/assets/{chunk-5FQGJX7Z-B4RvNAGm.js → chunk-5FQGJX7Z-e_arGD4o.js} +3 -3
  29. package/dist/assets/{chunk-ABZYJK2D-X_7JfTbo.js → chunk-ABZYJK2D-BInZW7OW.js} +1 -1
  30. package/dist/assets/{chunk-ATLVNIR6-BvOe4C7U.js → chunk-ATLVNIR6-_9Zaw7IP.js} +1 -1
  31. package/dist/assets/{chunk-B4BG7PRW-DuJr4Vxg.js → chunk-B4BG7PRW-Bg43tpY1.js} +1 -1
  32. package/dist/assets/{chunk-DI55MBZ5-U7-ld--F.js → chunk-DI55MBZ5-DX01Gov5.js} +1 -1
  33. package/dist/assets/{chunk-EXTU4WIE-B7W_a4w2.js → chunk-EXTU4WIE-Cwo9-IiR.js} +1 -1
  34. package/dist/assets/{chunk-JA3XYJ7Z-EueUUcXO.js → chunk-JA3XYJ7Z-C6cvGHie.js} +1 -1
  35. package/dist/assets/{chunk-JZLCHNYA-Bx4SqpPS.js → chunk-JZLCHNYA-BM-e2D_8.js} +1 -1
  36. package/dist/assets/{chunk-N4CR4FBY-DlrBiMsl.js → chunk-N4CR4FBY-BREYOeLP.js} +2 -2
  37. package/dist/assets/{chunk-QN33PNHL-DQrYk9Fj.js → chunk-QN33PNHL-DwGffwWu.js} +1 -1
  38. package/dist/assets/{chunk-QXUST7PY-COkAFJCN.js → chunk-QXUST7PY-Q2jlSUop.js} +1 -1
  39. package/dist/assets/{chunk-S3R3BYOJ-GS_DuFun.js → chunk-S3R3BYOJ-DGKPoF4U.js} +1 -1
  40. package/dist/assets/{chunk-TZMSLE5B-uYzKNbMS.js → chunk-TZMSLE5B-Bfbjtd_W.js} +1 -1
  41. package/dist/assets/classDiagram-2ON5EDUG-CBbpzZPu.js +1 -0
  42. package/dist/assets/classDiagram-v2-WZHVMYZB-B0cWCuuo.js +1 -0
  43. package/dist/assets/{code-block-37QAKDTI-JYeq6pxz.js → code-block-37QAKDTI-CtU_48GW.js} +1 -1
  44. package/dist/assets/{column-preview-DUPpv2dz.js → column-preview-8uxaalCj.js} +1 -1
  45. package/dist/assets/{command-CXDOCJwp.js → command-CBCkexpx.js} +1 -1
  46. package/dist/assets/{command-palette-B5AX7Cgd.js → command-palette-DicMKinS.js} +1 -1
  47. package/dist/assets/{common-DC9LEIym.js → common-CHmdPmWi.js} +1 -1
  48. package/dist/assets/{components-FepcpFGL.js → components-DVKf_7RU.js} +1 -1
  49. package/dist/assets/{components-BDnRtsA5.js → components-HCInimq-.js} +1 -1
  50. package/dist/assets/{config-ChCHm539.js → config-DczIUz0b.js} +1 -1
  51. package/dist/assets/{context-DGqo1TbK.js → context-B3MsQb-b.js} +1 -1
  52. package/dist/assets/{copy-icon-C67c9EwB.js → copy-icon-BYNydU7b.js} +1 -1
  53. package/dist/assets/{dagre-6UL2VRFP-DYsFeXDU.js → dagre-6UL2VRFP-DWD6iJku.js} +1 -1
  54. package/dist/assets/{data-grid-overlay-editor-BXZECgKd.js → data-grid-overlay-editor-DvZ8PZ2g.js} +1 -1
  55. package/dist/assets/{datasource-BCnGIjqn.js → datasource-Czm_KBfK.js} +2 -2
  56. package/dist/assets/{dates-DhByPWH5.js → dates-CAlnO9QB.js} +1 -1
  57. package/dist/assets/{dependency-graph-panel-k1WQZ4m-.js → dependency-graph-panel-DPKylrlr.js} +4 -4
  58. package/dist/assets/{diagram-PSM6KHXK-B8hv9RHG.js → diagram-PSM6KHXK-B_Cc0ttH.js} +1 -1
  59. package/dist/assets/{diagram-QEK2KX5R-G6A7hdno.js → diagram-QEK2KX5R-DhI0d2dH.js} +1 -1
  60. package/dist/assets/{diagram-S2PKOQOG-iaflbF2c.js → diagram-S2PKOQOG-cc2LNQee.js} +1 -1
  61. package/dist/assets/{dist-gG4VZW46.js → dist-A6v5-U3i.js} +1 -1
  62. package/dist/assets/{dist-C46P-i95.js → dist-B96NwXcp.js} +1 -1
  63. package/dist/assets/dist-BVBYIAbx.js +1 -0
  64. package/dist/assets/{dist-BMfl634h.js → dist-C204e66A.js} +1 -1
  65. package/dist/assets/{dist-COpce3-f.js → dist-CEUFTp7U.js} +1 -1
  66. package/dist/assets/{dist-DmZscTVZ.js → dist-CGDn0y-i.js} +1 -1
  67. package/dist/assets/{dist-BMGjzUx5.js → dist-CmTrDl8w.js} +1 -1
  68. package/dist/assets/{dist-nYyvRYnq.js → dist-Cmcbyg5X.js} +1 -1
  69. package/dist/assets/dist-Cn0rcGlX.js +1 -0
  70. package/dist/assets/{dist-CVTRujA4.js → dist-CwZoXpmG.js} +1 -1
  71. package/dist/assets/{dist-D68AVdXh.js → dist-Cwcldbhl.js} +1 -1
  72. package/dist/assets/{dist-CEysMnMQ.js → dist-DBiqbYe-.js} +1 -1
  73. package/dist/assets/dist-DMSWEOfO.js +1 -0
  74. package/dist/assets/{dist-Ds4ite_2.js → dist-DQOq2Tf-.js} +1 -1
  75. package/dist/assets/dist-Dn_fCOGr.js +1 -0
  76. package/dist/assets/dist-Dq4wQg6C.js +1 -0
  77. package/dist/assets/{dist-DC5pDLoK.js → dist-Dw9UX7x1.js} +1 -1
  78. package/dist/assets/dist-R7_s36kw.js +1 -0
  79. package/dist/assets/{dist-b7WC6dxf.js → dist-RsQv8CvG.js} +1 -1
  80. package/dist/assets/{dist-OWcDq-O3.js → dist-_XomGjg6.js} +1 -1
  81. package/dist/assets/{dist-0xasIeT1.js → dist-_qPWf6sD.js} +1 -1
  82. package/dist/assets/{dist-BtG3xAGt.js → dist-rzeRelEY.js} +1 -1
  83. package/dist/assets/{documentation-panel-BMrGuByB.js → documentation-panel-DZkIKuPv.js} +1 -1
  84. package/dist/assets/{download-Iyng0xCz.js → download-YUQiaxS9.js} +3 -3
  85. package/dist/assets/edit-page-BQMW68AT.js +9 -0
  86. package/dist/assets/{erDiagram-Q2GNP2WA-DyZONgFt.js → erDiagram-Q2GNP2WA-CPtVWZYn.js} +1 -1
  87. package/dist/assets/{error-banner-CTBwdcdk.js → error-banner-C6aBa98y.js} +1 -1
  88. package/dist/assets/{error-panel-CHSsnRFF.js → error-panel-C4UQHEjp.js} +1 -1
  89. package/dist/assets/{es-YQvzKo5h.js → es-DaYh1PsD.js} +1 -1
  90. package/dist/assets/{esm-CbD72kxC.js → esm-BRNC35J6.js} +1 -1
  91. package/dist/assets/{esm-G1JMtvxe.js → esm-BmrwxxCo.js} +1 -1
  92. package/dist/assets/{field-B8kJgr2A.js → field-BrLPDxsA.js} +1 -1
  93. package/dist/assets/{file-explorer-panel-DSahRBWr.js → file-explorer-panel-DYZ3D_k4.js} +3 -3
  94. package/dist/assets/{file-icons-DTNZv05h.js → file-icons-CMxkj_kV.js} +1 -1
  95. package/dist/assets/{file-name-input-CLlFR7p-.js → file-name-input-B1tIGkqI.js} +1 -1
  96. package/dist/assets/{floating-outline-CSNGDMAm.js → floating-outline-BtNnv2IX.js} +1 -1
  97. package/dist/assets/{flowDiagram-NV44I4VS-Bo2Wh9OF.js → flowDiagram-NV44I4VS-LeaIbfPS.js} +1 -1
  98. package/dist/assets/{focus-Baz7rlo0.js → focus-CXQpR65O.js} +1 -1
  99. package/dist/assets/{form-0wZOuqB-.js → form-x5lqxs04.js} +2 -2
  100. package/dist/assets/{formats-BvyJSIqk.js → formats-Dsc8AdCp.js} +1 -1
  101. package/dist/assets/{formatting-Cncf6ptO.js → formatting-TmuwpwTs.js} +1 -1
  102. package/dist/assets/{gallery-page-Ddl87lwR.js → gallery-page-C4kMatxN.js} +1 -1
  103. package/dist/assets/{ganttDiagram-JELNMOA3-Cc_BiCCk.js → ganttDiagram-JELNMOA3-Bj-STLOZ.js} +1 -1
  104. package/dist/assets/{gitGraphDiagram-V2S2FVAM-CGySG6ni.js → gitGraphDiagram-V2S2FVAM-B9HDL4DZ.js} +1 -1
  105. package/dist/assets/{glide-data-editor-Cr2RvoIz.js → glide-data-editor-CxV4Ph39.js} +4 -4
  106. package/dist/assets/{globals-xVhZei_S.js → globals-B-ZMi0ZU.js} +1 -1
  107. package/dist/assets/{home-page-QvO22-4u.js → home-page--11ZbFKt.js} +2 -2
  108. package/dist/assets/{hooks-BZOcKMEB.js → hooks-Dj8Y1kvn.js} +1 -1
  109. package/dist/assets/{square-Dj2Cf4ne.js → house-mGK3v0Mm.js} +1 -1
  110. package/dist/assets/{html-to-image-tbPEMBJg.js → html-to-image-BHdf1t5J.js} +1 -1
  111. package/dist/assets/{index-D48a2kB0.js → index-v7m3JjDM.js} +7 -7
  112. package/dist/assets/{infoDiagram-HS3SLOUP-Ci2MRh_P.js → infoDiagram-HS3SLOUP-BDcw9LMK.js} +1 -1
  113. package/dist/assets/{input-DyPS_GiK.js → input-BX98vgAu.js} +1 -1
  114. package/dist/assets/{journeyDiagram-XKPGCS4Q-C9-9zg54.js → journeyDiagram-XKPGCS4Q-D29tj64e.js} +1 -1
  115. package/dist/assets/{kanban-definition-3W4ZIXB7-D4ivIK0L.js → kanban-definition-3W4ZIXB7-DStZ4tGj.js} +1 -1
  116. package/dist/assets/{kiosk-mode-cWTXpegb.js → kiosk-mode-vHMq9vr1.js} +1 -1
  117. package/dist/assets/layout-D-cLXGXf.js +9 -0
  118. package/dist/assets/{linear-Bn2iRj5i.js → linear-Cof2JLCQ.js} +1 -1
  119. package/dist/assets/{links-BHtUMVOq.js → links-iy4RlM-h.js} +1 -1
  120. package/dist/assets/{logs-panel-Dgkr6V7q.js → logs-panel-DL9WeQsv.js} +1 -1
  121. package/dist/assets/{markdown-renderer-CFrgiLqu.js → markdown-renderer-DmnGXdCp.js} +3 -3
  122. package/dist/assets/mermaid-4DMBBIKO-gHC2PS1m.js +1 -0
  123. package/dist/assets/{mermaid-D5Aj1ujy.js → mermaid-CXmjgj4p.js} +3 -3
  124. package/dist/assets/{mermaid-parser.core-DP6UBthl.js → mermaid-parser.core-BQULBKwL.js} +1 -1
  125. package/dist/assets/{mindmap-definition-VGOIOE7T-BBFkIzCl.js → mindmap-definition-VGOIOE7T-Cy9nt356.js} +1 -1
  126. package/dist/assets/{name-cell-input-C5LXTI3T.js → name-cell-input-CHuLB3H7.js} +1 -1
  127. package/dist/assets/{number-overlay-editor-Cu1bME8q.js → number-overlay-editor-8-GuvfJX.js} +1 -1
  128. package/dist/assets/{outline-panel-0lyts6z4.js → outline-panel-JaSUHnmD.js} +1 -1
  129. package/dist/assets/{packages-panel-BhI1lbfw.js → packages-panel-BB5_Iu2c.js} +1 -1
  130. package/dist/assets/{panels-8fPdoW9_.js → panels-LnVrD2Ph.js} +1 -1
  131. package/dist/assets/{pathUtils-CSrNy17a.js → pathUtils-DOhgNpTR.js} +1 -1
  132. package/dist/assets/{pieDiagram-ADFJNKIX-BYGTzW8w.js → pieDiagram-ADFJNKIX-CqhovvcK.js} +1 -1
  133. package/dist/assets/{precisionRound-CU2C3Vxx.js → precisionRound-C3fmBb6j.js} +1 -1
  134. package/dist/assets/{process-output-BwZ5VxXO.js → process-output-hJso9ugZ.js} +1 -1
  135. package/dist/assets/{quadrantDiagram-AYHSOK5B-D8NZ19FM.js → quadrantDiagram-AYHSOK5B-BNyiC3hL.js} +1 -1
  136. package/dist/assets/radio-group-6t7ozlnG.js +1 -0
  137. package/dist/assets/react-vega-C1LnPwEN.js +1 -0
  138. package/dist/assets/{react-vega-BQXvtE5G.js → react-vega-SibldZnp.js} +1 -1
  139. package/dist/assets/readonly-python-code-JBCsN3-9.js +1 -0
  140. package/dist/assets/{renderShortcut-CkNNAheg.js → renderShortcut-DZpkrZaP.js} +1 -1
  141. package/dist/assets/{request-registry-D-jptgP0.js → request-registry-BwzANGxx.js} +1 -1
  142. package/dist/assets/{requirementDiagram-UZGBJVZJ-lUcxJMXj.js → requirementDiagram-UZGBJVZJ-U4CoEx7e.js} +1 -1
  143. package/dist/assets/{reveal-component-LHeN9pMI.css → reveal-component-CMD1_gk8.css} +1 -1
  144. package/dist/assets/reveal-component-DvnP8FBq.js +91 -0
  145. package/dist/assets/{run-page-x3v_5tzv.js → run-page-DMkxXk3G.js} +1 -1
  146. package/dist/assets/{sankeyDiagram-TZEHDZUN-BJExQFWg.js → sankeyDiagram-TZEHDZUN-BXgCc5j4.js} +1 -1
  147. package/dist/assets/scratchpad-panel-CpKz-ArR.js +1 -0
  148. package/dist/assets/{secrets-panel-DeNY3rAp.js → secrets-panel-DaR50P_m.js} +1 -1
  149. package/dist/assets/{sequenceDiagram-WL72ISMW-DcfyJdc2.js → sequenceDiagram-WL72ISMW-CB8apKmu.js} +1 -1
  150. package/dist/assets/session-panel-DF0m0wH3.js +1 -0
  151. package/dist/assets/{share-BXN2Sd1t.js → share-DIVpiHPe.js} +1 -1
  152. package/dist/assets/{snippets-panel-CnN632Ki.js → snippets-panel-CQKr-OMs.js} +1 -1
  153. package/dist/assets/square-DMaNzePN.js +1 -0
  154. package/dist/assets/{state-svfaehZt.js → state-B34hXjp9.js} +1 -1
  155. package/dist/assets/{state-CikXvgx3.js → state-CraSoEHI.js} +3 -3
  156. package/dist/assets/{state-Bsz477is.js → state-DCT6JLba.js} +1 -1
  157. package/dist/assets/{state-CoWk7q5y.js → state-Z-H4o98V.js} +1 -1
  158. package/dist/assets/{stateDiagram-FKZM4ZOC-D379CBmo.js → stateDiagram-FKZM4ZOC-3YqeHe0_.js} +1 -1
  159. package/dist/assets/stateDiagram-v2-4FDKWEC3-Dfvjjqh4.js +1 -0
  160. package/dist/assets/stex-D6sqtveI.js +1 -0
  161. package/dist/assets/{swiper-component-DLxR3y4N.js → swiper-component-B-P7FNP9.js} +1 -1
  162. package/dist/assets/{switch-DlgpDZMk.js → switch-ecwOrzz3.js} +1 -1
  163. package/dist/assets/{terminal-D8ZS2O18.js → terminal-CQZ69wrS.js} +1 -1
  164. package/dist/assets/{textarea-Dd0InTQJ.js → textarea-BI_mXP9w.js} +1 -1
  165. package/dist/assets/{time-yM1OtSdb.js → time-C12vLLcl.js} +1 -1
  166. package/dist/assets/{timeline-definition-IT6M3QCI-ChCqM1Sl.js → timeline-definition-IT6M3QCI-DZQqxPSn.js} +1 -1
  167. package/dist/assets/{tracing-BZPLfSlB.js → tracing-BF-ca60a.js} +1 -1
  168. package/dist/assets/{tracing-panel-DBaQBraG.js → tracing-panel-D1j7Fbvr.js} +2 -2
  169. package/dist/assets/{tree-actions-oMCx6WNc.js → tree-actions-Ci3CV3hN.js} +1 -1
  170. package/dist/assets/{useBoolean-CLFdHewv.js → useBoolean-B_vDzBHf.js} +1 -1
  171. package/dist/assets/useCellActionButton-CcXV09GQ.js +1 -0
  172. package/dist/assets/{useDateFormatter-BEz9SEXo.js → useDateFormatter-CgFoBhVq.js} +1 -1
  173. package/dist/assets/{useDeleteCell-C2Stbb6Q.js → useDeleteCell-BVX9aH-t.js} +1 -1
  174. package/dist/assets/{useDependencyPanelTab-8WaMRWbo.js → useDependencyPanelTab-CewdyAAy.js} +1 -1
  175. package/dist/assets/{useInstallPackage-afgh7PwB.js → useInstallPackage-D0NLybAx.js} +1 -1
  176. package/dist/assets/useNotebookActions-CTBSmORR.js +1 -0
  177. package/dist/assets/{useNumberFormatter-wQU1z0W_.js → useNumberFormatter-DtiQW2H_.js} +1 -1
  178. package/dist/assets/{usePress-CtfZXGno.js → usePress-CfcdTqJM.js} +1 -1
  179. package/dist/assets/useRunCells-CgXnbA14.js +1 -0
  180. package/dist/assets/{useSplitCell-BZPuhd8z.js → useSplitCell-_Q2wQXsQ.js} +1 -1
  181. package/dist/assets/{utils-Bq5kLQ87.js → utils-CGtUbqcR.js} +1 -1
  182. package/dist/assets/{vega-component-BnaMdpJB.js → vega-component-BDK4MwYT.js} +1 -1
  183. package/dist/assets/{vega-loader.browser-DXARUlxo.js → vega-loader.browser-BegSZk0G.js} +1 -1
  184. package/dist/assets/{write-secret-modal-BfflSuL6.js → write-secret-modal-BFLUPDlo.js} +1 -1
  185. package/dist/assets/{xychartDiagram-PRI3JC2R-DVMdJM5H.js → xychartDiagram-PRI3JC2R-CmNNcgCM.js} +1 -1
  186. package/dist/index.html +105 -105
  187. package/package.json +1 -1
  188. package/src/components/editor/notebook-cell.tsx +33 -23
  189. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +3 -5
  190. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +2 -17
  191. package/src/components/slides/reveal-component.tsx +159 -47
  192. package/src/components/slides/reveal-slides.css +8 -0
  193. package/src/components/slides/slide-cell-view.tsx +182 -0
  194. package/src/components/slides/slide-form.tsx +2 -0
  195. package/src/core/cells/utils.ts +45 -0
  196. package/src/core/islands/stubs/slide-cell-view.tsx +30 -0
  197. package/src/core/meta/__tests__/code-visibility.test.tsx +141 -0
  198. package/src/core/meta/code-visibility.ts +48 -0
  199. package/dist/assets/RenderHTML-DR6lqJGS.js +0 -1
  200. package/dist/assets/channel-BMMN1KqZ.js +0 -1
  201. package/dist/assets/classDiagram-2ON5EDUG-DDa_MJVI.js +0 -1
  202. package/dist/assets/classDiagram-v2-WZHVMYZB-dZzbS5Uq.js +0 -1
  203. package/dist/assets/dist-BN_qisx5.js +0 -1
  204. package/dist/assets/dist-Bzlk7AB1.js +0 -1
  205. package/dist/assets/dist-CPCp_PIz.js +0 -1
  206. package/dist/assets/dist-CPWl1X8t.js +0 -1
  207. package/dist/assets/dist-Cc_qFbl6.js +0 -1
  208. package/dist/assets/dist-Crt3qZze.js +0 -1
  209. package/dist/assets/edit-page-Lwy52pkS.js +0 -9
  210. package/dist/assets/layout-DXt0aA4F.js +0 -9
  211. package/dist/assets/mermaid-4DMBBIKO-BqnaUv4V.js +0 -1
  212. package/dist/assets/radio-group-BtBoRbGH.js +0 -1
  213. package/dist/assets/react-vega-BVATzlrQ.js +0 -1
  214. package/dist/assets/readonly-python-code-B0nrQE3U.js +0 -1
  215. package/dist/assets/reveal-component-CgCn23Mw.js +0 -91
  216. package/dist/assets/scratchpad-panel-CHFYLvso.js +0 -1
  217. package/dist/assets/session-panel-DMaf7Upn.js +0 -1
  218. package/dist/assets/slide-form-Dmi4fzLs.js +0 -1
  219. package/dist/assets/stateDiagram-v2-4FDKWEC3-c0yeJ4is.js +0 -1
  220. package/dist/assets/stex-Dn4qnyVB.js +0 -1
  221. package/dist/assets/useAddCell-De9xD63_.js +0 -1
  222. package/dist/assets/useCellActionButton-Bjxun3wK.js +0 -1
  223. package/dist/assets/useNotebookActions-v4SgyM_0.js +0 -1
  224. package/dist/assets/useRunCells-DU1tawR-.js +0 -1
  225. /package/dist/assets/{Deferred-DxQeE5uh.js → Deferred-DMWKlZOV.js} +0 -0
  226. /package/dist/assets/{SSRProvider-D3zWcDme.js → SSRProvider-kyGHZp36.js} +0 -0
  227. /package/dist/assets/{alert-cDholnQq.js → alert-DvqcBMUv.js} +0 -0
  228. /package/dist/assets/{badge-ChrPsdTW.js → badge-C7-HR1IO.js} +0 -0
  229. /package/dist/assets/{blob-CTort_or.js → blob-D-eV0cU3.js} +0 -0
  230. /package/dist/assets/{bundle.esm-DU-4isVC.js → bundle.esm-BIoPrMH_.js} +0 -0
  231. /package/dist/assets/{copy-B5qyZn5s.js → copy-BCF-tANo.js} +0 -0
  232. /package/dist/assets/{copy-Dk_3y0H-.js → copy-BwrPA9zQ.js} +0 -0
  233. /package/dist/assets/{database-zap-BUVn5HoR.js → database-zap-kIkTfzTX.js} +0 -0
  234. /package/dist/assets/{defaultLocale-BLne0bXb.js → defaultLocale-B6z1Qyqt.js} +0 -0
  235. /package/dist/assets/{defaultLocale-JieDVWC_.js → defaultLocale-YteS-k_t.js} +0 -0
  236. /package/dist/assets/{dialog-EekxpBBM.js → dialog-Dj0qTFnG.js} +0 -0
  237. /package/dist/assets/{dist-CRPTyqAT.js → dist-B324sPca.js} +0 -0
  238. /package/dist/assets/{dist-DZ2qbK2N.js → dist-E6ttb8td.js} +0 -0
  239. /package/dist/assets/{dist-DGxytjtv.js → dist-VjDnmGCZ.js} +0 -0
  240. /package/dist/assets/{ellipsis-pk06Lq82.js → ellipsis-KAhMaCIV.js} +0 -0
  241. /package/dist/assets/{ellipsis-vertical-gxgNyR5G.js → ellipsis-vertical-CkwWkOQL.js} +0 -0
  242. /package/dist/assets/{emotion-is-prop-valid.esm-DYxi7n2b.js → emotion-is-prop-valid.esm-DD4AwVTU.js} +0 -0
  243. /package/dist/assets/{en-US-BqRooSzc.js → en-US-D_il4jD7.js} +0 -0
  244. /package/dist/assets/{errors-CZb6hI2x.js → errors-TZBmrJmc.js} +0 -0
  245. /package/dist/assets/{events-Qeh-bHlj.js → events-BRAWQiYK.js} +0 -0
  246. /package/dist/assets/{extends-Co37_JfG.js → extends-B2LJnKU3.js} +0 -0
  247. /package/dist/assets/{eye-off-BT-KOYV5.js → eye-off-n1Li95bE.js} +0 -0
  248. /package/dist/assets/{file-HTLbeC2b.js → file-BrdxGLRX.js} +0 -0
  249. /package/dist/assets/{file-headphone-B3fuktN0.js → file-headphone-BrQspHac.js} +0 -0
  250. /package/dist/assets/{github-raQvpeuZ.js → github-BKS_2Qwn.js} +0 -0
  251. /package/dist/assets/{icons-BRopQwI3.js → icons-D9TuFTJG.js} +0 -0
  252. /package/dist/assets/{isValid-bmSEa3HX.js → isValid-C8T5uJYI.js} +0 -0
  253. /package/dist/assets/{kbd-CGShmG7L.js → kbd-B3Breaz2.js} +0 -0
  254. /package/dist/assets/{links-C-rLiK3d.js → links-Dpap8NI2.js} +0 -0
  255. /package/dist/assets/{micromark-factory-space-WzovnJik.js → micromark-factory-space-DzSMahmM.js} +0 -0
  256. /package/dist/assets/{numbers-OHL_xBiC.js → numbers-CAW8yjzj.js} +0 -0
  257. /package/dist/assets/{objectWithoutPropertiesLoose-smPWkHxB.js → objectWithoutPropertiesLoose-DaPAPabU.js} +0 -0
  258. /package/dist/assets/{ordinal-DEaY__23.js → ordinal-K0JYqmCT.js} +0 -0
  259. /package/dist/assets/{paths-CXng2XQv.js → paths-BXWH6vv4.js} +0 -0
  260. /package/dist/assets/{preload-helper-D2MJg03u.js → preload-helper-DItdS47A.js} +0 -0
  261. /package/dist/assets/{prop-types-BFRDxSKF.js → prop-types-BiQYf0aU.js} +0 -0
  262. /package/dist/assets/{purify.es-DC4RGS9t.js → purify.es-DBmVz-Wl.js} +0 -0
  263. /package/dist/assets/{range-1DwpgXvM.js → range-7fnH_zLA.js} +0 -0
  264. /package/dist/assets/{react-icons.esm-BUYTQ32a.js → react-icons.esm-D9xfKaPZ.js} +0 -0
  265. /package/dist/assets/{react-resizable-panels.browser.esm-Bcm5njwd.js → react-resizable-panels.browser.esm-BUNcfKXO.js} +0 -0
  266. /package/dist/assets/{session-nmTRerwF.js → session-VtovaFBS.js} +0 -0
  267. /package/dist/assets/{stex-jWatZkll.js → stex-CtmkcLz7.js} +0 -0
  268. /package/dist/assets/{table-23NNA1s9.js → table-DPyRV1LT.js} +0 -0
  269. /package/dist/assets/{trash-2-D280Xiwg.js → trash-2-CKlZA04n.js} +0 -0
  270. /package/dist/assets/{trash-uYoPsR8D.js → trash-CdBDfa8x.js} +0 -0
  271. /package/dist/assets/{triangle-alert-DBoAWWKA.js → triangle-alert-B8l157gP.js} +0 -0
  272. /package/dist/assets/{use-toast-BDYuj3zG.js → use-toast-T0_cQDma.js} +0 -0
  273. /package/dist/assets/{useAsyncData-dS4Ne6pU.js → useAsyncData-BFC6lWG9.js} +0 -0
  274. /package/dist/assets/{useDebounce-BDIglWmG.js → useDebounce-CLMpJfhX.js} +0 -0
  275. /package/dist/assets/{useHotkey-Bx4wWQCL.js → useHotkey-Cm0DaHEJ.js} +0 -0
  276. /package/dist/assets/{useIframeCapabilities-CryCjoyY.js → useIframeCapabilities-BvE4n6hj.js} +0 -0
  277. /package/dist/assets/{useTheme-DEcgJENn.js → useTheme-Cb4Wekek.js} +0 -0
  278. /package/dist/assets/{uuid-DXdzqzcr.js → uuid-DercMavo.js} +0 -0
  279. /package/dist/assets/{workflow-DYcZF-oV.js → workflow-ClChd5xI.js} +0 -0
  280. /package/dist/assets/{youtube-3lRHw8NU.js → youtube-CbdpN8oL.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-uGTbJddl.js","./copy-icon-C67c9EwB.js","./button-D9nb17Rw.js","./useEventListener-BR0C1MaI.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-BqBOg78p.js","./cn-DCUzRj2J.js","./clsx-Dz_KRrWq.js","./tooltip-Gcwqb_SK.js","./fullscreen-BDxedMYP.js","./react-dom-CSu739Rf.js","./dist-BoOh2kN5.js","./use-toast-BDYuj3zG.js","./copy-B5qyZn5s.js","./check-BH35Ndha.js","./createLucideIcon-D5guW7EU.js","./copy-Dk_3y0H-.js","./error-banner-CTBwdcdk.js","./alert-dialog-BGBdrcqJ.js","./errors-CZb6hI2x.js","./zod-H_cgTO0M.js","./dist-DS5RCKZO.js","./dist-BrR4M-k3.js","./dist-DGxytjtv.js","./dist-9g-_Ln9y.js","./dist-HlsDto3K.js","./dist-CEysMnMQ.js","./dist-DZ2qbK2N.js","./dist-DBBYmRY4.js","./dist-DggusHaA.js","./dist-Ds4ite_2.js","./dist-DmZscTVZ.js","./dist-CRPTyqAT.js","./dist-CsEqrZxx.js","./dist-OWcDq-O3.js","./dist-ooLAQ9IK.js","./dist-HW7R98td.js","./esm-G1JMtvxe.js","./extends-Co37_JfG.js","./objectWithoutPropertiesLoose-smPWkHxB.js","./dist-CHcznzB-.js","./esm-CbD72kxC.js","./dist-COpce3-f.js","./dist-0xasIeT1.js","./dist-C46P-i95.js","./dist-C9ZB41s2.js","./dist-BtG3xAGt.js","./dist-D6wwIjcW.js","./apl-T0uH_RjM.js","./asciiarmor-D3ol7c2G.js","./asn1-DA-fXXsk.js","./brainfuck-exn1QR7H.js","./clike-BK27e5qn.js","./clojure-Df1U5nhC.js","./cmake-DrCf0yvp.js","./cobol-BWxHqof4.js","./coffeescript-nKvg8y_U.js","./commonlisp-Dm562cBV.js","./crystal-CrCmK2Cb.js","./css-jpfGFPDE.js","./cypher-RQ5M28al.js","./d-CNQ_nPqU.js","./diff-DOODcY7A.js","./dtd-CRYKjxdR.js","./dylan-Bg0sO2y3.js","./ecl-DaBeV7OZ.js","./eiffel-BtJc6fqQ.js","./elm-D9Rly7Qq.js","./erlang-FZMRuv-7.js","./factor-BbYo7zsD.js","./simple-mode-BJAT_N3M.js","./forth-C6jh4lHA.js","./fortran-DuxTe5qi.js","./gas-D7RWbiQ0.js","./gherkin-DV4l4nlf.js","./groovy-Ij7mXzwd.js","./haskell-BT_ZNgUJ.js","./haxe-DYYwGmM8.js","./idl-CjBvIccU.js","./javascript-DQz7szA1.js","./julia-U0NSUEwm.js","./livescript-D7jeebX7.js","./lua-CT4vrRvN.js","./mathematica-DmzlinOc.js","./mbox-DYDL20A1.js","./mirc-6LiBC6Dw.js","./mllike-orSu1SHG.js","./modelica-BsibU-7c.js","./mscgen-vX4NsSXf.js","./mumps-DIZYQE11.js","./nsis-Cr8jf68z.js","./ntriples-CwlUIE0o.js","./octave-BWtN_wao.js","./oz-CJMVKlqL.js","./pascal-C9rPtth-.js","./perl-CF7pKLbl.js","./pig-Bu0nn8JT.js","./powershell-Bzwpi8yQ.js","./properties-Cfh_Lj0j.js","./protobuf-Vz3fs9Hb.js","./pug-CKg66ZCy.js","./puppet-JwSHf4DX.js","./python-BRHQZrcc.js","./q-DWFQ7YI_.js","./r-DHkTNFL2.js","./rpm-zbaZz_dk.js","./ruby-COvM5Bj_.js","./sas-Be8P6y_s.js","./scheme-B9Zors0b.js","./shell-CaaQwZ-W.js","./sieve-CdflT_3W.js","./smalltalk-CRO88y3z.js","./sparql-DEker8ZS.js","./stex-jWatZkll.js","./stylus-DAJwnVOa.js","./swift-D5F-FU3-.js","./tcl-DirNbhYm.js","./textile-DhHo4rKl.js","./toml-CrP9HWVu.js","./troff-BWD1WiE0.js","./ttcn-cfg-jzTcqwRW.js","./ttcn-CQzcRj0D.js","./turtle-BAqH2D2z.js","./vb-CrUpzy4g.js","./vbscript-DEuHZ0Y0.js","./velocity-D99sTvXl.js","./verilog-XWBMMjwd.js","./vhdl-BAGmVXDV.js","./webidl-xagG_7hd.js","./xquery-B8Mguhly.js","./yacas-XW2NxGKw.js","./z80-DhICfTcL.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-D5guW7EU.js";import{t as m}from"./preload-helper-D2MJg03u.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor-uGTbJddl.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133]),import.meta.url))})();export{s as __tla,r as n,a as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-C9DM60EN.js","./copy-icon-BYNydU7b.js","./button-D9nb17Rw.js","./useEventListener-BR0C1MaI.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-BqBOg78p.js","./cn-DCUzRj2J.js","./clsx-Dz_KRrWq.js","./tooltip-Gcwqb_SK.js","./fullscreen-BDxedMYP.js","./react-dom-CSu739Rf.js","./dist-BoOh2kN5.js","./use-toast-T0_cQDma.js","./copy-BCF-tANo.js","./check-BH35Ndha.js","./createLucideIcon-D5guW7EU.js","./copy-BwrPA9zQ.js","./error-banner-C6aBa98y.js","./alert-dialog-BGBdrcqJ.js","./errors-TZBmrJmc.js","./zod-H_cgTO0M.js","./dist-DS5RCKZO.js","./dist-BrR4M-k3.js","./dist-VjDnmGCZ.js","./dist-9g-_Ln9y.js","./dist-HlsDto3K.js","./dist-DBiqbYe-.js","./dist-E6ttb8td.js","./dist-DBBYmRY4.js","./dist-DggusHaA.js","./dist-DQOq2Tf-.js","./dist-CGDn0y-i.js","./dist-B324sPca.js","./dist-CsEqrZxx.js","./dist-_XomGjg6.js","./dist-ooLAQ9IK.js","./dist-HW7R98td.js","./esm-BmrwxxCo.js","./extends-B2LJnKU3.js","./objectWithoutPropertiesLoose-DaPAPabU.js","./dist-CHcznzB-.js","./esm-BRNC35J6.js","./dist-CEUFTp7U.js","./dist-_qPWf6sD.js","./dist-B96NwXcp.js","./dist-C9ZB41s2.js","./dist-rzeRelEY.js","./dist-D6wwIjcW.js","./apl-T0uH_RjM.js","./asciiarmor-D3ol7c2G.js","./asn1-DA-fXXsk.js","./brainfuck-exn1QR7H.js","./clike-BK27e5qn.js","./clojure-Df1U5nhC.js","./cmake-DrCf0yvp.js","./cobol-BWxHqof4.js","./coffeescript-nKvg8y_U.js","./commonlisp-Dm562cBV.js","./crystal-CrCmK2Cb.js","./css-jpfGFPDE.js","./cypher-RQ5M28al.js","./d-CNQ_nPqU.js","./diff-DOODcY7A.js","./dtd-CRYKjxdR.js","./dylan-Bg0sO2y3.js","./ecl-DaBeV7OZ.js","./eiffel-BtJc6fqQ.js","./elm-D9Rly7Qq.js","./erlang-FZMRuv-7.js","./factor-BbYo7zsD.js","./simple-mode-BJAT_N3M.js","./forth-C6jh4lHA.js","./fortran-DuxTe5qi.js","./gas-D7RWbiQ0.js","./gherkin-DV4l4nlf.js","./groovy-Ij7mXzwd.js","./haskell-BT_ZNgUJ.js","./haxe-DYYwGmM8.js","./idl-CjBvIccU.js","./javascript-DQz7szA1.js","./julia-U0NSUEwm.js","./livescript-D7jeebX7.js","./lua-CT4vrRvN.js","./mathematica-DmzlinOc.js","./mbox-DYDL20A1.js","./mirc-6LiBC6Dw.js","./mllike-orSu1SHG.js","./modelica-BsibU-7c.js","./mscgen-vX4NsSXf.js","./mumps-DIZYQE11.js","./nsis-Cr8jf68z.js","./ntriples-CwlUIE0o.js","./octave-BWtN_wao.js","./oz-CJMVKlqL.js","./pascal-C9rPtth-.js","./perl-CF7pKLbl.js","./pig-Bu0nn8JT.js","./powershell-Bzwpi8yQ.js","./properties-Cfh_Lj0j.js","./protobuf-Vz3fs9Hb.js","./pug-CKg66ZCy.js","./puppet-JwSHf4DX.js","./python-BRHQZrcc.js","./q-DWFQ7YI_.js","./r-DHkTNFL2.js","./rpm-zbaZz_dk.js","./ruby-COvM5Bj_.js","./sas-Be8P6y_s.js","./scheme-B9Zors0b.js","./shell-CaaQwZ-W.js","./sieve-CdflT_3W.js","./smalltalk-CRO88y3z.js","./sparql-DEker8ZS.js","./stex-CtmkcLz7.js","./stylus-DAJwnVOa.js","./swift-D5F-FU3-.js","./tcl-DirNbhYm.js","./textile-DhHo4rKl.js","./toml-CrP9HWVu.js","./troff-BWD1WiE0.js","./ttcn-cfg-jzTcqwRW.js","./ttcn-CQzcRj0D.js","./turtle-BAqH2D2z.js","./vb-CrUpzy4g.js","./vbscript-DEuHZ0Y0.js","./velocity-D99sTvXl.js","./verilog-XWBMMjwd.js","./vhdl-BAGmVXDV.js","./webidl-xagG_7hd.js","./xquery-B8Mguhly.js","./yacas-XW2NxGKw.js","./z80-DhICfTcL.js"])))=>i.map(i=>d[i]);
2
+ import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-D5guW7EU.js";import{t as m}from"./preload-helper-DItdS47A.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor-C9DM60EN.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133]),import.meta.url))})();export{s as __tla,r as n,a as t};
@@ -1,7 +1,7 @@
1
- import{s as J}from"./chunk-LvLJmgfZ.js";import{d as ve,f as Ne,l as be,u as ke}from"./useEvent-D91BmmQi.js";import{t as we}from"./react-Bj1aDYRI.js";import{E as Ie,Nn as $e,Tn as _e,ai as Fe,ar as Te,b as Ae,nt as Ce,oi as K,yi as Se}from"./cells-A-ljPpuj.js";import{t as q}from"./compiler-runtime-B3qBwwSJ.js";import{t as Me}from"./invariant-BUdrueMv.js";import{r as ze}from"./utils-DIGrmLDO.js";import{t as X}from"./cn-DCUzRj2J.js";import{t as Ee}from"./jsx-runtime-BqBOg78p.js";import{a as qe,i as Pe,n as Le,r as We}from"./multi-map-rafH3cg3.js";import{a as Ve,p as Be,r as Qe,t as De}from"./dropdown-menu-D1A3cFC8.js";import{t as Y}from"./tooltip-Gcwqb_SK.js";import{r as Z,t as $}from"./button-D9nb17Rw.js";import{t as H}from"./createLucideIcon-D5guW7EU.js";import{r as Oe}from"./x-C-6liIBr.js";import{t as He}from"./sparkles-CZ5WmLPA.js";import{c as ee,n as Ue}from"./datasource-BCnGIjqn.js";import{a as Re}from"./dist-CRPTyqAT.js";import{t as te}from"./RenderHTML-DR6lqJGS.js";import{t as re}from"./kbd-CGShmG7L.js";import{t as T}from"./links-C-rLiK3d.js";import{r as Ge,t as Je}from"./alert-cDholnQq.js";import{o as Ke,t as Xe}from"./useInstallPackage-afgh7PwB.js";import{n as Ye}from"./state-Bsz477is.js";import{n as b}from"./cell-link-d38hFEon.js";var Ze=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),A=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),se=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function et(t){let e=null,s=t.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function tt(t){let e=t.split(`
1
+ import{s as J}from"./chunk-LvLJmgfZ.js";import{d as ve,f as Ne,l as be,u as ke}from"./useEvent-D91BmmQi.js";import{t as we}from"./react-Bj1aDYRI.js";import{E as Ie,En as $e,Pn as _e,Si as Fe,b as Ae,ci as Te,li as K,nt as Ce,or as Se}from"./cells-CcBfzJ1Z.js";import{t as q}from"./compiler-runtime-B3qBwwSJ.js";import{t as Me}from"./invariant-BUdrueMv.js";import{r as Ee}from"./utils-DIGrmLDO.js";import{t as X}from"./cn-DCUzRj2J.js";import{t as ze}from"./jsx-runtime-BqBOg78p.js";import{a as qe,i as Pe,n as Le,r as We}from"./multi-map-rafH3cg3.js";import{a as Ve,p as Be,r as Qe,t as De}from"./dropdown-menu-D1A3cFC8.js";import{t as Y}from"./tooltip-Gcwqb_SK.js";import{r as Z,t as $}from"./button-D9nb17Rw.js";import{t as H}from"./createLucideIcon-D5guW7EU.js";import{r as Oe}from"./x-C-6liIBr.js";import{t as He}from"./sparkles-CZ5WmLPA.js";import{c as ee,n as Ue}from"./datasource-Czm_KBfK.js";import{a as Re}from"./dist-B324sPca.js";import{t as te}from"./RenderHTML-8cI8zL5y.js";import{t as re}from"./kbd-B3Breaz2.js";import{t as A}from"./links-Dpap8NI2.js";import{r as Ge,t as Je}from"./alert-DvqcBMUv.js";import{o as Ke,t as Xe}from"./useInstallPackage-D0NLybAx.js";import{n as Ye}from"./state-DCT6JLba.js";import{n as b}from"./cell-link-BRdZl0OJ.js";var Ze=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),se=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function et(t){let e=null,s=t.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function tt(t){let e=t.split(`
2
2
  `),s=" ",n=et(Re.parse(t));if(!n)return["def _():",...U(e,s),`${s}return`,"","","_()"].join(`
3
3
  `);let i=t.slice(0,n.from).trim(),l=t.slice(n.from).trim(),a=i.split(`
4
4
  `),c=l.split(`
5
5
  `);return["def _():",...U(a,s),`${s}return ${c[0]}`,...U(c.slice(1),s),"","","_()"].join(`
6
6
  `)}function U(t,e){if(t.length===1&&t[0]==="")return[];let s=[];for(let n of t)n===""?s.push(""):s.push(e+n);return s}function rt(t,e){var s;if(t.type==="multiple-defs")return[{title:"Fix: Wrap in a function",description:"Make this cell's variables local by wrapping the cell in a function.",fixType:"manual",onFix:async n=>{Me(n.editor,"Editor is null");let i=tt(n.editor.state.doc.toString());n.editor.dispatch({changes:{from:0,to:n.editor.state.doc.length,insert:i}})}}];if(t.type==="exception"&&t.exception_type==="NameError"){let n=(s=t.msg.match(/name '(.+)' is not defined/))==null?void 0:s[1];if(!n||!(n in ne))return[];let i=st(n);return[{title:`Fix: Add '${i}'`,description:"Add a new cell for the missing import",fixType:"manual",onFix:async l=>{l.addCodeBelow(i)}}]}return t.type==="sql-error"&&e.aiEnabled?[{title:"Fix with AI",description:"Fix the SQL statement",fixType:"ai",onFix:async n=>{var a;let i=Ue(n.cellId),l=`Fix the SQL statement: ${t.msg}.`;i&&(l+=`
7
- Database schema: ${i}`),(a=n.aiFix)==null||a.setAiCompletionCell({cellId:n.cellId,initialPrompt:l,triggerImmediately:n.aiFix.triggerFix})}}]:[]}function st(t){let e=ne[t];return e===t?`import ${e}`:`import ${e} as ${t}`}var ne={mo:"marimo",alt:"altair",bokeh:"bokeh",dask:"dask",np:"numpy",pd:"pandas",pl:"polars",plotly:"plotly",plt:"matplotlib.pyplot",px:"plotly.express",scipy:"scipy",sk:"sklearn",sns:"seaborn",stats:"scipy.stats",tf:"tensorflow",torch:"torch",xr:"xarray",dt:"datetime",json:"json",math:"math",os:"os",re:"re",sys:"sys"},nt=q(),lt=Se("marimo:ai-autofix-mode","autofix",$e);function it(){let t=(0,nt.c)(3),[e,s]=be(lt),n;return t[0]!==e||t[1]!==s?(n={fixMode:e,setFixMode:s},t[0]=e,t[1]=s,t[2]=n):n=t[2],n}var R=q(),r=J(Ee(),1);const N=t=>{let e=(0,R.c)(21),{errors:s,cellId:n,className:i}=t,l=Ne(),{createNewCell:a}=Ie(),c=ke(ze),o;if(e[0]!==c||e[1]!==s){let x;e[3]===c?x=e[4]:(x=y=>rt(y,{aiEnabled:c}),e[3]=c,e[4]=x),o=s.flatMap(x),e[0]=c,e[1]=s,e[2]=o}else o=e[2];let m=o,p=ve(Ye);if(m.length===0)return null;let d=m[0],f;e[5]!==n||e[6]!==a||e[7]!==d||e[8]!==p||e[9]!==l?(f=x=>{var k;let y=(k=l.get(Ae).cellHandles[n].current)==null?void 0:k.editorView;d.onFix({addCodeBelow:_=>{a({cellId:n,autoFocus:!1,before:!1,code:_})},editor:y,cellId:n,aiFix:{setAiCompletionCell:p,triggerFix:x}}),y==null||y.focus()},e[5]=n,e[6]=a,e[7]=d,e[8]=p,e[9]=l,e[10]=f):f=e[10];let u=f,j;e[11]===i?j=e[12]:(j=X("my-2",i),e[11]=i,e[12]=j);let h;e[13]!==d.description||e[14]!==d.fixType||e[15]!==d.title||e[16]!==u?(h=d.fixType==="ai"?(0,r.jsx)(ce,{tooltip:d.description,openPrompt:()=>u(!1),applyAutofix:()=>u(!0)}):(0,r.jsx)(Y,{content:d.description,align:"start",children:(0,r.jsxs)($,{size:"xs",variant:"outline",className:"font-normal",onClick:()=>u(!1),children:[(0,r.jsx)(ee,{className:"h-3 w-3 mr-2"}),d.title]})}),e[13]=d.description,e[14]=d.fixType,e[15]=d.title,e[16]=u,e[17]=h):h=e[17];let g;return e[18]!==j||e[19]!==h?(g=(0,r.jsx)("div",{className:j,children:h}),e[18]=j,e[19]=h,e[20]=g):g=e[20],g};var le=He,ie=ee,ae="Suggest a prompt",oe="Fix with AI";const ce=t=>{let e=(0,R.c)(21),{tooltip:s,openPrompt:n,applyAutofix:i}=t,{fixMode:l,setFixMode:a}=it(),c=l==="prompt"?n:i,o;e[0]===l?o=e[1]:(o=l==="prompt"?(0,r.jsx)(le,{className:"h-3 w-3 mr-2 mb-0.5"}):(0,r.jsx)(ie,{className:"h-3 w-3 mr-2 mb-0.5"}),e[0]=l,e[1]=o);let m=l==="prompt"?ae:oe,p;e[2]!==c||e[3]!==o||e[4]!==m?(p=(0,r.jsxs)($,{size:"xs",variant:"outline",className:"font-normal rounded-r-none border-r-0",onClick:c,children:[o,m]}),e[2]=c,e[3]=o,e[4]=m,e[5]=p):p=e[5];let d;e[6]!==p||e[7]!==s?(d=(0,r.jsx)(Y,{content:s,align:"start",children:p}),e[6]=p,e[7]=s,e[8]=d):d=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,r.jsx)(Be,{asChild:!0,children:(0,r.jsx)($,{size:"xs",variant:"outline",className:"rounded-l-none px-2","aria-label":"Fix options",children:(0,r.jsx)(Oe,{className:"h-3 w-3"})})}),e[9]=f):f=e[9];let u;e[10]!==l||e[11]!==a?(u=()=>{a(l==="prompt"?"autofix":"prompt")},e[10]=l,e[11]=a,e[12]=u):u=e[12];let j=l==="prompt"?"autofix":"prompt",h;e[13]===j?h=e[14]:(h=(0,r.jsx)(at,{mode:j}),e[13]=j,e[14]=h);let g;e[15]!==u||e[16]!==h?(g=(0,r.jsxs)(De,{children:[f,(0,r.jsx)(Qe,{align:"end",className:"w-56",children:(0,r.jsx)(Ve,{className:"flex items-center gap-2",onClick:u,children:h})})]}),e[15]=u,e[16]=h,e[17]=g):g=e[17];let x;return e[18]!==g||e[19]!==d?(x=(0,r.jsxs)("div",{className:"flex",children:[d,g]}),e[18]=g,e[19]=d,e[20]=x):x=e[20],x};var at=t=>{let e=(0,R.c)(12),{mode:s}=t,n;e[0]===s?n=e[1]:(n=s==="prompt"?(0,r.jsx)(le,{className:"h-4 w-4"}):(0,r.jsx)(ie,{className:"h-4 w-4"}),e[0]=s,e[1]=n);let i=n,l=s==="prompt"?ae:oe,a=s==="prompt"?"Edit the prompt before applying":"Apply AI fixes automatically",c;e[2]===l?c=e[3]:(c=(0,r.jsx)("span",{className:"font-medium",children:l}),e[2]=l,e[3]=c);let o;e[4]===a?o=e[5]:(o=(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:a}),e[4]=a,e[5]=o);let m;e[6]!==c||e[7]!==o?(m=(0,r.jsxs)("div",{className:"flex flex-col",children:[c,o]}),e[6]=c,e[7]=o,e[8]=m):m=e[8];let p;return e[9]!==i||e[10]!==m?(p=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[i,m]}),e[9]=i,e[10]=m,e[11]=p):p=e[11],p},de=/(https?:\/\/\S+)/,ot=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,me=/^data:image\//i,ct=["avatars.githubusercontent.com"];function pe(t){return me.test(t)?[{type:"image",url:t}]:t.split(de).filter(e=>e!=="").map(e=>de.test(e)?ot.test(e)||me.test(e)||ct.some(s=>e.includes(s))?{type:"image",url:e}:{type:"url",url:e}:{type:"text",value:e})}var ue=q(),P=J(we(),1),dt=new Ce;const G=t=>{let e=RegExp("\x1B\\[[0-9;]*m","g");return t.replaceAll(e,"")};var he=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi;function mt(t){he.lastIndex=0;let e=he.exec(t);if(!e)return null;let s=e.index+e[0].length,n=t.slice(s).split(/\s+/),i="",l=0;for(let c of n){let o=c.trim();if(!o)continue;if(o.startsWith("-")){l+=o.length+1;continue}let m=o.match(/^[\w,.[\]-]+/);if(m){i=m[0];break}break}if(!i)return null;let a=s+l+i.length;return{package:i,endIndex:a}}function w(t,e=""){if(!t)return null;if(!/https?:\/\//.test(t))return t;let s=pe(t);return s.length===1&&s[0].type==="text"?t:(0,r.jsx)(r.Fragment,{children:s.map((n,i)=>{let l=e?`${e}-${i}`:i;if(n.type==="url"){let a=G(n.url);return(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:Z.stopPropagation(),className:"text-link hover:underline",children:a},l)}if(n.type==="image"){let a=G(n.url);return(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:Z.stopPropagation(),className:"text-link hover:underline",children:a},l)}return(0,r.jsx)(P.Fragment,{children:n.value},l)})})}var pt=t=>{let e=(0,ue.c)(6),{packages:s,children:n}=t,{handleInstallPackages:i}=Xe(),l;e[0]!==i||e[1]!==s?(l=c=>{i(s),c.preventDefault()},e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;return e[3]!==n||e[4]!==l?(a=(0,r.jsx)("button",{onClick:l,className:"text-link hover:underline",type:"button",children:n}),e[3]=n,e[4]=l,e[5]=a):a=e[5],a};const ut=t=>{if(!(t instanceof K.Text))return;let e=G(t.data);if(!/(pip\s+install|uv\s+add|uv\s+pip\s+install)/i.test(e))return;let s=[],n=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi,i;for(;(i=n.exec(e))!==null;){let c=i.index,o=mt(e.slice(c));o&&s.push({match:i,result:o})}if(s.length===0)return;let l=[],a=0;if(s.forEach((c,o)=>{let{match:m,result:p}=c,d=m.index,f=d+p.endIndex;if(a<d){let j=e.slice(a,d);l.push((0,r.jsx)(P.Fragment,{children:w(j,`before-${o}`)},`before-${o}`))}let u=e.slice(d,f);l.push((0,r.jsx)(pt,{packages:[p.package],children:u},`install-${o}`)),a=f}),a<e.length){let c=e.slice(a);l.push((0,r.jsx)(P.Fragment,{children:w(c,"after")},"after"))}return(0,r.jsx)(r.Fragment,{children:l})},ht=t=>{if(!(t instanceof K.Text))return;let e=t.data;if(!/https?:\/\//.test(e))return;let s=w(e);if(typeof s!="string")return(0,r.jsx)(r.Fragment,{children:s})},xt=(...t)=>e=>{for(let s of t){let n=s(e);if(n!==void 0)return n}},ft=(t,e)=>(0,r.jsx)("span",{children:Fe(dt.ansi_to_html(t),{replace:s=>e(s)})}),jt=t=>{let e=(0,ue.c)(4),{text:s}=t,n;e[0]===s?n=e[1]:(n=ft(s,xt(ut,ht)),e[0]=s,e[1]=n);let i=n,l;return e[2]===i?l=e[3]:(l=(0,r.jsx)(r.Fragment,{children:i}),e[2]=i,e[3]=l),l};var xe=q(),I=t=>{let e=(0,xe.c)(10),s=t.title??"Tip",n;e[0]===s?n=e[1]:(n=(0,r.jsx)(qe,{className:"pt-2 pb-2 font-normal",children:s}),e[0]=s,e[1]=n);let i;e[2]===t.children?i=e[3]:(i=(0,r.jsx)(We,{className:"mr-24 text-[0.84375rem]",children:t.children}),e[2]=t.children,e[3]=i);let l;e[4]!==n||e[5]!==i?(l=(0,r.jsxs)(Pe,{value:"item-1",className:"text-muted-foreground",children:[n,i]}),e[4]=n,e[5]=i,e[6]=l):l=e[6];let a;return e[7]!==t.className||e[8]!==l?(a=(0,r.jsx)(Le,{type:"single",collapsible:!0,className:t.className,children:l}),e[7]=t.className,e[8]=l,e[9]=a):a=e[9],a};const gt=t=>{let e=(0,xe.c)(31),{errors:s,cellId:n,className:i}=t,l=_e(),a="This cell wasn't run because it has errors",c="destructive",o="text-error";if(s.some(yt))a="Interrupted";else if(s.some(vt))a="An internal error occurred";else if(s.some(Nt))a="Ancestor prevented from running",c="default",o="text-secondary-foreground";else if(s.some(bt))a="Ancestor stopped",c="default",o="text-secondary-foreground";else if(s.some(kt))a="SQL error";else{let x;e[0]===s?x=e[1]:(x=s.find(wt),e[0]=s,e[1]=x);let y=x;y&&"exception_type"in y&&(a=y.exception_type)}let m,p,d,f,u,j;if(e[2]!==c||e[3]!==n||e[4]!==l||e[5]!==i||e[6]!==s||e[7]!==o||e[8]!==a){let x=s.filter(It),y=s.filter($t),k=s.filter(_t),_=s.filter(Ft),L=s.filter(Tt),C=s.filter(At),S=s.filter(Ct),W=s.filter(St),V=s.filter(Mt),B=s.filter(zt),F=s.filter(Et),Q=s.filter(qt),D=s.filter(Pt),M;e[15]===l?M=e[16]:(M=()=>{l.openApplication("scratchpad")},e[15]=l,e[16]=M);let fe=M,je=()=>{let v=[];if(F.length>0||Q.length>0){let E=F.some(Lt),ye=!E&&F.some(Wt);v.push((0,r.jsxs)("div",{children:[F.map(Vt),Q.map(Bt),E&&(0,r.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>Ke(l),children:[(0,r.jsx)(Ze,{className:"h-3.5 w-3.5 mr-1.5 mb-0.5"}),(0,r.jsx)("span",{children:"Open package manager"})]}),ye&&(0,r.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>l.openApplication("terminal"),children:[(0,r.jsx)(se,{className:"h-3.5 w-3.5 mr-1.5"}),(0,r.jsx)("span",{children:"Open terminal"})]}),n&&(0,r.jsx)(N,{errors:[...F,...Q],cellId:n})]},"syntax-unknown"))}if(x.length>0&&v.push((0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground font-medium",children:"The setup cell cannot be run because it has references."}),(0,r.jsx)("ul",{className:"list-disc",children:x.flatMap(Qt)}),n&&(0,r.jsx)(N,{errors:x,cellId:n}),(0,r.jsxs)(I,{title:"Why can't the setup cell have references?",className:"mb-2",children:[(0,r.jsx)("p",{className:"pb-2",children:"The setup cell contains logic that must be run before any other cell runs, including top-level imports used by top-level functions. For this reason, it can't refer to other cells' variables."}),(0,r.jsx)("p",{className:"py-2",children:"Try simplifying the setup cell to only contain only necessary variables."}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(T,{href:"https://links.marimo.app/errors-setup",children:["Learn more at our docs"," ",(0,r.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"setup-refs")),y.length>0&&v.push((0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell is in a cycle."}),(0,r.jsx)("ul",{className:"list-disc",children:y.flatMap(Dt)}),n&&(0,r.jsx)(N,{errors:y,cellId:n}),(0,r.jsxs)(I,{title:"What are cycles and how do I resolve them?",className:"mb-2",children:[(0,r.jsx)("p",{className:"pb-2",children:"An example of a cycle is if one cell declares a variable 'a' and reads 'b', and another cell declares 'b' and and reads 'a'. Cycles like this make it impossible for marimo to know how to run your cells, and generally suggest that your code has a bug."}),(0,r.jsx)("p",{className:"py-2",children:"Try merging these cells into a single cell to eliminate the cycle."}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(T,{href:"https://links.marimo.app/errors-cycles",children:["Learn more at our docs"," ",(0,r.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"cycle")),k.length>0){let E=k[0].name;v.push((0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell redefines variables from other cells."}),k.map(Ht),n&&(0,r.jsx)(N,{errors:k,cellId:n}),(0,r.jsxs)(I,{title:"Why can't I redefine variables?",children:[(0,r.jsx)("p",{className:"pb-2",children:"marimo requires that each variable is defined in just one cell. This constraint enables reactive and reproducible execution, arbitrary cell reordering, seamless UI elements, execution as a script, and more."}),(0,r.jsxs)("p",{className:"py-2",children:["Try merging this cell with the mentioned cells or wrapping it in a function. Alternatively, prefix variables with an underscore (e.g., ",(0,r.jsxs)(re,{className:"inline",children:["_",E]}),"). to make them private to this cell."]}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(T,{href:"https://links.marimo.app/errors-multiple-definitions",children:["Learn more at our docs"," ",(0,r.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]}),(0,r.jsx)(I,{title:"Need a scratchpad?",children:(0,r.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,r.jsxs)($,{size:"xs",variant:"link",className:"my-2 font-normal mx-0 px-0",onClick:fe,children:[(0,r.jsx)(Te,{className:"h-3"}),(0,r.jsx)("span",{children:"Try the scratchpad"})]}),(0,r.jsx)("span",{children:"to experiment without restrictions on variable names."})]})})]},"multiple-defs"))}return _.length>0&&v.push((0,r.jsxs)("div",{children:[_.map(Ut),n&&(0,r.jsx)(N,{errors:_,cellId:n}),(0,r.jsxs)(I,{title:"Why can't I use `import *`?",children:[(0,r.jsx)("p",{className:"pb-2",children:"Star imports are incompatible with marimo's git-friendly file format and reproducible reactive execution."}),(0,r.jsx)("p",{className:"py-2",children:"marimo's Python file format stores code in functions, so notebooks can be imported as regular Python modules without executing all their code. But Python disallows `import *` everywhere except at the top-level of a module."}),(0,r.jsx)("p",{className:"py-2",children:"Star imports would also silently add names to globals, which would be incompatible with reactive execution."}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(T,{href:"https://links.marimo.app/errors-import-star",children:["Learn more at our docs"," ",(0,r.jsx)(A,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"import-star")),L.length>0&&v.push((0,r.jsxs)("div",{children:[L.map(Rt),n&&(0,r.jsx)(N,{errors:L,cellId:n})]},"interruption")),C.length>0&&v.push((0,r.jsxs)("ul",{children:[C.map(Gt),C.some(Jt)&&(0,r.jsx)(I,{children:"Fix the error in the mentioned cells, or handle the exceptions with try/except blocks."}),n&&(0,r.jsx)(N,{errors:C,cellId:n})]},"exception")),S.length>0&&v.push((0,r.jsxs)("ul",{children:[S.map(Kt),n&&(0,r.jsx)(N,{errors:S,cellId:n}),(0,r.jsx)(I,{children:S.some(Xt)?"Ensure that the referenced cells define the required variables, or turn off strict execution.":"Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."})]},"strict-exception")),W.length>0&&v.push((0,r.jsxs)("div",{children:[W.map(Yt),n&&(0,r.jsx)(N,{errors:W,cellId:n})]},"internal")),V.length>0&&v.push((0,r.jsxs)("div",{children:[V.map(Zt),n&&(0,r.jsx)(N,{errors:V,cellId:n})]},"ancestor-prevented")),B.length>0&&v.push((0,r.jsxs)("div",{children:[B.map(er),n&&(0,r.jsx)(N,{errors:B,cellId:n})]},"ancestor-stopped")),D.length>0&&v.push((0,r.jsxs)("div",{children:[D.map(tr),n&&(0,r.jsx)(N,{errors:D,cellId:n,className:"mt-2.5"})]},"sql-errors")),v},O=`font-code font-medium tracking-wide ${o}`,z;e[17]!==O||e[18]!==a?(z=(0,r.jsx)(Ge,{className:O,children:a}),e[17]=O,e[18]=a,e[19]=z):z=e[19];let ge=z;m=Je,f=c,e[20]===i?u=e[21]:(u=X("border-none font-code text-sm text-[0.84375rem] px-0 text-muted-foreground normal [&:has(svg)]:pl-0 space-y-4",i),e[20]=i,e[21]=u),j=ge,p="flex flex-col gap-8",d=je(),e[2]=c,e[3]=n,e[4]=l,e[5]=i,e[6]=s,e[7]=o,e[8]=a,e[9]=m,e[10]=p,e[11]=d,e[12]=f,e[13]=u,e[14]=j}else m=e[9],p=e[10],d=e[11],f=e[12],u=e[13],j=e[14];let h;e[22]!==p||e[23]!==d?(h=(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:p,children:d})}),e[22]=p,e[23]=d,e[24]=h):h=e[24];let g;return e[25]!==m||e[26]!==f||e[27]!==u||e[28]!==j||e[29]!==h?(g=(0,r.jsxs)(m,{variant:f,className:u,children:[j,h]}),e[25]=m,e[26]=f,e[27]=u,e[28]=j,e[29]=h,e[30]=g):g=e[30],g};function yt(t){return t.type==="interruption"}function vt(t){return t.type==="internal"}function Nt(t){return t.type==="ancestor-prevented"}function bt(t){return t.type==="ancestor-stopped"}function kt(t){return t.type==="sql-error"}function wt(t){return t.type==="exception"}function It(t){return t.type==="setup-refs"}function $t(t){return t.type==="cycle"}function _t(t){return t.type==="multiple-defs"}function Ft(t){return t.type==="import-star"}function Tt(t){return t.type==="interruption"}function At(t){return t.type==="exception"}function Ct(t){return t.type==="strict-exception"}function St(t){return t.type==="internal"}function Mt(t){return t.type==="ancestor-prevented"}function zt(t){return t.type==="ancestor-stopped"}function Et(t){return t.type==="syntax"}function qt(t){return t.type==="unknown"}function Pt(t){return t.type==="sql-error"}function Lt(t){return t.msg.includes("!pip")}function Wt(t){return t.msg.includes("use os.subprocess")}function Vt(t,e){return(0,r.jsx)("pre",{children:w(t.msg,`syntax-${e}`)},`syntax-${e}`)}function Bt(t,e){return(0,r.jsx)("pre",{children:w(t.msg,`unknown-${e}`)},`unknown-${e}`)}function Qt(t,e){return t.edges_with_vars.map((s,n)=>(0,r.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,r.jsx)(b,{cellId:s[0]}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[": "," ",s[1].length===1?s[1][0]:s[1].join(", ")]})]},`setup-refs-${e}-${n}`))}function Dt(t,e){return t.edges_with_vars.map((s,n)=>(0,r.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,r.jsx)(b,{cellId:s[0]}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[" -> ",s[1].length===1?s[1][0]:s[1].join(", ")," -> "]}),(0,r.jsx)(b,{cellId:s[2]})]},`cycle-${e}-${n}`))}function Ot(t,e){return(0,r.jsx)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:(0,r.jsx)(b,{cellId:t})},`cell-${e}`)}function Ht(t,e){return(0,r.jsxs)(P.Fragment,{children:[(0,r.jsx)("p",{className:"text-muted-foreground mt-2",children:`'${t.name}' was also defined by:`}),(0,r.jsx)("ul",{className:"list-disc",children:t.cells.map(Ot)})]},`multiple-defs-${e}`)}function Ut(t,e){return(0,r.jsx)("p",{className:"text-muted-foreground",children:t.msg},`import-star-${e}`)}function Rt(t,e){return(0,r.jsx)("p",{children:"This cell was interrupted and needs to be re-run."},`interruption-${e}`)}function Gt(t,e){return t.exception_type==="NameError"&&t.msg.startsWith("name 'mo'")?(0,r.jsx)("li",{className:"my-2",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:"name 'mo' is not defined."}),(0,r.jsxs)("p",{className:"text-muted-foreground mt-2",children:["The marimo module (imported as"," ",(0,r.jsx)(re,{className:"inline",children:"mo"}),") is required for Markdown, SQL, and UI elements."]})]})},`exception-${e}`):t.exception_type==="NameError"&&t.msg.startsWith("name '_")?(0,r.jsx)("li",{className:"my-2",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:t.msg}),(0,r.jsxs)("p",{className:"text-muted-foreground mt-2",children:["Variables prefixed with an underscore are local to a cell"," ","(",(0,r.jsxs)(T,{href:"https://links.marimo.app/local-variables",children:["docs"," ",(0,r.jsx)(A,{size:"0.75rem",className:"inline"})]}),")."]}),(0,r.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]})},`exception-${e}`):(0,r.jsx)("li",{className:"my-2",children:t.raising_cell==null?(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:w(t.msg,`exception-${e}`)}),"traceback"in t&&t.traceback?(0,r.jsx)("div",{className:"font-code text-sm mt-2 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text",children:te({html:t.traceback})}):(0,r.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]}):(0,r.jsxs)("div",{children:[w(t.msg,`exception-${e}`),(0,r.jsx)(b,{cellId:t.raising_cell}),"traceback"in t&&t.traceback&&(0,r.jsx)("div",{className:"font-code text-sm mt-2 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text",children:te({html:t.traceback})})]})},`exception-${e}`)}function Jt(t){return t.raising_cell!=null}function Kt(t,e){return(0,r.jsx)("li",{className:"my-2",children:t.blamed_cell==null?(0,r.jsx)("p",{children:t.msg}):(0,r.jsxs)("div",{children:[t.msg,(0,r.jsx)(b,{cellId:t.blamed_cell})]})},`strict-exception-${e}`)}function Xt(t){return t.blamed_cell!=null}function Yt(t,e){return(0,r.jsx)("p",{children:t.msg},`internal-${e}`)}function Zt(t,e){return(0,r.jsxs)("div",{children:[t.msg,t.blamed_cell==null?(0,r.jsxs)("span",{children:["(",(0,r.jsx)(b,{cellId:t.raising_cell}),")"]}):(0,r.jsxs)("span",{children:["(",(0,r.jsx)(b,{cellId:t.raising_cell}),"\xA0blames\xA0",(0,r.jsx)(b,{cellId:t.blamed_cell}),")"]})]},`ancestor-prevented-${e}`)}function er(t,e){return(0,r.jsxs)("div",{children:[t.msg,(0,r.jsx)(b,{cellId:t.raising_cell})]},`ancestor-stopped-${e}`)}function tr(t,e){return(0,r.jsx)("div",{className:"space-y-2 mt-2",children:(0,r.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:t.msg})},`sql-error-${e}`)}export{se as a,ce as i,jt as n,pe as r,gt as t};
7
+ Database schema: ${i}`),(a=n.aiFix)==null||a.setAiCompletionCell({cellId:n.cellId,initialPrompt:l,triggerImmediately:n.aiFix.triggerFix})}}]:[]}function st(t){let e=ne[t];return e===t?`import ${e}`:`import ${e} as ${t}`}var ne={mo:"marimo",alt:"altair",bokeh:"bokeh",dask:"dask",np:"numpy",pd:"pandas",pl:"polars",plotly:"plotly",plt:"matplotlib.pyplot",px:"plotly.express",scipy:"scipy",sk:"sklearn",sns:"seaborn",stats:"scipy.stats",tf:"tensorflow",torch:"torch",xr:"xarray",dt:"datetime",json:"json",math:"math",os:"os",re:"re",sys:"sys"},nt=q(),lt=Fe("marimo:ai-autofix-mode","autofix",_e);function it(){let t=(0,nt.c)(3),[e,s]=be(lt),n;return t[0]!==e||t[1]!==s?(n={fixMode:e,setFixMode:s},t[0]=e,t[1]=s,t[2]=n):n=t[2],n}var R=q(),r=J(ze(),1);const N=t=>{let e=(0,R.c)(21),{errors:s,cellId:n,className:i}=t,l=Ne(),{createNewCell:a}=Ie(),c=ke(Ee),o;if(e[0]!==c||e[1]!==s){let x;e[3]===c?x=e[4]:(x=y=>rt(y,{aiEnabled:c}),e[3]=c,e[4]=x),o=s.flatMap(x),e[0]=c,e[1]=s,e[2]=o}else o=e[2];let m=o,p=ve(Ye);if(m.length===0)return null;let d=m[0],f;e[5]!==n||e[6]!==a||e[7]!==d||e[8]!==p||e[9]!==l?(f=x=>{var k;let y=(k=l.get(Ae).cellHandles[n].current)==null?void 0:k.editorView;d.onFix({addCodeBelow:_=>{a({cellId:n,autoFocus:!1,before:!1,code:_})},editor:y,cellId:n,aiFix:{setAiCompletionCell:p,triggerFix:x}}),y==null||y.focus()},e[5]=n,e[6]=a,e[7]=d,e[8]=p,e[9]=l,e[10]=f):f=e[10];let u=f,j;e[11]===i?j=e[12]:(j=X("my-2",i),e[11]=i,e[12]=j);let h;e[13]!==d.description||e[14]!==d.fixType||e[15]!==d.title||e[16]!==u?(h=d.fixType==="ai"?(0,r.jsx)(ce,{tooltip:d.description,openPrompt:()=>u(!1),applyAutofix:()=>u(!0)}):(0,r.jsx)(Y,{content:d.description,align:"start",children:(0,r.jsxs)($,{size:"xs",variant:"outline",className:"font-normal",onClick:()=>u(!1),children:[(0,r.jsx)(ee,{className:"h-3 w-3 mr-2"}),d.title]})}),e[13]=d.description,e[14]=d.fixType,e[15]=d.title,e[16]=u,e[17]=h):h=e[17];let g;return e[18]!==j||e[19]!==h?(g=(0,r.jsx)("div",{className:j,children:h}),e[18]=j,e[19]=h,e[20]=g):g=e[20],g};var le=He,ie=ee,ae="Suggest a prompt",oe="Fix with AI";const ce=t=>{let e=(0,R.c)(21),{tooltip:s,openPrompt:n,applyAutofix:i}=t,{fixMode:l,setFixMode:a}=it(),c=l==="prompt"?n:i,o;e[0]===l?o=e[1]:(o=l==="prompt"?(0,r.jsx)(le,{className:"h-3 w-3 mr-2 mb-0.5"}):(0,r.jsx)(ie,{className:"h-3 w-3 mr-2 mb-0.5"}),e[0]=l,e[1]=o);let m=l==="prompt"?ae:oe,p;e[2]!==c||e[3]!==o||e[4]!==m?(p=(0,r.jsxs)($,{size:"xs",variant:"outline",className:"font-normal rounded-r-none border-r-0",onClick:c,children:[o,m]}),e[2]=c,e[3]=o,e[4]=m,e[5]=p):p=e[5];let d;e[6]!==p||e[7]!==s?(d=(0,r.jsx)(Y,{content:s,align:"start",children:p}),e[6]=p,e[7]=s,e[8]=d):d=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,r.jsx)(Be,{asChild:!0,children:(0,r.jsx)($,{size:"xs",variant:"outline",className:"rounded-l-none px-2","aria-label":"Fix options",children:(0,r.jsx)(Oe,{className:"h-3 w-3"})})}),e[9]=f):f=e[9];let u;e[10]!==l||e[11]!==a?(u=()=>{a(l==="prompt"?"autofix":"prompt")},e[10]=l,e[11]=a,e[12]=u):u=e[12];let j=l==="prompt"?"autofix":"prompt",h;e[13]===j?h=e[14]:(h=(0,r.jsx)(at,{mode:j}),e[13]=j,e[14]=h);let g;e[15]!==u||e[16]!==h?(g=(0,r.jsxs)(De,{children:[f,(0,r.jsx)(Qe,{align:"end",className:"w-56",children:(0,r.jsx)(Ve,{className:"flex items-center gap-2",onClick:u,children:h})})]}),e[15]=u,e[16]=h,e[17]=g):g=e[17];let x;return e[18]!==g||e[19]!==d?(x=(0,r.jsxs)("div",{className:"flex",children:[d,g]}),e[18]=g,e[19]=d,e[20]=x):x=e[20],x};var at=t=>{let e=(0,R.c)(12),{mode:s}=t,n;e[0]===s?n=e[1]:(n=s==="prompt"?(0,r.jsx)(le,{className:"h-4 w-4"}):(0,r.jsx)(ie,{className:"h-4 w-4"}),e[0]=s,e[1]=n);let i=n,l=s==="prompt"?ae:oe,a=s==="prompt"?"Edit the prompt before applying":"Apply AI fixes automatically",c;e[2]===l?c=e[3]:(c=(0,r.jsx)("span",{className:"font-medium",children:l}),e[2]=l,e[3]=c);let o;e[4]===a?o=e[5]:(o=(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:a}),e[4]=a,e[5]=o);let m;e[6]!==c||e[7]!==o?(m=(0,r.jsxs)("div",{className:"flex flex-col",children:[c,o]}),e[6]=c,e[7]=o,e[8]=m):m=e[8];let p;return e[9]!==i||e[10]!==m?(p=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[i,m]}),e[9]=i,e[10]=m,e[11]=p):p=e[11],p},de=/(https?:\/\/\S+)/,ot=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,me=/^data:image\//i,ct=["avatars.githubusercontent.com"];function pe(t){return me.test(t)?[{type:"image",url:t}]:t.split(de).filter(e=>e!=="").map(e=>de.test(e)?ot.test(e)||me.test(e)||ct.some(s=>e.includes(s))?{type:"image",url:e}:{type:"url",url:e}:{type:"text",value:e})}var ue=q(),P=J(we(),1),dt=new Ce;const G=t=>{let e=RegExp("\x1B\\[[0-9;]*m","g");return t.replaceAll(e,"")};var he=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi;function mt(t){he.lastIndex=0;let e=he.exec(t);if(!e)return null;let s=e.index+e[0].length,n=t.slice(s).split(/\s+/),i="",l=0;for(let c of n){let o=c.trim();if(!o)continue;if(o.startsWith("-")){l+=o.length+1;continue}let m=o.match(/^[\w,.[\]-]+/);if(m){i=m[0];break}break}if(!i)return null;let a=s+l+i.length;return{package:i,endIndex:a}}function w(t,e=""){if(!t)return null;if(!/https?:\/\//.test(t))return t;let s=pe(t);return s.length===1&&s[0].type==="text"?t:(0,r.jsx)(r.Fragment,{children:s.map((n,i)=>{let l=e?`${e}-${i}`:i;if(n.type==="url"){let a=G(n.url);return(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:Z.stopPropagation(),className:"text-link hover:underline",children:a},l)}if(n.type==="image"){let a=G(n.url);return(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:Z.stopPropagation(),className:"text-link hover:underline",children:a},l)}return(0,r.jsx)(P.Fragment,{children:n.value},l)})})}var pt=t=>{let e=(0,ue.c)(6),{packages:s,children:n}=t,{handleInstallPackages:i}=Xe(),l;e[0]!==i||e[1]!==s?(l=c=>{i(s),c.preventDefault()},e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;return e[3]!==n||e[4]!==l?(a=(0,r.jsx)("button",{onClick:l,className:"text-link hover:underline",type:"button",children:n}),e[3]=n,e[4]=l,e[5]=a):a=e[5],a};const ut=t=>{if(!(t instanceof K.Text))return;let e=G(t.data);if(!/(pip\s+install|uv\s+add|uv\s+pip\s+install)/i.test(e))return;let s=[],n=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi,i;for(;(i=n.exec(e))!==null;){let c=i.index,o=mt(e.slice(c));o&&s.push({match:i,result:o})}if(s.length===0)return;let l=[],a=0;if(s.forEach((c,o)=>{let{match:m,result:p}=c,d=m.index,f=d+p.endIndex;if(a<d){let j=e.slice(a,d);l.push((0,r.jsx)(P.Fragment,{children:w(j,`before-${o}`)},`before-${o}`))}let u=e.slice(d,f);l.push((0,r.jsx)(pt,{packages:[p.package],children:u},`install-${o}`)),a=f}),a<e.length){let c=e.slice(a);l.push((0,r.jsx)(P.Fragment,{children:w(c,"after")},"after"))}return(0,r.jsx)(r.Fragment,{children:l})},ht=t=>{if(!(t instanceof K.Text))return;let e=t.data;if(!/https?:\/\//.test(e))return;let s=w(e);if(typeof s!="string")return(0,r.jsx)(r.Fragment,{children:s})},xt=(...t)=>e=>{for(let s of t){let n=s(e);if(n!==void 0)return n}},ft=(t,e)=>(0,r.jsx)("span",{children:Te(dt.ansi_to_html(t),{replace:s=>e(s)})}),jt=t=>{let e=(0,ue.c)(4),{text:s}=t,n;e[0]===s?n=e[1]:(n=ft(s,xt(ut,ht)),e[0]=s,e[1]=n);let i=n,l;return e[2]===i?l=e[3]:(l=(0,r.jsx)(r.Fragment,{children:i}),e[2]=i,e[3]=l),l};var xe=q(),I=t=>{let e=(0,xe.c)(10),s=t.title??"Tip",n;e[0]===s?n=e[1]:(n=(0,r.jsx)(qe,{className:"pt-2 pb-2 font-normal",children:s}),e[0]=s,e[1]=n);let i;e[2]===t.children?i=e[3]:(i=(0,r.jsx)(We,{className:"mr-24 text-[0.84375rem]",children:t.children}),e[2]=t.children,e[3]=i);let l;e[4]!==n||e[5]!==i?(l=(0,r.jsxs)(Pe,{value:"item-1",className:"text-muted-foreground",children:[n,i]}),e[4]=n,e[5]=i,e[6]=l):l=e[6];let a;return e[7]!==t.className||e[8]!==l?(a=(0,r.jsx)(Le,{type:"single",collapsible:!0,className:t.className,children:l}),e[7]=t.className,e[8]=l,e[9]=a):a=e[9],a};const gt=t=>{let e=(0,xe.c)(31),{errors:s,cellId:n,className:i}=t,l=$e(),a="This cell wasn't run because it has errors",c="destructive",o="text-error";if(s.some(yt))a="Interrupted";else if(s.some(vt))a="An internal error occurred";else if(s.some(Nt))a="Ancestor prevented from running",c="default",o="text-secondary-foreground";else if(s.some(bt))a="Ancestor stopped",c="default",o="text-secondary-foreground";else if(s.some(kt))a="SQL error";else{let x;e[0]===s?x=e[1]:(x=s.find(wt),e[0]=s,e[1]=x);let y=x;y&&"exception_type"in y&&(a=y.exception_type)}let m,p,d,f,u,j;if(e[2]!==c||e[3]!==n||e[4]!==l||e[5]!==i||e[6]!==s||e[7]!==o||e[8]!==a){let x=s.filter(It),y=s.filter($t),k=s.filter(_t),_=s.filter(Ft),L=s.filter(At),C=s.filter(Tt),S=s.filter(Ct),W=s.filter(St),V=s.filter(Mt),B=s.filter(Et),F=s.filter(zt),Q=s.filter(qt),D=s.filter(Pt),M;e[15]===l?M=e[16]:(M=()=>{l.openApplication("scratchpad")},e[15]=l,e[16]=M);let fe=M,je=()=>{let v=[];if(F.length>0||Q.length>0){let z=F.some(Lt),ye=!z&&F.some(Wt);v.push((0,r.jsxs)("div",{children:[F.map(Vt),Q.map(Bt),z&&(0,r.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>Ke(l),children:[(0,r.jsx)(Ze,{className:"h-3.5 w-3.5 mr-1.5 mb-0.5"}),(0,r.jsx)("span",{children:"Open package manager"})]}),ye&&(0,r.jsxs)($,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>l.openApplication("terminal"),children:[(0,r.jsx)(se,{className:"h-3.5 w-3.5 mr-1.5"}),(0,r.jsx)("span",{children:"Open terminal"})]}),n&&(0,r.jsx)(N,{errors:[...F,...Q],cellId:n})]},"syntax-unknown"))}if(x.length>0&&v.push((0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground font-medium",children:"The setup cell cannot be run because it has references."}),(0,r.jsx)("ul",{className:"list-disc",children:x.flatMap(Qt)}),n&&(0,r.jsx)(N,{errors:x,cellId:n}),(0,r.jsxs)(I,{title:"Why can't the setup cell have references?",className:"mb-2",children:[(0,r.jsx)("p",{className:"pb-2",children:"The setup cell contains logic that must be run before any other cell runs, including top-level imports used by top-level functions. For this reason, it can't refer to other cells' variables."}),(0,r.jsx)("p",{className:"py-2",children:"Try simplifying the setup cell to only contain only necessary variables."}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(A,{href:"https://links.marimo.app/errors-setup",children:["Learn more at our docs"," ",(0,r.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"setup-refs")),y.length>0&&v.push((0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell is in a cycle."}),(0,r.jsx)("ul",{className:"list-disc",children:y.flatMap(Dt)}),n&&(0,r.jsx)(N,{errors:y,cellId:n}),(0,r.jsxs)(I,{title:"What are cycles and how do I resolve them?",className:"mb-2",children:[(0,r.jsx)("p",{className:"pb-2",children:"An example of a cycle is if one cell declares a variable 'a' and reads 'b', and another cell declares 'b' and and reads 'a'. Cycles like this make it impossible for marimo to know how to run your cells, and generally suggest that your code has a bug."}),(0,r.jsx)("p",{className:"py-2",children:"Try merging these cells into a single cell to eliminate the cycle."}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(A,{href:"https://links.marimo.app/errors-cycles",children:["Learn more at our docs"," ",(0,r.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"cycle")),k.length>0){let z=k[0].name;v.push((0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell redefines variables from other cells."}),k.map(Ht),n&&(0,r.jsx)(N,{errors:k,cellId:n}),(0,r.jsxs)(I,{title:"Why can't I redefine variables?",children:[(0,r.jsx)("p",{className:"pb-2",children:"marimo requires that each variable is defined in just one cell. This constraint enables reactive and reproducible execution, arbitrary cell reordering, seamless UI elements, execution as a script, and more."}),(0,r.jsxs)("p",{className:"py-2",children:["Try merging this cell with the mentioned cells or wrapping it in a function. Alternatively, prefix variables with an underscore (e.g., ",(0,r.jsxs)(re,{className:"inline",children:["_",z]}),"). to make them private to this cell."]}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(A,{href:"https://links.marimo.app/errors-multiple-definitions",children:["Learn more at our docs"," ",(0,r.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]}),(0,r.jsx)(I,{title:"Need a scratchpad?",children:(0,r.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,r.jsxs)($,{size:"xs",variant:"link",className:"my-2 font-normal mx-0 px-0",onClick:fe,children:[(0,r.jsx)(Se,{className:"h-3"}),(0,r.jsx)("span",{children:"Try the scratchpad"})]}),(0,r.jsx)("span",{children:"to experiment without restrictions on variable names."})]})})]},"multiple-defs"))}return _.length>0&&v.push((0,r.jsxs)("div",{children:[_.map(Ut),n&&(0,r.jsx)(N,{errors:_,cellId:n}),(0,r.jsxs)(I,{title:"Why can't I use `import *`?",children:[(0,r.jsx)("p",{className:"pb-2",children:"Star imports are incompatible with marimo's git-friendly file format and reproducible reactive execution."}),(0,r.jsx)("p",{className:"py-2",children:"marimo's Python file format stores code in functions, so notebooks can be imported as regular Python modules without executing all their code. But Python disallows `import *` everywhere except at the top-level of a module."}),(0,r.jsx)("p",{className:"py-2",children:"Star imports would also silently add names to globals, which would be incompatible with reactive execution."}),(0,r.jsxs)("p",{className:"py-2",children:[(0,r.jsxs)(A,{href:"https://links.marimo.app/errors-import-star",children:["Learn more at our docs"," ",(0,r.jsx)(T,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"import-star")),L.length>0&&v.push((0,r.jsxs)("div",{children:[L.map(Rt),n&&(0,r.jsx)(N,{errors:L,cellId:n})]},"interruption")),C.length>0&&v.push((0,r.jsxs)("ul",{children:[C.map(Gt),C.some(Jt)&&(0,r.jsx)(I,{children:"Fix the error in the mentioned cells, or handle the exceptions with try/except blocks."}),n&&(0,r.jsx)(N,{errors:C,cellId:n})]},"exception")),S.length>0&&v.push((0,r.jsxs)("ul",{children:[S.map(Kt),n&&(0,r.jsx)(N,{errors:S,cellId:n}),(0,r.jsx)(I,{children:S.some(Xt)?"Ensure that the referenced cells define the required variables, or turn off strict execution.":"Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."})]},"strict-exception")),W.length>0&&v.push((0,r.jsxs)("div",{children:[W.map(Yt),n&&(0,r.jsx)(N,{errors:W,cellId:n})]},"internal")),V.length>0&&v.push((0,r.jsxs)("div",{children:[V.map(Zt),n&&(0,r.jsx)(N,{errors:V,cellId:n})]},"ancestor-prevented")),B.length>0&&v.push((0,r.jsxs)("div",{children:[B.map(er),n&&(0,r.jsx)(N,{errors:B,cellId:n})]},"ancestor-stopped")),D.length>0&&v.push((0,r.jsxs)("div",{children:[D.map(tr),n&&(0,r.jsx)(N,{errors:D,cellId:n,className:"mt-2.5"})]},"sql-errors")),v},O=`font-code font-medium tracking-wide ${o}`,E;e[17]!==O||e[18]!==a?(E=(0,r.jsx)(Ge,{className:O,children:a}),e[17]=O,e[18]=a,e[19]=E):E=e[19];let ge=E;m=Je,f=c,e[20]===i?u=e[21]:(u=X("border-none font-code text-sm text-[0.84375rem] px-0 text-muted-foreground normal [&:has(svg)]:pl-0 space-y-4",i),e[20]=i,e[21]=u),j=ge,p="flex flex-col gap-8",d=je(),e[2]=c,e[3]=n,e[4]=l,e[5]=i,e[6]=s,e[7]=o,e[8]=a,e[9]=m,e[10]=p,e[11]=d,e[12]=f,e[13]=u,e[14]=j}else m=e[9],p=e[10],d=e[11],f=e[12],u=e[13],j=e[14];let h;e[22]!==p||e[23]!==d?(h=(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:p,children:d})}),e[22]=p,e[23]=d,e[24]=h):h=e[24];let g;return e[25]!==m||e[26]!==f||e[27]!==u||e[28]!==j||e[29]!==h?(g=(0,r.jsxs)(m,{variant:f,className:u,children:[j,h]}),e[25]=m,e[26]=f,e[27]=u,e[28]=j,e[29]=h,e[30]=g):g=e[30],g};function yt(t){return t.type==="interruption"}function vt(t){return t.type==="internal"}function Nt(t){return t.type==="ancestor-prevented"}function bt(t){return t.type==="ancestor-stopped"}function kt(t){return t.type==="sql-error"}function wt(t){return t.type==="exception"}function It(t){return t.type==="setup-refs"}function $t(t){return t.type==="cycle"}function _t(t){return t.type==="multiple-defs"}function Ft(t){return t.type==="import-star"}function At(t){return t.type==="interruption"}function Tt(t){return t.type==="exception"}function Ct(t){return t.type==="strict-exception"}function St(t){return t.type==="internal"}function Mt(t){return t.type==="ancestor-prevented"}function Et(t){return t.type==="ancestor-stopped"}function zt(t){return t.type==="syntax"}function qt(t){return t.type==="unknown"}function Pt(t){return t.type==="sql-error"}function Lt(t){return t.msg.includes("!pip")}function Wt(t){return t.msg.includes("use os.subprocess")}function Vt(t,e){return(0,r.jsx)("pre",{children:w(t.msg,`syntax-${e}`)},`syntax-${e}`)}function Bt(t,e){return(0,r.jsx)("pre",{children:w(t.msg,`unknown-${e}`)},`unknown-${e}`)}function Qt(t,e){return t.edges_with_vars.map((s,n)=>(0,r.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,r.jsx)(b,{cellId:s[0]}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[": "," ",s[1].length===1?s[1][0]:s[1].join(", ")]})]},`setup-refs-${e}-${n}`))}function Dt(t,e){return t.edges_with_vars.map((s,n)=>(0,r.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,r.jsx)(b,{cellId:s[0]}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[" -> ",s[1].length===1?s[1][0]:s[1].join(", ")," -> "]}),(0,r.jsx)(b,{cellId:s[2]})]},`cycle-${e}-${n}`))}function Ot(t,e){return(0,r.jsx)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:(0,r.jsx)(b,{cellId:t})},`cell-${e}`)}function Ht(t,e){return(0,r.jsxs)(P.Fragment,{children:[(0,r.jsx)("p",{className:"text-muted-foreground mt-2",children:`'${t.name}' was also defined by:`}),(0,r.jsx)("ul",{className:"list-disc",children:t.cells.map(Ot)})]},`multiple-defs-${e}`)}function Ut(t,e){return(0,r.jsx)("p",{className:"text-muted-foreground",children:t.msg},`import-star-${e}`)}function Rt(t,e){return(0,r.jsx)("p",{children:"This cell was interrupted and needs to be re-run."},`interruption-${e}`)}function Gt(t,e){return t.exception_type==="NameError"&&t.msg.startsWith("name 'mo'")?(0,r.jsx)("li",{className:"my-2",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:"name 'mo' is not defined."}),(0,r.jsxs)("p",{className:"text-muted-foreground mt-2",children:["The marimo module (imported as"," ",(0,r.jsx)(re,{className:"inline",children:"mo"}),") is required for Markdown, SQL, and UI elements."]})]})},`exception-${e}`):t.exception_type==="NameError"&&t.msg.startsWith("name '_")?(0,r.jsx)("li",{className:"my-2",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:t.msg}),(0,r.jsxs)("p",{className:"text-muted-foreground mt-2",children:["Variables prefixed with an underscore are local to a cell"," ","(",(0,r.jsxs)(A,{href:"https://links.marimo.app/local-variables",children:["docs"," ",(0,r.jsx)(T,{size:"0.75rem",className:"inline"})]}),")."]}),(0,r.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]})},`exception-${e}`):(0,r.jsx)("li",{className:"my-2",children:t.raising_cell==null?(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground",children:w(t.msg,`exception-${e}`)}),"traceback"in t&&t.traceback?(0,r.jsx)("div",{className:"font-code text-sm mt-2 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text",children:te({html:t.traceback})}):(0,r.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]}):(0,r.jsxs)("div",{children:[w(t.msg,`exception-${e}`),(0,r.jsx)(b,{cellId:t.raising_cell}),"traceback"in t&&t.traceback&&(0,r.jsx)("div",{className:"font-code text-sm mt-2 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text",children:te({html:t.traceback})})]})},`exception-${e}`)}function Jt(t){return t.raising_cell!=null}function Kt(t,e){return(0,r.jsx)("li",{className:"my-2",children:t.blamed_cell==null?(0,r.jsx)("p",{children:t.msg}):(0,r.jsxs)("div",{children:[t.msg,(0,r.jsx)(b,{cellId:t.blamed_cell})]})},`strict-exception-${e}`)}function Xt(t){return t.blamed_cell!=null}function Yt(t,e){return(0,r.jsx)("p",{children:t.msg},`internal-${e}`)}function Zt(t,e){return(0,r.jsxs)("div",{children:[t.msg,t.blamed_cell==null?(0,r.jsxs)("span",{children:["(",(0,r.jsx)(b,{cellId:t.raising_cell}),")"]}):(0,r.jsxs)("span",{children:["(",(0,r.jsx)(b,{cellId:t.raising_cell}),"\xA0blames\xA0",(0,r.jsx)(b,{cellId:t.blamed_cell}),")"]})]},`ancestor-prevented-${e}`)}function er(t,e){return(0,r.jsxs)("div",{children:[t.msg,(0,r.jsx)(b,{cellId:t.raising_cell})]},`ancestor-stopped-${e}`)}function tr(t,e){return(0,r.jsx)("div",{className:"space-y-2 mt-2",children:(0,r.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:t.msg})},`sql-error-${e}`)}export{se as a,ce as i,jt as n,pe as r,gt as t};
@@ -1 +1 @@
1
- import{s as Ce}from"./chunk-LvLJmgfZ.js";import{t as ye}from"./react-Bj1aDYRI.js";import{$ as Se,Y as ke,et as _e}from"./input-DyPS_GiK.js";import{D as Le,F as xe,I as v,L as Me,N as w,P as S,T as Fe,V as R,c as Ie,j as k,k as Pe,l as We,p as Ae,w as Ke,x as ne}from"./usePress-CtfZXGno.js";import{t as He}from"./context-DGqo1TbK.js";var Be=class{get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,n=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let i=r,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});t.push(l),l.currentNode=n,this._currentSetFor.add(l),r=n=i.host}else r=r.parentNode;let o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(o),o.currentNode=n,this._currentSetFor.add(o),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return k(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){var t;let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(t=this.filter)!=null&&t.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(t):(r=this.filter)!=null&&r.acceptNode&&(n=this.filter.acceptNode(t)),n===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let o=this.lastChild();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var l;if(i.nodeType===Node.ELEMENT_NODE){let a=i.shadowRoot;if(a){let d=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((l=this.filter)!=null&&l.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}};function oe(e,t,r,n){return xe()?new Be(e,t,r,n):e.createTreeWalker(t,r,n)}var h=Ce(ye(),1);function De(e,t){let r=(0,h.useRef)(!0),n=(0,h.useRef)(null),o=Ae(e);(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,h.useEffect)(()=>{let i=n.current;r.current?r.current=!1:(!i||t.some((l,a)=>!Object.is(l,i[a])))&&o(),n.current=t},t)}function z(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&r.overflow!=="hidden"&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function Oe(e,t){let r=e;for(z(r,t)&&(r=r.parentElement);r&&!z(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function ie(e,t){let r=[],n=document.scrollingElement||document.documentElement;do z(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function je(e){return Ke()?e.metaKey:e.ctrlKey}var ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ve(e){return e instanceof HTMLInputElement&&!ze.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var qe=0,q=new Map;function Ue(e){let[t,r]=(0,h.useState)();return R(()=>{if(!e)return;let n=q.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${qe++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},q.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),q.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function U(e,t,r={}){let{block:n="nearest",inline:o="nearest"}=r;if(e===t)return;let i=e.scrollTop,l=e.scrollLeft,a=t.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.getComputedStyle(t),s=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,u=e===f?0:d.top,N=e===f?e.clientHeight:d.bottom,b=e===f?0:d.left,P=e===f?e.clientWidth:d.right,_=parseInt(c.scrollMarginTop,10)||0,pe=parseInt(c.scrollMarginBottom,10)||0,Ne=parseInt(c.scrollMarginLeft,10)||0,me=parseInt(c.scrollMarginRight,10)||0,be=parseInt(s.scrollPaddingTop,10)||0,ve=parseInt(s.scrollPaddingBottom,10)||0,Ee=parseInt(s.scrollPaddingLeft,10)||0,ge=parseInt(s.scrollPaddingRight,10)||0,Q=parseInt(s.borderTopWidth,10)||0,Z=parseInt(s.borderBottomWidth,10)||0,ee=parseInt(s.borderLeftWidth,10)||0,te=parseInt(s.borderRightWidth,10)||0,W=a.top-_,A=a.bottom+pe,K=a.left-Ne,H=a.right+me,Te=e===f?0:ee+te,we=e===f?0:Q+Z,re=e.offsetWidth-e.clientWidth-Te,Re=e.offsetHeight-e.clientHeight-we,B=u+Q+be,D=N-Z-ve-Re,L=b+ee+Ee,x=P-te-ge;s.direction==="rtl"&&!Le()?L+=re:x-=re;let O=W<B||A>D,j=K<L||H>x;if(O&&n==="start")i+=W-B;else if(O&&n==="center")i+=(W+A)/2-(B+D)/2;else if(O&&n==="end")i+=A-D;else if(O&&n==="nearest"){let M=W-B,F=A-D;i+=Math.abs(M)<=Math.abs(F)?M:F}if(j&&o==="start")l+=K-L;else if(j&&o==="center")l+=(K+H)/2-(L+x)/2;else if(j&&o==="end")l+=H-x;else if(j&&o==="nearest"){let M=K-L,F=H-x;l+=Math.abs(M)<=Math.abs(F)?M:F}e.scrollTo({left:l,top:i})}function $e(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let l=document.scrollingElement||document.documentElement;if(window.getComputedStyle(l).overflow!=="hidden"&&!ne()){var n;let{left:a,top:d}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)==null||n.call(e,{block:"nearest"});let{left:c,top:s}=e.getBoundingClientRect();if(Math.abs(a-c)>1||Math.abs(d-s)>1){var o,i;r==null||(o=r.scrollIntoView)==null||o.call(r,{block:"center",inline:"center"}),(i=e.scrollIntoView)==null||i.call(e,{block:"nearest"})}}else{let{left:a,top:d}=e.getBoundingClientRect(),c=ie(e,!0);for(let u of c)U(u,e);let{left:s,top:f}=e.getBoundingClientRect();if(Math.abs(a-s)>1||Math.abs(d-f)>1){c=r?ie(r,!0):[];for(let u of c)U(u,r,{block:"center",inline:"center"})}}}}var $=new Map;function Ye(e){let{locale:t}=He(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($.has(r))return $.get(r);let n=new Intl.Collator(t,e);return $.set(r,n),n}var le=h.createContext(null),Y="react-aria-focus-scope-restore",p=null;function Ge(e){let{children:t,contain:r,restoreFocus:n,autoFocus:o}=e,i=(0,h.useRef)(null),l=(0,h.useRef)(null),a=(0,h.useRef)([]),{parentNode:d}=(0,h.useContext)(le)||{},c=(0,h.useMemo)(()=>new X({scopeRef:a}),[a]);R(()=>{let u=d||m.root;if(m.getTreeNode(u.scopeRef)&&p&&!V(p,u.scopeRef)){let N=m.getTreeNode(p);N&&(u=N)}u.addChild(c),m.addNode(c)},[c,d]),R(()=>{let u=m.getTreeNode(a);u&&(u.contain=!!r)},[r]),R(()=>{var P;let u=(P=i.current)==null?void 0:P.nextSibling,N=[],b=_=>_.stopPropagation();for(;u&&u!==l.current;)N.push(u),u.addEventListener(Y,b),u=u.nextSibling;return a.current=N,()=>{for(let _ of N)_.removeEventListener(Y,b)}},[t]),rt(a,n,r),Ze(a,r),nt(a,n,r),tt(a,o),(0,h.useEffect)(()=>{let u=w(v(a.current?a.current[0]:void 0)),N=null;if(T(u,a.current)){for(let b of m.traverse())b.scopeRef&&T(u,b.scopeRef.current)&&(N=b);N===m.getTreeNode(a)&&(p=N.scopeRef)}},[a]),R(()=>()=>{var N,b;let u=((b=(N=m.getTreeNode(a))==null?void 0:N.parent)==null?void 0:b.scopeRef)??null;(a===p||V(a,p))&&(!u||m.getTreeNode(u))&&(p=u),m.removeTreeNode(a)},[a]);let s=(0,h.useMemo)(()=>Je(a),[]),f=(0,h.useMemo)(()=>({focusManager:s,parentNode:c}),[c,s]);return h.createElement(le.Provider,{value:f},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}function Je(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[0].previousElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.nextNode();return!s&&i&&(c.currentNode=d,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[r.length-1].nextElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.previousNode();return!s&&i&&(c.currentNode=d,s=c.previousNode()),s&&E(s,!0),s},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let l=i.nextNode();return l&&E(l,!0),l},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let l=i.previousNode();return l&&E(l,!0),l}}}function y(e){return e[0].parentElement}function I(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Xe(e){if(!e.form)return Array.from(v(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(n=>!n.form);let t=e.form.elements.namedItem(e.name),r=Me(e);return t instanceof r.RadioNodeList?Array.from(t).filter(n=>n instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}function Qe(e){if(e.checked)return!0;let t=Xe(e);return t.length>0&&!t.some(r=>r.checked)}function Ze(e,t){let r=(0,h.useRef)(void 0),n=(0,h.useRef)(void 0);R(()=>{let o=e.current;if(!t){n.current&&(n.current=(cancelAnimationFrame(n.current),void 0));return}let i=v(o?o[0]:void 0),l=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!I(e)||c.isComposing)return;let s=w(i),f=e.current;if(!f||!T(s,f))return;let u=g(y(f),{tabbable:!0},f);if(!s)return;u.currentNode=s;let N=c.shiftKey?u.previousNode():u.nextNode();N||(N=(u.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,c.shiftKey?u.previousNode():u.nextNode())),c.preventDefault(),N&&E(N,!0)},a=c=>{(!p||V(p,e))&&T(S(c),e.current)?(p=e,r.current=S(c)):I(e)&&!C(S(c),e)?r.current?r.current.focus():p&&p.current&&G(p.current):I(e)&&(r.current=S(c))},d=c=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let s=_e(),f=(s==="virtual"||s===null)&&Fe()&&ne(),u=w(i);if(!f&&u&&I(e)&&!C(u,e)){p=e;let b=S(c);if(b&&b.isConnected){var N;r.current=b,(N=r.current)==null||N.focus()}else p.current&&G(p.current)}})};return i.addEventListener("keydown",l,!1),i.addEventListener("focusin",a,!1),o==null||o.forEach(c=>c.addEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",d,!1)),()=>{i.removeEventListener("keydown",l,!1),i.removeEventListener("focusin",a,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",d,!1))}},[e,t]),R(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function ce(e){return C(e)}function T(e,t){return!e||!t?!1:t.some(r=>k(r,e))}function C(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of m.traverse(m.getTreeNode(t)))if(r&&T(e,r.current))return!0;return!1}function et(e){return C(e,p)}function V(e,t){var n;let r=(n=m.getTreeNode(t))==null?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function E(e,t=!1){if(e!=null&&!t)try{Se(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function se(e,t=!0){let r=e[0].previousElementSibling,n=y(e),o=g(n,{tabbable:t},e);o.currentNode=r;let i=o.nextNode();return t&&!i&&(n=y(e),o=g(n,{tabbable:!1},e),o.currentNode=r,i=o.nextNode()),i}function G(e,t=!0){E(se(e,t))}function tt(e,t){let r=h.useRef(t);(0,h.useEffect)(()=>{r.current&&(p=e,!T(w(v(e.current?e.current[0]:void 0)),p.current)&&e.current&&G(e.current)),r.current=!1},[e])}function rt(e,t,r){R(()=>{if(t||r)return;let n=e.current,o=v(n?n[0]:void 0),i=l=>{let a=S(l);T(a,e.current)?p=e:ce(a)||(p=null)};return o.addEventListener("focusin",i,!1),n==null||n.forEach(l=>l.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),n==null||n.forEach(l=>l.removeEventListener("focusin",i,!1))}},[e,t,r])}function ae(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function nt(e,t,r){let n=(0,h.useRef)(typeof document<"u"?w(v(e.current?e.current[0]:void 0)):null);R(()=>{let o=e.current,i=v(o?o[0]:void 0);if(!t||r)return;let l=()=>{(!p||V(p,e))&&T(w(i),e.current)&&(p=e)};return i.addEventListener("focusin",l,!1),o==null||o.forEach(a=>a.addEventListener("focusin",l,!1)),()=>{i.removeEventListener("focusin",l,!1),o==null||o.forEach(a=>a.removeEventListener("focusin",l,!1))}},[e,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!I(e)||l.isComposing)return;let a=o.activeElement;if(!C(a,e)||!ae(e))return;let d=m.getTreeNode(e);if(!d)return;let c=d.nodeToRestore,s=g(o.body,{tabbable:!0});s.currentNode=a;let f=l.shiftKey?s.previousNode():s.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,d.nodeToRestore=void 0),(!f||!C(f,e))&&c){s.currentNode=c;do f=l.shiftKey?s.previousNode():s.nextNode();while(C(f,e));l.preventDefault(),l.stopPropagation(),f?E(f,!0):ce(c)?E(c,!0):a.blur()}};return r||o.addEventListener("keydown",i,!0),()=>{r||o.removeEventListener("keydown",i,!0)}},[e,t,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=m.getTreeNode(e);if(i)return i.nodeToRestore=n.current??void 0,()=>{let l=m.getTreeNode(e);if(!l)return;let a=l.nodeToRestore,d=w(o);if(t&&a&&(d&&C(d,e)||d===o.body&&ae(e))){let c=m.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let s=c.getTreeNode(e);for(;s;){if(s.nodeToRestore&&s.nodeToRestore.isConnected){ue(s.nodeToRestore);return}s=s.parent}for(s=c.getTreeNode(e);s;){if(s.scopeRef&&s.scopeRef.current&&m.getTreeNode(s.scopeRef)){ue(se(s.scopeRef.current,!0));return}s=s.parent}}})}}},[e,t])}function ue(e){e.dispatchEvent(new CustomEvent(Y,{bubbles:!0,cancelable:!0}))&&E(e)}function g(e,t,r){let n=t!=null&&t.tabbable?We:Ie,o=v((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),i=oe(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return k(t==null?void 0:t.from,l)||t!=null&&t.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!Qe(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:n(l)&&(!r||T(l,r))&&(!(t!=null&&t.accept)||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function ot(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});k(n,d)&&(c.currentNode=d);let s=c.nextNode();return!s&&l&&(c.currentNode=n,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});if(k(n,d))c.currentNode=d;else{let f=J(c);return f&&E(f,!0),f??null}let s=c.previousNode();if(!s&&l){c.currentNode=n;let f=J(c);if(!f)return null;s=f}return s&&E(s,!0),s??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=g(n,{tabbable:o,accept:i}).nextNode();return l&&E(l,!0),l},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=J(g(n,{tabbable:o,accept:i}));return l&&E(l,!0),l??null}}}function J(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var it=class he{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let o=this.fastMap.get(r??null);if(!o)return;let i=new X({scopeRef:t});o.addChild(i),i.parent=o,this.fastMap.set(t,i),n&&(i.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let i of this.traverse())i!==r&&r.nodeToRestore&&i.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&T(i.nodeToRestore,r.scopeRef.current)&&(i.nodeToRestore=r.nodeToRestore);let o=r.children;n&&(n.removeChild(r),o.size>0&&o.forEach(i=>n&&n.addChild(i))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var r;let t=new he;for(let n of this.traverse())t.addTreeNode(n.scopeRef,((r=n.parent)==null?void 0:r.scopeRef)??null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X({scopeRef:null}),this.fastMap.set(null,this.root)}},X=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},m=new it,de={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function fe(e={}){let{style:t,isFocusable:r}=e,[n,o]=(0,h.useState)(!1),{focusWithinProps:i}=ke({isDisabled:!r,onFocusWithinChange:a=>o(a)}),l=(0,h.useMemo)(()=>n?t:t?{...de,...t}:de,[n]);return{visuallyHiddenProps:{...i,style:l}}}function lt(e){let{children:t,elementType:r="div",isFocusable:n,style:o,...i}=e,{visuallyHiddenProps:l}=fe(e);return h.createElement(r,Pe(i,l),t)}var ct=(0,h.createContext)(null);(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null);var st=(0,h.createContext)({}),at=(0,h.createContext)(null);(0,h.createContext)(null);export{z as _,fe as a,g as c,U as d,$e as f,Oe as g,Ve as h,lt as i,ot as l,je as m,at as n,et as o,Ue as p,st as r,Ge as s,ct as t,Ye as u,De as v,oe as y};
1
+ import{s as Ce}from"./chunk-LvLJmgfZ.js";import{t as ye}from"./react-Bj1aDYRI.js";import{$ as Se,Y as ke,et as _e}from"./input-BX98vgAu.js";import{D as Le,F as xe,I as v,L as Me,N as w,P as S,T as Fe,V as R,c as Ie,j as k,k as Pe,l as We,p as Ae,w as Ke,x as ne}from"./usePress-CfcdTqJM.js";import{t as He}from"./context-B3MsQb-b.js";var Be=class{get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,n=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let i=r,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});t.push(l),l.currentNode=n,this._currentSetFor.add(l),r=n=i.host}else r=r.parentNode;let o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(o),o.currentNode=n,this._currentSetFor.add(o),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return k(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){var t;let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(t=this.filter)!=null&&t.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(t):(r=this.filter)!=null&&r.acceptNode&&(n=this.filter.acceptNode(t)),n===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let o=this.lastChild();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var l;if(i.nodeType===Node.ELEMENT_NODE){let a=i.shadowRoot;if(a){let d=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((l=this.filter)!=null&&l.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}};function oe(e,t,r,n){return xe()?new Be(e,t,r,n):e.createTreeWalker(t,r,n)}var h=Ce(ye(),1);function De(e,t){let r=(0,h.useRef)(!0),n=(0,h.useRef)(null),o=Ae(e);(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,h.useEffect)(()=>{let i=n.current;r.current?r.current=!1:(!i||t.some((l,a)=>!Object.is(l,i[a])))&&o(),n.current=t},t)}function z(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&r.overflow!=="hidden"&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function Oe(e,t){let r=e;for(z(r,t)&&(r=r.parentElement);r&&!z(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function ie(e,t){let r=[],n=document.scrollingElement||document.documentElement;do z(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function je(e){return Ke()?e.metaKey:e.ctrlKey}var ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ve(e){return e instanceof HTMLInputElement&&!ze.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var qe=0,q=new Map;function Ue(e){let[t,r]=(0,h.useState)();return R(()=>{if(!e)return;let n=q.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${qe++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},q.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),q.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function U(e,t,r={}){let{block:n="nearest",inline:o="nearest"}=r;if(e===t)return;let i=e.scrollTop,l=e.scrollLeft,a=t.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.getComputedStyle(t),s=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,u=e===f?0:d.top,N=e===f?e.clientHeight:d.bottom,b=e===f?0:d.left,P=e===f?e.clientWidth:d.right,_=parseInt(c.scrollMarginTop,10)||0,pe=parseInt(c.scrollMarginBottom,10)||0,Ne=parseInt(c.scrollMarginLeft,10)||0,me=parseInt(c.scrollMarginRight,10)||0,be=parseInt(s.scrollPaddingTop,10)||0,ve=parseInt(s.scrollPaddingBottom,10)||0,Ee=parseInt(s.scrollPaddingLeft,10)||0,ge=parseInt(s.scrollPaddingRight,10)||0,Q=parseInt(s.borderTopWidth,10)||0,Z=parseInt(s.borderBottomWidth,10)||0,ee=parseInt(s.borderLeftWidth,10)||0,te=parseInt(s.borderRightWidth,10)||0,W=a.top-_,A=a.bottom+pe,K=a.left-Ne,H=a.right+me,Te=e===f?0:ee+te,we=e===f?0:Q+Z,re=e.offsetWidth-e.clientWidth-Te,Re=e.offsetHeight-e.clientHeight-we,B=u+Q+be,D=N-Z-ve-Re,L=b+ee+Ee,x=P-te-ge;s.direction==="rtl"&&!Le()?L+=re:x-=re;let O=W<B||A>D,j=K<L||H>x;if(O&&n==="start")i+=W-B;else if(O&&n==="center")i+=(W+A)/2-(B+D)/2;else if(O&&n==="end")i+=A-D;else if(O&&n==="nearest"){let M=W-B,F=A-D;i+=Math.abs(M)<=Math.abs(F)?M:F}if(j&&o==="start")l+=K-L;else if(j&&o==="center")l+=(K+H)/2-(L+x)/2;else if(j&&o==="end")l+=H-x;else if(j&&o==="nearest"){let M=K-L,F=H-x;l+=Math.abs(M)<=Math.abs(F)?M:F}e.scrollTo({left:l,top:i})}function $e(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let l=document.scrollingElement||document.documentElement;if(window.getComputedStyle(l).overflow!=="hidden"&&!ne()){var n;let{left:a,top:d}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)==null||n.call(e,{block:"nearest"});let{left:c,top:s}=e.getBoundingClientRect();if(Math.abs(a-c)>1||Math.abs(d-s)>1){var o,i;r==null||(o=r.scrollIntoView)==null||o.call(r,{block:"center",inline:"center"}),(i=e.scrollIntoView)==null||i.call(e,{block:"nearest"})}}else{let{left:a,top:d}=e.getBoundingClientRect(),c=ie(e,!0);for(let u of c)U(u,e);let{left:s,top:f}=e.getBoundingClientRect();if(Math.abs(a-s)>1||Math.abs(d-f)>1){c=r?ie(r,!0):[];for(let u of c)U(u,r,{block:"center",inline:"center"})}}}}var $=new Map;function Ye(e){let{locale:t}=He(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($.has(r))return $.get(r);let n=new Intl.Collator(t,e);return $.set(r,n),n}var le=h.createContext(null),Y="react-aria-focus-scope-restore",p=null;function Ge(e){let{children:t,contain:r,restoreFocus:n,autoFocus:o}=e,i=(0,h.useRef)(null),l=(0,h.useRef)(null),a=(0,h.useRef)([]),{parentNode:d}=(0,h.useContext)(le)||{},c=(0,h.useMemo)(()=>new X({scopeRef:a}),[a]);R(()=>{let u=d||m.root;if(m.getTreeNode(u.scopeRef)&&p&&!V(p,u.scopeRef)){let N=m.getTreeNode(p);N&&(u=N)}u.addChild(c),m.addNode(c)},[c,d]),R(()=>{let u=m.getTreeNode(a);u&&(u.contain=!!r)},[r]),R(()=>{var P;let u=(P=i.current)==null?void 0:P.nextSibling,N=[],b=_=>_.stopPropagation();for(;u&&u!==l.current;)N.push(u),u.addEventListener(Y,b),u=u.nextSibling;return a.current=N,()=>{for(let _ of N)_.removeEventListener(Y,b)}},[t]),rt(a,n,r),Ze(a,r),nt(a,n,r),tt(a,o),(0,h.useEffect)(()=>{let u=w(v(a.current?a.current[0]:void 0)),N=null;if(T(u,a.current)){for(let b of m.traverse())b.scopeRef&&T(u,b.scopeRef.current)&&(N=b);N===m.getTreeNode(a)&&(p=N.scopeRef)}},[a]),R(()=>()=>{var N,b;let u=((b=(N=m.getTreeNode(a))==null?void 0:N.parent)==null?void 0:b.scopeRef)??null;(a===p||V(a,p))&&(!u||m.getTreeNode(u))&&(p=u),m.removeTreeNode(a)},[a]);let s=(0,h.useMemo)(()=>Je(a),[]),f=(0,h.useMemo)(()=>({focusManager:s,parentNode:c}),[c,s]);return h.createElement(le.Provider,{value:f},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}function Je(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[0].previousElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.nextNode();return!s&&i&&(c.currentNode=d,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[r.length-1].nextElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.previousNode();return!s&&i&&(c.currentNode=d,s=c.previousNode()),s&&E(s,!0),s},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let l=i.nextNode();return l&&E(l,!0),l},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let l=i.previousNode();return l&&E(l,!0),l}}}function y(e){return e[0].parentElement}function I(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Xe(e){if(!e.form)return Array.from(v(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(n=>!n.form);let t=e.form.elements.namedItem(e.name),r=Me(e);return t instanceof r.RadioNodeList?Array.from(t).filter(n=>n instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}function Qe(e){if(e.checked)return!0;let t=Xe(e);return t.length>0&&!t.some(r=>r.checked)}function Ze(e,t){let r=(0,h.useRef)(void 0),n=(0,h.useRef)(void 0);R(()=>{let o=e.current;if(!t){n.current&&(n.current=(cancelAnimationFrame(n.current),void 0));return}let i=v(o?o[0]:void 0),l=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!I(e)||c.isComposing)return;let s=w(i),f=e.current;if(!f||!T(s,f))return;let u=g(y(f),{tabbable:!0},f);if(!s)return;u.currentNode=s;let N=c.shiftKey?u.previousNode():u.nextNode();N||(N=(u.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,c.shiftKey?u.previousNode():u.nextNode())),c.preventDefault(),N&&E(N,!0)},a=c=>{(!p||V(p,e))&&T(S(c),e.current)?(p=e,r.current=S(c)):I(e)&&!C(S(c),e)?r.current?r.current.focus():p&&p.current&&G(p.current):I(e)&&(r.current=S(c))},d=c=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let s=_e(),f=(s==="virtual"||s===null)&&Fe()&&ne(),u=w(i);if(!f&&u&&I(e)&&!C(u,e)){p=e;let b=S(c);if(b&&b.isConnected){var N;r.current=b,(N=r.current)==null||N.focus()}else p.current&&G(p.current)}})};return i.addEventListener("keydown",l,!1),i.addEventListener("focusin",a,!1),o==null||o.forEach(c=>c.addEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",d,!1)),()=>{i.removeEventListener("keydown",l,!1),i.removeEventListener("focusin",a,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",d,!1))}},[e,t]),R(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function ce(e){return C(e)}function T(e,t){return!e||!t?!1:t.some(r=>k(r,e))}function C(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of m.traverse(m.getTreeNode(t)))if(r&&T(e,r.current))return!0;return!1}function et(e){return C(e,p)}function V(e,t){var n;let r=(n=m.getTreeNode(t))==null?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function E(e,t=!1){if(e!=null&&!t)try{Se(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function se(e,t=!0){let r=e[0].previousElementSibling,n=y(e),o=g(n,{tabbable:t},e);o.currentNode=r;let i=o.nextNode();return t&&!i&&(n=y(e),o=g(n,{tabbable:!1},e),o.currentNode=r,i=o.nextNode()),i}function G(e,t=!0){E(se(e,t))}function tt(e,t){let r=h.useRef(t);(0,h.useEffect)(()=>{r.current&&(p=e,!T(w(v(e.current?e.current[0]:void 0)),p.current)&&e.current&&G(e.current)),r.current=!1},[e])}function rt(e,t,r){R(()=>{if(t||r)return;let n=e.current,o=v(n?n[0]:void 0),i=l=>{let a=S(l);T(a,e.current)?p=e:ce(a)||(p=null)};return o.addEventListener("focusin",i,!1),n==null||n.forEach(l=>l.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),n==null||n.forEach(l=>l.removeEventListener("focusin",i,!1))}},[e,t,r])}function ae(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function nt(e,t,r){let n=(0,h.useRef)(typeof document<"u"?w(v(e.current?e.current[0]:void 0)):null);R(()=>{let o=e.current,i=v(o?o[0]:void 0);if(!t||r)return;let l=()=>{(!p||V(p,e))&&T(w(i),e.current)&&(p=e)};return i.addEventListener("focusin",l,!1),o==null||o.forEach(a=>a.addEventListener("focusin",l,!1)),()=>{i.removeEventListener("focusin",l,!1),o==null||o.forEach(a=>a.removeEventListener("focusin",l,!1))}},[e,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!I(e)||l.isComposing)return;let a=o.activeElement;if(!C(a,e)||!ae(e))return;let d=m.getTreeNode(e);if(!d)return;let c=d.nodeToRestore,s=g(o.body,{tabbable:!0});s.currentNode=a;let f=l.shiftKey?s.previousNode():s.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,d.nodeToRestore=void 0),(!f||!C(f,e))&&c){s.currentNode=c;do f=l.shiftKey?s.previousNode():s.nextNode();while(C(f,e));l.preventDefault(),l.stopPropagation(),f?E(f,!0):ce(c)?E(c,!0):a.blur()}};return r||o.addEventListener("keydown",i,!0),()=>{r||o.removeEventListener("keydown",i,!0)}},[e,t,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=m.getTreeNode(e);if(i)return i.nodeToRestore=n.current??void 0,()=>{let l=m.getTreeNode(e);if(!l)return;let a=l.nodeToRestore,d=w(o);if(t&&a&&(d&&C(d,e)||d===o.body&&ae(e))){let c=m.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let s=c.getTreeNode(e);for(;s;){if(s.nodeToRestore&&s.nodeToRestore.isConnected){ue(s.nodeToRestore);return}s=s.parent}for(s=c.getTreeNode(e);s;){if(s.scopeRef&&s.scopeRef.current&&m.getTreeNode(s.scopeRef)){ue(se(s.scopeRef.current,!0));return}s=s.parent}}})}}},[e,t])}function ue(e){e.dispatchEvent(new CustomEvent(Y,{bubbles:!0,cancelable:!0}))&&E(e)}function g(e,t,r){let n=t!=null&&t.tabbable?We:Ie,o=v((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),i=oe(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return k(t==null?void 0:t.from,l)||t!=null&&t.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!Qe(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:n(l)&&(!r||T(l,r))&&(!(t!=null&&t.accept)||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function ot(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});k(n,d)&&(c.currentNode=d);let s=c.nextNode();return!s&&l&&(c.currentNode=n,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});if(k(n,d))c.currentNode=d;else{let f=J(c);return f&&E(f,!0),f??null}let s=c.previousNode();if(!s&&l){c.currentNode=n;let f=J(c);if(!f)return null;s=f}return s&&E(s,!0),s??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=g(n,{tabbable:o,accept:i}).nextNode();return l&&E(l,!0),l},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=J(g(n,{tabbable:o,accept:i}));return l&&E(l,!0),l??null}}}function J(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var it=class he{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let o=this.fastMap.get(r??null);if(!o)return;let i=new X({scopeRef:t});o.addChild(i),i.parent=o,this.fastMap.set(t,i),n&&(i.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let i of this.traverse())i!==r&&r.nodeToRestore&&i.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&T(i.nodeToRestore,r.scopeRef.current)&&(i.nodeToRestore=r.nodeToRestore);let o=r.children;n&&(n.removeChild(r),o.size>0&&o.forEach(i=>n&&n.addChild(i))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var r;let t=new he;for(let n of this.traverse())t.addTreeNode(n.scopeRef,((r=n.parent)==null?void 0:r.scopeRef)??null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X({scopeRef:null}),this.fastMap.set(null,this.root)}},X=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},m=new it,de={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function fe(e={}){let{style:t,isFocusable:r}=e,[n,o]=(0,h.useState)(!1),{focusWithinProps:i}=ke({isDisabled:!r,onFocusWithinChange:a=>o(a)}),l=(0,h.useMemo)(()=>n?t:t?{...de,...t}:de,[n]);return{visuallyHiddenProps:{...i,style:l}}}function lt(e){let{children:t,elementType:r="div",isFocusable:n,style:o,...i}=e,{visuallyHiddenProps:l}=fe(e);return h.createElement(r,Pe(i,l),t)}var ct=(0,h.createContext)(null);(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null);var st=(0,h.createContext)({}),at=(0,h.createContext)(null);(0,h.createContext)(null);export{z as _,fe as a,g as c,U as d,$e as f,Oe as g,Ve as h,lt as i,ot as l,je as m,at as n,et as o,Ue as p,st as r,Ge as s,ct as t,Ye as u,De as v,oe as y};
@@ -0,0 +1 @@
1
+ import{s as x}from"./chunk-LvLJmgfZ.js";import{i as g,p as T,u as C}from"./useEvent-D91BmmQi.js";import{t as M}from"./react-Bj1aDYRI.js";import{Sn as H,ci as I,it as j,li as c,m as L,vn as N,yt as k}from"./cells-CcBfzJ1Z.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{_ as w}from"./useEventListener-BR0C1MaI.js";import{o as _}from"./utils-DIGrmLDO.js";import{t as A}from"./jsx-runtime-BqBOg78p.js";import{t as F}from"./tooltip-Gcwqb_SK.js";import{t as O}from"./copy-icon-BYNydU7b.js";import{t as W}from"./usePress-CfcdTqJM.js";import{n as q}from"./useDebounce-CLMpJfhX.js";import{t as R}from"./useRunCells-CgXnbA14.js";var z=E(),m=x(M(),1),l=x(A(),1);const V=e=>{let t=(0,z.c)(16),r,n,i;t[0]===e?(r=t[1],n=t[2],i=t[3]):({href:n,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=i);let a=(0,m.useRef)(null),o;t[4]===n?o=t[5]:(o=()=>{let p=new URL(globalThis.location.href);p.hash=n,globalThis.history.pushState({},"",p.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=n.slice(1),y=document.getElementById(S);y&&y.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=n,t[5]=o);let s=o,f;t[6]===s?f=t[7]:(f={onPress:()=>{s()}},t[6]=s,t[7]=f);let{pressProps:h}=W(f),u;t[8]===s?u=t[9]:(u=p=>{p.preventDefault(),s()},t[8]=s,t[9]=u);let b=u,d;return t[10]!==r||t[11]!==b||t[12]!==n||t[13]!==h||t[14]!==i?(d=(0,l.jsx)("a",{ref:a,href:n,...h,onClick:b,...i,children:r}),t[10]=r,t[11]=b,t[12]=n,t[13]=h,t[14]=i,t[15]=d):d=t[15],d};async function P(e){let t=L().inOrderIds.at(0);if(t)try{let r=await N.request({document:e,cellId:t});if(!r||r.options.length===0)return;let n=e.split(".").pop()??e,i=r.options[0],a=r.options.find(o=>o.name===n)??i;a!=null&&a.completion_info&&g.set(H,{documentation:a.completion_info})}catch(r){w.debug(`Doc lookup failed for "${e}"`,r)}}var D=E();const $=e=>{let t=(0,D.c)(8),{qualifiedName:r,children:n}=e,i;t[0]===r?i=t[1]:(i=()=>{P(r)},t[0]=r,t[1]=i);let a=q(i,100),o;t[2]===a?o=t[3]:(o=()=>a.cancel(),t[2]=a,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,l.jsx)("span",{onMouseEnter:a,onMouseLeave:o,children:n}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s};function B(e){if(typeof e!="object"||!e)return!1;let t=e;return!(t.trusted!==!0||t.notebookCode!==void 0&&typeof t.notebookCode!="string")}function U(){let e=window==null?void 0:window.__MARIMO_EXPORT_CONTEXT__;return B(e)?e:void 0}function v(){var e;return((e=U())==null?void 0:e.trusted)===!0}function X(){if(g.get(R)||v()||g.get(_))return!0;try{if(j()==="read")return!0}catch{}return!1}var G=T(e=>{let t=e(R),r=e(_);if(t||r||v())return!1;let n=!0;try{n=j()==="read"}catch{return!0}return!n});function K(){return C(G)}var Z=E(),J=e=>{if(e instanceof c.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},Q=(e,t)=>{if(t instanceof c.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},Y=(e,t)=>{if(t instanceof c.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},tt=e=>{if(e instanceof c.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,n])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,n)}),(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},et=e=>{if(e instanceof c.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!X())return w.warn(`[RenderHTML] refusing <script src> in untrusted context: ${t}`),(0,l.jsx)(l.Fragment,{});if(![...document.querySelectorAll("script[src]")].some(r=>r.getAttribute("src")===t)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,l.jsx)(l.Fragment,{})}},rt=(e,t)=>{if(t instanceof c.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let n=null;return(0,m.isValidElement)(e)&&"props"in e&&(n=e.props.children),(0,l.jsx)(V,{href:r,...t.attribs,children:n})}}},nt=(e,t,r)=>{var n,i;if(t instanceof c.Element&&t.name==="div"&&((i=(n=t.attribs)==null?void 0:n.class)!=null&&i.includes("codehilite")))return(0,l.jsx)(ot,{children:e},r)},it=(e,t)=>{var r;if(t instanceof c.Element&&((r=t.attribs)!=null&&r["data-marimo-doc"])){let n=t.attribs["data-marimo-doc"];return(0,l.jsx)($,{qualifiedName:n,children:e})}},at=(e,t)=>{var r,n;if(t instanceof c.Element&&((r=t.attribs)!=null&&r["data-tooltip"])){if((((n=t.name)==null?void 0:n.toLowerCase())??"").startsWith("marimo-"))return;let i=t.attribs["data-tooltip"];return(0,l.jsx)(F,{content:i,children:e})}},ot=e=>{let t=(0,Z.c)(3),{children:r}=e,n=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,l.jsx)(O,{tooltip:!1,className:"p-1",value:()=>{var s;let o=(s=n.current)==null?void 0:s.firstChild;return o&&o.textContent||""}})}),t[0]=i):i=t[0];let a;return t[1]===r?a=t[2]:(a=(0,l.jsxs)("div",{className:"relative group codehilite-wrapper",ref:n,children:[r,i]}),t[1]=r,t[2]=a),a};const st=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,l.jsx)(lt,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var lt=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let n=K();return ct({html:(0,m.useMemo)(()=>r||n?k(e):e,[e,r,n]),additionalReplacements:t})};function ct({html:e,additionalReplacements:t=[]}){let r=[J,tt,et,...t],n=[nt,rt,it,at,Q,Y];return I(e,{replace:(i,a)=>{for(let o of r){let s=o(i,a);if(s)return s}return i},transform:(i,a,o)=>{for(let s of n){let f=s(i,a,o);if(f)return f}return i}})}export{v as n,st as t};
@@ -0,0 +1 @@
1
+ import{s as S}from"./chunk-LvLJmgfZ.js";import{t as D}from"./react-Bj1aDYRI.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{v as M}from"./useEventListener-BR0C1MaI.js";import{f as w,s as q}from"./config-DczIUz0b.js";import{n as E,t as T}from"./cn-DCUzRj2J.js";import{t as F}from"./jsx-runtime-BqBOg78p.js";import{t as O}from"./tooltip-Gcwqb_SK.js";import{r as W}from"./button-D9nb17Rw.js";import{r as L}from"./requests-DIwGYs0l.js";import{t as V}from"./createLucideIcon-D5guW7EU.js";import{t as N}from"./play-C7DcCsoO.js";import{C as B,O as I,ut as P,w as K}from"./input-BX98vgAu.js";import{t as U}from"./square-DMaNzePN.js";import{N as H,P as _,V as G,j as C,k as J}from"./usePress-CfcdTqJM.js";import{l as Q}from"./RSPContexts-CINae4Gg.js";import{t as X}from"./context-B3MsQb-b.js";import{a as z}from"./renderShortcut-DZpkrZaP.js";var Y=V("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),y=S(D(),1);function Z(n,e){let{"aria-label":t,"aria-labelledby":a,orientation:r="horizontal"}=n,[o,c]=(0,y.useState)(!1);G(()=>{var i;c(!!(e.current&&((i=e.current.parentElement)!=null&&i.closest('[role="toolbar"]'))))});let{direction:u}=X(),m=u==="rtl"&&r==="horizontal",f=Q(e),l=i=>{if(C(i.currentTarget,_(i))){if(r==="horizontal"&&i.key==="ArrowRight"||r==="vertical"&&i.key==="ArrowDown")m?f.focusPrevious():f.focusNext();else if(r==="horizontal"&&i.key==="ArrowLeft"||r==="vertical"&&i.key==="ArrowUp")m?f.focusNext():f.focusPrevious();else if(i.key==="Tab"){i.stopPropagation(),s.current=H(),i.shiftKey?f.focusFirst():f.focusLast();return}else return;i.stopPropagation(),i.preventDefault()}},s=(0,y.useRef)(null),b=i=>{!C(i.currentTarget,i.relatedTarget)&&!s.current&&(s.current=_(i))},p=i=>{if(s.current&&!C(i.currentTarget,i.relatedTarget)&&C(e.current,_(i))){var h;(h=s.current)==null||h.focus(),s.current=null}};return{toolbarProps:{...P(n,{labelable:!0}),role:o?"group":"toolbar","aria-orientation":r,"aria-label":t,"aria-labelledby":t==null?a:void 0,onKeyDownCapture:o?void 0:l,onFocusCapture:o?void 0:p,onBlurCapture:o?void 0:b}}}var $=(0,y.createContext)({}),ee=(0,y.forwardRef)(function(n,e){[n,e]=B(n,e,$);let{toolbarProps:t}=Z(n,e),a=K({...n,values:{orientation:n.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=P(n,{global:!0});return delete r.id,y.createElement(I.div,{...J(r,a,t),ref:e,slot:n.slot||void 0,"data-orientation":n.orientation||"horizontal"},a.children)}),te=x(),re=200;function R(n){let e=(0,te.c)(3),[t,a]=(0,y.useState)(!1),r,o;return e[0]===n?(r=e[1],o=e[2]):(r=()=>{if(!n)return;a(!1);let c=setTimeout(()=>{a(!0)},re);return()=>clearTimeout(c)},o=[n],e[0]=n,e[1]=r,e[2]=o),(0,y.useEffect)(r,o),n&&t}var A=x(),g=S(F(),1),oe=E("rounded-full shadow-xs-solid border p-[5px] transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 [&>svg]:size-3 active:shadow-none bg-background",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",stale:"bg-(--yellow-3) hover:bg-(--yellow-4) text-(--yellow-11)",green:"hover:bg-(--grass-2) hover:text-(--grass-11) hover:border-[var(--grass-7)],",disabled:"opacity-50 cursor-not-allowed",danger:"hover:bg-(--red-3) hover:text-(--red-11)"}},defaultVariants:{variant:"default"}});const k=n=>{let e=(0,A.c)(18),t,a,r,o,c,u,m;if(e[0]!==n){let{children:s,tooltip:b,disabled:p,variant:i,...h}=n;t=s,m=b;let d=p===void 0?!1:p;a=d,r=h,o=v=>{var j;d||((j=h.onClick)==null||j.call(h,v))},c=W.preventFocus,u=T(oe({variant:i}),h.className),e[0]=n,e[1]=t,e[2]=a,e[3]=r,e[4]=o,e[5]=c,e[6]=u,e[7]=m}else t=e[1],a=e[2],r=e[3],o=e[4],c=e[5],u=e[6],m=e[7];let f;e[8]!==t||e[9]!==a||e[10]!==r||e[11]!==o||e[12]!==c||e[13]!==u?(f=(0,g.jsx)("button",{disabled:a,...r,onClick:o,onMouseDown:c,className:u,children:t}),e[8]=t,e[9]=a,e[10]=r,e[11]=o,e[12]=c,e[13]=u,e[14]=f):f=e[14];let l=f;if(m){let s;return e[15]!==l||e[16]!==m?(s=(0,g.jsx)(O,{content:m,side:"top",delayDuration:200,usePortal:!1,children:l}),e[15]=l,e[16]=m,e[17]=s):s=e[17],s}return l},ae=n=>{let e=(0,A.c)(5),{children:t,className:a}=n,r;e[0]===a?r=e[1]:(r=T("flex items-center gap-1 bg-background m-[2px] rounded-full",a),e[0]=a,e[1]=r);let o;return e[2]!==t||e[3]!==r?(o=(0,g.jsx)(ee,{className:r,children:t}),e[2]=t,e[3]=r,e[4]=o):o=e[4],o};var ne=x();const ie=n=>{let e=(0,ne.c)(9),{connectionState:t,status:a}=n,{sendInterrupt:r}=L(),o=R(a==="running"),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=z("global.interrupt"),e[0]=c):c=e[0];let u;e[1]!==t||e[2]!==o?(u=w(t)||!o,e[1]=t,e[2]=o,e[3]=u):u=e[3];let m=o?r:M.NOOP,f=o?"stale":"disabled",l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=(0,g.jsx)(U,{strokeWidth:1.5}),e[4]=l):l=e[4];let s;return e[5]!==u||e[6]!==m||e[7]!==f?(s=(0,g.jsx)(k,{tooltip:c,disabled:u,onClick:m,variant:f,"data-testid":"run-button",children:l}),e[5]=u,e[6]=m,e[7]=f,e[8]=s):s=e[8],s};var le=x();function se({connectionState:n,needsRun:e,loading:t,inactive:a}){return w(n)?"disabled":e&&!t?"stale":t||a?"disabled":"green"}const de=n=>{let e=(0,le.c)(27),{onClick:t,connectionState:a,needsRun:r,status:o,config:c,edited:u}=n,m=o==="disabled-transitively",f=o==="running"||o==="queued",l,s;e[0]!==m||e[1]!==c.disabled||e[2]!==a||e[3]!==u||e[4]!==f||e[5]!==r?(l=w(a)||f||!c.disabled&&m&&!u,s=se({connectionState:a,needsRun:r,loading:f,inactive:l}),e[0]=m,e[1]=c.disabled,e[2]=a,e[3]=u,e[4]=f,e[5]=r,e[6]=l,e[7]=s):(l=e[6],s=e[7]);let b=s;if(c.disabled){let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(Y,{}),e[8]=d):d=e[8];let v;return e[9]!==l||e[10]!==t||e[11]!==b?(v=(0,g.jsx)(k,{tooltip:"Add code to notebook",disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:d}),e[9]=l,e[10]=t,e[11]=b,e[12]=v):v=e[12],v}if(!c.disabled&&m&&!u){let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(N,{strokeWidth:1.2}),e[13]=d):d=e[13];let v;return e[14]!==l||e[15]!==t||e[16]!==b?(v=(0,g.jsx)(k,{disabled:l,tooltip:"This cell can't be run because it has a disabled ancestor",onClick:t,variant:b,"data-testid":"run-button",children:d}),e[14]=l,e[15]=t,e[16]=b,e[17]=v):v=e[17],v}let p;if(w(a)){let d;e[18]===a?d=e[19]:(d=q(a),e[18]=a,e[19]=d),p=d}else if(o==="queued")p="This cell is already queued to run";else if(o==="running")p="This cell is already running.";else{let d;e[20]===Symbol.for("react.memo_cache_sentinel")?(d=z("cell.run"),e[20]=d):d=e[20],p=d}let i;e[21]===Symbol.for("react.memo_cache_sentinel")?(i=(0,g.jsx)(N,{strokeWidth:1.2}),e[21]=i):i=e[21];let h;return e[22]!==l||e[23]!==t||e[24]!==p||e[25]!==b?(h=(0,g.jsx)(k,{tooltip:p,disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:i}),e[22]=l,e[23]=t,e[24]=p,e[25]=b,e[26]=h):h=e[26],h};export{R as a,k as i,ie as n,ae as r,de as t};