@marimo-team/islands 0.25.3-dev23 → 0.25.3-dev230

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 (745) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DfG3PRaJ.js → ConnectedDataExplorerComponent-BBihxHrr.js} +120 -116
  2. package/dist/{ErrorBoundary-h0Ea26dF.js → ErrorBoundary-DZwEkAT6.js} +16 -16
  3. package/dist/_baseSet-BfI5FjBM.js +328 -0
  4. package/dist/{abnfDiagram-VCTEODGH-B3w-XWX8.js → abnfDiagram-VCTEODGH-DBcJVxYP.js} +2 -2
  5. package/dist/any-language-editor-jGaR0EAo.js +75 -0
  6. package/dist/{architectureDiagram-5GKGNRK7-C18U9A6k.js → architectureDiagram-5GKGNRK7-BcHZXF4S.js} +1 -1
  7. package/dist/{arrays-CN1djC4k.js → arrays-DoQ-AILx.js} +15 -27
  8. package/dist/assets/__vite-browser-external-BKBpimif.js +1 -0
  9. package/dist/assets/worker-CgoMtD-_.js +113 -0
  10. package/dist/{blockDiagram-I7D4REHJ-Cg25UrxT.js → blockDiagram-I7D4REHJ-Dkhe6_PP.js} +1 -1
  11. package/dist/{button-CvjkwdSk.js → button-B6RjDKJx.js} +227 -217
  12. package/dist/{capabilities-CQ5IjhzL.js → capabilities-CkVzWJEX.js} +2 -2
  13. package/dist/{chat-ui-w8SVynkn.js → chat-ui-DljFsfWf.js} +1277 -1275
  14. package/dist/{check-BMKBBrdc.js → check-Z_vtI3OL.js} +1 -1
  15. package/dist/{chunk-IMKFNOWR-CrS5bzqW.js → chunk-IMKFNOWR-CTZlwBAA.js} +1 -1
  16. package/dist/{chunk-SHT3W25Y-StpvPvUG.js → chunk-SHT3W25Y-53g_RZHm.js} +1 -1
  17. package/dist/{chunk-SVP7TREG-CBXjbYZC.js → chunk-SVP7TREG-P6abNGV_.js} +1 -1
  18. package/dist/{chunk-TICWLB2K-Dp6bIb-q.js → chunk-TICWLB2K-BTJJqkyF.js} +1 -1
  19. package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
  20. package/dist/{classDiagram-ZZMXUADV-BFYuxV5g.js → classDiagram-ZZMXUADV-BUGqOrTm.js} +2 -2
  21. package/dist/{classDiagram-v2-VYDZK3BY-D_tjXVMl.js → classDiagram-v2-VYDZK3BY-CXpQvO-s.js} +2 -2
  22. package/dist/code-visibility-BOmgV0Fh.js +134 -0
  23. package/dist/{common-DNPxRLm_.js → common-DdHcuklD.js} +9837 -9658
  24. package/dist/config-DbjzjwxX.js +636 -0
  25. package/dist/{copy-icon-BgUO8jsi.js → copy-icon-CG57cxwb.js} +3 -3
  26. package/dist/createReducer-DePYJ0F3.js +63 -0
  27. package/dist/{cynefinDiagram-5FMLGOSQ-DSgYrHB2.js → cynefinDiagram-5FMLGOSQ-DOcnl8wW.js} +1 -1
  28. package/dist/{dagre-GXQ25YYZ-GYlruCBf.js → dagre-GXQ25YYZ-CuHR9QfG.js} +3 -3
  29. package/dist/{dagre-BGSfXNEb.js → dagre-mqiMAsFY.js} +531 -680
  30. package/dist/{data-grid-overlay-editor-B9QxYH-I.js → data-grid-overlay-editor-Dxdsrndd.js} +5 -5
  31. package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
  32. package/dist/{debounce-C3jyATpc.js → debounce-DrhhziJv.js} +2 -2
  33. package/dist/{diagram-S7CK7UJ4-DRu5LX5_.js → diagram-S7CK7UJ4-BPiG4kso.js} +1 -1
  34. package/dist/{diagram-UQ7AKVKN-DD7uiejP.js → diagram-UQ7AKVKN-_piBOvOC.js} +1 -1
  35. package/dist/{diagram-VX7I27RA-ByH9KAJJ.js → diagram-VX7I27RA-DCzVeJ8M.js} +1 -1
  36. package/dist/{diagram-Z3DM3KII-BsQHPRke.js → diagram-Z3DM3KII-D64CF1jQ.js} +1 -1
  37. package/dist/{dialog-Cc479ZEH.js → dialog-DsZ49mmU.js} +26 -26
  38. package/dist/{dist-Bvs24R_E.js → dist-11T5wq3_.js} +31 -30
  39. package/dist/{dist-F8Ep36rk.js → dist-17ugwGZc.js} +59 -58
  40. package/dist/{dist-BMQf5zIS.js → dist-7cRjf--y.js} +123 -122
  41. package/dist/{dist-diIx5qJW.js → dist-B8pkfkzc.js} +31 -30
  42. package/dist/{dist-CN_BeG2I.js → dist-B9UoM_wq.js} +58 -57
  43. package/dist/{dist-CLdpGQVr.js → dist-BGuMTs1i.js} +118 -117
  44. package/dist/{dist-BK4Oj99o.js → dist-BHW11fni.js} +18 -17
  45. package/dist/dist-BLY4m1Wi.js +850 -0
  46. package/dist/{dist-PXYI_yuP.js → dist-BNlcVoxs.js} +24 -23
  47. package/dist/{dist-D6d86eNJ.js → dist-BQYe5Bju.js} +47 -46
  48. package/dist/{dist-CkTTIdBe.js → dist-BX1mn8na.js} +337 -337
  49. package/dist/{dist-DiDibOYr.js → dist-Bh0PTKUW.js} +151 -150
  50. package/dist/{dist-CSJ0MDRw.js → dist-CKaXK92p.js} +56 -55
  51. package/dist/{dist-C8fAKSH1.js → dist-CLhwfhpJ.js} +53 -52
  52. package/dist/{dist-DoE4XJBC.js → dist-CYeqK4Xw.js} +9801 -10649
  53. package/dist/{dist-BLfKmR-l.js → dist-Cxlp3WH6.js} +16 -15
  54. package/dist/{dist-D-wwqlzJ.js → dist-DSJPGj42.js} +158 -157
  55. package/dist/{dist-BorMD-uX.js → dist-DU9ICsWZ.js} +75 -74
  56. package/dist/{dist-DBtSl3sf.js → dist-DWv0ALBi.js} +47 -46
  57. package/dist/{dist-OR1OnN-y.js → dist-DiBpWEsB.js} +31 -30
  58. package/dist/{dist-CrSP_H1M.js → dist-DiLFTlnl.js} +242 -242
  59. package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
  60. package/dist/{dist-CSbh1PNP.js → dist-cVDV5IuI.js} +23 -22
  61. package/dist/{dist-BuaRHxOc.js → dist-fRfaOoq8.js} +44 -43
  62. package/dist/{dist-Cg7gzw-a.js → dist-gTTI-9Px.js} +78 -77
  63. package/dist/dropdown-menu-BRiE7Vnp.js +6083 -0
  64. package/dist/{ebnfDiagram-PWID7BFC-CQRK5_eT.js → ebnfDiagram-PWID7BFC-BapQPML-.js} +2 -2
  65. package/dist/{erDiagram-RLTQ6QDP-BKtWrDVh.js → erDiagram-RLTQ6QDP-CNQvC2_Q.js} +1 -1
  66. package/dist/{error-banner-CFPHFw4h.js → error-banner-IsonnvA0.js} +84 -83
  67. package/dist/error-entries-CRPfxMqm.js +2505 -0
  68. package/dist/{esm-D2gTsXEV.js → esm-BgKjMvWw.js} +530 -529
  69. package/dist/{esm-AMFssoNp.js → esm-CHjVSexr.js} +328 -329
  70. package/dist/feedback-button-bkhTNCeV.js +374 -0
  71. package/dist/{flowDiagram-HODETNUW-1IN-ih2E.js → flowDiagram-HODETNUW-BBt6S6oe.js} +2 -2
  72. package/dist/{formats-X4mMQWzX.js → formats-BK4VefeF.js} +6 -6
  73. package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
  74. package/dist/{glide-data-editor-BIYjd9hQ.js → glide-data-editor-Cd5G4gkf.js} +417 -415
  75. package/dist/{glide-utils-DM9zBO4W.js → glide-utils-CQddGpa-.js} +16 -16
  76. package/dist/{globals-BX22lYk2.js → globals-Cm5hDd9R.js} +3 -3
  77. package/dist/{graphlib-BmY_CCV9.js → graphlib-nlwT3Wvy.js} +177 -220
  78. package/dist/hasIn-C20JsQ2m.js +28 -0
  79. package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
  80. package/dist/{error-entries-Damuuclv.js → html-to-image-0FooaKop.js} +26911 -26769
  81. package/dist/{infoDiagram-27XIBGKW-CkB-zr4p.js → infoDiagram-27XIBGKW-Hd8Ifz82.js} +1 -1
  82. package/dist/isArrayLikeObject-B-HXCsex.js +626 -0
  83. package/dist/isEmpty-CdX7MTE1.js +14 -0
  84. package/dist/{ishikawaDiagram-5VMMS53U-wlyLjBmM.js → ishikawaDiagram-5VMMS53U-CP7hnHWx.js} +1 -1
  85. package/dist/{kanban-definition-UXKFOSKX-C2usY0i-.js → kanban-definition-UXKFOSKX-CX91sa9b.js} +1 -1
  86. package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
  87. package/dist/{loader-BQOfjTIJ.js → loader-BisjOLiW.js} +12 -12
  88. package/dist/main.js +10253 -8126
  89. package/dist/{mermaid-BA-Z6wGL.js → mermaid-Djb3Ni9t.js} +54 -54
  90. package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
  91. package/dist/{mindmap-definition-YA3MSWOX-nKOWS8RR.js → mindmap-definition-YA3MSWOX-DgCNo07O.js} +1 -1
  92. package/dist/{now-jM8-M7IR.js → now-BKZCLE5P.js} +12 -13
  93. package/dist/{number-overlay-editor-DK-HbLsV.js → number-overlay-editor-BLCXOIUf.js} +3 -3
  94. package/dist/{dist-CN8zI-XC.js → objectWithoutPropertiesLoose-ai5NUqGa.js} +262 -240
  95. package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
  96. package/dist/{once-BtE-wKRL.js → once-NnpX_HnX.js} +1 -1
  97. package/dist/{pegDiagram-XKGWAZYB-Dac9EIKD.js → pegDiagram-XKGWAZYB-SGJhnIKo.js} +2 -2
  98. package/dist/pick-tCszMUbm.js +35 -0
  99. package/dist/{pieDiagram-E7YTZNPT-B7S-DsW_.js → pieDiagram-E7YTZNPT-1stXIWCQ.js} +1 -1
  100. package/dist/precisionRound-DhAzeRcm.js +49 -0
  101. package/dist/{process-output-CTPTtxXB.js → process-output-BOvkTEDt.js} +4 -4
  102. package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
  103. package/dist/{railroadDiagram-O6MQD6OU-Cfa5Q-hr.js → railroadDiagram-O6MQD6OU-DY1mojzB.js} +2 -2
  104. package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
  105. package/dist/{requirementDiagram-BXWQKSXE-d8zXCJIk.js → requirementDiagram-BXWQKSXE-gHzhUp0D.js} +1 -1
  106. package/dist/{reveal-component-Dl9ZugRb.js → reveal-component-BcLwP52P.js} +426 -403
  107. package/dist/schemas-CdscWNy_.js +4747 -0
  108. package/dist/select-BSxlITBo.js +1200 -0
  109. package/dist/{sequenceDiagram-WJ2MYXX4-b6pei3lJ.js → sequenceDiagram-WJ2MYXX4-rjPtD9fB.js} +1 -1
  110. package/dist/{spec-BJzgmvVa.js → spec-Dq8RNplp.js} +41 -11
  111. package/dist/{stateDiagram-D77RDMKH-Be-xSpaZ.js → stateDiagram-D77RDMKH-DMNxjUxV.js} +4 -4
  112. package/dist/{stateDiagram-v2-MP3YSRHH-5Y-FxesJ.js → stateDiagram-v2-MP3YSRHH-CumAaqGo.js} +2 -2
  113. package/dist/static-state-BldGd99T.js +72 -0
  114. package/dist/strings-BGW-fXVJ.js +507 -0
  115. package/dist/style.css +1 -1
  116. package/dist/{swimlanes-42K2YHIH-nRRl4NU0.js → swimlanes-42K2YHIH-BU14_Tej.js} +1 -1
  117. package/dist/{swimlanesDiagram-VR7AAH4N-BS79510V.js → swimlanesDiagram-VR7AAH4N-CieAnPqJ.js} +2 -2
  118. package/dist/{swiper-component-DKntyn8p.js → swiper-component-Dir1o8ml.js} +2 -2
  119. package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
  120. package/dist/{timeline-definition-24CTP7MA-Cfzf8WPf.js → timeline-definition-24CTP7MA-CrVj4E1K.js} +1 -1
  121. package/dist/toast-BWIPi3aF.js +491 -0
  122. package/dist/{tooltip-CtBZ5q8p.js → tooltip-C3UnvsRe.js} +329 -305
  123. package/dist/use-restore-focus-BWO0z1lo.js +1672 -0
  124. package/dist/{useAsyncData-BD534XmW.js → useAsyncData-DsZMvNXn.js} +15 -14
  125. package/dist/{useDateFormatter-DkajGwwd.js → useDateFormatter-ChB4eyim.js} +2 -2
  126. package/dist/{useDeepCompareMemoize-C72_RNsu.js → useDeepCompareMemoize-KMBBux8C.js} +1 -1
  127. package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-cMNQ80CK.js} +1 -1
  128. package/dist/useLifecycle-BquH9ET-.js +112 -0
  129. package/dist/useTheme-DgOLVISn.js +337 -0
  130. package/dist/utils-DXkj82sK.js +813 -0
  131. package/dist/{vega-component-DfcYgj-Y.js → vega-component-Bwg_Kuh-.js} +171 -170
  132. package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
  133. package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
  134. package/dist/{vennDiagram-4TSXK5OY-CeY6Z1xZ.js → vennDiagram-4TSXK5OY-ZLxQ8yhm.js} +1 -1
  135. package/dist/{wardleyDiagram-VM6X3IG4-Cxs9NtVi.js → wardleyDiagram-VM6X3IG4-D88pcLY1.js} +1 -1
  136. package/dist/{xychartDiagram-S5SC5T6Z-DNWbvPK7.js → xychartDiagram-S5SC5T6Z-_13d4g8g.js} +2 -2
  137. package/package.json +16 -20
  138. package/src/__mocks__/document.tsx +63 -0
  139. package/src/__mocks__/notebook.ts +3 -4
  140. package/src/__mocks__/partial.ts +26 -0
  141. package/src/__mocks__/requests.ts +1 -4
  142. package/src/__tests__/main.test.tsx +24 -1
  143. package/src/__tests__/module-entry.test.ts +44 -0
  144. package/src/__tests__/mount.test.ts +1 -21
  145. package/src/__tests__/{host-imports.test.ts → replica-imports.test.ts} +12 -11
  146. package/src/components/ai/__tests__/ai-model-dropdown.test.tsx +63 -0
  147. package/src/components/ai/ai-model-dropdown.tsx +11 -6
  148. package/src/components/app-config/ai-config.tsx +155 -149
  149. package/src/components/app-config/app-config-button.tsx +6 -5
  150. package/src/components/app-config/app-config-form.tsx +5 -9
  151. package/src/components/app-config/common.tsx +7 -9
  152. package/src/components/app-config/data-form.tsx +112 -113
  153. package/src/components/app-config/mcp-config.tsx +30 -53
  154. package/src/components/app-config/user-config-form.css +91 -0
  155. package/src/components/app-config/user-config-form.tsx +266 -349
  156. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  157. package/src/components/chat/__tests__/notebook-access-selector.test.tsx +64 -0
  158. package/src/components/chat/acp/__tests__/session-tabs.test.tsx +43 -0
  159. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  160. package/src/components/chat/acp/blocks.tsx +3 -2
  161. package/src/components/chat/acp/session-tabs.tsx +8 -3
  162. package/src/components/chat/capabilities-popover.tsx +1 -5
  163. package/src/components/chat/chat-components.tsx +2 -0
  164. package/src/components/chat/chat-panel.tsx +23 -104
  165. package/src/components/chat/chat-utils.ts +4 -8
  166. package/src/components/chat/notebook-access-selector.stories.tsx +22 -0
  167. package/src/components/chat/notebook-access-selector.tsx +100 -0
  168. package/src/components/data-table/TableBottomBar.tsx +4 -1
  169. package/src/components/data-table/TableTopBar.tsx +2 -0
  170. package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
  171. package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
  172. package/src/components/data-table/__tests__/columns.test.tsx +105 -0
  173. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  174. package/src/components/data-table/__tests__/data-table.test.tsx +1 -0
  175. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  176. package/src/components/data-table/__tests__/export-actions.test.tsx +105 -0
  177. package/src/components/data-table/__tests__/keyboard-selection.test.tsx +188 -0
  178. package/src/components/data-table/__tests__/pagination.test.tsx +28 -1
  179. package/src/components/data-table/__tests__/search-highlight.test.tsx +109 -0
  180. package/src/components/data-table/__tests__/url-detector.test.tsx +74 -0
  181. package/src/components/data-table/cell-selection/feature.ts +2 -2
  182. package/src/components/data-table/cell-selection/types.ts +2 -2
  183. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
  184. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
  185. package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
  186. package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
  187. package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
  188. package/src/components/data-table/charts/charts.tsx +40 -30
  189. package/src/components/data-table/charts/storage.ts +16 -5
  190. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  191. package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
  192. package/src/components/data-table/column-summary/column-summary.tsx +2 -4
  193. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  194. package/src/components/data-table/columns.tsx +45 -46
  195. package/src/components/data-table/context-menu.tsx +36 -20
  196. package/src/components/data-table/data-table.tsx +17 -1
  197. package/src/components/data-table/date-popover.tsx +6 -4
  198. package/src/components/data-table/export-actions.tsx +76 -48
  199. package/src/components/data-table/pagination.tsx +44 -33
  200. package/src/components/data-table/range-focus/atoms.ts +4 -6
  201. package/src/components/data-table/range-focus/use-cell-range-selection.ts +65 -38
  202. package/src/components/data-table/range-focus/use-scroll-into-view.ts +21 -2
  203. package/src/components/data-table/renderers.tsx +16 -7
  204. package/src/components/data-table/row-viewer-panel/__tests__/row-viewer.test.tsx +24 -1
  205. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +4 -4
  206. package/src/components/data-table/search-highlight.tsx +79 -0
  207. package/src/components/data-table/types.ts +1 -0
  208. package/src/components/data-table/url-detector.tsx +49 -9
  209. package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
  210. package/src/components/datasources/__tests__/column-preview.test.tsx +96 -5
  211. package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
  212. package/src/components/datasources/__tests__/table-list.test.tsx +118 -0
  213. package/src/components/datasources/__tests__/utils.test.ts +57 -6
  214. package/src/components/datasources/column-preview.tsx +17 -12
  215. package/src/components/datasources/datasources.tsx +56 -43
  216. package/src/components/datasources/utils.ts +32 -23
  217. package/src/components/debugger/debugger-code.tsx +5 -0
  218. package/src/components/dependency-graph/custom-node.tsx +1 -1
  219. package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
  220. package/src/components/dependency-graph/elements.ts +24 -21
  221. package/src/components/dependency-graph/minimap-content.tsx +13 -19
  222. package/src/components/dependency-graph/panels.tsx +4 -2
  223. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
  224. package/src/components/editor/SortableCell.tsx +1 -3
  225. package/src/components/editor/__tests__/Output.test.tsx +50 -32
  226. package/src/{core/attachments/__tests__/toast.test.tsx → components/editor/__tests__/agent-toast.test.tsx} +1 -1
  227. package/src/components/editor/__tests__/data-attributes.test.tsx +28 -14
  228. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  229. package/src/components/editor/__tests__/output-persistence.test.tsx +6 -2
  230. package/src/components/editor/__tests__/package-alert.test.tsx +22 -1
  231. package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +69 -0
  232. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +40 -10
  233. package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +6 -10
  234. package/src/components/editor/actions/__tests__/useCellActionButton.test.tsx +113 -0
  235. package/src/components/editor/actions/name-cell-input.tsx +4 -3
  236. package/src/components/editor/actions/pair-with-agent-commands.ts +2 -2
  237. package/src/components/editor/actions/pair-with-agent-modal.tsx +24 -21
  238. package/src/components/editor/actions/pair-with-agent.tsx +15 -10
  239. package/src/components/editor/actions/useCellActionButton.tsx +36 -31
  240. package/src/components/editor/actions/useConfigActions.tsx +3 -4
  241. package/src/components/editor/actions/useNotebookActions.tsx +19 -23
  242. package/src/components/editor/actions/useRestartKernel.tsx +1 -1
  243. package/src/components/editor/actions/useSetCodeVisibility.ts +11 -12
  244. package/src/components/editor/actions/useSetOutputsExpanded.ts +14 -19
  245. package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
  246. package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
  247. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +1 -1
  248. package/src/components/editor/alerts/connection-notice.tsx +1 -1
  249. package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
  250. package/src/components/editor/alerts/stdin-blocking-alert.tsx +1 -1
  251. package/src/components/editor/app-container.tsx +1 -1
  252. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +1 -1
  253. package/src/components/editor/cell/CreateCellButton.tsx +15 -21
  254. package/src/components/editor/cell/DeleteButton.tsx +3 -2
  255. package/src/components/editor/cell/RunButton.tsx +2 -2
  256. package/src/components/editor/cell/StagedAICell.tsx +10 -2
  257. package/src/components/editor/cell/StopButton.tsx +2 -2
  258. package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +4 -2
  259. package/src/components/editor/cell/__tests__/useShouldShowInterrupt.test.ts +39 -0
  260. package/src/components/editor/cell/cell-actions.tsx +12 -1
  261. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  262. package/src/components/editor/cell/code/cell-editor.tsx +46 -165
  263. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  264. package/src/components/editor/cell/collapse.tsx +11 -4
  265. package/src/components/editor/cell/useAddCell.ts +4 -8
  266. package/src/components/editor/cell/useDeleteCell.tsx +10 -36
  267. package/src/components/editor/cell/useRunCells.ts +2 -5
  268. package/src/components/editor/cell/useShouldShowInterrupt.ts +2 -12
  269. package/src/components/editor/cell/useSplitCell.tsx +10 -6
  270. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +1 -1
  271. package/src/components/editor/chrome/components/feedback-button.tsx +2 -8
  272. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +31 -2
  273. package/src/components/editor/chrome/panels/__tests__/runtime-details.test.tsx +1 -1
  274. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +1 -1
  275. package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
  276. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +1 -1
  277. package/src/components/editor/chrome/panels/logs-panel.tsx +2 -1
  278. package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +84 -0
  279. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +39 -14
  280. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +3 -2
  281. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -7
  282. package/src/components/editor/chrome/panels/secrets-panel.tsx +1 -0
  283. package/src/components/editor/chrome/panels/session-panel.tsx +1 -1
  284. package/src/components/editor/chrome/panels/snippets-panel.tsx +10 -12
  285. package/src/components/editor/chrome/panels/variable-panel.tsx +1 -5
  286. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +6 -9
  287. package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +92 -0
  288. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +62 -3
  289. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +4 -4
  290. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  291. package/src/components/editor/chrome/wrapper/footer-items/document-sync-status.tsx +54 -0
  292. package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +1 -1
  293. package/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx +1 -1
  294. package/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx +1 -7
  295. package/src/components/editor/chrome/wrapper/footer.tsx +2 -2
  296. package/src/components/editor/chrome/wrapper/minimap-state.ts +1 -1
  297. package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +12 -2
  298. package/src/components/editor/chrome/wrapper/storage.ts +1 -1
  299. package/src/components/editor/columns/__tests__/cell-column.test.tsx +1 -1
  300. package/src/components/editor/columns/cell-column.tsx +1 -1
  301. package/src/components/editor/columns/sortable-column.tsx +2 -2
  302. package/src/components/editor/connections/components.tsx +5 -10
  303. package/src/components/editor/controls/Controls.tsx +4 -4
  304. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  305. package/src/components/editor/controls/__tests__/keyboard-shortcuts.test.tsx +61 -0
  306. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +10 -4
  307. package/src/components/editor/controls/command-palette.tsx +22 -10
  308. package/src/components/editor/controls/keyboard-shortcuts.tsx +14 -5
  309. package/src/components/editor/documentation.css +34 -11
  310. package/src/components/editor/dynamic-favicon.tsx +21 -40
  311. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +25 -20
  312. package/src/components/editor/errors/auto-fix.tsx +4 -8
  313. package/src/components/editor/errors/send-error-report-button.tsx +3 -6
  314. package/src/components/editor/file-tree/__tests__/file-explorer-interactions.test.tsx +6 -0
  315. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +47 -0
  316. package/src/components/editor/file-tree/__tests__/use-file-search.test.tsx +91 -0
  317. package/src/components/editor/file-tree/file-explorer.tsx +48 -15
  318. package/src/components/editor/file-tree/file-name-input.tsx +1 -0
  319. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  320. package/src/components/editor/file-tree/use-file-search.ts +35 -21
  321. package/src/components/editor/header/__tests__/filename-form.test.tsx +1 -4
  322. package/src/components/editor/header/__tests__/status.test.tsx +5 -3
  323. package/src/components/editor/header/app-header.tsx +1 -1
  324. package/src/components/editor/header/filename-form.tsx +1 -1
  325. package/src/components/editor/header/status.tsx +40 -20
  326. package/src/components/editor/links/__tests__/cell-link.test.tsx +148 -0
  327. package/src/components/editor/links/cell-link-list.tsx +1 -1
  328. package/src/components/editor/links/cell-link.tsx +17 -7
  329. package/src/components/editor/navigation/__tests__/clipboard.test.ts +60 -38
  330. package/src/components/editor/navigation/__tests__/navigation.test.ts +108 -85
  331. package/src/components/editor/navigation/__tests__/selection.test.ts +43 -21
  332. package/src/components/editor/navigation/clipboard.ts +17 -14
  333. package/src/components/editor/navigation/focus-utils.ts +23 -4
  334. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +17 -33
  335. package/src/components/editor/navigation/navigation.ts +71 -70
  336. package/src/components/editor/navigation/selection.ts +30 -29
  337. package/src/components/editor/notebook-banner.tsx +1 -0
  338. package/src/components/editor/notebook-cell.tsx +29 -32
  339. package/src/components/editor/output/MarimoErrorOutput.tsx +2 -1
  340. package/src/components/editor/output/MarimoTracebackOutput.tsx +19 -17
  341. package/src/components/editor/output/Outputs.css +8 -0
  342. package/src/components/editor/output/__tests__/traceback.test.tsx +27 -1
  343. package/src/components/editor/output/ansi-reduce.ts +33 -20
  344. package/src/components/editor/output/console/ConsoleOutput.tsx +19 -25
  345. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +125 -69
  346. package/src/components/editor/package-alert.tsx +14 -7
  347. package/src/components/editor/renderers/cell-array.tsx +22 -33
  348. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
  349. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
  350. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +1 -1
  351. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +4 -4
  352. package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
  353. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +1 -1
  354. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
  355. package/src/components/editor/stdin-blocking-alert.tsx +1 -1
  356. package/src/components/home/components.tsx +17 -31
  357. package/src/components/icons/__tests__/large-spinner.test.tsx +39 -0
  358. package/src/components/icons/large-spinner.tsx +3 -14
  359. package/src/components/icons/spinner.tsx +1 -1
  360. package/src/components/markdown/markdown-renderer.tsx +4 -8
  361. package/src/components/mcp/mcp-status-indicator.tsx +1 -1
  362. package/src/components/pages/__tests__/home-page.test.tsx +116 -0
  363. package/src/components/pages/edit-page.tsx +19 -17
  364. package/src/components/pages/home-page.tsx +164 -91
  365. package/src/components/scratchpad/scratchpad.test.tsx +89 -0
  366. package/src/components/scratchpad/scratchpad.tsx +43 -32
  367. package/src/components/scratchpad/state.ts +7 -0
  368. package/src/components/slides/__tests__/minimap-actions.test.tsx +22 -29
  369. package/src/components/slides/__tests__/minimap.test.ts +38 -19
  370. package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +37 -0
  371. package/src/components/slides/minimap.tsx +17 -12
  372. package/src/components/slides/reveal-component.tsx +58 -26
  373. package/src/components/slides/reveal-slides.css +5 -4
  374. package/src/components/slides/slide-cell-view.tsx +4 -5
  375. package/src/components/slides/slide-form.tsx +1 -0
  376. package/src/components/slides/slide-scroll-hint.tsx +3 -1
  377. package/src/components/sort/SortableCellsProvider.tsx +8 -25
  378. package/src/components/tracing/tracing-keyboard.test.tsx +85 -0
  379. package/src/components/tracing/tracing.tsx +46 -42
  380. package/src/components/ui/__tests__/draggable-popover.test.tsx +24 -0
  381. package/src/components/ui/__tests__/range-slider.test.tsx +165 -0
  382. package/src/components/ui/alert-dialog.tsx +1 -1
  383. package/src/components/ui/draggable-popover.tsx +24 -2
  384. package/src/components/ui/range-slider.tsx +22 -9
  385. package/src/core/MarimoApp.tsx +1 -1
  386. package/src/core/ai/__tests__/staged-cells.test.ts +32 -33
  387. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +8 -12
  388. package/src/core/ai/context/providers/cell-output.ts +2 -2
  389. package/src/core/ai/context/providers/datasource.ts +6 -2
  390. package/src/core/ai/staged-cells.ts +18 -19
  391. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +40 -88
  392. package/src/core/ai/tools/__tests__/registry.test.ts +17 -0
  393. package/src/core/ai/tools/base.ts +18 -15
  394. package/src/core/ai/tools/edit-notebook-tool.ts +86 -80
  395. package/src/core/ai/tools/registry.ts +13 -10
  396. package/src/core/ai/tools/sample-tool.ts +6 -7
  397. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -37
  398. package/src/core/cells/__tests__/actions.test.ts +624 -35
  399. package/src/core/cells/__tests__/add-missing-import.test.ts +7 -8
  400. package/src/core/cells/__tests__/arrange.test.ts +432 -0
  401. package/src/core/cells/__tests__/cell.test.ts +39 -0
  402. package/src/core/cells/__tests__/cells.test.ts +251 -2540
  403. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
  404. package/src/core/cells/__tests__/document.test.ts +164 -0
  405. package/src/core/cells/__tests__/editor.test.ts +57 -0
  406. package/src/core/cells/__tests__/flush-document.test.ts +40 -0
  407. package/src/core/cells/__tests__/harness.ts +106 -0
  408. package/src/core/cells/__tests__/layout.test.ts +177 -0
  409. package/src/core/cells/__tests__/notebook-outline.test.ts +122 -0
  410. package/src/core/cells/__tests__/outputs.test.tsx +71 -53
  411. package/src/core/cells/__tests__/session.test.ts +445 -211
  412. package/src/core/cells/__tests__/utils.test.ts +9 -108
  413. package/src/core/cells/actions.ts +675 -6
  414. package/src/core/cells/add-missing-import.ts +47 -43
  415. package/src/core/cells/arrange.ts +529 -0
  416. package/src/core/cells/cell.ts +14 -3
  417. package/src/core/cells/cells.ts +126 -1363
  418. package/src/core/cells/columns.ts +38 -0
  419. package/src/core/cells/document.ts +178 -0
  420. package/src/core/cells/edit.ts +30 -0
  421. package/src/core/cells/editor.ts +82 -0
  422. package/src/core/cells/layout.ts +221 -0
  423. package/src/core/cells/outputs.ts +12 -28
  424. package/src/core/cells/pending-delete-service.ts +3 -7
  425. package/src/core/cells/session.ts +76 -53
  426. package/src/core/cells/types.ts +22 -6
  427. package/src/core/cells/utils.ts +10 -8
  428. package/src/core/codemirror/__tests__/format.test.ts +0 -34
  429. package/src/core/codemirror/__tests__/setup.test.ts +29 -29
  430. package/src/core/codemirror/ai/__tests__/resources.test.ts +117 -0
  431. package/src/core/codemirror/ai/resources.ts +1 -1
  432. package/src/core/codemirror/cells/__tests__/extensions.test.ts +2 -6
  433. package/src/core/codemirror/cells/extensions.ts +30 -28
  434. package/src/core/codemirror/cells/state.ts +1 -6
  435. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +6 -7
  436. package/src/core/codemirror/copilot/getCodes.ts +2 -2
  437. package/src/core/codemirror/format.ts +6 -23
  438. package/src/core/codemirror/keymaps/vim.ts +4 -8
  439. package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
  440. package/src/core/codemirror/language/__tests__/utils.test.ts +187 -15
  441. package/src/core/codemirror/language/cell-code.ts +114 -0
  442. package/src/core/codemirror/language/extension.ts +52 -35
  443. package/src/core/codemirror/language/languages/markdown.ts +8 -6
  444. package/src/core/codemirror/language/languages/python.ts +16 -10
  445. package/src/core/codemirror/language/languages/sql/sql.ts +16 -24
  446. package/src/core/codemirror/language/panel/panel.tsx +1 -0
  447. package/src/core/codemirror/language/types.ts +7 -7
  448. package/src/core/codemirror/language/utils.ts +9 -39
  449. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +1 -2
  450. package/src/core/codemirror/lsp/notebook-lsp.ts +6 -5
  451. package/src/core/codemirror/lsp/utils.ts +1 -1
  452. package/src/core/codemirror/misc/__tests__/paste.test.ts +3 -1
  453. package/src/core/codemirror/misc/paste.ts +1 -1
  454. package/src/core/codemirror/readonly/__tests__/extension.test.ts +1 -1
  455. package/src/core/codemirror/readonly/extension.ts +2 -2
  456. package/src/core/codemirror/utils.ts +1 -0
  457. package/src/core/config/__tests__/app-config.test.ts +64 -0
  458. package/src/core/config/__tests__/config-schema.test.ts +56 -6
  459. package/src/core/config/config-schema.ts +17 -4
  460. package/src/core/config/config.ts +65 -20
  461. package/src/core/config/feature-flag.tsx +0 -2
  462. package/src/core/datasets/__tests__/data-source-discovery.test.ts +5 -5
  463. package/src/core/datasets/data-source-discovery.ts +4 -6
  464. package/src/core/documentation/doc-lookup.ts +1 -1
  465. package/src/core/edit-app.tsx +21 -28
  466. package/src/core/errors/error-entries.ts +4 -1
  467. package/src/core/export/hooks.ts +1 -1
  468. package/src/core/export/layout.ts +2 -2
  469. package/src/core/hotkeys/actions.ts +2 -4
  470. package/src/core/islands/__tests__/bootstrap.test.ts +69 -17
  471. package/src/core/islands/__tests__/bridge.test.ts +85 -27
  472. package/src/core/islands/bootstrap.ts +46 -53
  473. package/src/core/islands/bridge.ts +84 -25
  474. package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
  475. package/src/core/islands/components/web-components.tsx +1 -1
  476. package/src/core/islands/worker/__tests__/controller.test.ts +62 -4
  477. package/src/core/islands/worker/controller.ts +4 -10
  478. package/src/core/islands/worker/worker.tsx +33 -33
  479. package/src/core/kernel/__tests__/RuntimeState.test.ts +1 -1
  480. package/src/core/kernel/__tests__/handlers.test.ts +7 -153
  481. package/src/core/kernel/handlers.ts +19 -72
  482. package/src/core/meta/__tests__/code-visibility.test.tsx +78 -70
  483. package/src/core/meta/code-visibility.ts +18 -9
  484. package/src/core/network/__tests__/connection.test.ts +1 -1
  485. package/src/core/network/__tests__/requests-lazy.test.ts +1 -3
  486. package/src/core/network/connection-notice.ts +1 -1
  487. package/src/core/network/connection.ts +1 -1
  488. package/src/core/network/requests-lazy.ts +2 -5
  489. package/src/core/network/requests-network.ts +5 -31
  490. package/src/core/network/requests-static.ts +1 -4
  491. package/src/core/network/requests-toasting.tsx +1 -4
  492. package/src/core/network/types.ts +6 -14
  493. package/src/core/network/useConnectionNotice.ts +8 -2
  494. package/src/core/notebook/__tests__/operations.test.ts +51 -0
  495. package/src/core/notebook/attachments.ts +38 -0
  496. package/src/core/notebook/document/__tests__/codemirror.test.ts +758 -0
  497. package/src/core/notebook/document/__tests__/draft.test.ts +363 -0
  498. package/src/core/notebook/document/__tests__/fixtures.ts +92 -0
  499. package/src/core/notebook/document/__tests__/hooks.test.tsx +391 -0
  500. package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +61 -0
  501. package/src/core/notebook/document/__tests__/model.test.ts +247 -0
  502. package/src/core/notebook/document/__tests__/protocol-fixtures.ts +38 -0
  503. package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +230 -0
  504. package/src/core/notebook/document/__tests__/scenario-fixture.ts +43 -0
  505. package/src/core/notebook/document/__tests__/scenarios.test.ts +205 -0
  506. package/src/core/notebook/document/__tests__/state.test.ts +459 -0
  507. package/src/core/notebook/document/__tests__/submission.test.ts +203 -0
  508. package/src/core/notebook/document/__tests__/test-host.test.ts +92 -0
  509. package/src/core/notebook/document/__tests__/test-host.ts +247 -0
  510. package/src/core/notebook/document/__tests__/test-notebook.ts +149 -0
  511. package/src/core/notebook/document/__tests__/user.ts +61 -0
  512. package/src/core/notebook/document/codemirror.ts +216 -0
  513. package/src/core/notebook/document/draft.ts +502 -0
  514. package/src/core/notebook/document/hooks.tsx +118 -0
  515. package/src/core/notebook/document/index.ts +24 -0
  516. package/src/core/notebook/document/model.ts +102 -0
  517. package/src/core/notebook/document/select.ts +41 -0
  518. package/src/core/notebook/document/state.ts +378 -0
  519. package/src/core/notebook/document/sync.ts +369 -0
  520. package/src/core/notebook/index.ts +19 -0
  521. package/src/core/notebook/operations.ts +30 -0
  522. package/src/core/notebook/replica/AGENTS.md +11 -0
  523. package/src/core/{host → notebook/replica}/__tests__/attachments.test.ts +9 -10
  524. package/src/core/{host → notebook/replica}/__tests__/document.test.ts +18 -16
  525. package/src/core/notebook/replica/__tests__/executions.test.ts +201 -0
  526. package/src/core/notebook/replica/__tests__/fixtures.ts +79 -0
  527. package/src/core/notebook/replica/__tests__/replica.test.ts +559 -0
  528. package/src/core/notebook/replica/__tests__/results.test.ts +193 -0
  529. package/src/core/notebook/replica/__tests__/runtime.test.ts +78 -0
  530. package/src/core/notebook/replica/backend.ts +19 -0
  531. package/src/core/notebook/replica/connection.ts +42 -0
  532. package/src/core/notebook/replica/index.ts +20 -0
  533. package/src/core/notebook/replica/replica.ts +336 -0
  534. package/src/core/{host → notebook/replica}/resources/attachments.ts +6 -3
  535. package/src/core/{host → notebook/replica}/resources/document.ts +4 -4
  536. package/src/core/notebook/replica/resources/executions.ts +157 -0
  537. package/src/core/notebook/replica/resources/results.ts +48 -0
  538. package/src/core/notebook/replica/resources/runtime.ts +14 -0
  539. package/src/core/packages/__tests__/useSandboxController.test.tsx +1 -1
  540. package/src/core/packages/useSandboxController.ts +1 -1
  541. package/src/core/run-app.tsx +48 -51
  542. package/src/core/runtime/__tests__/adapter.test.ts +1 -1
  543. package/src/core/runtime/__tests__/createWsUrl.test.ts +77 -7
  544. package/src/core/runtime/__tests__/runtime.test.ts +32 -74
  545. package/src/core/runtime/adapter.ts +1 -1
  546. package/src/core/runtime/config.ts +2 -2
  547. package/src/core/runtime/runtime.ts +33 -46
  548. package/src/core/runtime/types.ts +0 -2
  549. package/src/core/saving/__tests__/document.test.tsx +123 -0
  550. package/src/core/saving/__tests__/state.test.ts +111 -0
  551. package/src/core/saving/__tests__/useAutoSave.test.tsx +67 -0
  552. package/src/core/saving/document.ts +33 -0
  553. package/src/core/saving/filename.ts +1 -1
  554. package/src/core/saving/save-component.tsx +39 -60
  555. package/src/core/saving/state.ts +38 -39
  556. package/src/core/saving/useAutoSave.ts +17 -53
  557. package/src/core/session/__tests__/backend.test.ts +236 -0
  558. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +184 -0
  559. package/src/core/{websocket → session}/__tests__/useNotebookSession.hook.test.tsx +213 -262
  560. package/src/core/session/active-notebook.ts +28 -0
  561. package/src/core/session/backend.ts +123 -0
  562. package/src/core/session/embedded.ts +7 -0
  563. package/src/core/{websocket → session}/types.ts +2 -2
  564. package/src/core/session/useNotebookReplica.ts +74 -0
  565. package/src/core/{websocket → session}/useNotebookSession.tsx +77 -64
  566. package/src/core/state/__tests__/jotai.test.tsx +108 -0
  567. package/src/core/state/jotai.ts +1 -1
  568. package/src/core/static/__tests__/files.test.ts +38 -10
  569. package/src/core/static/files.ts +2 -0
  570. package/src/core/{websocket → transports}/__tests__/connection-state.test.ts +1 -13
  571. package/src/core/transports/__tests__/server.test.ts +408 -0
  572. package/src/core/transports/__tests__/static.test.ts +306 -0
  573. package/src/core/transports/__tests__/wasm.test.ts +166 -0
  574. package/src/core/{websocket → transports}/connection-state.ts +9 -16
  575. package/src/core/transports/server.ts +152 -0
  576. package/src/core/transports/static.ts +166 -0
  577. package/src/core/transports/wasm.ts +97 -0
  578. package/src/core/wasm/__tests__/bridge.test.ts +105 -65
  579. package/src/core/wasm/__tests__/worker.test.ts +187 -0
  580. package/src/core/wasm/bridge.ts +69 -72
  581. package/src/core/wasm/rpc.ts +15 -3
  582. package/src/core/wasm/store.ts +3 -3
  583. package/src/core/wasm/worker/bootstrap.ts +55 -51
  584. package/src/core/wasm/worker/getMarimoWheel.ts +1 -1
  585. package/src/core/wasm/worker/save-worker.ts +9 -10
  586. package/src/core/wasm/worker/types.ts +29 -18
  587. package/src/core/wasm/worker/worker.ts +89 -45
  588. package/src/css/app/codemirror.css +1 -1
  589. package/src/css/globals.css +66 -22
  590. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  591. package/src/hooks/__tests__/useDebounce.test.tsx +51 -0
  592. package/src/hooks/__tests__/useDeepCompareMemoize.test.tsx +39 -0
  593. package/src/hooks/__tests__/useDelayElapsed.test.tsx +28 -0
  594. package/src/hooks/__tests__/useInternalStateWithSync.test.tsx +20 -0
  595. package/src/hooks/__tests__/useScript.test.tsx +77 -0
  596. package/src/hooks/__tests__/useStateForKey.test.tsx +257 -0
  597. package/src/hooks/useAsyncData.ts +3 -3
  598. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  599. package/src/hooks/useDebounce.ts +6 -10
  600. package/src/hooks/useDeepCompareMemoize.ts +1 -1
  601. package/src/hooks/useDelayElapsed.ts +14 -10
  602. package/src/hooks/useElapsedTime.ts +3 -3
  603. package/src/hooks/useEventListener.ts +1 -2
  604. package/src/hooks/useInputHistory.ts +4 -7
  605. package/src/hooks/useInternalStateWithSync.ts +6 -6
  606. package/src/hooks/useResizeObserver.ts +4 -7
  607. package/src/hooks/useScript.ts +67 -70
  608. package/src/hooks/useStateForKey.ts +93 -0
  609. package/src/mount.tsx +20 -15
  610. package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
  611. package/src/plugins/core/registerReactComponent.tsx +1 -1
  612. package/src/plugins/impl/CodeEditorPlugin.tsx +1 -1
  613. package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
  614. package/src/plugins/impl/DataTablePlugin.tsx +69 -37
  615. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  616. package/src/plugins/impl/FileBrowserPlugin.tsx +4 -16
  617. package/src/plugins/impl/FormPlugin.tsx +1 -1
  618. package/src/plugins/impl/RangeSliderPlugin.tsx +16 -2
  619. package/src/plugins/impl/RefreshPlugin.tsx +1 -0
  620. package/src/plugins/impl/SliderPlugin.tsx +6 -8
  621. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +387 -1
  622. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +45 -0
  623. package/src/plugins/impl/__tests__/RangeSliderPlugin.test.tsx +109 -0
  624. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +24 -3
  625. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +153 -0
  626. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  627. package/src/plugins/impl/anywidget/model.ts +3 -1
  628. package/src/plugins/impl/anywidget/registry.ts +18 -14
  629. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  630. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  631. package/src/plugins/impl/chat/__tests__/chat-prompts.test.tsx +93 -0
  632. package/src/plugins/impl/chat/chat-ui.tsx +14 -11
  633. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  634. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  635. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  636. package/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx +1 -1
  637. package/src/plugins/impl/data-explorer/components/column-summary.tsx +4 -2
  638. package/src/plugins/impl/data-explorer/state/reducer.ts +1 -1
  639. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -2
  640. package/src/plugins/impl/data-frames/__tests__/sidebar.test.tsx +160 -0
  641. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +66 -66
  642. package/src/plugins/impl/data-frames/panel.tsx +43 -16
  643. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  644. package/src/plugins/impl/panel/PanelPlugin.tsx +16 -17
  645. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  646. package/src/plugins/impl/panel/utils.ts +17 -0
  647. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
  648. package/src/plugins/impl/plotly/selection.ts +25 -19
  649. package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
  650. package/src/plugins/impl/vega/make-selectable.ts +4 -7
  651. package/src/plugins/layout/RoutesPlugin.tsx +1 -1
  652. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  653. package/src/stories/button.stories.tsx +1 -0
  654. package/src/stories/cell.stories.tsx +2 -5
  655. package/src/stories/data-table.stories.tsx +31 -0
  656. package/src/stories/editor.stories.tsx +24 -17
  657. package/src/stories/form-wrapper.stories.tsx +2 -2
  658. package/src/stories/layout/vertical/one-column.stories.tsx +28 -23
  659. package/src/stories/runtime-story.tsx +23 -17
  660. package/src/stories/select.stories.tsx +2 -2
  661. package/src/stories/switchable-multi-select.stories.tsx +1 -1
  662. package/src/utils/__tests__/arrays.test.ts +35 -0
  663. package/src/utils/__tests__/batch-requests.test.ts +3 -3
  664. package/src/utils/__tests__/{createReducer.test.ts → createReducer.test.tsx} +29 -0
  665. package/src/utils/__tests__/numbers.test.ts +105 -1
  666. package/src/utils/__tests__/objects.test.ts +21 -0
  667. package/src/utils/arrays.ts +11 -2
  668. package/src/utils/blob.ts +1 -1
  669. package/src/utils/createReducer.ts +53 -26
  670. package/src/utils/maps.ts +0 -3
  671. package/src/utils/numbers.ts +79 -18
  672. package/src/utils/objects.ts +4 -9
  673. package/src/utils/tracer.ts +9 -5
  674. package/src/utils/zod-utils.ts +1 -3
  675. package/dist/_baseMerge-BiGRwuqv.js +0 -165
  676. package/dist/any-language-editor-D4q-IFcM.js +0 -76
  677. package/dist/assets/__vite-browser-external-BXYkiFsk.js +0 -1
  678. package/dist/assets/worker-HPY9fbhz.js +0 -114
  679. package/dist/code-visibility-vqPDeo1_.js +0 -138
  680. package/dist/dropdown-menu-DHP9P4VE.js +0 -4678
  681. package/dist/feedback-button-BPcyKSZd.js +0 -379
  682. package/dist/hasIn-o2Us0uVx.js +0 -132
  683. package/dist/html-to-image-BdA59IUD.js +0 -3251
  684. package/dist/isArrayLikeObject-BZl-15ir.js +0 -450
  685. package/dist/isEmpty-BSZ1LaUo.js +0 -35
  686. package/dist/isSymbol-kQcfYbNX.js +0 -8
  687. package/dist/label-DoysmLMW.js +0 -281
  688. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
  689. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +0 -23
  690. package/dist/pick-CJeoxYOS.js +0 -51
  691. package/dist/precisionRound-DMIVQrt2.js +0 -97
  692. package/dist/select-DemoKT4G.js +0 -1344
  693. package/dist/toDate-B5mIgxwZ.js +0 -1185
  694. package/dist/toast-PkdZraM8.js +0 -1830
  695. package/dist/use-restore-focus-CKjfFjLM.js +0 -6369
  696. package/dist/useLifecycle-BGWzTwHK.js +0 -169
  697. package/dist/useTheme-BhQvec43.js +0 -904
  698. package/src/components/editor/cell/code/__tests__/rtc-editor-config.test.ts +0 -50
  699. package/src/components/editor/chrome/wrapper/footer-items/rtc-status.tsx +0 -65
  700. package/src/components/editor/navigation/__tests__/state.test.ts +0 -81
  701. package/src/components/editor/navigation/state.ts +0 -65
  702. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +0 -656
  703. package/src/core/ai/tools/run-cells-tool.ts +0 -303
  704. package/src/core/attachments/state.ts +0 -18
  705. package/src/core/cells/__tests__/apply-transaction.test.ts +0 -991
  706. package/src/core/cells/__tests__/document-changes.test.ts +0 -1140
  707. package/src/core/cells/__tests__/document-roundtrip.test.ts +0 -392
  708. package/src/core/cells/document-changes.ts +0 -944
  709. package/src/core/codemirror/rtc/extension.ts +0 -453
  710. package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +0 -52
  711. package/src/core/codemirror/rtc/loro/awareness.ts +0 -531
  712. package/src/core/codemirror/rtc/loro/colors.ts +0 -38
  713. package/src/core/codemirror/rtc/loro/sync.ts +0 -168
  714. package/src/core/host/AGENTS.md +0 -11
  715. package/src/core/host/__tests__/events.test.ts +0 -46
  716. package/src/core/host/__tests__/fixtures.ts +0 -39
  717. package/src/core/host/__tests__/notebook-client.test.ts +0 -433
  718. package/src/core/host/__tests__/protocol.test.ts +0 -214
  719. package/src/core/host/__tests__/stream.test.ts +0 -211
  720. package/src/core/host/connection.ts +0 -81
  721. package/src/core/host/events.ts +0 -61
  722. package/src/core/host/notebook-client.ts +0 -290
  723. package/src/core/host/protocol.ts +0 -1943
  724. package/src/core/host/resources/resource.ts +0 -59
  725. package/src/core/host/stream.ts +0 -213
  726. package/src/core/rtc/state.ts +0 -34
  727. package/src/core/state/__tests__/jotai.test.ts +0 -25
  728. package/src/core/wasm/worker/message-buffer.ts +0 -33
  729. package/src/core/websocket/__tests__/createConnectionTransport.test.ts +0 -49
  730. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +0 -170
  731. package/src/core/websocket/state.ts +0 -7
  732. package/src/core/websocket/transports/__tests__/basic.test.ts +0 -275
  733. package/src/core/websocket/transports/__tests__/sse.test.ts +0 -335
  734. package/src/core/websocket/transports/__tests__/transport.test.ts +0 -308
  735. package/src/core/websocket/transports/__tests__/ws.test.ts +0 -125
  736. package/src/core/websocket/transports/basic.ts +0 -102
  737. package/src/core/websocket/transports/create.ts +0 -31
  738. package/src/core/websocket/transports/sse.ts +0 -308
  739. package/src/core/websocket/transports/transport.ts +0 -50
  740. package/src/core/websocket/transports/ws.ts +0 -98
  741. package/src/core/websocket/useNotebookClient.ts +0 -88
  742. package/src/utils/__tests__/id-tree.test.ts +0 -2145
  743. package/src/utils/id-tree.tsx +0 -1134
  744. /package/src/{core/attachments/toast.ts → components/editor/agent-toast.ts} +0 -0
  745. /package/src/core/{websocket → session}/connection-utils.ts +0 -0
@@ -1,25 +1,24 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-sHtZdjeP.js";
3
3
  import { t as n } from "./jsx-runtime-3BD1kT0s.js";
4
- import { $ as r, At as i, C as a, F as o, H as s, Ht as c, It as l, Kt as u, Mt as d, Ot as f, Pt as p, Rt as m, St as h, Tt as g, Ut as _, Wt as v, Z as y, a as b, at as x, bt as S, ct as C, dt as ee, ft as te, g as w, gt as T, ht as E, it as D, j as O, jt as k, k as A, ot as j, p as M, pt as N, qt as ne, st as re, tt as P, vt as ie, wt as F, x as ae, xt as oe, yt as I, zt as L } from "./dist-DoE4XJBC.js";
5
- import { a as se, c as R, l as ce, n as z, o as B } from "./dist-CN8zI-XC.js";
6
- import { a as le, c as ue, i as de, r as V } from "./dist-CkTTIdBe.js";
7
- import { n as fe, t as pe } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
4
+ import { $ as r, At as i, D as a, Dt as o, Et as s, Ft as c, J as l, K as u, Mt as d, Pt as f, R as p, St as m, T as ee, U as h, V as g, X as _, Y as v, _ as y, bt as b, ct as te, et as x, f as S, ft as C, gt as w, it as ne, j as T, jt as E, l as D, lt as O, ot as k, pt as A, q as j, rt as M, st as re, t as N, tt as ie, ut as P, vt as F, wt as ae, y as I, yt as L, z as R } from "./dist-CYeqK4Xw.js";
5
+ import { c as z, d as oe, i as se, n as B, s as V, t as ce, u as le } from "./objectWithoutPropertiesLoose-ai5NUqGa.js";
6
+ import { a as ue, c as H, i as de, r as fe } from "./dist-BX1mn8na.js";
8
7
  //#region ../node_modules/.pnpm/@codemirror+search@6.7.2/node_modules/@codemirror/search/dist/index.js
9
- var H = /* @__PURE__ */ e(t()), me = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, U = class {
8
+ var U = /* @__PURE__ */ e(t()), pe = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, W = class {
10
9
  constructor(e, t, n = 0, r = e.length, i, a) {
11
10
  this.test = a, this.value = {
12
11
  from: 0,
13
12
  to: 0,
14
13
  precise: !1
15
- }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(me(e)) : me, this.query = this.normalize(t);
14
+ }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(pe(e)) : pe, this.query = this.normalize(t);
16
15
  }
17
16
  peek() {
18
17
  if (this.bufferPos == this.buffer.length) {
19
18
  if (this.bufferStart += this.buffer.length, this.iter.next(), this.iter.done) return -1;
20
19
  this.bufferPos = 0, this.buffer = this.iter.value;
21
20
  }
22
- return c(this.buffer, this.bufferPos);
21
+ return i(this.buffer, this.bufferPos);
23
22
  }
24
23
  next() {
25
24
  for (; this.matches.length;) this.matches.pop();
@@ -29,8 +28,8 @@ var H = /* @__PURE__ */ e(t()), me = typeof String.prototype.normalize == "funct
29
28
  for (;;) {
30
29
  let e = this.peek();
31
30
  if (e < 0) return this.done = !0, this;
32
- let t = ne(e), n = this.bufferStart + this.bufferPos;
33
- this.bufferPos += _(e);
31
+ let t = c(e), n = this.bufferStart + this.bufferPos;
32
+ this.bufferPos += E(e);
34
33
  let r = this.normalize(t);
35
34
  if (r.length) for (let e = 0, i = n, a = !0;; e++) {
36
35
  let n = r.charCodeAt(e), o = this.match(n, i, a, this.bufferPos + this.bufferStart, e == r.length - 1);
@@ -61,20 +60,20 @@ var H = /* @__PURE__ */ e(t()), me = typeof String.prototype.normalize == "funct
61
60
  })), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
62
61
  }
63
62
  };
64
- typeof Symbol < "u" && (U.prototype[Symbol.iterator] = function() {
63
+ typeof Symbol < "u" && (W.prototype[Symbol.iterator] = function() {
65
64
  return this;
66
65
  });
67
- var he = {
66
+ var me = {
68
67
  from: -1,
69
68
  to: -1,
70
69
  match: /*@__PURE__*/ /.*/.exec(""),
71
70
  precise: !0
72
- }, ge = "gm" + (/x/.unicode == null ? "" : "u"), _e = class {
71
+ }, he = "gm" + (/x/.unicode == null ? "" : "u"), ge = class {
73
72
  constructor(e, t, n, r = 0, i = e.length) {
74
- if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = he, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new be(e, t, n, r, i);
75
- this.re = new RegExp(t, ge + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
73
+ if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = me, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new ye(e, t, n, r, i);
74
+ this.re = new RegExp(t, he + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
76
75
  let a = e.lineAt(r);
77
- this.curLineStart = a.from, this.matchPos = W(e, r), this.getLine(this.curLineStart);
76
+ this.curLineStart = a.from, this.matchPos = G(e, r), this.getLine(this.curLineStart);
78
77
  }
79
78
  getLine(e) {
80
79
  this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
@@ -88,7 +87,7 @@ var he = {
88
87
  let t = this.matchPos <= this.to && this.re.exec(this.curLine);
89
88
  if (t) {
90
89
  let n = this.curLineStart + t.index, r = n + t[0].length;
91
- if (this.matchPos = W(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
90
+ if (this.matchPos = G(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
92
91
  from: n,
93
92
  to: r,
94
93
  precise: !0,
@@ -99,7 +98,7 @@ var he = {
99
98
  else return this.done = !0, this;
100
99
  }
101
100
  }
102
- }, ve = /*@__PURE__*/ new WeakMap(), ye = class e {
101
+ }, _e = /*@__PURE__*/ new WeakMap(), ve = class e {
103
102
  constructor(e, t) {
104
103
  this.from = e, this.text = t;
105
104
  }
@@ -107,18 +106,18 @@ var he = {
107
106
  return this.from + this.text.length;
108
107
  }
109
108
  static get(t, n, r) {
110
- let i = ve.get(t);
109
+ let i = _e.get(t);
111
110
  if (!i || i.from >= r || i.to <= n) {
112
111
  let i = new e(n, t.sliceString(n, r));
113
- return ve.set(t, i), i;
112
+ return _e.set(t, i), i;
114
113
  }
115
114
  if (i.from == n && i.to == r) return i;
116
115
  let { text: a, from: o } = i;
117
- return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), ve.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
116
+ return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), _e.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
118
117
  }
119
- }, be = class {
118
+ }, ye = class {
120
119
  constructor(e, t, n, r, i) {
121
- this.text = e, this.to = i, this.done = !1, this.value = he, this.matchPos = W(e, r), this.re = new RegExp(t, ge + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = ye.get(e, r, this.chunkEnd(r + 5e3));
120
+ this.text = e, this.to = i, this.done = !1, this.value = me, this.matchPos = G(e, r), this.re = new RegExp(t, he + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = ve.get(e, r, this.chunkEnd(r + 5e3));
122
121
  }
123
122
  chunkEnd(e) {
124
123
  return e >= this.to ? this.to : this.text.lineAt(e).to;
@@ -133,87 +132,87 @@ var he = {
133
132
  to: n,
134
133
  precise: !0,
135
134
  match: t
136
- }, this.matchPos = W(this.text, n + +(e == n)), this;
135
+ }, this.matchPos = G(this.text, n + +(e == n)), this;
137
136
  }
138
137
  if (this.flat.to == this.to) return this.done = !0, this;
139
- this.flat = ye.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
138
+ this.flat = ve.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
140
139
  }
141
140
  }
142
141
  };
143
- typeof Symbol < "u" && (_e.prototype[Symbol.iterator] = be.prototype[Symbol.iterator] = function() {
142
+ typeof Symbol < "u" && (ge.prototype[Symbol.iterator] = ye.prototype[Symbol.iterator] = function() {
144
143
  return this;
145
144
  });
146
- function xe(e) {
145
+ function be(e) {
147
146
  try {
148
- return new RegExp(e, ge), !0;
147
+ return new RegExp(e, he), !0;
149
148
  } catch {
150
149
  return !1;
151
150
  }
152
151
  }
153
- function W(e, t) {
152
+ function G(e, t) {
154
153
  if (t >= e.length) return t;
155
154
  let n = e.lineAt(t), r;
156
155
  for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
157
156
  return t;
158
157
  }
159
- var Se = (e) => {
160
- let t = re(e, "cm-goto-line");
158
+ var xe = (e) => {
159
+ let t = v(e, "cm-goto-line");
161
160
  if (t) {
162
161
  let e = t.dom.querySelector("input[type=text]");
163
162
  return e && e.select(), !0;
164
163
  }
165
- let { state: n } = e, a = String(n.doc.lineAt(e.state.selection.main.head).number), { close: o, result: s } = oe(e, {
164
+ let { state: n } = e, r = String(n.doc.lineAt(e.state.selection.main.head).number), { close: i, result: a } = O(e, {
166
165
  class: "cm-goto-line",
167
166
  label: n.phrase("Go to line"),
168
167
  input: {
169
168
  type: "text",
170
169
  name: "line",
171
- value: a
170
+ value: r
172
171
  },
173
172
  focus: !0,
174
173
  submitLabel: n.phrase("go")
175
174
  });
176
- return s.then((t) => {
177
- let a = t && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);
178
- if (!a) {
179
- e.dispatch({ effects: o });
175
+ return a.then((t) => {
176
+ let r = t && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);
177
+ if (!r) {
178
+ e.dispatch({ effects: i });
180
179
  return;
181
180
  }
182
- let s = n.doc.lineAt(n.selection.main.head), [, c, l, u, d] = a, f = u ? +u.slice(1) : 0, p = l ? +l : s.number;
183
- if (l && d) {
184
- let e = p / 100;
185
- c && (e = e * (c == "-" ? -1 : 1) + s.number / n.doc.lines), p = Math.round(n.doc.lines * e);
186
- } else l && c && (p = p * (c == "-" ? -1 : 1) + s.number);
187
- let m = n.doc.line(Math.max(1, Math.min(n.doc.lines, p))), h = i.cursor(m.from + Math.max(0, Math.min(f, m.length)));
181
+ let a = n.doc.lineAt(n.selection.main.head), [, o, s, c, l] = r, u = c ? +c.slice(1) : 0, d = s ? +s : a.number;
182
+ if (s && l) {
183
+ let e = d / 100;
184
+ o && (e = e * (o == "-" ? -1 : 1) + a.number / n.doc.lines), d = Math.round(n.doc.lines * e);
185
+ } else s && o && (d = d * (o == "-" ? -1 : 1) + a.number);
186
+ let f = n.doc.line(Math.max(1, Math.min(n.doc.lines, d))), p = F.cursor(f.from + Math.max(0, Math.min(u, f.length)));
188
187
  e.dispatch({
189
- effects: [o, r.scrollIntoView(h.from, { y: "center" })],
190
- selection: h
188
+ effects: [i, g.scrollIntoView(p.from, { y: "center" })],
189
+ selection: p
191
190
  });
192
191
  }), !0;
193
- }, Ce = {
192
+ }, Se = {
194
193
  highlightWordAroundCursor: !1,
195
194
  minSelectionLength: 1,
196
195
  maxMatches: 100,
197
196
  wholeWords: !1
198
- }, we = /*@__PURE__*/ d.define({ combine(e) {
199
- return v(e, Ce, {
197
+ }, Ce = /*@__PURE__*/ b.define({ combine(e) {
198
+ return d(e, Se, {
200
199
  highlightWordAroundCursor: (e, t) => e || t,
201
200
  minSelectionLength: Math.min,
202
201
  maxMatches: Math.min
203
202
  });
204
203
  } });
205
- function Te(e) {
206
- let t = [je, Ae];
207
- return e && t.push(we.of(e)), t;
204
+ function we(e) {
205
+ let t = [Ae, ke];
206
+ return e && t.push(Ce.of(e)), t;
208
207
  }
209
- var Ee = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch" }), De = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
210
- function Oe(e, t, n, r) {
211
- return (n == 0 || e(t.sliceDoc(n - 1, n)) != f.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != f.Word);
208
+ var Te = /*@__PURE__*/ R.mark({ class: "cm-selectionMatch" }), Ee = /*@__PURE__*/ R.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
209
+ function De(e, t, n, r) {
210
+ return (n == 0 || e(t.sliceDoc(n - 1, n)) != w.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != w.Word);
212
211
  }
213
- function ke(e, t, n, r) {
214
- return e(t.sliceDoc(n, n + 1)) == f.Word && e(t.sliceDoc(r - 1, r)) == f.Word;
212
+ function Oe(e, t, n, r) {
213
+ return e(t.sliceDoc(n, n + 1)) == w.Word && e(t.sliceDoc(r - 1, r)) == w.Word;
215
214
  }
216
- var Ae = /*@__PURE__*/ P.fromClass(class {
215
+ var ke = /*@__PURE__*/ h.fromClass(class {
217
216
  constructor(e) {
218
217
  this.decorations = this.getDeco(e);
219
218
  }
@@ -221,43 +220,43 @@ var Ae = /*@__PURE__*/ P.fromClass(class {
221
220
  (e.selectionSet || e.docChanged || e.viewportChanged) && (this.decorations = this.getDeco(e.view));
222
221
  }
223
222
  getDeco(e) {
224
- let t = e.state.facet(we), { state: n } = e, r = n.selection;
225
- if (r.ranges.length > 1) return y.none;
223
+ let t = e.state.facet(Ce), { state: n } = e, r = n.selection;
224
+ if (r.ranges.length > 1) return R.none;
226
225
  let i = r.main, a, o = null;
227
226
  if (i.empty) {
228
- if (!t.highlightWordAroundCursor) return y.none;
227
+ if (!t.highlightWordAroundCursor) return R.none;
229
228
  let e = n.wordAt(i.head);
230
- if (!e) return y.none;
229
+ if (!e) return R.none;
231
230
  o = n.charCategorizer(i.head), a = n.sliceDoc(e.from, e.to);
232
231
  } else {
233
232
  let e = i.to - i.from;
234
- if (e < t.minSelectionLength || e > 200) return y.none;
233
+ if (e < t.minSelectionLength || e > 200) return R.none;
235
234
  if (t.wholeWords) {
236
- if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(Oe(o, n, i.from, i.to) && ke(o, n, i.from, i.to))) return y.none;
237
- } else if (a = n.sliceDoc(i.from, i.to), !a) return y.none;
235
+ if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(De(o, n, i.from, i.to) && Oe(o, n, i.from, i.to))) return R.none;
236
+ } else if (a = n.sliceDoc(i.from, i.to), !a) return R.none;
238
237
  }
239
238
  let s = [];
240
239
  for (let r of e.visibleRanges) {
241
- let e = new U(n.doc, a, r.from, r.to);
240
+ let e = new W(n.doc, a, r.from, r.to);
242
241
  for (; !e.next().done;) {
243
242
  let { from: r, to: a } = e.value;
244
- if ((!o || Oe(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(De.range(r, a)) : (r >= i.to || a <= i.from) && s.push(Ee.range(r, a)), s.length > t.maxMatches)) return y.none;
243
+ if ((!o || De(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(Ee.range(r, a)) : (r >= i.to || a <= i.from) && s.push(Te.range(r, a)), s.length > t.maxMatches)) return R.none;
245
244
  }
246
245
  }
247
- return y.set(s);
246
+ return R.set(s);
248
247
  }
249
- }, { decorations: (e) => e.decorations }), je = /*@__PURE__*/ r.baseTheme({
248
+ }, { decorations: (e) => e.decorations }), Ae = /*@__PURE__*/ g.baseTheme({
250
249
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
251
250
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
252
- }), Me = ({ state: e, dispatch: t }) => {
253
- let { selection: n } = e, r = i.create(n.ranges.map((t) => e.wordAt(t.head) || i.cursor(t.head)), n.mainIndex);
251
+ }), je = ({ state: e, dispatch: t }) => {
252
+ let { selection: n } = e, r = F.create(n.ranges.map((t) => e.wordAt(t.head) || F.cursor(t.head)), n.mainIndex);
254
253
  return !r.eq(n) && (t(e.update({ selection: r })), !0);
255
254
  };
256
- function Ne(e, t) {
255
+ function Me(e, t) {
257
256
  let { main: n, ranges: r } = e.selection, i = e.wordAt(n.head), a = i && i.from == n.from && i.to == n.to;
258
- for (let n = !1, i = new U(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
257
+ for (let n = !1, i = new W(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
259
258
  if (n) return null;
260
- i = new U(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
259
+ i = new W(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
261
260
  } else {
262
261
  if (n && r.some((e) => e.from == i.value.from)) continue;
263
262
  if (a) {
@@ -267,32 +266,32 @@ function Ne(e, t) {
267
266
  return i.value;
268
267
  }
269
268
  }
270
- var Pe = ({ state: e, dispatch: t }) => {
269
+ var Ne = ({ state: e, dispatch: t }) => {
271
270
  let { ranges: n } = e.selection;
272
- if (n.some((e) => e.from === e.to)) return Me({
271
+ if (n.some((e) => e.from === e.to)) return je({
273
272
  state: e,
274
273
  dispatch: t
275
274
  });
276
- let a = e.sliceDoc(n[0].from, n[0].to);
277
- if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != a)) return !1;
278
- let o = Ne(e, a);
279
- return o ? (t(e.update({
280
- selection: e.selection.addRange(i.range(o.from, o.to), !1),
281
- effects: r.scrollIntoView(o.to)
275
+ let r = e.sliceDoc(n[0].from, n[0].to);
276
+ if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != r)) return !1;
277
+ let i = Me(e, r);
278
+ return i ? (t(e.update({
279
+ selection: e.selection.addRange(F.range(i.from, i.to), !1),
280
+ effects: g.scrollIntoView(i.to)
282
281
  })), !0) : !1;
283
- }, G = /*@__PURE__*/ d.define({ combine(e) {
284
- return v(e, {
282
+ }, K = /*@__PURE__*/ b.define({ combine(e) {
283
+ return d(e, {
285
284
  top: !1,
286
285
  caseSensitive: !1,
287
286
  literal: !1,
288
287
  regexp: !1,
289
288
  wholeWord: !1,
290
289
  createPanel: (e) => new st(e),
291
- scrollToMatch: (e) => r.scrollIntoView(e)
290
+ scrollToMatch: (e) => g.scrollIntoView(e)
292
291
  });
293
- } }), Fe = class {
292
+ } }), Pe = class {
294
293
  constructor(e) {
295
- this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || xe(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
294
+ this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || be(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
296
295
  }
297
296
  unquote(e) {
298
297
  return this.literal ? e : e.replace(/\\([nrt\\])/g, (e, t) => t == "n" ? "\n" : t == "r" ? "\r" : t == "t" ? " " : "\\");
@@ -301,42 +300,42 @@ var Pe = ({ state: e, dispatch: t }) => {
301
300
  return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord && this.test == e.test;
302
301
  }
303
302
  create() {
304
- return this.regexp ? new He(this) : new ze(this);
303
+ return this.regexp ? new He(this) : new Re(this);
305
304
  }
306
305
  getCursor(e, t = 0, n) {
307
- let r = e.doc ? e : k.create({ doc: e });
308
- return n ??= r.doc.length, this.regexp ? q(this, r, t, n) : K(this, r, t, n);
306
+ let r = e.doc ? e : L.create({ doc: e });
307
+ return n ??= r.doc.length, this.regexp ? J(this, r, t, n) : q(this, r, t, n);
309
308
  }
310
- }, Ie = class {
309
+ }, Fe = class {
311
310
  constructor(e) {
312
311
  this.spec = e;
313
312
  }
314
313
  };
315
- function Le(e, t, n) {
314
+ function Ie(e, t, n) {
316
315
  return (r, i, a, o) => n && !n(r, i, a, o) ? !1 : e(r >= o && i <= o + a.length ? a.slice(r - o, i - o) : t.doc.sliceString(r, i), t, r, i);
317
316
  }
318
- function K(e, t, n, r) {
317
+ function q(e, t, n, r) {
319
318
  let i;
320
- return e.wholeWord && (i = Re(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Le(e.test, t, i)), new U(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
319
+ return e.wholeWord && (i = Le(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Ie(e.test, t, i)), new W(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
321
320
  }
322
- function Re(e, t) {
323
- return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(J(i, n - a)) != f.Word || t(Y(i, n - a)) != f.Word) && (t(Y(i, r - a)) != f.Word || t(J(i, r - a)) != f.Word));
321
+ function Le(e, t) {
322
+ return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(Y(i, n - a)) != w.Word || t(Be(i, n - a)) != w.Word) && (t(Be(i, r - a)) != w.Word || t(Y(i, r - a)) != w.Word));
324
323
  }
325
- var ze = class extends Ie {
324
+ var Re = class extends Fe {
326
325
  constructor(e) {
327
326
  super(e);
328
327
  }
329
328
  nextMatch(e, t, n) {
330
- let r = K(this.spec, e, n, e.doc.length).nextOverlapping();
329
+ let r = q(this.spec, e, n, e.doc.length).nextOverlapping();
331
330
  if (r.done) {
332
331
  let n = Math.min(e.doc.length, t + this.spec.unquoted.length);
333
- r = K(this.spec, e, 0, n).nextOverlapping();
332
+ r = q(this.spec, e, 0, n).nextOverlapping();
334
333
  }
335
334
  return r.done || r.value.from == t && r.value.to == n ? null : r.value;
336
335
  }
337
336
  prevMatchInRange(e, t, n) {
338
337
  for (let r = n;;) {
339
- let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = K(this.spec, e, n, r), a = null;
338
+ let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = q(this.spec, e, n, r), a = null;
340
339
  for (; !i.nextOverlapping().done;) a = i.value;
341
340
  if (a) return a;
342
341
  if (n == t) return null;
@@ -351,7 +350,7 @@ var ze = class extends Ie {
351
350
  return this.spec.unquote(this.spec.replace);
352
351
  }
353
352
  matchAll(e, t) {
354
- let n = K(this.spec, e, 0, e.doc.length), r = [];
353
+ let n = q(this.spec, e, 0, e.doc.length), r = [];
355
354
  for (; !n.next().done;) {
356
355
  if (r.length >= t) return null;
357
356
  r.push(n.value);
@@ -359,37 +358,37 @@ var ze = class extends Ie {
359
358
  return r;
360
359
  }
361
360
  highlight(e, t, n, r) {
362
- let i = K(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
361
+ let i = q(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
363
362
  for (; !i.next().done;) r(i.value.from, i.value.to);
364
363
  }
365
364
  };
366
- function Be(e, t, n) {
365
+ function ze(e, t, n) {
367
366
  return (r, i, a) => (!n || n(r, i, a)) && e(a[0], t, r, i);
368
367
  }
369
- function q(e, t, n, r) {
368
+ function J(e, t, n, r) {
370
369
  let i;
371
- return e.wholeWord && (i = Ve(t.charCategorizer(t.selection.main.head))), e.test && (i = Be(e.test, t, i)), new _e(t.doc, e.search, {
370
+ return e.wholeWord && (i = Ve(t.charCategorizer(t.selection.main.head))), e.test && (i = ze(e.test, t, i)), new ge(t.doc, e.search, {
372
371
  ignoreCase: !e.caseSensitive,
373
372
  test: i
374
373
  }, n, r);
375
374
  }
376
- function J(e, t) {
377
- return e.slice(u(e, t, !1), t);
378
- }
379
375
  function Y(e, t) {
380
- return e.slice(t, u(e, t));
376
+ return e.slice(f(e, t, !1), t);
377
+ }
378
+ function Be(e, t) {
379
+ return e.slice(t, f(e, t));
381
380
  }
382
381
  function Ve(e) {
383
- return (t, n, r) => !r[0].length || (e(J(r.input, r.index)) != f.Word || e(Y(r.input, r.index)) != f.Word) && (e(Y(r.input, r.index + r[0].length)) != f.Word || e(J(r.input, r.index + r[0].length)) != f.Word);
382
+ return (t, n, r) => !r[0].length || (e(Y(r.input, r.index)) != w.Word || e(Be(r.input, r.index)) != w.Word) && (e(Be(r.input, r.index + r[0].length)) != w.Word || e(Y(r.input, r.index + r[0].length)) != w.Word);
384
383
  }
385
- var He = class extends Ie {
384
+ var He = class extends Fe {
386
385
  nextMatch(e, t, n) {
387
- let r = q(this.spec, e, n, e.doc.length).next();
388
- return r.done && (r = q(this.spec, e, 0, t).next()), r.done ? null : r.value;
386
+ let r = J(this.spec, e, n, e.doc.length).next();
387
+ return r.done && (r = J(this.spec, e, 0, t).next()), r.done ? null : r.value;
389
388
  }
390
389
  prevMatchInRange(e, t, n) {
391
390
  for (let r = 1;; r++) {
392
- let i = Math.max(t, n - r * 1e4), a = q(this.spec, e, i, n), o = null;
391
+ let i = Math.max(t, n - r * 1e4), a = J(this.spec, e, i, n), o = null;
393
392
  for (; !a.next().done;) o = a.value;
394
393
  if (o && (i == t || o.from > i + 10)) return o;
395
394
  if (i == t) return null;
@@ -410,7 +409,7 @@ var He = class extends Ie {
410
409
  });
411
410
  }
412
411
  matchAll(e, t) {
413
- let n = q(this.spec, e, 0, e.doc.length), r = [];
412
+ let n = J(this.spec, e, 0, e.doc.length), r = [];
414
413
  for (; !n.next().done;) {
415
414
  if (r.length >= t) return null;
416
415
  r.push(n.value);
@@ -418,10 +417,10 @@ var He = class extends Ie {
418
417
  return r;
419
418
  }
420
419
  highlight(e, t, n, r) {
421
- let i = q(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
420
+ let i = J(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
422
421
  for (; !i.next().done;) r(i.value.from, i.value.to);
423
422
  }
424
- }, X = /*@__PURE__*/ m.define(), Ue = /*@__PURE__*/ m.define(), Z = /*@__PURE__*/ L.define({
423
+ }, X = /*@__PURE__*/ s.define(), Ue = /*@__PURE__*/ s.define(), Z = /*@__PURE__*/ o.define({
425
424
  create(e) {
426
425
  return new We(tt(e).create(), null);
427
426
  },
@@ -429,12 +428,12 @@ var He = class extends Ie {
429
428
  for (let n of t.effects) n.is(X) ? e = new We(n.value.create(), e.panel) : n.is(Ue) && (e = new We(e.query, n.value ? et : null));
430
429
  return e;
431
430
  },
432
- provide: (e) => h.from(e, (e) => e.panel)
431
+ provide: (e) => P.from(e, (e) => e.panel)
433
432
  }), We = class {
434
433
  constructor(e, t) {
435
434
  this.query = e, this.panel = t;
436
435
  }
437
- }, Ge = /*@__PURE__*/ y.mark({ class: "cm-searchMatch" }), Ke = /*@__PURE__*/ y.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), qe = /*@__PURE__*/ P.fromClass(class {
436
+ }, Ge = /*@__PURE__*/ R.mark({ class: "cm-searchMatch" }), Ke = /*@__PURE__*/ R.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), qe = /*@__PURE__*/ h.fromClass(class {
438
437
  constructor(e) {
439
438
  this.view = e, this.decorations = this.highlight(e.state.field(Z));
440
439
  }
@@ -443,8 +442,8 @@ var He = class extends Ie {
443
442
  (t != e.startState.field(Z) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
444
443
  }
445
444
  highlight({ query: e, panel: t }) {
446
- if (!t || !e.spec.valid) return y.none;
447
- let { view: n } = this, r = new l();
445
+ if (!t || !e.spec.valid) return R.none;
446
+ let { view: n } = this, r = new ae();
448
447
  for (let t = 0, i = n.visibleRanges, a = i.length; t < a; t++) {
449
448
  let { from: o, to: s } = i[t];
450
449
  for (; t < a - 1 && s > i[t + 1].from - 500;) s = i[++t].to;
@@ -465,55 +464,55 @@ function Q(e) {
465
464
  var Je = /*@__PURE__*/ Q((e, { query: t }) => {
466
465
  let { to: n } = e.state.selection.main, r = t.nextMatch(e.state, n, n);
467
466
  if (!r) return !1;
468
- let a = i.single(r.from, r.to), o = e.state.facet(G);
467
+ let i = F.single(r.from, r.to), a = e.state.facet(K);
469
468
  return e.dispatch({
470
- selection: a,
471
- effects: [ut(e, r), o.scrollToMatch(a.main, e)],
469
+ selection: i,
470
+ effects: [ut(e, r), a.scrollToMatch(i.main, e)],
472
471
  userEvent: "select.search"
473
472
  }), rt(e), !0;
474
473
  }), Ye = /*@__PURE__*/ Q((e, { query: t }) => {
475
- let { state: n } = e, { from: r } = n.selection.main, a = t.prevMatch(n, r, r);
476
- if (!a) return !1;
477
- let o = i.single(a.from, a.to), s = e.state.facet(G);
474
+ let { state: n } = e, { from: r } = n.selection.main, i = t.prevMatch(n, r, r);
475
+ if (!i) return !1;
476
+ let a = F.single(i.from, i.to), o = e.state.facet(K);
478
477
  return e.dispatch({
479
- selection: o,
480
- effects: [ut(e, a), s.scrollToMatch(o.main, e)],
478
+ selection: a,
479
+ effects: [ut(e, i), o.scrollToMatch(a.main, e)],
481
480
  userEvent: "select.search"
482
481
  }), rt(e), !0;
483
482
  }), Xe = /*@__PURE__*/ Q((e, { query: t }) => {
484
483
  let n = t.matchAll(e.state, 1e3);
485
484
  return !n || !n.length ? !1 : (e.dispatch({
486
- selection: i.create(n.map((e) => i.range(e.from, e.to))),
485
+ selection: F.create(n.map((e) => F.range(e.from, e.to))),
487
486
  userEvent: "select.search.matches"
488
487
  }), !0);
489
488
  }), Ze = ({ state: e, dispatch: t }) => {
490
489
  let n = e.selection;
491
490
  if (n.ranges.length > 1 || n.main.empty) return !1;
492
- let { from: r, to: a } = n.main, o = [], s = 0;
493
- for (let t = new U(e.doc, e.sliceDoc(r, a)); !t.next().done;) {
494
- if (o.length > 1e3) return !1;
495
- t.value.from == r && (s = o.length), o.push(i.range(t.value.from, t.value.to));
491
+ let { from: r, to: i } = n.main, a = [], o = 0;
492
+ for (let t = new W(e.doc, e.sliceDoc(r, i)); !t.next().done;) {
493
+ if (a.length > 1e3) return !1;
494
+ t.value.from == r && (o = a.length), a.push(F.range(t.value.from, t.value.to));
496
495
  }
497
496
  return t(e.update({
498
- selection: i.create(o, s),
497
+ selection: F.create(a, o),
499
498
  userEvent: "select.search.matches"
500
499
  })), !0;
501
500
  }, Qe = /*@__PURE__*/ Q((e, { query: t }) => {
502
- let { state: n } = e, { from: a, to: o } = n.selection.main;
501
+ let { state: n } = e, { from: r, to: i } = n.selection.main;
503
502
  if (n.readOnly) return !1;
504
- let s = t.nextMatch(n, a, a);
505
- if (!s) return !1;
506
- let c = s, l = [], u, d, f = [];
507
- c.precise ? c.from == a && c.to == o && (d = n.toText(t.getReplacement(c)), l.push({
508
- from: c.from,
509
- to: c.to,
510
- insert: d
511
- }), c = t.nextMatch(n, c.from, c.to), f.push(r.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(a).number) + "."))) : c = t.nextMatch(n, c.from, c.to);
512
- let p = e.state.changes(l);
513
- return c && (u = i.single(c.from, c.to).map(p), f.push(ut(e, c)), f.push(n.facet(G).scrollToMatch(u.main, e))), e.dispatch({
514
- changes: p,
515
- selection: u,
516
- effects: f,
503
+ let a = t.nextMatch(n, r, r);
504
+ if (!a) return !1;
505
+ let o = a, s = [], c, l, u = [];
506
+ o.precise ? o.from == r && o.to == i && (l = n.toText(t.getReplacement(o)), s.push({
507
+ from: o.from,
508
+ to: o.to,
509
+ insert: l
510
+ }), o = t.nextMatch(n, o.from, o.to), u.push(g.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(r).number) + "."))) : o = t.nextMatch(n, o.from, o.to);
511
+ let d = e.state.changes(s);
512
+ return o && (c = F.single(o.from, o.to).map(d), u.push(ut(e, o)), u.push(n.facet(K).scrollToMatch(c.main, e))), e.dispatch({
513
+ changes: d,
514
+ selection: c,
515
+ effects: u,
517
516
  userEvent: "input.replace"
518
517
  }), !0;
519
518
  }), $e = /*@__PURE__*/ Q((e, { query: t }) => {
@@ -528,21 +527,21 @@ var Je = /*@__PURE__*/ Q((e, { query: t }) => {
528
527
  });
529
528
  }
530
529
  if (!n.length) return !1;
531
- let i = e.state.phrase("replaced $ matches", n.length) + ".";
530
+ let r = e.state.phrase("replaced $ matches", n.length) + ".";
532
531
  return e.dispatch({
533
532
  changes: n,
534
- effects: r.announce.of(i),
533
+ effects: g.announce.of(r),
535
534
  userEvent: "input.replace.all"
536
535
  }), !0;
537
536
  });
538
537
  function et(e) {
539
- return e.state.facet(G).createPanel(e);
538
+ return e.state.facet(K).createPanel(e);
540
539
  }
541
540
  function tt(e, t) {
542
541
  let n = e.selection.main, r = n.empty || n.to > n.from + 100 ? "" : e.sliceDoc(n.from, n.to);
543
542
  if (t && !r) return t;
544
- let i = e.facet(G);
545
- return new Fe({
543
+ let i = e.facet(K);
544
+ return new Pe({
546
545
  search: t?.literal ?? i.literal ? r : r.replace(/\n/g, "\\n"),
547
546
  caseSensitive: t?.caseSensitive ?? i.caseSensitive,
548
547
  literal: t?.literal ?? i.literal,
@@ -551,7 +550,7 @@ function tt(e, t) {
551
550
  });
552
551
  }
553
552
  function nt(e) {
554
- let t = C(e, et);
553
+ let t = _(e, et);
555
554
  return t && t.dom.querySelector("[main-field]");
556
555
  }
557
556
  function rt(e) {
@@ -566,12 +565,12 @@ var it = (e) => {
566
565
  let r = tt(e.state, t.query.spec);
567
566
  r.valid && e.dispatch({ effects: X.of(r) }), n.focus(), n.select();
568
567
  }
569
- } else e.dispatch({ effects: [Ue.of(!0), t ? X.of(tt(e.state, t.query.spec)) : m.appendConfig.of(ft)] });
568
+ } else e.dispatch({ effects: [Ue.of(!0), t ? X.of(tt(e.state, t.query.spec)) : s.appendConfig.of(ft)] });
570
569
  return !0;
571
570
  }, at = (e) => {
572
571
  let t = e.state.field(Z, !1);
573
572
  if (!t || !t.panel) return !1;
574
- let n = C(e, et);
573
+ let n = _(e, et);
575
574
  return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: Ue.of(!1) }), !0;
576
575
  }, ot = [
577
576
  {
@@ -604,18 +603,18 @@ var it = (e) => {
604
603
  },
605
604
  {
606
605
  key: "Mod-Alt-g",
607
- run: Se
606
+ run: xe
608
607
  },
609
608
  {
610
609
  key: "Mod-d",
611
- run: Pe,
610
+ run: Ne,
612
611
  preventDefault: !0
613
612
  }
614
613
  ], st = class {
615
614
  constructor(e) {
616
615
  this.view = e;
617
616
  let t = this.query = e.state.field(Z).query.spec;
618
- this.commit = this.commit.bind(this), this.searchField = F("input", {
617
+ this.commit = this.commit.bind(this), this.searchField = C("input", {
619
618
  value: t.search,
620
619
  placeholder: $(e, "Find"),
621
620
  "aria-label": $(e, "Find"),
@@ -625,7 +624,7 @@ var it = (e) => {
625
624
  "main-field": "true",
626
625
  onchange: this.commit,
627
626
  onkeyup: this.commit
628
- }), this.replaceField = F("input", {
627
+ }), this.replaceField = C("input", {
629
628
  value: t.replace,
630
629
  placeholder: $(e, "Replace"),
631
630
  "aria-label": $(e, "Replace"),
@@ -634,19 +633,19 @@ var it = (e) => {
634
633
  form: "",
635
634
  onchange: this.commit,
636
635
  onkeyup: this.commit
637
- }), this.caseField = F("input", {
636
+ }), this.caseField = C("input", {
638
637
  type: "checkbox",
639
638
  name: "case",
640
639
  form: "",
641
640
  checked: t.caseSensitive,
642
641
  onchange: this.commit
643
- }), this.reField = F("input", {
642
+ }), this.reField = C("input", {
644
643
  type: "checkbox",
645
644
  name: "re",
646
645
  form: "",
647
646
  checked: t.regexp,
648
647
  onchange: this.commit
649
- }), this.wordField = F("input", {
648
+ }), this.wordField = C("input", {
650
649
  type: "checkbox",
651
650
  name: "word",
652
651
  form: "",
@@ -654,14 +653,14 @@ var it = (e) => {
654
653
  onchange: this.commit
655
654
  });
656
655
  function n(e, t, n) {
657
- return F("button", {
656
+ return C("button", {
658
657
  class: "cm-button",
659
658
  name: e,
660
659
  onclick: t,
661
660
  type: "button"
662
661
  }, n);
663
662
  }
664
- this.dom = F("div", {
663
+ this.dom = C("div", {
665
664
  onkeydown: (e) => this.keydown(e),
666
665
  class: "cm-search"
667
666
  }, [
@@ -669,16 +668,16 @@ var it = (e) => {
669
668
  n("next", () => Je(e), [$(e, "next")]),
670
669
  n("prev", () => Ye(e), [$(e, "previous")]),
671
670
  n("select", () => Xe(e), [$(e, "all")]),
672
- F("label", null, [this.caseField, $(e, "match case")]),
673
- F("label", null, [this.reField, $(e, "regexp")]),
674
- F("label", null, [this.wordField, $(e, "by word")]),
671
+ C("label", null, [this.caseField, $(e, "match case")]),
672
+ C("label", null, [this.reField, $(e, "regexp")]),
673
+ C("label", null, [this.wordField, $(e, "by word")]),
675
674
  ...e.state.readOnly ? [] : [
676
- F("br"),
675
+ C("br"),
677
676
  this.replaceField,
678
677
  n("replace", () => Qe(e), [$(e, "replace")]),
679
678
  n("replaceAll", () => $e(e), [$(e, "replace all")])
680
679
  ],
681
- F("button", {
680
+ C("button", {
682
681
  name: "close",
683
682
  onclick: () => at(e),
684
683
  "aria-label": $(e, "close"),
@@ -687,7 +686,7 @@ var it = (e) => {
687
686
  ]);
688
687
  }
689
688
  commit() {
690
- let e = new Fe({
689
+ let e = new Pe({
691
690
  search: this.searchField.value,
692
691
  caseSensitive: this.caseField.checked,
693
692
  regexp: this.reField.checked,
@@ -697,7 +696,7 @@ var it = (e) => {
697
696
  e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: X.of(e) }));
698
697
  }
699
698
  keydown(e) {
700
- S(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? Ye : Je)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Qe(this.view));
699
+ te(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? Ye : Je)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Qe(this.view));
701
700
  }
702
701
  update(e) {
703
702
  for (let t of e.transactions) for (let e of t.effects) e.is(X) && !e.value.eq(this.query) && this.setQuery(e.value);
@@ -712,7 +711,7 @@ var it = (e) => {
712
711
  return 80;
713
712
  }
714
713
  get top() {
715
- return this.view.state.facet(G).top;
714
+ return this.view.state.facet(K).top;
716
715
  }
717
716
  };
718
717
  function $(e, t) {
@@ -720,22 +719,22 @@ function $(e, t) {
720
719
  }
721
720
  var ct = 30, lt = /[\s\.,:;?!]/;
722
721
  function ut(e, { from: t, to: n }) {
723
- let i = e.state.doc.lineAt(t), a = e.state.doc.lineAt(n).to, o = Math.max(i.from, t - ct), s = Math.min(a, n + ct), c = e.state.sliceDoc(o, s);
724
- if (o != i.from) {
725
- for (let e = 0; e < ct; e++) if (!lt.test(c[e + 1]) && lt.test(c[e])) {
726
- c = c.slice(e);
722
+ let r = e.state.doc.lineAt(t), i = e.state.doc.lineAt(n).to, a = Math.max(r.from, t - ct), o = Math.min(i, n + ct), s = e.state.sliceDoc(a, o);
723
+ if (a != r.from) {
724
+ for (let e = 0; e < ct; e++) if (!lt.test(s[e + 1]) && lt.test(s[e])) {
725
+ s = s.slice(e);
727
726
  break;
728
727
  }
729
728
  }
730
- if (s != a) {
731
- for (let e = c.length - 1; e > c.length - ct; e--) if (!lt.test(c[e - 1]) && lt.test(c[e])) {
732
- c = c.slice(0, e);
729
+ if (o != i) {
730
+ for (let e = s.length - 1; e > s.length - ct; e--) if (!lt.test(s[e - 1]) && lt.test(s[e])) {
731
+ s = s.slice(0, e);
733
732
  break;
734
733
  }
735
734
  }
736
- return r.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${i.number}.`);
735
+ return g.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`);
737
736
  }
738
- var dt = /*@__PURE__*/ r.baseTheme({
737
+ var dt = /*@__PURE__*/ g.baseTheme({
739
738
  ".cm-panel.cm-search": {
740
739
  padding: "2px 6px 4px",
741
740
  position: "relative",
@@ -762,21 +761,21 @@ var dt = /*@__PURE__*/ r.baseTheme({
762
761
  "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
763
762
  }), ft = [
764
763
  Z,
765
- /*@__PURE__*/ p.low(qe),
764
+ /*@__PURE__*/ m.low(qe),
766
765
  dt
767
766
  ], pt = function(e) {
768
767
  e === void 0 && (e = {});
769
- var t = e.crosshairCursor, n = t !== void 0 && t, r = [];
770
- e.closeBracketsKeymap !== !1 && (r = r.concat(le)), e.defaultKeymap !== !1 && (r = r.concat(se)), e.searchKeymap !== !1 && (r = r.concat(ot)), e.historyKeymap !== !1 && (r = r.concat(R)), e.foldKeymap !== !1 && (r = r.concat(a)), e.completionKeymap !== !1 && (r = r.concat(ue)), e.lintKeymap !== !1 && (r = r.concat(z));
771
- var i = [];
772
- return e.lineNumbers !== !1 && i.push(T()), e.highlightActiveLineGutter !== !1 && i.push(te()), e.highlightSpecialChars !== !1 && i.push(N()), e.history !== !1 && i.push(B()), e.foldGutter !== !1 && i.push(ae()), e.drawSelection !== !1 && i.push(x()), e.dropCursor !== !1 && i.push(j()), e.allowMultipleSelections !== !1 && i.push(k.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && i.push(A()), e.syntaxHighlighting !== !1 && i.push(o(w, { fallback: !0 })), e.bracketMatching !== !1 && i.push(M()), e.closeBrackets !== !1 && i.push(de()), e.autocompletion !== !1 && i.push(V()), e.rectangularSelection !== !1 && i.push(I()), n !== !1 && i.push(D()), e.highlightActiveLine !== !1 && i.push(ee()), e.highlightSelectionMatches !== !1 && i.push(Te()), e.tabSize && typeof e.tabSize == "number" && i.push(O.of(" ".repeat(e.tabSize))), i.concat([E.of(r.flat())]).filter(Boolean);
768
+ var t = e.crosshairCursor, n = t !== void 0 && t, i = [];
769
+ e.closeBracketsKeymap !== !1 && (i = i.concat(ue)), e.defaultKeymap !== !1 && (i = i.concat(V)), e.searchKeymap !== !1 && (i = i.concat(ot)), e.historyKeymap !== !1 && (i = i.concat(le)), e.foldKeymap !== !1 && (i = i.concat(I)), e.completionKeymap !== !1 && (i = i.concat(H)), e.lintKeymap !== !1 && (i = i.concat(se));
770
+ var o = [];
771
+ return e.lineNumbers !== !1 && o.push(ne()), e.highlightActiveLineGutter !== !1 && o.push(x()), e.highlightSpecialChars !== !1 && o.push(ie()), e.history !== !1 && o.push(z()), e.foldGutter !== !1 && o.push(y()), e.drawSelection !== !1 && o.push(j()), e.dropCursor !== !1 && o.push(l()), e.allowMultipleSelections !== !1 && o.push(L.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && o.push(ee()), e.syntaxHighlighting !== !1 && o.push(T(S, { fallback: !0 })), e.bracketMatching !== !1 && o.push(D()), e.closeBrackets !== !1 && o.push(de()), e.autocompletion !== !1 && o.push(fe()), e.rectangularSelection !== !1 && o.push(re()), n !== !1 && o.push(u()), e.highlightActiveLine !== !1 && o.push(r()), e.highlightSelectionMatches !== !1 && o.push(we()), e.tabSize && typeof e.tabSize == "number" && o.push(a.of(" ".repeat(e.tabSize))), o.concat([M.of(i.flat())]).filter(Boolean);
773
772
  }, mt = function(e) {
774
773
  e === void 0 && (e = {});
775
774
  var t = [];
776
- e.defaultKeymap !== !1 && (t = t.concat(se)), e.historyKeymap !== !1 && (t = t.concat(R));
775
+ e.defaultKeymap !== !1 && (t = t.concat(V)), e.historyKeymap !== !1 && (t = t.concat(le));
777
776
  var n = [];
778
- return e.highlightSpecialChars !== !1 && n.push(N()), e.history !== !1 && n.push(B()), e.drawSelection !== !1 && n.push(x()), e.syntaxHighlighting !== !1 && n.push(o(w, { fallback: !0 })), n.concat([E.of(t.flat())]).filter(Boolean);
779
- }, ht = "#e5c07b", gt = "#e06c75", _t = "#56b6c2", vt = "#ffffff", yt = "#abb2bf", bt = "#7d8799", xt = "#61afef", St = "#98c379", Ct = "#d19a66", wt = "#c678dd", Tt = "#21252b", Et = "#2c313a", Dt = "#282c34", Ot = "#353a42", kt = "#3E4451", At = "#528bff", jt = /*@__PURE__*/ r.theme({
777
+ return e.highlightSpecialChars !== !1 && n.push(ie()), e.history !== !1 && n.push(z()), e.drawSelection !== !1 && n.push(j()), e.syntaxHighlighting !== !1 && n.push(T(S, { fallback: !0 })), n.concat([M.of(t.flat())]).filter(Boolean);
778
+ }, ht = "#e5c07b", gt = "#e06c75", _t = "#56b6c2", vt = "#ffffff", yt = "#abb2bf", bt = "#7d8799", xt = "#61afef", St = "#98c379", Ct = "#d19a66", wt = "#c678dd", Tt = "#21252b", Et = "#2c313a", Dt = "#282c34", Ot = "#353a42", kt = "#3E4451", At = "#528bff", jt = /*@__PURE__*/ g.theme({
780
779
  "&": {
781
780
  color: yt,
782
781
  backgroundColor: Dt
@@ -825,122 +824,122 @@ var dt = /*@__PURE__*/ r.baseTheme({
825
824
  backgroundColor: Et,
826
825
  color: yt
827
826
  } }
828
- }, { dark: !0 }), Mt = /*@__PURE__*/ b.define([
827
+ }, { dark: !0 }), Mt = /*@__PURE__*/ N.define([
829
828
  {
830
- tag: s.keyword,
829
+ tag: p.keyword,
831
830
  color: wt
832
831
  },
833
832
  {
834
833
  tag: [
835
- s.name,
836
- s.deleted,
837
- s.character,
838
- s.propertyName,
839
- s.macroName
834
+ p.name,
835
+ p.deleted,
836
+ p.character,
837
+ p.propertyName,
838
+ p.macroName
840
839
  ],
841
840
  color: gt
842
841
  },
843
842
  {
844
- tag: [/*@__PURE__*/ s.function(s.variableName), s.labelName],
843
+ tag: [/*@__PURE__*/ p.function(p.variableName), p.labelName],
845
844
  color: xt
846
845
  },
847
846
  {
848
847
  tag: [
849
- s.color,
850
- /*@__PURE__*/ s.constant(s.name),
851
- /*@__PURE__*/ s.standard(s.name)
848
+ p.color,
849
+ /*@__PURE__*/ p.constant(p.name),
850
+ /*@__PURE__*/ p.standard(p.name)
852
851
  ],
853
852
  color: Ct
854
853
  },
855
854
  {
856
- tag: [/*@__PURE__*/ s.definition(s.name), s.separator],
855
+ tag: [/*@__PURE__*/ p.definition(p.name), p.separator],
857
856
  color: yt
858
857
  },
859
858
  {
860
859
  tag: [
861
- s.typeName,
862
- s.className,
863
- s.number,
864
- s.changed,
865
- s.annotation,
866
- s.modifier,
867
- s.self,
868
- s.namespace
860
+ p.typeName,
861
+ p.className,
862
+ p.number,
863
+ p.changed,
864
+ p.annotation,
865
+ p.modifier,
866
+ p.self,
867
+ p.namespace
869
868
  ],
870
869
  color: ht
871
870
  },
872
871
  {
873
872
  tag: [
874
- s.operator,
875
- s.operatorKeyword,
876
- s.url,
877
- s.escape,
878
- s.regexp,
879
- s.link,
880
- /*@__PURE__*/ s.special(s.string)
873
+ p.operator,
874
+ p.operatorKeyword,
875
+ p.url,
876
+ p.escape,
877
+ p.regexp,
878
+ p.link,
879
+ /*@__PURE__*/ p.special(p.string)
881
880
  ],
882
881
  color: _t
883
882
  },
884
883
  {
885
- tag: [s.meta, s.comment],
884
+ tag: [p.meta, p.comment],
886
885
  color: bt
887
886
  },
888
887
  {
889
- tag: s.strong,
888
+ tag: p.strong,
890
889
  fontWeight: "bold"
891
890
  },
892
891
  {
893
- tag: s.emphasis,
892
+ tag: p.emphasis,
894
893
  fontStyle: "italic"
895
894
  },
896
895
  {
897
- tag: s.strikethrough,
896
+ tag: p.strikethrough,
898
897
  textDecoration: "line-through"
899
898
  },
900
899
  {
901
- tag: s.link,
900
+ tag: p.link,
902
901
  color: bt,
903
902
  textDecoration: "underline"
904
903
  },
905
904
  {
906
- tag: s.heading,
905
+ tag: p.heading,
907
906
  fontWeight: "bold",
908
907
  color: gt
909
908
  },
910
909
  {
911
910
  tag: [
912
- s.atom,
913
- s.bool,
914
- /*@__PURE__*/ s.special(s.variableName)
911
+ p.atom,
912
+ p.bool,
913
+ /*@__PURE__*/ p.special(p.variableName)
915
914
  ],
916
915
  color: Ct
917
916
  },
918
917
  {
919
918
  tag: [
920
- s.processingInstruction,
921
- s.string,
922
- s.inserted
919
+ p.processingInstruction,
920
+ p.string,
921
+ p.inserted
923
922
  ],
924
923
  color: St
925
924
  },
926
925
  {
927
- tag: s.invalid,
926
+ tag: p.invalid,
928
927
  color: vt
929
928
  }
930
- ]), Nt = [jt, /*@__PURE__*/ o(Mt)], Pt = r.theme({ "&": { backgroundColor: "#fff" } }, { dark: !1 }), Ft = function(e) {
929
+ ]), Nt = [jt, /*@__PURE__*/ T(Mt)], Pt = g.theme({ "&": { backgroundColor: "#fff" } }, { dark: !1 }), Ft = function(e) {
931
930
  e === void 0 && (e = {});
932
- var t = e, n = t.indentWithTab, i = n === void 0 || n, a = t.editable, o = a === void 0 || a, s = t.readOnly, c = s !== void 0 && s, l = t.theme, u = l === void 0 ? "light" : l, d = t.placeholder, f = d === void 0 ? "" : d, p = t.basicSetup, m = p === void 0 || p, h = [];
933
- switch (i && h.unshift(E.of([ce])), m && (typeof m == "boolean" ? h.unshift(pt()) : h.unshift(pt(m))), f && h.unshift(ie(f)), u) {
931
+ var t = e, n = t.indentWithTab, r = n === void 0 || n, i = t.editable, a = i === void 0 || i, o = t.readOnly, s = o !== void 0 && o, c = t.theme, l = c === void 0 ? "light" : c, u = t.placeholder, d = u === void 0 ? "" : u, f = t.basicSetup, p = f === void 0 || f, m = [];
932
+ switch (r && m.unshift(M.of([oe])), p && (typeof p == "boolean" ? m.unshift(pt()) : m.unshift(pt(p))), d && m.unshift(k(d)), l) {
934
933
  case "light":
935
- h.push(Pt);
934
+ m.push(Pt);
936
935
  break;
937
936
  case "dark":
938
- h.push(Nt);
937
+ m.push(Nt);
939
938
  break;
940
939
  case "none": break;
941
- default: h.push(u);
940
+ default: m.push(l);
942
941
  }
943
- return o === !1 && h.push(r.editable.of(!1)), c && h.push(k.readOnly.of(!0)), [...h];
942
+ return a === !1 && m.push(g.editable.of(!1)), s && m.push(L.readOnly.of(!0)), [...m];
944
943
  }, It = (e) => ({
945
944
  line: e.state.doc.lineAt(e.state.selection.main.from),
946
945
  lineCount: e.state.doc.lines,
@@ -1000,99 +999,99 @@ var dt = /*@__PURE__*/ r.baseTheme({
1000
999
  stop() {
1001
1000
  this.interval !== null && (clearInterval(this.interval), this.interval = null);
1002
1001
  }
1003
- }, zt = null, Bt = () => typeof window > "u" ? new Rt() : (zt ||= new Rt(), zt), Vt = r.theme({ "& .cm-scroller": { height: "100% !important" } }), Ht = null, Ut = null;
1004
- function Wt(e, t, n, i, a, o) {
1005
- if (!e && !t && !n && !i && !a && !o) return null;
1006
- var s = JSON.stringify({
1002
+ }, zt = null, Bt = () => typeof window > "u" ? new Rt() : (zt ||= new Rt(), zt), Vt = g.theme({ "& .cm-scroller": { height: "100% !important" } }), Ht = null, Ut = null;
1003
+ function Wt(e, t, n, r, i, a) {
1004
+ if (!e && !t && !n && !r && !i && !a) return null;
1005
+ var o = JSON.stringify({
1007
1006
  height: e,
1008
1007
  minHeight: t,
1009
1008
  maxHeight: n,
1010
- width: i,
1011
- minWidth: a,
1012
- maxWidth: o
1009
+ width: r,
1010
+ minWidth: i,
1011
+ maxWidth: a
1013
1012
  });
1014
- return s === Ht ? Ut : (Ht = s, Ut = r.theme({ "&": {
1013
+ return o === Ht ? Ut : (Ht = o, Ut = g.theme({ "&": {
1015
1014
  height: e,
1016
1015
  minHeight: t,
1017
1016
  maxHeight: n,
1018
- width: i,
1019
- minWidth: a,
1020
- maxWidth: o
1017
+ width: r,
1018
+ minWidth: i,
1019
+ maxWidth: a
1021
1020
  } }), Ut);
1022
1021
  }
1023
1022
  //#endregion
1024
1023
  //#region ../node_modules/.pnpm/@uiw+react-codemirror@4.25.11_@babel+runtime@7.27.6_@codemirror+autocomplete@6.20.3_@co_49c708f5e8044c3002cd598e6281e94d/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js
1025
- var Gt = g.define(), Kt = 200, qt = [];
1024
+ var Gt = A.define(), Kt = 200, qt = [];
1026
1025
  function Jt(e) {
1027
- var t = e.value, n = e.selection, i = e.onChange, a = e.onStatistics, o = e.onCreateEditor, s = e.onUpdate, c = e.extensions, l = c === void 0 ? qt : c, u = e.autoFocus, d = e.theme, f = d === void 0 ? "light" : d, p = e.height, h = p === void 0 ? null : p, g = e.minHeight, _ = g === void 0 ? null : g, v = e.maxHeight, y = v === void 0 ? null : v, b = e.width, x = b === void 0 ? null : b, S = e.minWidth, C = S === void 0 ? null : S, ee = e.maxWidth, te = ee === void 0 ? null : ee, w = e.placeholder, T = w === void 0 ? "" : w, E = e.editable, D = E === void 0 || E, O = e.readOnly, A = O !== void 0 && O, j = e.indentWithTab, M = j === void 0 || j, N = e.basicSetup, ne = N === void 0 || N, re = e.root, P = e.initialState, ie = (0, H.useState)(), F = ie[0], ae = ie[1], oe = (0, H.useState)(), I = oe[0], L = oe[1], se = (0, H.useState)(), R = se[0], ce = se[1], z = (0, H.useState)(() => ({ current: null }))[0], B = (0, H.useState)(() => ({ current: null }))[0], le = Wt(h, _, y, x, C, te), ue = r.updateListener.of((e) => {
1028
- e.docChanged && typeof i == "function" && !e.transactions.some((e) => e.annotation(Gt)) && (z.current ? z.current.reset() : (z.current = new Lt(() => {
1029
- if (B.current) {
1030
- var e = B.current;
1031
- B.current = null, e();
1026
+ var t = e.value, n = e.selection, r = e.onChange, i = e.onStatistics, a = e.onCreateEditor, o = e.onUpdate, c = e.extensions, l = c === void 0 ? qt : c, u = e.autoFocus, d = e.theme, f = d === void 0 ? "light" : d, p = e.height, m = p === void 0 ? null : p, ee = e.minHeight, h = ee === void 0 ? null : ee, _ = e.maxHeight, v = _ === void 0 ? null : _, y = e.width, b = y === void 0 ? null : y, te = e.minWidth, x = te === void 0 ? null : te, S = e.maxWidth, C = S === void 0 ? null : S, w = e.placeholder, ne = w === void 0 ? "" : w, T = e.editable, E = T === void 0 || T, D = e.readOnly, O = D !== void 0 && D, k = e.indentWithTab, A = k === void 0 || k, j = e.basicSetup, M = j === void 0 || j, re = e.root, N = e.initialState, ie = (0, U.useState)(), P = ie[0], F = ie[1], ae = (0, U.useState)(), I = ae[0], R = ae[1], z = (0, U.useState)(), oe = z[0], se = z[1], B = (0, U.useState)(() => ({ current: null }))[0], V = (0, U.useState)(() => ({ current: null }))[0], ce = Wt(m, h, v, b, x, C), le = g.updateListener.of((e) => {
1027
+ e.docChanged && typeof r == "function" && !e.transactions.some((e) => e.annotation(Gt)) && (B.current ? B.current.reset() : (B.current = new Lt(() => {
1028
+ if (V.current) {
1029
+ var e = V.current;
1030
+ V.current = null, e();
1032
1031
  }
1033
- z.current = null;
1034
- }, Kt), Bt().add(z.current)), i(e.state.doc.toString(), e)), a && a(It(e));
1035
- }), de = Ft({
1032
+ B.current = null;
1033
+ }, Kt), Bt().add(B.current)), r(e.state.doc.toString(), e)), i && i(It(e));
1034
+ }), ue = Ft({
1036
1035
  theme: f,
1037
- editable: D,
1038
- readOnly: A,
1039
- placeholder: T,
1040
- indentWithTab: M,
1041
- basicSetup: ne
1042
- }), V = [
1043
- ue,
1044
- ...le ? [le] : [],
1036
+ editable: E,
1037
+ readOnly: O,
1038
+ placeholder: ne,
1039
+ indentWithTab: A,
1040
+ basicSetup: M
1041
+ }), H = [
1042
+ le,
1043
+ ...ce ? [ce] : [],
1045
1044
  Vt,
1046
- ...de
1045
+ ...ue
1047
1046
  ];
1048
- return s && typeof s == "function" && V.push(r.updateListener.of(s)), V = V.concat(l), (0, H.useLayoutEffect)(() => {
1049
- if (F && !R) {
1047
+ return o && typeof o == "function" && H.push(g.updateListener.of(o)), H = H.concat(l), (0, U.useLayoutEffect)(() => {
1048
+ if (P && !oe) {
1050
1049
  var e = {
1051
1050
  doc: t,
1052
1051
  selection: n,
1053
- extensions: V
1054
- }, i = P ? k.fromJSON(P.json, e, P.fields) : k.create(e);
1055
- if (ce(i), !I) {
1056
- var a = new r({
1057
- state: i,
1058
- parent: F,
1052
+ extensions: H
1053
+ }, r = N ? L.fromJSON(N.json, e, N.fields) : L.create(e);
1054
+ if (se(r), !I) {
1055
+ var i = new g({
1056
+ state: r,
1057
+ parent: P,
1059
1058
  root: re
1060
1059
  });
1061
- L(a), o && o(a, i);
1060
+ R(i), a && a(i, r);
1062
1061
  }
1063
1062
  }
1064
1063
  return () => {
1065
- I && (ce(void 0), L(void 0));
1064
+ I && (se(void 0), R(void 0));
1066
1065
  };
1067
- }, [F, R]), (0, H.useEffect)(() => {
1068
- e.container && ae(e.container);
1069
- }, [e.container]), (0, H.useEffect)(() => () => {
1070
- I && (I.destroy(), L(void 0)), z.current &&= (z.current.cancel(), null);
1071
- }, [I]), (0, H.useEffect)(() => {
1066
+ }, [P, oe]), (0, U.useEffect)(() => {
1067
+ e.container && F(e.container);
1068
+ }, [e.container]), (0, U.useEffect)(() => () => {
1069
+ I && (I.destroy(), R(void 0)), B.current &&= (B.current.cancel(), null);
1070
+ }, [I]), (0, U.useEffect)(() => {
1072
1071
  u && I && I.focus();
1073
- }, [u, I]), (0, H.useEffect)(() => {
1074
- I && I.dispatch({ effects: m.reconfigure.of(V) });
1072
+ }, [u, I]), (0, U.useEffect)(() => {
1073
+ I && I.dispatch({ effects: s.reconfigure.of(H) });
1075
1074
  }, [
1076
1075
  f,
1077
1076
  l,
1077
+ m,
1078
1078
  h,
1079
- _,
1080
- y,
1079
+ v,
1080
+ b,
1081
1081
  x,
1082
1082
  C,
1083
- te,
1084
- T,
1085
- D,
1083
+ ne,
1084
+ E,
1085
+ O,
1086
1086
  A,
1087
1087
  M,
1088
- ne,
1089
- i,
1090
- s
1091
- ]), (0, H.useEffect)(() => {
1088
+ r,
1089
+ o
1090
+ ]), (0, U.useEffect)(() => {
1092
1091
  if (t !== void 0) {
1093
1092
  var e = I ? I.state.doc.toString() : "";
1094
1093
  if (I && t !== e) {
1095
- var n = z.current && !z.current.isDone, r = () => {
1094
+ var n = B.current && !B.current.isDone, r = () => {
1096
1095
  I && t !== I.state.doc.toString() && I.dispatch({
1097
1096
  changes: {
1098
1097
  from: 0,
@@ -1102,16 +1101,16 @@ function Jt(e) {
1102
1101
  annotations: [Gt.of(!0)]
1103
1102
  });
1104
1103
  };
1105
- n ? B.current = r : r();
1104
+ n ? V.current = r : r();
1106
1105
  }
1107
1106
  }
1108
1107
  }, [t, I]), {
1109
- state: R,
1110
- setState: ce,
1108
+ state: oe,
1109
+ setState: se,
1111
1110
  view: I,
1112
- setView: L,
1113
- container: F,
1114
- setContainer: ae
1111
+ setView: R,
1112
+ container: P,
1113
+ setContainer: F
1115
1114
  };
1116
1115
  }
1117
1116
  //#endregion
@@ -1140,50 +1139,50 @@ var Yt = n(), Xt = [
1140
1139
  "readOnly",
1141
1140
  "root",
1142
1141
  "initialState"
1143
- ], Zt = /*#__PURE__*/ (0, H.forwardRef)((e, t) => {
1144
- var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection, o = e.extensions, s = o === void 0 ? [] : o, c = e.onChange, l = e.onStatistics, u = e.onCreateEditor, d = e.onUpdate, f = e.autoFocus, p = e.theme, m = p === void 0 ? "light" : p, h = e.height, g = e.minHeight, _ = e.maxHeight, v = e.width, y = e.minWidth, b = e.maxWidth, x = e.basicSetup, S = e.placeholder, C = e.indentWithTab, ee = e.editable, te = e.readOnly, w = e.root, T = e.initialState, E = pe(e, Xt), D = (0, H.useRef)(null), O = Jt({
1142
+ ], Zt = /*#__PURE__*/ (0, U.forwardRef)((e, t) => {
1143
+ var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection, o = e.extensions, s = o === void 0 ? [] : o, c = e.onChange, l = e.onStatistics, u = e.onCreateEditor, d = e.onUpdate, f = e.autoFocus, p = e.theme, m = p === void 0 ? "light" : p, ee = e.height, h = e.minHeight, g = e.maxHeight, _ = e.width, v = e.minWidth, y = e.maxWidth, b = e.basicSetup, te = e.placeholder, x = e.indentWithTab, S = e.editable, C = e.readOnly, w = e.root, ne = e.initialState, T = ce(e, Xt), E = (0, U.useRef)(null), D = Jt({
1145
1144
  root: w,
1146
1145
  value: i,
1147
1146
  autoFocus: f,
1148
1147
  theme: m,
1149
- height: h,
1150
- minHeight: g,
1151
- maxHeight: _,
1152
- width: v,
1153
- minWidth: y,
1154
- maxWidth: b,
1155
- basicSetup: x,
1156
- placeholder: S,
1157
- indentWithTab: C,
1158
- editable: ee,
1159
- readOnly: te,
1148
+ height: ee,
1149
+ minHeight: h,
1150
+ maxHeight: g,
1151
+ width: _,
1152
+ minWidth: v,
1153
+ maxWidth: y,
1154
+ basicSetup: b,
1155
+ placeholder: te,
1156
+ indentWithTab: x,
1157
+ editable: S,
1158
+ readOnly: C,
1160
1159
  selection: a,
1161
1160
  onChange: c,
1162
1161
  onStatistics: l,
1163
1162
  onCreateEditor: u,
1164
1163
  onUpdate: d,
1165
1164
  extensions: s,
1166
- initialState: T
1167
- }), k = O.state, A = O.view, j = O.container, M = O.setContainer;
1168
- (0, H.useImperativeHandle)(t, () => ({
1169
- editor: D.current,
1170
- state: k,
1171
- view: A
1165
+ initialState: ne
1166
+ }), O = D.state, k = D.view, A = D.container, j = D.setContainer;
1167
+ (0, U.useImperativeHandle)(t, () => ({
1168
+ editor: E.current,
1169
+ state: O,
1170
+ view: k
1172
1171
  }), [
1173
- D,
1174
- j,
1175
- k,
1176
- A
1172
+ E,
1173
+ A,
1174
+ O,
1175
+ k
1177
1176
  ]);
1178
- var N = (0, H.useCallback)((e) => {
1179
- D.current = e, M(e);
1180
- }, [M]);
1177
+ var M = (0, U.useCallback)((e) => {
1178
+ E.current = e, j(e);
1179
+ }, [j]);
1181
1180
  if (typeof i != "string") throw Error("value must be typeof string but got " + typeof i);
1182
- var ne = typeof m == "string" ? "cm-theme-" + m : "cm-theme";
1183
- return /*#__PURE__*/ (0, Yt.jsx)("div", fe({
1184
- ref: N,
1185
- className: "" + ne + (n ? " " + n : "")
1186
- }, E));
1181
+ var re = typeof m == "string" ? "cm-theme-" + m : "cm-theme";
1182
+ return /*#__PURE__*/ (0, Yt.jsx)("div", B({
1183
+ ref: M,
1184
+ className: "" + re + (n ? " " + n : "")
1185
+ }, T));
1187
1186
  });
1188
1187
  Zt.displayName = "CodeMirror";
1189
1188
  //#endregion